diff --git a/assets/docs/changelog.txt b/assets/docs/changelog.txt index ddc40b5880..5d2c85d33e 100644 --- a/assets/docs/changelog.txt +++ b/assets/docs/changelog.txt @@ -1,6 +1,238 @@ This file shows the changes in recent releases of MODX. The most current release is usually the development release, and is only shown to give an idea of what's currently in the pipeline. +MODX Evolution 1.2.2(Jul 10, 2017) +* [GitHub:#99d1b62cd] - [F] fix properties for instal snippet,modules,plugins (dmi3yy) +* [GitHub:#e18d5d373] - [F] mm multiplefields for php 7 (dmi3yy) +* [GitHub:#9a0da748c] - [F] params for richtext (dmi3yy) +* [GitHub:#1a6ad1faf] - [I] for composer (dmi3yy) +* [GitHub:#a7c01f6e0] - [F] update Plugins version (dmi3yy) +* [GitHub:#e9000c2f4] - [I] update DocLister (dmi3yy) +* [GitHub:#32c33198c] - [F] doc parser (dmi3yy) +* [GitHub:#7854a1933] - [F] send mail via smtp (dmi3yy) +* [GitHub:#c937e4e04] - [I] add one-dark theme in codemirror (dmi3yy) +* [GitHub:#73e221004] - [F] &else in snippet if (dmi3yy) +* [GitHub:#d033a2337] - [F] update ru lang (dmi3yy) +* [GitHub:#33898ec08] - [I] update modxre2_dropdown theme (dmi3yy) +* [GitHub:#5e7636e4e] - [F] Days allowed to manager access #568 (dmi3yy) +* [GitHub:#726606744] - [F] tynyMCE (dmi3yy) +* [GitHub:#879cacc5f] - [R] update FormLister to 1.7.2 (dmi3yy) +* [GitHub:#4c7d864b5] - [I] first step for composer (dmi3yy) +* [GitHub:#862d2986d] - [F] #1343 Init Quicksearch after Tree-Reload for all tabs (Deesen) +* [GitHub:#13e4be667] - [F] when modx installed in folder, request of home page with parameters causes endless redirect (sunhaim) +* [GitHub:#ed84bbe94] - [F] thumb generation fixed on some php7 systems (sunhaim) +* [GitHub:#565e25b61] - [F] #1377 $modx->getDocumentChildrenTVars() (yamamoto) +* [GitHub:#949d090ea] - [F] update phpmailer to 5.2.23 (dmi3yy) +* [GitHub:#d867fc2f6] - [R] action buttons (dmi3yy) +* [GitHub:#b48f80064] - [F] style for action buttons in new theme (dmi3yy) +* [GitHub:#25afbced6] - [F] permission in new theme (dmi3yy) +* [GitHub:#11b63feb1] - [F] in OnManagerMenuPrepender (dmi3yy) +* [GitHub:#89e31b0af] - [F] fix in OnManagerNodePrepender (dmi3yy) +* [GitHub:#d0b4f6957] - [F] update login page in new theme (dmi3yy) +* [GitHub:#2d4202ce2] - [F] php7.2 error (dmi3yy) +* [GitHub:#0dca7be96] - [F] php7 notices (dmi3yy) +* [GitHub:#f27eee4b4] - [F] php7 notices (dmi3yy) +* [GitHub:#1ae4c4ec6] - [F] default config max size images (dmi3yy) +* [GitHub:#91b54bf03] - [F] php7 notice (dmi3yy) +* [GitHub:#e044e9d4d] - [F] no need bootstrap css in catecogy manager (dmi3yy) +* [GitHub:#09f9d25eb] - [R] FormLister 1.6.2 (dmi3yy) +* [GitHub:#461b7abc5] - [F] snippet if fix php7 notice (dmi3yy) +* [GitHub:#c8843b02b] - [F] fix image position in backend tinmymce4 (dmi3yy) +* [GitHub:#6776e42ed] - [F] need only for settings (dmi3yy) +* [GitHub:#1293a05d6] - [I] fast work in manager after save document (dmi3yy) +* [GitHub:#b4293cda6] - [F] in modxre_dropdownmenu (dmi3yy) +* [GitHub:#e13199af0] - [F] check for 'register_globals' fixed #1370 (sunhaim) +* [GitHub:#7fbb6999e] - [F] sql fix (dmi3yy) +* [GitHub:#71b33897c] - [R] update dropdown theme (dmi3yy) +* [GitHub:#826937e0a] - [I] add sample tv for head and SEO tab (dmi3yy) +* [GitHub:#30e63a1dc] - [I] add sample head scripts (dmi3yy) +* [GitHub:#9e87bdbc6] - [I] update dropdown theme (dmi3yy) +* [GitHub:#53e8ab9fa] - [I] - set name from Request use with new mechanism create elements from codemmiror (dmi3yy) +* [GitHub:#1e94cac0b] - [I] Module Extras/Store parse chunk version (Mr B) +* [GitHub:#465d1da73] - [I] update theme dropdown and extend codemirror (dmi3yy) +* [GitHub:#625838cea] - [F] #907 Quick Manager+ : Vertical align text (Mr B) +* [GitHub:#6cbfec34d] - [F] Remove img tag so Font Awesome icons display for locked resource in tree (Mr B) +* [GitHub:#b3293567b] - [I] Update plugin.tinymce.php (Mr B) +* [GitHub:#21438b28e] - [F] Update TinyMCE version numbers to match (Mr B) +* [GitHub:#63e7d61c1] - [F] Edit a role - check boxes were inline instead of block (Mr B) +* [GitHub:#eaddeec48] - [R] Manager Polish translation update (Piotr Matysiak) +* [GitHub:#fa82430d5] - [I] #1332 Highlight actual viewed or edited file (Deesen) +* [GitHub:#fc764b953] - [F] #1346 Allow users with permission "Allow root" to create doc in root (Deesen) +* [GitHub:#9025ac120] - [C] Replaced short-tag recent documents>uses template (yamamoto) +* [GitHub:#bce17e1c6] - [F] dropdown items white icons on hover (Nicola) +* [GitHub:#1ebd3a24c] - [F] #1227 (Pathologic) +* [GitHub:#b6f514514] - [I] Ditto + Cross references = not working (yamamoto) +* [GitHub:#cd9edc726] - [F] update theme with dropdown (dmi3yy) +* [GitHub:#e72c1633a] - [F] search static (dmi3yy) +* [GitHub:#bb613a516] - [F] style (dmi3yy) +* [GitHub:#9f55793a3] - [F] session keep alive (dmi3yy) +* [GitHub:#7127787b8] - [F] warning in mgrResources (dmi3yy) +* [GitHub:#f2d24c0f9] - [F] Update dropdown theme (dmi3yy) +* [GitHub:#1532ef67e] - [F] Update modxre_dropdonwmenu theme (dmi3yy) +* [GitHub:#a024c2f2d] - [F] Change gridster image to fa (dmi3yy) +* [GitHub:#b32c7f8a6] - [F] Fixed sidebar search buttons position (Piotr Matysiak) +* [GitHub:#aaecb8a69] - [F] fixed wrong path to jquery library (Sasha Beep) +* [GitHub:#4e48080a3] - [R] Add responsive buttons style to new theme (dmi3yy) +* [GitHub:#b4783a78b] - [F] fix new theme with dropdown (dmi3yy) +* [GitHub:#5ae71ba5c] - [F] Fix js (dmi3yy) +* [GitHub:#100cdb1e7] - [F] fix 2016 to 2017 (dmi3yy) +* [GitHub:#69455bd79] - [F] lost icon in search (dmi3yy) +* [GitHub:#ac59e8deb] - [F] mobile actionbuttons fix for roles (Nicola) +* [GitHub:#bf07b997e] - [F] Search mobile actionbutton (Nicola) +* [GitHub:#5392a64a3] - [F] Fix Manage Users mobile Action buttons (Nicola) +* [GitHub:#f1cc3cb87] - [F] https://github.com/modxcms/evolution/issues/1306 (Nicola) +* [GitHub:#be8f23bc6] - [R] Responsive Action Buttons (Nicola) +* [GitHub:#2750446a3] - [F] Fix vertical align (MrSwed) +* [GitHub:#e849197ea] - [I] MODxRE2_DropdownMenu -new theme (dmi3yy) +* [GitHub:#ae3a90da5] - [F] typo in setup.sql (dmi3yy) +* [GitHub:#38eb4f6af] - [F]. Https in site_url (dmi3yy) +* [GitHub:#66f7eef77] - [F] #1218 TVs/PHs will not be rendered if custom_meta_title is not assigned to template like [*custom_meta_title:ne:then=`[*custom_meta_title*]`:else=`[*pagetitle*]`*] (dmi3yy) +* [GitHub:#7e9766084] - add .json exclude to alias (dmi3yy) +* [GitHub:#10317fa75] - [F] Fix params from modules to plugins (dmi3yy) +* [GitHub:#bc4517afc] - [F] for aliaslistingfolder no need check for docAlias for search id (dmi3yy) +* [GitHub:#4e309dc84] - [F] staticSearch for ajaxSearch (dmi3yy) +* [GitHub:#aff734e19] - [F] hardcoded fix ElementsInTree (dmi3yy) +* [GitHub:#e3e0da8e8] - [F] DLBuildMenu lot of queries (dmi3yy) +* [GitHub:#11d6288c5] - [F] #1279 If container has no siblings, get default-template from parent (Deesen) +* [GitHub:#90f69323a] - [C] Remove old version (Digitalime) +* [GitHub:#899e630af] - [R] Allow HTML email for Websignup (Digitalime) +* [GitHub:#48f694e31] - [I] Get the q parameter from the request and store it in a property, as well as cleaning it up for future use. (MadHatter) +* [GitHub:#1b635fb78] - [F] fix OnLoadDocumentObject event dont work #1271 (dmi3yy) +* [GitHub:#94418b98b] - [I] Update docLister add (makePaginateUrl param) (dmi3yy) +* [GitHub:#ba98bc6fa] - [I] Make sure site tree context menu is also within frame horizontally (Mr B) +* [GitHub:#27c560230] - [F] - #1275. http://take.ms/wo4RF (dmi3yy) +* [GitHub:#829808440] - [F] #1273 Permission-check for setting "Allow root" (Deesen) +* [GitHub:#34ce1939c] - [F] !contains (not_contains) condition for [[if]] (webber12) +* [GitHub:#03c5eb9e9] - [F] Code cleanup (yamamoto) +* [GitHub:#0a244df39] - [R] - $modx->invokeEvent() (yamamoto) +* [GitHub:#00e806af0] - [I] #1248 Show ID in tooltip (Deesen) +* [GitHub:#0970d3f7b] - [I] Assigning category automatically when using contextmenu-button "create new" (Deesen) +* [GitHub:#74eb8c054] - Icon for first tab (Sasha Beep) +* [GitHub:#a587691a4] - [R] Fix and Refactor - $modx->getSettings() (yamamoto) +* [GitHub:#8ff87f09e] - [R] Update ditto.class.inc.php (Intersel) +* [GitHub:#676606d3b] - [F] fix css typo in manage elements (Nicola Lambathakis) +* [GitHub:#983bc4d1f] - [R] Allow Webuser Signup Email to contain HTML (Digitalime) +* [GitHub:#717bcaed0] - [I] styles for resource view options toggle (Nicola Lambathakis) +* [GitHub:#2326f1a11] - [I] restyled resource view options toggle (Nicola Lambathakis) +* [GitHub:#14c01835b] - [I] added toggle speed animation to resource view options (Nicola Lambathakis) +* [GitHub:#0aa16f8fc] - [F] Update config.inc.tpl (Mr B) +* [GitHub:#33b17cdc0] - [R] no BG colors and other (MrSwed) +* [GitHub:#71b1748ce] - [F] fix site_manager_url for capcha (MrSwed) +* [GitHub:#2951ad121] - [F] Function isn't a constructor, it's a static method (Matthew Simpson) +* [GitHub:#bcf1aa6a1] - [F] Typo (Deesen) +* [GitHub:#45a368b62] - [F] Flex-View in Chrome: Fix breaking lines / spreading elements into next column (Deesen) +* [GitHub:#638e8f458] - [F] Added padding-bottom:10px for open panels (Deesen) +* [GitHub:#d5c0584f5] - [F] Removed unnecessary spaces and corrected alignments (Deesen) +* [GitHub:#a786013db] - [F] Inline-View: Removed space between collapsed categories (Deesen) +* [GitHub:#f39f54b75] - [F] QM fix modal buttons styles for tvs (Nicola Lambathakis) +* [GitHub:#8fc895fa5] - [F] QM media query in sidebar view (Nicola Lambathakis) +* [GitHub:#e6a6ea8a0] - [F] #1177 #1239 Corrected $_lang['lang_code'] (Deesen) +* [GitHub:#7984bcc89] - [F] Fix javascript error in console: 404 http://localhost/manager/JS (Nicola Lambathakis) +* [GitHub:#f043190d2] - [F] #1222 Fix tinymce4 introtext width (Nicola Lambathakis) +* [GitHub:#9ed21706e] - [O] Improve language for minify php option (Mr B) +* [GitHub:#fe42ef07d] - [F] for getIdFromAlias (sunhaim) +* [GitHub:#1a4540566] - [R] Refactored and improved "Manage Elements" - added language-strings - load template-files only once - added "View Options"-paragraph to "Help" (Deesen) +* [GitHub:#670cc8777] - [F] Sorting in "Combined View" (Deesen) +* [GitHub:#e996a0ba7] - [R] Refactored and improved "Manage Elements" - adapted "Combined View" to new view-mechanismn (Deesen) +* [GitHub:#6e77f636d] - [I] Aligned form below action-buttons (Deesen) +* [GitHub:#2c13cd979] - [F] Remove unnecessary "-" (Deesen) +* [GitHub:#e225194ed] - [F] Display lock-icon nicely instead of element-icon (Deesen) +* [GitHub:#78febbe40] - [R] Refactored and improved "Manage Elements" - moved HTML-templates into external files - adapted quicksearch - cleaned up CSS-styles (Deesen) +* [GitHub:#03f34e2d8] - [R] Refactored and improved "Manage Elements" - added collapsible categories (+ remember via localStorage) - added nuContextMenu - adapted CSS to new features (Deesen) +* [GitHub:#875621086] - [R] Moved jq-plugin "nuContextMenu" to external file "manager/media/script/jquery.nucontextmenu.js" (Deesen) +* [GitHub:#1a48e736a] - [F] alias_visible fix2 (sunhaim) +* [GitHub:#98adbe4cd] - [F] alias_visible fix (sunhaim) +* [GitHub:#7a9cf8e53] - [R] Refactored and improved "Manage Elements" - added "View Options"-button to show/hide form - removed checkbox "small font" - instead added font-size option - added checkbox "all tabs" to change views of all tabs with same options - added button "reset" to reset to defaults, works with "all tabs"-checkbox (Deesen) +* [GitHub:#d2bc89616] - [R] Refactored and improved "Manage Elements" as per idea of Nicola1971 - different views like "list, inline, flex" - flex provides dynamic columns using CSS3 "columns-count" - localStorage to store view-settings per tab - new class "mgrResources" to provide array with all nessecary details (Deesen) +* [GitHub:#c68c36a30] - [F] version 1.2.2-beta2, because of changes in document.parser (Deesen) +* [GitHub:#921e1b995] - [F] #1226 Load user-specific language instead of manager default-language (Deesen) +* [GitHub:#8c0027a54] - [F] category row padding (Nicola Lambathakis) +* [GitHub:#806196e7a] - [F] #1225 Manage Categories button in Combined View (Nicola Lambathakis) +* [GitHub:#d8e568162] - [F] Manage Elements - minor css fix - smaller row height (Nicola Lambathakis) +* [GitHub:#af2e886bf] - [F] Manage Elements - minor css fix - smaller row height (Nicola Lambathakis) +* [GitHub:#c51d7a10f] - [I] #1134 Added "styleFormat_inline" and "styleFormat_block" to plugin-config to allow separated settings for inline- and block-styles in simple-format (Deesen) +* [GitHub:#12c67aad3] - [F] #1218 Parse TVs/placeholders & modifiers even if TV is not assigned to actual template like [*custom_meta_title:ne:then=`[*custom_meta_title*]`:else=`[*pagetitle*]`*] (Deesen) +* [GitHub:#a30163dbe] - [F] #1200 Provide using (nested) placeholders/modifiers in Wayfinder (PHX backward-compatibility) (Deesen) +* [GitHub:#47c60d97b] - [F] Checkbox-value fallback to "name" if no "value" is given http://modx.im/blog/news/4950.html#comment41140 (Deesen) +* [GitHub:#a11311870] - [F] recent commit (yamamoto) +* [GitHub:#8dcf976ef] - [O]: reorder security configuration (Mr B) +* [GitHub:#e8db62140] - [C] Replaced htmlspecialchars() by $modx->htmlspecialchars() (Deesen) +* [GitHub:#2031422a1] - [F] Do not show users who forgot pressing logout in "Online Users"-list after login (Deesen) +* [GitHub:#6230c969d] - [F] #1205 TinyMCE4 usersettings: Added new checkbox "Use the global setting" - to params "Custom Plugins", "Custom Buttons", "Block Formats" - small clean-up of modxRTEbridge (Deesen) +* [GitHub:#ea765448d] - [C] #1214 Removed confusion in creating $modx->config to rely only on $modx->getSettings() and $modx->getUserSettings() - splitted $modx->getSettings() into getSettings() and getUserSettings(), so usersettings can be queried after startCMSSession(); - added $modx->configGlobal to keep fallback-values of global settings overwritten by usersettings (req. for Tiny4 "Use global settings"-checkbox in usersettings) - removed unnecessary inclusion of settings.inc.php and user_settings.inc.php (Deesen) +* [GitHub:#377fc22e2] - [I] New buttons theme and design improvemets (Nicola Lambathakis) +* [GitHub:#193e6d793] - [R] Updated Colorbox to 1.6.4 (Nicola Lambathakis) +* [GitHub:#d6f752573] - [R] media query for mobile Buttons (Nicola Lambathakis) +* [GitHub:#dc73e54cb] - [R] welcome.static.php (yamamoto) +* [GitHub:#f334a44a5] - [R] Manager theme template (yamamoto) +* [GitHub:#c528150a1] - [R] $modx->getUserInfo() (yamamoto) +* [GitHub:#7d3eca38e] - [I] Link snippet name to arbitrary function (yamamoto) +* [GitHub:#2591d6c8f] - [I] New modifier - json_decode (yamamoto) +* [GitHub:#6b0a6b904] - [I] New modifier - json_encode (yamamoto) +* [GitHub:#06fe67b18] - [F] Remove calling nonexistent metod (yamamoto) +* [GitHub:#1ff46451e] - [F] Wayfinder - &hideSubMenus (yamamoto) +* [GitHub:#e5e4eabcf] - [R] QM less hidden closed toolbar -47px (Nicola Lambathakis) +* [GitHub:#8804e77e3] - [R] QM icon for custom buttons in sideba (Nicola Lambathakis) +* [GitHub:#81284dd36] - [R] new QM position: right, left, before (Nicola Lambathakis) +* [GitHub:#29af60343] - [R] added QM bottom tollbar option (Nicola Lambathakis) +* [GitHub:#0c1e747c1] - [F] removed modx logo from QM toolbar (Nicola Lambathakis) +* [GitHub:#6d859f710] - [F] Remove users who forgot pressing logout from "Online Users"-list (Deesen) +* [GitHub:#5d3dfbe89] - [F] fixed some bugs and better save button style (Nicola Lambathakis) +* [GitHub:#6ac3d951f] - [i] Quick Manager buttons restyle (MODxRE2 style) (Nicola Lambathakis) +* [GitHub:#596422400] - [C] Removing Notice: Undefined offset: 0 (kulmjens) +* [GitHub:#d8f97efd1] - [F] fix incorrect detect id if in url string start from numeric (dmi3yy) +* [GitHub:#5f59f2c2c] - [R] font awesome icons for View Children (document overview) (Nicola Lambathakis) +* [GitHub:#3de7826a3] - [R] View Children: new buttons+font awesome (Nicola Lambathakis) +* [GitHub:#48447fbcd] - [I] changing output filename for easier sorting (kulmjens) +* [GitHub:#65edfb661] - [F] Do not list "index.html" as category/tab (Deesen) +* [GitHub:#4ca716fd6] - [C] delete category button (Nicola Lambathakis) +* [GitHub:#7c09a42fc] - [F] updated resource.static with buttons for 1.2.1 (Nicola Lambathakis) +* [GitHub:#a9f036792] - [F] updated styles for latest 1.2.1 (Nicola) +* [GitHub:#d7e089265] - [F] Ensure login button is styled for iPad/iPhone (Mr B) +* [GitHub:#0d2316965] - [I] #775 Added .border-bottom for category-manager (Deesen) +* [GitHub:#5137199eb] - [F] del ?> (dmi3yy) +* [GitHub:#64bad31f2] - [F] fix warnings in module extras on php 7 (dmi3yy) +* [GitHub:#94938d29a] - [F] #1184 Added missing "static" to var $i (Deesen) + MODX Evolution 1.2.1(Jan 11, 2017) * [GitHub:#6f404c6] - [I] Debug information (yamamoto) diff --git a/assets/js/easy-ui/easyloader.js b/assets/js/easy-ui/easyloader.js old mode 100755 new mode 100644 index d5ec1cf84b..edf4b5ebcc --- a/assets/js/easy-ui/easyloader.js +++ b/assets/js/easy-ui/easyloader.js @@ -1,14 +1,14 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function(){ -var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","window","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},tooltip:{js:"jquery.tooltip.js"},parser:{js:"jquery.parser.js"}}; +var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}}; var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"}; var _3={}; function _4(_5,_6){ diff --git a/assets/js/easy-ui/editors/fileBrowser.js b/assets/js/easy-ui/editors/fileBrowser.js old mode 100755 new mode 100644 index a7649d0bf1..5e0163ad41 --- a/assets/js/easy-ui/editors/fileBrowser.js +++ b/assets/js/easy-ui/editors/fileBrowser.js @@ -3,7 +3,7 @@ fileBrowser: { init: function (container, options) { var input = $('').appendTo(container); - var button = $('').appendTo(container); + var button = $('' + (options.hasOwnProperty('icon') ? '' : '')+'').appendTo(container); button.click({ target: this, field: input, @@ -22,7 +22,7 @@ $(target).val(value); }, resize: function (target, width) { - return; + $(target).width(width-30); }, browse: function (e) { var width = screen.width * 0.5; diff --git a/assets/js/easy-ui/jquery.easyui.min.js b/assets/js/easy-ui/jquery.easyui.min.js old mode 100755 new mode 100644 index 6c061dd903..ed68ac4cd3 --- a/assets/js/easy-ui/jquery.easyui.min.js +++ b/assets/js/easy-ui/jquery.easyui.min.js @@ -1,158 +1,222 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ -$.parser={auto:true,onComplete:function(_1){ -},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","progressbar","tree","textbox","filebox","combo","combobox","combotree","combogrid","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","tabs","accordion","window","dialog","form"],parse:function(_2){ +$.easyui={indexOfArray:function(a,o,id){ +for(var i=0,_1=a.length;i<_1;i++){ +if(id==undefined){ +if(a[i]==o){ +return i; +} +}else{ +if(a[i][o]==id){ +return i; +} +} +} +return -1; +},removeArrayItem:function(a,o,id){ +if(typeof o=="string"){ +for(var i=0,_2=a.length;i<_2;i++){ +if(a[i][o]==id){ +a.splice(i,1); +return; +} +} +}else{ +var _3=this.indexOfArray(a,o); +if(_3!=-1){ +a.splice(_3,1); +} +} +},addArrayItem:function(a,o,r){ +var _4=this.indexOfArray(a,o,r?r[o]:undefined); +if(_4==-1){ +a.push(r?r:o); +}else{ +a[_4]=r?r:o; +} +},getArrayItem:function(a,o,id){ +var _5=this.indexOfArray(a,o,id); +return _5==-1?null:a[_5]; +},forEach:function(_6,_7,_8){ +var _9=[]; +for(var i=0;i<_6.length;i++){ +_9.push(_6[i]); +} +while(_9.length){ +var _a=_9.shift(); +if(_8(_a)==false){ +return; +} +if(_7&&_a.children){ +for(var i=_a.children.length-1;i>=0;i--){ +_9.unshift(_a.children[i]); +} +} +} +}}; +$.parser={auto:true,onComplete:function(_b){ +},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","switchbutton","progressbar","tree","textbox","passwordbox","filebox","combo","combobox","combotree","combogrid","combotreegrid","tagbox","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_c){ var aa=[]; for(var i=0;i<$.parser.plugins.length;i++){ -var _3=$.parser.plugins[i]; -var r=$(".easyui-"+_3,_2); +var _d=$.parser.plugins[i]; +var r=$(".easyui-"+_d,_c); if(r.length){ -if(r[_3]){ -r[_3](); +if(r[_d]){ +r.each(function(){ +$(this)[_d]($.data(this,"options")||{}); +}); }else{ -aa.push({name:_3,jq:r}); +aa.push({name:_d,jq:r}); } } } if(aa.length&&window.easyloader){ -var _4=[]; +var _e=[]; for(var i=0;i=0){ -v=Math.floor((_8.width()-_9)*v/100); +},parseValue:function(_10,_11,_12,_13){ +_13=_13||0; +var v=$.trim(String(_11||"")); +var _14=v.substr(v.length-1,1); +if(_14=="%"){ +v=parseFloat(v.substr(0,v.length-1)); +if(_10.toLowerCase().indexOf("width")>=0){ +v=Math.floor((_12.width()-_13)*v/100); }else{ -v=Math.floor((_8.height()-_9)*v/100); +v=Math.floor((_12.height()-_13)*v/100); } }else{ v=parseInt(v)||undefined; } return v; -},parseOptions:function(_b,_c){ -var t=$(_b); -var _d={}; +},parseOptions:function(_15,_16){ +var t=$(_15); +var _17={}; var s=$.trim(t.attr("data-options")); if(s){ if(s.substring(0,1)!="{"){ s="{"+s+"}"; } -_d=(new Function("return "+s))(); +_17=(new Function("return "+s))(); } $.map(["width","height","left","top","minWidth","maxWidth","minHeight","maxHeight"],function(p){ -var pv=$.trim(_b.style[p]||""); +var pv=$.trim(_15.style[p]||""); if(pv){ if(pv.indexOf("%")==-1){ -pv=parseInt(pv)||undefined; +pv=parseInt(pv); +if(isNaN(pv)){ +pv=undefined; } -_d[p]=pv; +} +_17[p]=pv; } }); -if(_c){ -var _e={}; -for(var i=0;i<_c.length;i++){ -var pp=_c[i]; +if(_16){ +var _18={}; +for(var i=0;i<_16.length;i++){ +var pp=_16[i]; if(typeof pp=="string"){ -_e[pp]=t.attr(pp); +_18[pp]=t.attr(pp); }else{ -for(var _f in pp){ -var _10=pp[_f]; -if(_10=="boolean"){ -_e[_f]=t.attr(_f)?(t.attr(_f)=="true"):undefined; +for(var _19 in pp){ +var _1a=pp[_19]; +if(_1a=="boolean"){ +_18[_19]=t.attr(_19)?(t.attr(_19)=="true"):undefined; }else{ -if(_10=="number"){ -_e[_f]=t.attr(_f)=="0"?0:parseFloat(t.attr(_f))||undefined; +if(_1a=="number"){ +_18[_19]=t.attr(_19)=="0"?0:parseFloat(t.attr(_19))||undefined; } } } } } -$.extend(_d,_e); +$.extend(_17,_18); } -return _d; +return _17; }}; $(function(){ var d=$("
").appendTo("body"); $._boxModel=d.outerWidth()!=100; d.remove(); +d=$("
").appendTo("body"); +$._positionFixed=(d.css("position")=="fixed"); +d.remove(); if(!window.easyloader&&$.parser.auto){ $.parser.parse(); } }); -$.fn._outerWidth=function(_11){ -if(_11==undefined){ +$.fn._outerWidth=function(_1b){ +if(_1b==undefined){ if(this[0]==window){ return this.width()||document.body.clientWidth; } return this.outerWidth()||0; } -return this._size("width",_11); +return this._size("width",_1b); }; -$.fn._outerHeight=function(_12){ -if(_12==undefined){ +$.fn._outerHeight=function(_1c){ +if(_1c==undefined){ if(this[0]==window){ return this.height()||document.body.clientHeight; } return this.outerHeight()||0; } -return this._size("height",_12); +return this._size("height",_1c); }; -$.fn._scrollLeft=function(_13){ -if(_13==undefined){ +$.fn._scrollLeft=function(_1d){ +if(_1d==undefined){ return this.scrollLeft(); }else{ return this.each(function(){ -$(this).scrollLeft(_13); +$(this).scrollLeft(_1d); }); } }; $.fn._propAttr=$.fn.prop||$.fn.attr; -$.fn._size=function(_14,_15){ -if(typeof _14=="string"){ -if(_14=="clear"){ +$.fn._size=function(_1e,_1f){ +if(typeof _1e=="string"){ +if(_1e=="clear"){ return this.each(function(){ $(this).css({width:"",minWidth:"",maxWidth:"",height:"",minHeight:"",maxHeight:""}); }); }else{ -if(_14=="fit"){ +if(_1e=="fit"){ return this.each(function(){ -_16(this,this.tagName=="BODY"?$("body"):$(this).parent(),true); +_20(this,this.tagName=="BODY"?$("body"):$(this).parent(),true); }); }else{ -if(_14=="unfit"){ +if(_1e=="unfit"){ return this.each(function(){ -_16(this,$(this).parent(),false); +_20(this,$(this).parent(),false); }); }else{ -if(_15==undefined){ -return _17(this[0],_14); +if(_1f==undefined){ +return _21(this[0],_1e); }else{ return this.each(function(){ -_17(this,_14,_15); +_21(this,_1e,_1f); }); } } @@ -160,10 +224,10 @@ _17(this,_14,_15); } }else{ return this.each(function(){ -_15=_15||$(this).parent(); -$.extend(_14,_16(this,_15,_14.fit)||{}); -var r1=_18(this,"width",_15,_14); -var r2=_18(this,"height",_15,_14); +_1f=_1f||$(this).parent(); +$.extend(_1e,_20(this,_1f,_1e.fit)||{}); +var r1=_22(this,"width",_1f,_1e); +var r2=_22(this,"height",_1f,_1e); if(r1||r2){ $(this).addClass("easyui-fluid"); }else{ @@ -171,17 +235,17 @@ $(this).removeClass("easyui-fluid"); } }); } -function _16(_19,_1a,fit){ -if(!_1a.length){ +function _20(_23,_24,fit){ +if(!_24.length){ return false; } -var t=$(_19)[0]; -var p=_1a[0]; -var _1b=p.fcount||0; +var t=$(_23)[0]; +var p=_24[0]; +var _25=p.fcount||0; if(fit){ if(!t.fitted){ t.fitted=true; -p.fcount=_1b+1; +p.fcount=_25+1; $(p).addClass("panel-noscroll"); if(p.tagName=="BODY"){ $("html").addClass("panel-fit"); @@ -191,7 +255,7 @@ return {width:($(p).width()||1),height:($(p).height()||1)}; }else{ if(t.fitted){ t.fitted=false; -p.fcount=_1b-1; +p.fcount=_25-1; if(p.fcount==0){ $(p).removeClass("panel-noscroll"); if(p.tagName=="BODY"){ @@ -202,18 +266,18 @@ $("html").removeClass("panel-fit"); return false; } }; -function _18(_1c,_1d,_1e,_1f){ -var t=$(_1c); -var p=_1d; +function _22(_26,_27,_28,_29){ +var t=$(_26); +var p=_27; var p1=p.substr(0,1).toUpperCase()+p.substr(1); -var min=$.parser.parseValue("min"+p1,_1f["min"+p1],_1e); -var max=$.parser.parseValue("max"+p1,_1f["max"+p1],_1e); -var val=$.parser.parseValue(p,_1f[p],_1e); -var _20=(String(_1f[p]||"").indexOf("%")>=0?true:false); +var min=$.parser.parseValue("min"+p1,_29["min"+p1],_28); +var max=$.parser.parseValue("max"+p1,_29["max"+p1],_28); +var val=$.parser.parseValue(p,_29[p],_28); +var _2a=(String(_29[p]||"").indexOf("%")>=0?true:false); if(!isNaN(val)){ var v=Math.min(Math.max(val,min||0),max||99999); -if(!_20){ -_1f[p]=v; +if(!_2a){ +_29[p]=v; } t._size("min"+p1,""); t._size("max"+p1,""); @@ -223,34 +287,34 @@ t._size(p,""); t._size("min"+p1,min); t._size("max"+p1,max); } -return _20||_1f.fit; +return _2a||_29.fit; }; -function _17(_21,_22,_23){ -var t=$(_21); -if(_23==undefined){ -_23=parseInt(_21.style[_22]); -if(isNaN(_23)){ +function _21(_2b,_2c,_2d){ +var t=$(_2b); +if(_2d==undefined){ +_2d=parseInt(_2b.style[_2c]); +if(isNaN(_2d)){ return undefined; } if($._boxModel){ -_23+=_24(); +_2d+=_2e(); } -return _23; +return _2d; }else{ -if(_23===""){ -t.css(_22,""); +if(_2d===""){ +t.css(_2c,""); }else{ if($._boxModel){ -_23-=_24(); -if(_23<0){ -_23=0; +_2d-=_2e(); +if(_2d<0){ +_2d=0; } } -t.css(_22,_23+"px"); +t.css(_2c,_2d+"px"); } } -function _24(){ -if(_22.toLowerCase().indexOf("width")>=0){ +function _2e(){ +if(_2c.toLowerCase().indexOf("width")>=0){ return t.outerWidth()-t.width(); }else{ return t.outerHeight()-t.height(); @@ -260,204 +324,212 @@ return t.outerHeight()-t.height(); }; })(jQuery); (function($){ -var _25=null; -var _26=null; -var _27=false; -function _28(e){ +var _2f=null; +var _30=null; +var _31=false; +function _32(e){ if(e.touches.length!=1){ return; } -if(!_27){ -_27=true; +if(!_31){ +_31=true; dblClickTimer=setTimeout(function(){ -_27=false; +_31=false; },500); }else{ clearTimeout(dblClickTimer); -_27=false; -_29(e,"dblclick"); +_31=false; +_33(e,"dblclick"); } -_25=setTimeout(function(){ -_29(e,"contextmenu",3); +_2f=setTimeout(function(){ +_33(e,"contextmenu",3); },1000); -_29(e,"mousedown"); +_33(e,"mousedown"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; -function _2a(e){ +function _34(e){ if(e.touches.length!=1){ return; } -if(_25){ -clearTimeout(_25); +if(_2f){ +clearTimeout(_2f); } -_29(e,"mousemove"); +_33(e,"mousemove"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; -function _2b(e){ -if(_25){ -clearTimeout(_25); +function _35(e){ +if(_2f){ +clearTimeout(_2f); } -_29(e,"mouseup"); +_33(e,"mouseup"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; -function _29(e,_2c,_2d){ -var _2e=new $.Event(_2c); -_2e.pageX=e.changedTouches[0].pageX; -_2e.pageY=e.changedTouches[0].pageY; -_2e.which=_2d||1; -$(e.target).trigger(_2e); +function _33(e,_36,_37){ +var _38=new $.Event(_36); +_38.pageX=e.changedTouches[0].pageX; +_38.pageY=e.changedTouches[0].pageY; +_38.which=_37||1; +$(e.target).trigger(_38); }; if(document.addEventListener){ -document.addEventListener("touchstart",_28,true); -document.addEventListener("touchmove",_2a,true); -document.addEventListener("touchend",_2b,true); +document.addEventListener("touchstart",_32,true); +document.addEventListener("touchmove",_34,true); +document.addEventListener("touchend",_35,true); } })(jQuery); (function($){ -function _2f(e){ -var _30=$.data(e.data.target,"draggable"); -var _31=_30.options; -var _32=_30.proxy; -var _33=e.data; -var _34=_33.startLeft+e.pageX-_33.startX; -var top=_33.startTop+e.pageY-_33.startY; -if(_32){ -if(_32.parent()[0]==document.body){ -if(_31.deltaX!=null&&_31.deltaX!=undefined){ -_34=e.pageX+_31.deltaX; -}else{ -_34=e.pageX-e.data.offsetWidth; -} -if(_31.deltaY!=null&&_31.deltaY!=undefined){ -top=e.pageY+_31.deltaY; +function _39(e){ +var _3a=$.data(e.data.target,"draggable"); +var _3b=_3a.options; +var _3c=_3a.proxy; +var _3d=e.data; +var _3e=_3d.startLeft+e.pageX-_3d.startX; +var top=_3d.startTop+e.pageY-_3d.startY; +if(_3c){ +if(_3c.parent()[0]==document.body){ +if(_3b.deltaX!=null&&_3b.deltaX!=undefined){ +_3e=e.pageX+_3b.deltaX; +}else{ +_3e=e.pageX-e.data.offsetWidth; +} +if(_3b.deltaY!=null&&_3b.deltaY!=undefined){ +top=e.pageY+_3b.deltaY; }else{ top=e.pageY-e.data.offsetHeight; } }else{ -if(_31.deltaX!=null&&_31.deltaX!=undefined){ -_34+=e.data.offsetWidth+_31.deltaX; +if(_3b.deltaX!=null&&_3b.deltaX!=undefined){ +_3e+=e.data.offsetWidth+_3b.deltaX; } -if(_31.deltaY!=null&&_31.deltaY!=undefined){ -top+=e.data.offsetHeight+_31.deltaY; +if(_3b.deltaY!=null&&_3b.deltaY!=undefined){ +top+=e.data.offsetHeight+_3b.deltaY; } } } if(e.data.parent!=document.body){ -_34+=$(e.data.parent).scrollLeft(); +_3e+=$(e.data.parent).scrollLeft(); top+=$(e.data.parent).scrollTop(); } -if(_31.axis=="h"){ -_33.left=_34; +if(_3b.axis=="h"){ +_3d.left=_3e; }else{ -if(_31.axis=="v"){ -_33.top=top; +if(_3b.axis=="v"){ +_3d.top=top; }else{ -_33.left=_34; -_33.top=top; +_3d.left=_3e; +_3d.top=top; } } }; -function _35(e){ -var _36=$.data(e.data.target,"draggable"); -var _37=_36.options; -var _38=_36.proxy; -if(!_38){ -_38=$(e.data.target); +function _3f(e){ +var _40=$.data(e.data.target,"draggable"); +var _41=_40.options; +var _42=_40.proxy; +if(!_42){ +_42=$(e.data.target); } -_38.css({left:e.data.left,top:e.data.top}); -$("body").css("cursor",_37.cursor); +_42.css({left:e.data.left,top:e.data.top}); +$("body").css("cursor",_41.cursor); }; -function _39(e){ -$.fn.draggable.isDragging=true; -var _3a=$.data(e.data.target,"draggable"); -var _3b=_3a.options; -var _3c=$(".droppable").filter(function(){ +function _43(e){ +if(!$.fn.draggable.isDragging){ +return false; +} +var _44=$.data(e.data.target,"draggable"); +var _45=_44.options; +var _46=$(".droppable:visible").filter(function(){ return e.data.target!=this; }).filter(function(){ -var _3d=$.data(this,"droppable").options.accept; -if(_3d){ -return $(_3d).filter(function(){ +var _47=$.data(this,"droppable").options.accept; +if(_47){ +return $(_47).filter(function(){ return this==e.data.target; }).length>0; }else{ return true; } }); -_3a.droppables=_3c; -var _3e=_3a.proxy; -if(!_3e){ -if(_3b.proxy){ -if(_3b.proxy=="clone"){ -_3e=$(e.data.target).clone().insertAfter(e.data.target); +_44.droppables=_46; +var _48=_44.proxy; +if(!_48){ +if(_45.proxy){ +if(_45.proxy=="clone"){ +_48=$(e.data.target).clone().insertAfter(e.data.target); }else{ -_3e=_3b.proxy.call(e.data.target,e.data.target); +_48=_45.proxy.call(e.data.target,e.data.target); } -_3a.proxy=_3e; +_44.proxy=_48; }else{ -_3e=$(e.data.target); +_48=$(e.data.target); } } -_3e.css("position","absolute"); -_2f(e); -_35(e); -_3b.onStartDrag.call(e.data.target,e); +_48.css("position","absolute"); +_39(e); +_3f(e); +_45.onStartDrag.call(e.data.target,e); return false; }; -function _3f(e){ -var _40=$.data(e.data.target,"draggable"); -_2f(e); -if(_40.options.onDrag.call(e.data.target,e)!=false){ -_35(e); +function _49(e){ +if(!$.fn.draggable.isDragging){ +return false; +} +var _4a=$.data(e.data.target,"draggable"); +_39(e); +if(_4a.options.onDrag.call(e.data.target,e)!=false){ +_3f(e); } -var _41=e.data.target; -_40.droppables.each(function(){ -var _42=$(this); -if(_42.droppable("options").disabled){ +var _4b=e.data.target; +_4a.droppables.each(function(){ +var _4c=$(this); +if(_4c.droppable("options").disabled){ return; } -var p2=_42.offset(); -if(e.pageX>p2.left&&e.pageXp2.top&&e.pageYp2.left&&e.pageXp2.top&&e.pageYp2.left&&e.pageXp2.top&&e.pageYp2.left&&e.pageXp2.top&&e.pageY_57.options.edge; +function _5d(e){ +var _62=$.data(e.data.target,"draggable"); +var _63=_62.handle; +var _64=$(_63).offset(); +var _65=$(_63).outerWidth(); +var _66=$(_63).outerHeight(); +var t=e.pageY-_64.top; +var r=_64.left+_65-e.pageX; +var b=_64.top+_66-e.pageY; +var l=e.pageX-_64.left; +return Math.min(t,r,b,l)>_62.options.edge; }; }); }; @@ -581,11 +666,11 @@ return jq.each(function(){ $(this).draggable({disabled:true}); }); }}; -$.fn.draggable.parseOptions=function(_5c){ -var t=$(_5c); -return $.extend({},$.parser.parseOptions(_5c,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); +$.fn.draggable.parseOptions=function(_67){ +var t=$(_67); +return $.extend({},$.parser.parseOptions(_67,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number","delay":"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); }; -$.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,onBeforeDrag:function(e){ +$.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,delay:100,onBeforeDrag:function(e){ },onStartDrag:function(e){ },onDrag:function(e){ },onStopDrag:function(e){ @@ -593,33 +678,33 @@ $.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,delta $.fn.draggable.isDragging=false; })(jQuery); (function($){ -function _5d(_5e){ -$(_5e).addClass("droppable"); -$(_5e).bind("_dragenter",function(e,_5f){ -$.data(_5e,"droppable").options.onDragEnter.apply(_5e,[e,_5f]); +function _68(_69){ +$(_69).addClass("droppable"); +$(_69).bind("_dragenter",function(e,_6a){ +$.data(_69,"droppable").options.onDragEnter.apply(_69,[e,_6a]); }); -$(_5e).bind("_dragleave",function(e,_60){ -$.data(_5e,"droppable").options.onDragLeave.apply(_5e,[e,_60]); +$(_69).bind("_dragleave",function(e,_6b){ +$.data(_69,"droppable").options.onDragLeave.apply(_69,[e,_6b]); }); -$(_5e).bind("_dragover",function(e,_61){ -$.data(_5e,"droppable").options.onDragOver.apply(_5e,[e,_61]); +$(_69).bind("_dragover",function(e,_6c){ +$.data(_69,"droppable").options.onDragOver.apply(_69,[e,_6c]); }); -$(_5e).bind("_drop",function(e,_62){ -$.data(_5e,"droppable").options.onDrop.apply(_5e,[e,_62]); +$(_69).bind("_drop",function(e,_6d){ +$.data(_69,"droppable").options.onDrop.apply(_69,[e,_6d]); }); }; -$.fn.droppable=function(_63,_64){ -if(typeof _63=="string"){ -return $.fn.droppable.methods[_63](this,_64); +$.fn.droppable=function(_6e,_6f){ +if(typeof _6e=="string"){ +return $.fn.droppable.methods[_6e](this,_6f); } -_63=_63||{}; +_6e=_6e||{}; return this.each(function(){ -var _65=$.data(this,"droppable"); -if(_65){ -$.extend(_65.options,_63); +var _70=$.data(this,"droppable"); +if(_70){ +$.extend(_70.options,_6e); }else{ -_5d(this); -$.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,$.fn.droppable.parseOptions(this),_63)}); +_68(this); +$.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,$.fn.droppable.parseOptions(this),_6e)}); } }); }; @@ -634,97 +719,97 @@ return jq.each(function(){ $(this).droppable({disabled:true}); }); }}; -$.fn.droppable.parseOptions=function(_66){ -var t=$(_66); -return $.extend({},$.parser.parseOptions(_66,["accept"]),{disabled:(t.attr("disabled")?true:undefined)}); -}; -$.fn.droppable.defaults={accept:null,disabled:false,onDragEnter:function(e,_67){ -},onDragOver:function(e,_68){ -},onDragLeave:function(e,_69){ -},onDrop:function(e,_6a){ +$.fn.droppable.parseOptions=function(_71){ +var t=$(_71); +return $.extend({},$.parser.parseOptions(_71,["accept"]),{disabled:(t.attr("disabled")?true:undefined)}); +}; +$.fn.droppable.defaults={accept:null,disabled:false,onDragEnter:function(e,_72){ +},onDragOver:function(e,_73){ +},onDragLeave:function(e,_74){ +},onDrop:function(e,_75){ }}; })(jQuery); (function($){ -$.fn.resizable=function(_6b,_6c){ -if(typeof _6b=="string"){ -return $.fn.resizable.methods[_6b](this,_6c); -} -function _6d(e){ -var _6e=e.data; -var _6f=$.data(_6e.target,"resizable").options; -if(_6e.dir.indexOf("e")!=-1){ -var _70=_6e.startWidth+e.pageX-_6e.startX; -_70=Math.min(Math.max(_70,_6f.minWidth),_6f.maxWidth); -_6e.width=_70; -} -if(_6e.dir.indexOf("s")!=-1){ -var _71=_6e.startHeight+e.pageY-_6e.startY; -_71=Math.min(Math.max(_71,_6f.minHeight),_6f.maxHeight); -_6e.height=_71; -} -if(_6e.dir.indexOf("w")!=-1){ -var _70=_6e.startWidth-e.pageX+_6e.startX; -_70=Math.min(Math.max(_70,_6f.minWidth),_6f.maxWidth); -_6e.width=_70; -_6e.left=_6e.startLeft+_6e.startWidth-_6e.width; -} -if(_6e.dir.indexOf("n")!=-1){ -var _71=_6e.startHeight-e.pageY+_6e.startY; -_71=Math.min(Math.max(_71,_6f.minHeight),_6f.maxHeight); -_6e.height=_71; -_6e.top=_6e.startTop+_6e.startHeight-_6e.height; -} -}; -function _72(e){ -var _73=e.data; -var t=$(_73.target); -t.css({left:_73.left,top:_73.top}); -if(t.outerWidth()!=_73.width){ -t._outerWidth(_73.width); -} -if(t.outerHeight()!=_73.height){ -t._outerHeight(_73.height); -} -}; -function _74(e){ +$.fn.resizable=function(_76,_77){ +if(typeof _76=="string"){ +return $.fn.resizable.methods[_76](this,_77); +} +function _78(e){ +var _79=e.data; +var _7a=$.data(_79.target,"resizable").options; +if(_79.dir.indexOf("e")!=-1){ +var _7b=_79.startWidth+e.pageX-_79.startX; +_7b=Math.min(Math.max(_7b,_7a.minWidth),_7a.maxWidth); +_79.width=_7b; +} +if(_79.dir.indexOf("s")!=-1){ +var _7c=_79.startHeight+e.pageY-_79.startY; +_7c=Math.min(Math.max(_7c,_7a.minHeight),_7a.maxHeight); +_79.height=_7c; +} +if(_79.dir.indexOf("w")!=-1){ +var _7b=_79.startWidth-e.pageX+_79.startX; +_7b=Math.min(Math.max(_7b,_7a.minWidth),_7a.maxWidth); +_79.width=_7b; +_79.left=_79.startLeft+_79.startWidth-_79.width; +} +if(_79.dir.indexOf("n")!=-1){ +var _7c=_79.startHeight-e.pageY+_79.startY; +_7c=Math.min(Math.max(_7c,_7a.minHeight),_7a.maxHeight); +_79.height=_7c; +_79.top=_79.startTop+_79.startHeight-_79.height; +} +}; +function _7d(e){ +var _7e=e.data; +var t=$(_7e.target); +t.css({left:_7e.left,top:_7e.top}); +if(t.outerWidth()!=_7e.width){ +t._outerWidth(_7e.width); +} +if(t.outerHeight()!=_7e.height){ +t._outerHeight(_7e.height); +} +}; +function _7f(e){ $.fn.resizable.isResizing=true; $.data(e.data.target,"resizable").options.onStartResize.call(e.data.target,e); return false; }; -function _75(e){ -_6d(e); +function _80(e){ +_78(e); if($.data(e.data.target,"resizable").options.onResize.call(e.data.target,e)!=false){ -_72(e); +_7d(e); } return false; }; -function _76(e){ +function _81(e){ $.fn.resizable.isResizing=false; -_6d(e,true); -_72(e); +_78(e,true); +_7d(e); $.data(e.data.target,"resizable").options.onStopResize.call(e.data.target,e); $(document).unbind(".resizable"); $("body").css("cursor",""); return false; }; return this.each(function(){ -var _77=null; -var _78=$.data(this,"resizable"); -if(_78){ +var _82=null; +var _83=$.data(this,"resizable"); +if(_83){ $(this).unbind(".resizable"); -_77=$.extend(_78.options,_6b||{}); +_82=$.extend(_83.options,_76||{}); }else{ -_77=$.extend({},$.fn.resizable.defaults,$.fn.resizable.parseOptions(this),_6b||{}); -$.data(this,"resizable",{options:_77}); +_82=$.extend({},$.fn.resizable.defaults,$.fn.resizable.parseOptions(this),_76||{}); +$.data(this,"resizable",{options:_82}); } -if(_77.disabled==true){ +if(_82.disabled==true){ return; } $(this).bind("mousemove.resizable",{target:this},function(e){ if($.fn.resizable.isResizing){ return; } -var dir=_79(e); +var dir=_84(e); if(dir==""){ $(e.data.target).css("cursor",""); }else{ @@ -733,11 +818,11 @@ $(e.data.target).css("cursor",dir+"-resize"); }).bind("mouseleave.resizable",{target:this},function(e){ $(e.data.target).css("cursor",""); }).bind("mousedown.resizable",{target:this},function(e){ -var dir=_79(e); +var dir=_84(e); if(dir==""){ return; } -function _7a(css){ +function _85(css){ var val=parseInt($(e.data.target).css(css)); if(isNaN(val)){ return 0; @@ -745,37 +830,37 @@ return 0; return val; } }; -var _7b={target:e.data.target,dir:dir,startLeft:_7a("left"),startTop:_7a("top"),left:_7a("left"),top:_7a("top"),startX:e.pageX,startY:e.pageY,startWidth:$(e.data.target).outerWidth(),startHeight:$(e.data.target).outerHeight(),width:$(e.data.target).outerWidth(),height:$(e.data.target).outerHeight(),deltaWidth:$(e.data.target).outerWidth()-$(e.data.target).width(),deltaHeight:$(e.data.target).outerHeight()-$(e.data.target).height()}; -$(document).bind("mousedown.resizable",_7b,_74); -$(document).bind("mousemove.resizable",_7b,_75); -$(document).bind("mouseup.resizable",_7b,_76); +var _86={target:e.data.target,dir:dir,startLeft:_85("left"),startTop:_85("top"),left:_85("left"),top:_85("top"),startX:e.pageX,startY:e.pageY,startWidth:$(e.data.target).outerWidth(),startHeight:$(e.data.target).outerHeight(),width:$(e.data.target).outerWidth(),height:$(e.data.target).outerHeight(),deltaWidth:$(e.data.target).outerWidth()-$(e.data.target).width(),deltaHeight:$(e.data.target).outerHeight()-$(e.data.target).height()}; +$(document).bind("mousedown.resizable",_86,_7f); +$(document).bind("mousemove.resizable",_86,_80); +$(document).bind("mouseup.resizable",_86,_81); $("body").css("cursor",dir+"-resize"); }); -function _79(e){ +function _84(e){ var tt=$(e.data.target); var dir=""; -var _7c=tt.offset(); -var _7d=tt.outerWidth(); -var _7e=tt.outerHeight(); -var _7f=_77.edge; -if(e.pageY>_7c.top&&e.pageY<_7c.top+_7f){ +var _87=tt.offset(); +var _88=tt.outerWidth(); +var _89=tt.outerHeight(); +var _8a=_82.edge; +if(e.pageY>_87.top&&e.pageY<_87.top+_8a){ dir+="n"; }else{ -if(e.pageY<_7c.top+_7e&&e.pageY>_7c.top+_7e-_7f){ +if(e.pageY<_87.top+_89&&e.pageY>_87.top+_89-_8a){ dir+="s"; } } -if(e.pageX>_7c.left&&e.pageX<_7c.left+_7f){ +if(e.pageX>_87.left&&e.pageX<_87.left+_8a){ dir+="w"; }else{ -if(e.pageX<_7c.left+_7d&&e.pageX>_7c.left+_7d-_7f){ +if(e.pageX<_87.left+_88&&e.pageX>_87.left+_88-_8a){ dir+="e"; } } -var _80=_77.handles.split(","); -for(var i=0;i<_80.length;i++){ -var _81=_80[i].replace(/(^\s*)|(\s*$)/g,""); -if(_81=="all"||_81==dir){ +var _8b=_82.handles.split(","); +for(var i=0;i<_8b.length;i++){ +var _8c=_8b[i].replace(/(^\s*)|(\s*$)/g,""); +if(_8c=="all"||_8c==dir){ return dir; } } @@ -794,9 +879,9 @@ return jq.each(function(){ $(this).resizable({disabled:true}); }); }}; -$.fn.resizable.parseOptions=function(_82){ -var t=$(_82); -return $.extend({},$.parser.parseOptions(_82,["handles",{minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number",edge:"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); +$.fn.resizable.parseOptions=function(_8d){ +var t=$(_8d); +return $.extend({},$.parser.parseOptions(_8d,["handles",{minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number",edge:"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); }; $.fn.resizable.defaults={disabled:false,handles:"n, e, s, w, ne, se, sw, nw, all",minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000,edge:5,onStartResize:function(e){ },onResize:function(e){ @@ -805,81 +890,84 @@ $.fn.resizable.defaults={disabled:false,handles:"n, e, s, w, ne, se, sw, nw, all $.fn.resizable.isResizing=false; })(jQuery); (function($){ -function _83(_84,_85){ -var _86=$.data(_84,"linkbutton").options; -if(_85){ -$.extend(_86,_85); -} -if(_86.width||_86.height||_86.fit){ -var btn=$(_84); -var _87=btn.parent(); -var _88=btn.is(":visible"); -if(!_88){ -var _89=$("
").insertBefore(_84); -var _8a={position:btn.css("position"),display:btn.css("display"),left:btn.css("left")}; +function _8e(_8f,_90){ +var _91=$.data(_8f,"linkbutton").options; +if(_90){ +$.extend(_91,_90); +} +if(_91.width||_91.height||_91.fit){ +var btn=$(_8f); +var _92=btn.parent(); +var _93=btn.is(":visible"); +if(!_93){ +var _94=$("
").insertBefore(_8f); +var _95={position:btn.css("position"),display:btn.css("display"),left:btn.css("left")}; btn.appendTo("body"); btn.css({position:"absolute",display:"inline-block",left:-20000}); } -btn._size(_86,_87); -var _8b=btn.find(".l-btn-left"); -_8b.css("margin-top",0); -_8b.css("margin-top",parseInt((btn.height()-_8b.height())/2)+"px"); -if(!_88){ -btn.insertAfter(_89); -btn.css(_8a); -_89.remove(); +btn._size(_91,_92); +var _96=btn.find(".l-btn-left"); +_96.css("margin-top",0); +_96.css("margin-top",parseInt((btn.height()-_96.height())/2)+"px"); +if(!_93){ +btn.insertAfter(_94); +btn.css(_95); +_94.remove(); } } }; -function _8c(_8d){ -var _8e=$.data(_8d,"linkbutton").options; -var t=$(_8d).empty(); -t.addClass("l-btn").removeClass("l-btn-plain l-btn-selected l-btn-plain-selected"); -t.removeClass("l-btn-small l-btn-medium l-btn-large").addClass("l-btn-"+_8e.size); -if(_8e.plain){ +function _97(_98){ +var _99=$.data(_98,"linkbutton").options; +var t=$(_98).empty(); +t.addClass("l-btn").removeClass("l-btn-plain l-btn-selected l-btn-plain-selected l-btn-outline"); +t.removeClass("l-btn-small l-btn-medium l-btn-large").addClass("l-btn-"+_99.size); +if(_99.plain){ t.addClass("l-btn-plain"); } -if(_8e.selected){ -t.addClass(_8e.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); +if(_99.outline){ +t.addClass("l-btn-outline"); } -t.attr("group",_8e.group||""); -t.attr("id",_8e.id||""); -var _8f=$("").appendTo(t); -if(_8e.text){ -$("").html(_8e.text).appendTo(_8f); +if(_99.selected){ +t.addClass(_99.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); +} +t.attr("group",_99.group||""); +t.attr("id",_99.id||""); +var _9a=$("").appendTo(t); +if(_99.text){ +$("").html(_99.text).appendTo(_9a); }else{ -$(" ").appendTo(_8f); +$(" ").appendTo(_9a); } -if(_8e.iconCls){ -$(" ").addClass(_8e.iconCls).appendTo(_8f); -_8f.addClass("l-btn-icon-"+_8e.iconAlign); +if(_99.iconCls){ +$(" ").addClass(_99.iconCls).appendTo(_9a); +_9a.addClass("l-btn-icon-"+_99.iconAlign); } t.unbind(".linkbutton").bind("focus.linkbutton",function(){ -if(!_8e.disabled){ +if(!_99.disabled){ $(this).addClass("l-btn-focus"); } }).bind("blur.linkbutton",function(){ $(this).removeClass("l-btn-focus"); }).bind("click.linkbutton",function(){ -if(!_8e.disabled){ -if(_8e.toggle){ -if(_8e.selected){ +if(!_99.disabled){ +if(_99.toggle){ +if(_99.selected){ $(this).linkbutton("unselect"); }else{ $(this).linkbutton("select"); } } -_8e.onClick.call(this); +_99.onClick.call(this); } }); -_90(_8d,_8e.selected); -_91(_8d,_8e.disabled); +_9b(_98,_99.selected); +_9c(_98,_99.disabled); }; -function _90(_92,_93){ -var _94=$.data(_92,"linkbutton").options; -if(_93){ -if(_94.group){ -$("a.l-btn[group=\""+_94.group+"\"]").each(function(){ +function _9b(_9d,_9e){ +var _9f=$.data(_9d,"linkbutton").options; +if(_9e){ +if(_9f.group){ +$("a.l-btn[group=\""+_9f.group+"\"]").each(function(){ var o=$(this).linkbutton("options"); if(o.toggle){ $(this).removeClass("l-btn-selected l-btn-plain-selected"); @@ -887,107 +975,110 @@ o.selected=false; } }); } -$(_92).addClass(_94.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); -_94.selected=true; +$(_9d).addClass(_9f.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); +_9f.selected=true; }else{ -if(!_94.group){ -$(_92).removeClass("l-btn-selected l-btn-plain-selected"); -_94.selected=false; +if(!_9f.group){ +$(_9d).removeClass("l-btn-selected l-btn-plain-selected"); +_9f.selected=false; } } }; -function _91(_95,_96){ -var _97=$.data(_95,"linkbutton"); -var _98=_97.options; -$(_95).removeClass("l-btn-disabled l-btn-plain-disabled"); -if(_96){ -_98.disabled=true; -var _99=$(_95).attr("href"); -if(_99){ -_97.href=_99; -$(_95).attr("href","javascript:void(0)"); +function _9c(_a0,_a1){ +var _a2=$.data(_a0,"linkbutton"); +var _a3=_a2.options; +$(_a0).removeClass("l-btn-disabled l-btn-plain-disabled"); +if(_a1){ +_a3.disabled=true; +var _a4=$(_a0).attr("href"); +if(_a4){ +_a2.href=_a4; +$(_a0).attr("href","javascript:;"); } -if(_95.onclick){ -_97.onclick=_95.onclick; -_95.onclick=null; +if(_a0.onclick){ +_a2.onclick=_a0.onclick; +_a0.onclick=null; } -_98.plain?$(_95).addClass("l-btn-disabled l-btn-plain-disabled"):$(_95).addClass("l-btn-disabled"); +_a3.plain?$(_a0).addClass("l-btn-disabled l-btn-plain-disabled"):$(_a0).addClass("l-btn-disabled"); }else{ -_98.disabled=false; -if(_97.href){ -$(_95).attr("href",_97.href); +_a3.disabled=false; +if(_a2.href){ +$(_a0).attr("href",_a2.href); } -if(_97.onclick){ -_95.onclick=_97.onclick; +if(_a2.onclick){ +_a0.onclick=_a2.onclick; } } }; -$.fn.linkbutton=function(_9a,_9b){ -if(typeof _9a=="string"){ -return $.fn.linkbutton.methods[_9a](this,_9b); +$.fn.linkbutton=function(_a5,_a6){ +if(typeof _a5=="string"){ +return $.fn.linkbutton.methods[_a5](this,_a6); } -_9a=_9a||{}; +_a5=_a5||{}; return this.each(function(){ -var _9c=$.data(this,"linkbutton"); -if(_9c){ -$.extend(_9c.options,_9a); +var _a7=$.data(this,"linkbutton"); +if(_a7){ +$.extend(_a7.options,_a5); }else{ -$.data(this,"linkbutton",{options:$.extend({},$.fn.linkbutton.defaults,$.fn.linkbutton.parseOptions(this),_9a)}); +$.data(this,"linkbutton",{options:$.extend({},$.fn.linkbutton.defaults,$.fn.linkbutton.parseOptions(this),_a5)}); $(this).removeAttr("disabled"); -$(this).bind("_resize",function(e,_9d){ -if($(this).hasClass("easyui-fluid")||_9d){ -_83(this); +$(this).bind("_resize",function(e,_a8){ +if($(this).hasClass("easyui-fluid")||_a8){ +_8e(this); } return false; }); } -_8c(this); -_83(this); +_97(this); +_8e(this); }); }; $.fn.linkbutton.methods={options:function(jq){ return $.data(jq[0],"linkbutton").options; -},resize:function(jq,_9e){ +},resize:function(jq,_a9){ return jq.each(function(){ -_83(this,_9e); +_8e(this,_a9); }); },enable:function(jq){ return jq.each(function(){ -_91(this,false); +_9c(this,false); }); },disable:function(jq){ return jq.each(function(){ -_91(this,true); +_9c(this,true); }); },select:function(jq){ return jq.each(function(){ -_90(this,true); +_9b(this,true); }); },unselect:function(jq){ return jq.each(function(){ -_90(this,false); +_9b(this,false); }); }}; -$.fn.linkbutton.parseOptions=function(_9f){ -var t=$(_9f); -return $.extend({},$.parser.parseOptions(_9f,["id","iconCls","iconAlign","group","size",{plain:"boolean",toggle:"boolean",selected:"boolean"}]),{disabled:(t.attr("disabled")?true:undefined),text:$.trim(t.html()),iconCls:(t.attr("icon")||t.attr("iconCls"))}); +$.fn.linkbutton.parseOptions=function(_aa){ +var t=$(_aa); +return $.extend({},$.parser.parseOptions(_aa,["id","iconCls","iconAlign","group","size","text",{plain:"boolean",toggle:"boolean",selected:"boolean",outline:"boolean"}]),{disabled:(t.attr("disabled")?true:undefined),text:($.trim(t.html())||undefined),iconCls:(t.attr("icon")||t.attr("iconCls"))}); }; -$.fn.linkbutton.defaults={id:null,disabled:false,toggle:false,selected:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){ +$.fn.linkbutton.defaults={id:null,disabled:false,toggle:false,selected:false,outline:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){ }}; })(jQuery); (function($){ -function _a0(_a1){ -var _a2=$.data(_a1,"pagination"); -var _a3=_a2.options; -var bb=_a2.bb={}; -var _a4=$(_a1).addClass("pagination").html("
"); -var tr=_a4.find("tr"); -var aa=$.extend([],_a3.layout); -if(!_a3.showPageList){ -_a5(aa,"list"); -} -if(!_a3.showRefresh){ -_a5(aa,"refresh"); +function _ab(_ac){ +var _ad=$.data(_ac,"pagination"); +var _ae=_ad.options; +var bb=_ad.bb={}; +var _af=$(_ac).addClass("pagination").html("
"); +var tr=_af.find("tr"); +var aa=$.extend([],_ae.layout); +if(!_ae.showPageList){ +_b0(aa,"list"); +} +if(!_ae.showPageInfo){ +_b0(aa,"info"); +} +if(!_ae.showRefresh){ +_b0(aa,"refresh"); } if(aa[0]=="sep"){ aa.shift(); @@ -995,52 +1086,61 @@ aa.shift(); if(aa[aa.length-1]=="sep"){ aa.pop(); } -for(var _a6=0;_a6"); ps.bind("change",function(){ -_a3.pageSize=parseInt($(this).val()); -_a3.onChangePageSize.call(_a1,_a3.pageSize); -_ad(_a1,_a3.pageNumber); +_ae.pageSize=parseInt($(this).val()); +_ae.onChangePageSize.call(_ac,_ae.pageSize); +_b8(_ac,_ae.pageNumber); }); -for(var i=0;i<_a3.pageList.length;i++){ -$("").text(_a3.pageList[i]).appendTo(ps); +for(var i=0;i<_ae.pageList.length;i++){ +$("").text(_ae.pageList[i]).appendTo(ps); } $("").append(ps).appendTo(tr); }else{ -if(_a7=="sep"){ +if(_b2=="sep"){ $("
").appendTo(tr); }else{ -if(_a7=="first"){ -bb.first=_a8("first"); +if(_b2=="first"){ +bb.first=_b3("first"); }else{ -if(_a7=="prev"){ -bb.prev=_a8("prev"); +if(_b2=="prev"){ +bb.prev=_b3("prev"); }else{ -if(_a7=="next"){ -bb.next=_a8("next"); +if(_b2=="next"){ +bb.next=_b3("next"); }else{ -if(_a7=="last"){ -bb.last=_a8("last"); +if(_b2=="last"){ +bb.last=_b3("last"); }else{ -if(_a7=="manual"){ -$("").html(_a3.beforePageText).appendTo(tr).wrap(""); +if(_b2=="manual"){ +$("").html(_ae.beforePageText).appendTo(tr).wrap(""); bb.num=$("").appendTo(tr).wrap(""); bb.num.unbind(".pagination").bind("keydown.pagination",function(e){ if(e.keyCode==13){ -var _a9=parseInt($(this).val())||1; -_ad(_a1,_a9); +var _b4=parseInt($(this).val())||1; +_b8(_ac,_b4); return false; } }); bb.after=$("").appendTo(tr).wrap(""); }else{ -if(_a7=="refresh"){ -bb.refresh=_a8("refresh"); +if(_b2=="refresh"){ +bb.refresh=_b3("refresh"); }else{ -if(_a7=="links"){ +if(_b2=="links"){ $("").appendTo(tr); +}else{ +if(_b2=="info"){ +if(_b1==aa.length-1){ +$("
").appendTo(_af); +$("
").appendTo(_af); +}else{ +$("
").appendTo(tr); +} +} } } } @@ -1051,16 +1151,16 @@ $("").appendTo(tr); } } } -if(_a3.buttons){ +if(_ae.buttons){ $("
").appendTo(tr); -if($.isArray(_a3.buttons)){ -for(var i=0;i<_a3.buttons.length;i++){ -var btn=_a3.buttons[i]; +if($.isArray(_ae.buttons)){ +for(var i=0;i<_ae.buttons.length;i++){ +var btn=_ae.buttons[i]; if(btn=="-"){ $("
").appendTo(tr); }else{ var td=$("").appendTo(tr); -var a=$("").appendTo(td); +var a=$("").appendTo(td); a[0].onclick=eval(btn.handler||function(){ }); a.linkbutton($.extend({},btn,{plain:true})); @@ -1068,204 +1168,202 @@ a.linkbutton($.extend({},btn,{plain:true})); } }else{ var td=$("").appendTo(tr); -$(_a3.buttons).appendTo(td).show(); +$(_ae.buttons).appendTo(td).show(); } } -$("
").appendTo(_a4); -$("
").appendTo(_a4); -function _a8(_aa){ -var btn=_a3.nav[_aa]; -var a=$("").appendTo(tr); +function _b3(_b5){ +var btn=_ae.nav[_b5]; +var a=$("").appendTo(tr); a.wrap(""); a.linkbutton({iconCls:btn.iconCls,plain:true}).unbind(".pagination").bind("click.pagination",function(){ -btn.handler.call(_a1); +btn.handler.call(_ac); }); return a; }; -function _a5(aa,_ab){ -var _ac=$.inArray(_ab,aa); -if(_ac>=0){ -aa.splice(_ac,1); +function _b0(aa,_b6){ +var _b7=$.inArray(_b6,aa); +if(_b7>=0){ +aa.splice(_b7,1); } return aa; }; }; -function _ad(_ae,_af){ -var _b0=$.data(_ae,"pagination").options; -_b1(_ae,{pageNumber:_af}); -_b0.onSelectPage.call(_ae,_b0.pageNumber,_b0.pageSize); +function _b8(_b9,_ba){ +var _bb=$.data(_b9,"pagination").options; +_bc(_b9,{pageNumber:_ba}); +_bb.onSelectPage.call(_b9,_bb.pageNumber,_bb.pageSize); }; -function _b1(_b2,_b3){ -var _b4=$.data(_b2,"pagination"); -var _b5=_b4.options; -var bb=_b4.bb; -$.extend(_b5,_b3||{}); -var ps=$(_b2).find("select.pagination-page-list"); +function _bc(_bd,_be){ +var _bf=$.data(_bd,"pagination"); +var _c0=_bf.options; +var bb=_bf.bb; +$.extend(_c0,_be||{}); +var ps=$(_bd).find("select.pagination-page-list"); if(ps.length){ -ps.val(_b5.pageSize+""); -_b5.pageSize=parseInt(ps.val()); +ps.val(_c0.pageSize+""); +_c0.pageSize=parseInt(ps.val()); } -var _b6=Math.ceil(_b5.total/_b5.pageSize)||1; -if(_b5.pageNumber<1){ -_b5.pageNumber=1; +var _c1=Math.ceil(_c0.total/_c0.pageSize)||1; +if(_c0.pageNumber<1){ +_c0.pageNumber=1; } -if(_b5.pageNumber>_b6){ -_b5.pageNumber=_b6; +if(_c0.pageNumber>_c1){ +_c0.pageNumber=_c1; } -if(_b5.total==0){ -_b5.pageNumber=0; -_b6=0; +if(_c0.total==0){ +_c0.pageNumber=0; +_c1=0; } if(bb.num){ -bb.num.val(_b5.pageNumber); +bb.num.val(_c0.pageNumber); } if(bb.after){ -bb.after.html(_b5.afterPageText.replace(/{pages}/,_b6)); +bb.after.html(_c0.afterPageText.replace(/{pages}/,_c1)); } -var td=$(_b2).find("td.pagination-links"); +var td=$(_bd).find("td.pagination-links"); if(td.length){ td.empty(); -var _b7=_b5.pageNumber-Math.floor(_b5.links/2); -if(_b7<1){ -_b7=1; +var _c2=_c0.pageNumber-Math.floor(_c0.links/2); +if(_c2<1){ +_c2=1; } -var _b8=_b7+_b5.links-1; -if(_b8>_b6){ -_b8=_b6; +var _c3=_c2+_c0.links-1; +if(_c3>_c1){ +_c3=_c1; } -_b7=_b8-_b5.links+1; -if(_b7<1){ -_b7=1; +_c2=_c3-_c0.links+1; +if(_c2<1){ +_c2=1; } -for(var i=_b7;i<=_b8;i++){ -var a=$("").appendTo(td); +for(var i=_c2;i<=_c3;i++){ +var a=$("").appendTo(td); a.linkbutton({plain:true,text:i}); -if(i==_b5.pageNumber){ +if(i==_c0.pageNumber){ a.linkbutton("select"); }else{ a.unbind(".pagination").bind("click.pagination",{pageNumber:i},function(e){ -_ad(_b2,e.data.pageNumber); +_b8(_bd,e.data.pageNumber); }); } } } -var _b9=_b5.displayMsg; -_b9=_b9.replace(/{from}/,_b5.total==0?0:_b5.pageSize*(_b5.pageNumber-1)+1); -_b9=_b9.replace(/{to}/,Math.min(_b5.pageSize*(_b5.pageNumber),_b5.total)); -_b9=_b9.replace(/{total}/,_b5.total); -$(_b2).find("div.pagination-info").html(_b9); +var _c4=_c0.displayMsg; +_c4=_c4.replace(/{from}/,_c0.total==0?0:_c0.pageSize*(_c0.pageNumber-1)+1); +_c4=_c4.replace(/{to}/,Math.min(_c0.pageSize*(_c0.pageNumber),_c0.total)); +_c4=_c4.replace(/{total}/,_c0.total); +$(_bd).find("div.pagination-info").html(_c4); if(bb.first){ -bb.first.linkbutton({disabled:((!_b5.total)||_b5.pageNumber==1)}); +bb.first.linkbutton({disabled:((!_c0.total)||_c0.pageNumber==1)}); } if(bb.prev){ -bb.prev.linkbutton({disabled:((!_b5.total)||_b5.pageNumber==1)}); +bb.prev.linkbutton({disabled:((!_c0.total)||_c0.pageNumber==1)}); } if(bb.next){ -bb.next.linkbutton({disabled:(_b5.pageNumber==_b6)}); +bb.next.linkbutton({disabled:(_c0.pageNumber==_c1)}); } if(bb.last){ -bb.last.linkbutton({disabled:(_b5.pageNumber==_b6)}); +bb.last.linkbutton({disabled:(_c0.pageNumber==_c1)}); } -_ba(_b2,_b5.loading); +_c5(_bd,_c0.loading); }; -function _ba(_bb,_bc){ -var _bd=$.data(_bb,"pagination"); -var _be=_bd.options; -_be.loading=_bc; -if(_be.showRefresh&&_bd.bb.refresh){ -_bd.bb.refresh.linkbutton({iconCls:(_be.loading?"pagination-loading":"pagination-load")}); +function _c5(_c6,_c7){ +var _c8=$.data(_c6,"pagination"); +var _c9=_c8.options; +_c9.loading=_c7; +if(_c9.showRefresh&&_c8.bb.refresh){ +_c8.bb.refresh.linkbutton({iconCls:(_c9.loading?"pagination-loading":"pagination-load")}); } }; -$.fn.pagination=function(_bf,_c0){ -if(typeof _bf=="string"){ -return $.fn.pagination.methods[_bf](this,_c0); +$.fn.pagination=function(_ca,_cb){ +if(typeof _ca=="string"){ +return $.fn.pagination.methods[_ca](this,_cb); } -_bf=_bf||{}; +_ca=_ca||{}; return this.each(function(){ -var _c1; -var _c2=$.data(this,"pagination"); -if(_c2){ -_c1=$.extend(_c2.options,_bf); +var _cc; +var _cd=$.data(this,"pagination"); +if(_cd){ +_cc=$.extend(_cd.options,_ca); }else{ -_c1=$.extend({},$.fn.pagination.defaults,$.fn.pagination.parseOptions(this),_bf); -$.data(this,"pagination",{options:_c1}); +_cc=$.extend({},$.fn.pagination.defaults,$.fn.pagination.parseOptions(this),_ca); +$.data(this,"pagination",{options:_cc}); } -_a0(this); -_b1(this); +_ab(this); +_bc(this); }); }; $.fn.pagination.methods={options:function(jq){ return $.data(jq[0],"pagination").options; },loading:function(jq){ return jq.each(function(){ -_ba(this,true); +_c5(this,true); }); },loaded:function(jq){ return jq.each(function(){ -_ba(this,false); +_c5(this,false); }); -},refresh:function(jq,_c3){ +},refresh:function(jq,_ce){ return jq.each(function(){ -_b1(this,_c3); +_bc(this,_ce); }); -},select:function(jq,_c4){ +},select:function(jq,_cf){ return jq.each(function(){ -_ad(this,_c4); +_b8(this,_cf); }); }}; -$.fn.pagination.parseOptions=function(_c5){ -var t=$(_c5); -return $.extend({},$.parser.parseOptions(_c5,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)}); -}; -$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh"],onSelectPage:function(_c6,_c7){ -},onBeforeRefresh:function(_c8,_c9){ -},onRefresh:function(_ca,_cb){ -},onChangePageSize:function(_cc){ +$.fn.pagination.parseOptions=function(_d0){ +var t=$(_d0); +return $.extend({},$.parser.parseOptions(_d0,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showPageInfo:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)}); +}; +$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showPageInfo:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh","info"],onSelectPage:function(_d1,_d2){ +},onBeforeRefresh:function(_d3,_d4){ +},onRefresh:function(_d5,_d6){ +},onChangePageSize:function(_d7){ },beforePageText:"Page",afterPageText:"of {pages}",displayMsg:"Displaying {from} to {to} of {total} items",nav:{first:{iconCls:"pagination-first",handler:function(){ -var _cd=$(this).pagination("options"); -if(_cd.pageNumber>1){ +var _d8=$(this).pagination("options"); +if(_d8.pageNumber>1){ $(this).pagination("select",1); } }},prev:{iconCls:"pagination-prev",handler:function(){ -var _ce=$(this).pagination("options"); -if(_ce.pageNumber>1){ -$(this).pagination("select",_ce.pageNumber-1); +var _d9=$(this).pagination("options"); +if(_d9.pageNumber>1){ +$(this).pagination("select",_d9.pageNumber-1); } }},next:{iconCls:"pagination-next",handler:function(){ -var _cf=$(this).pagination("options"); -var _d0=Math.ceil(_cf.total/_cf.pageSize); -if(_cf.pageNumber<_d0){ -$(this).pagination("select",_cf.pageNumber+1); +var _da=$(this).pagination("options"); +var _db=Math.ceil(_da.total/_da.pageSize); +if(_da.pageNumber<_db){ +$(this).pagination("select",_da.pageNumber+1); } }},last:{iconCls:"pagination-last",handler:function(){ -var _d1=$(this).pagination("options"); -var _d2=Math.ceil(_d1.total/_d1.pageSize); -if(_d1.pageNumber<_d2){ -$(this).pagination("select",_d2); +var _dc=$(this).pagination("options"); +var _dd=Math.ceil(_dc.total/_dc.pageSize); +if(_dc.pageNumber<_dd){ +$(this).pagination("select",_dd); } }},refresh:{iconCls:"pagination-refresh",handler:function(){ -var _d3=$(this).pagination("options"); -if(_d3.onBeforeRefresh.call(this,_d3.pageNumber,_d3.pageSize)!=false){ -$(this).pagination("select",_d3.pageNumber); -_d3.onRefresh.call(this,_d3.pageNumber,_d3.pageSize); +var _de=$(this).pagination("options"); +if(_de.onBeforeRefresh.call(this,_de.pageNumber,_de.pageSize)!=false){ +$(this).pagination("select",_de.pageNumber); +_de.onRefresh.call(this,_de.pageNumber,_de.pageSize); } }}}}; })(jQuery); (function($){ -function _d4(_d5){ -var _d6=$(_d5); -_d6.addClass("tree"); -return _d6; -}; -function _d7(_d8){ -var _d9=$.data(_d8,"tree").options; -$(_d8).unbind().bind("mouseover",function(e){ +function _df(_e0){ +var _e1=$(_e0); +_e1.addClass("tree"); +return _e1; +}; +function _e2(_e3){ +var _e4=$.data(_e3,"tree").options; +$(_e3).unbind().bind("mouseover",function(e){ var tt=$(e.target); -var _da=tt.closest("div.tree-node"); -if(!_da.length){ +var _e5=tt.closest("div.tree-node"); +if(!_e5.length){ return; } -_da.addClass("tree-node-hover"); +_e5.addClass("tree-node-hover"); if(tt.hasClass("tree-hit")){ if(tt.hasClass("tree-expanded")){ tt.addClass("tree-expanded-hover"); @@ -1276,11 +1374,11 @@ tt.addClass("tree-collapsed-hover"); e.stopPropagation(); }).bind("mouseout",function(e){ var tt=$(e.target); -var _db=tt.closest("div.tree-node"); -if(!_db.length){ +var _e6=tt.closest("div.tree-node"); +if(!_e6.length){ return; } -_db.removeClass("tree-node-hover"); +_e6.removeClass("tree-node-hover"); if(tt.hasClass("tree-hit")){ if(tt.hasClass("tree-expanded")){ tt.removeClass("tree-expanded-hover"); @@ -1291,60 +1389,60 @@ tt.removeClass("tree-collapsed-hover"); e.stopPropagation(); }).bind("click",function(e){ var tt=$(e.target); -var _dc=tt.closest("div.tree-node"); -if(!_dc.length){ +var _e7=tt.closest("div.tree-node"); +if(!_e7.length){ return; } if(tt.hasClass("tree-hit")){ -_13b(_d8,_dc[0]); +_145(_e3,_e7[0]); return false; }else{ if(tt.hasClass("tree-checkbox")){ -_104(_d8,_dc[0],!tt.hasClass("tree-checkbox1")); +_10c(_e3,_e7[0]); return false; }else{ -_181(_d8,_dc[0]); -_d9.onClick.call(_d8,_df(_d8,_dc[0])); +_188(_e3,_e7[0]); +_e4.onClick.call(_e3,_ea(_e3,_e7[0])); } } e.stopPropagation(); }).bind("dblclick",function(e){ -var _dd=$(e.target).closest("div.tree-node"); -if(!_dd.length){ +var _e8=$(e.target).closest("div.tree-node"); +if(!_e8.length){ return; } -_181(_d8,_dd[0]); -_d9.onDblClick.call(_d8,_df(_d8,_dd[0])); +_188(_e3,_e8[0]); +_e4.onDblClick.call(_e3,_ea(_e3,_e8[0])); e.stopPropagation(); }).bind("contextmenu",function(e){ -var _de=$(e.target).closest("div.tree-node"); -if(!_de.length){ +var _e9=$(e.target).closest("div.tree-node"); +if(!_e9.length){ return; } -_d9.onContextMenu.call(_d8,e,_df(_d8,_de[0])); +_e4.onContextMenu.call(_e3,e,_ea(_e3,_e9[0])); e.stopPropagation(); }); }; -function _e0(_e1){ -var _e2=$.data(_e1,"tree").options; -_e2.dnd=false; -var _e3=$(_e1).find("div.tree-node"); -_e3.draggable("disable"); -_e3.css("cursor","pointer"); -}; -function _e4(_e5){ -var _e6=$.data(_e5,"tree"); -var _e7=_e6.options; -var _e8=_e6.tree; -_e6.disabledNodes=[]; -_e7.dnd=true; -_e8.find("div.tree-node").draggable({disabled:false,revert:true,cursor:"pointer",proxy:function(_e9){ +function _eb(_ec){ +var _ed=$.data(_ec,"tree").options; +_ed.dnd=false; +var _ee=$(_ec).find("div.tree-node"); +_ee.draggable("disable"); +_ee.css("cursor","pointer"); +}; +function _ef(_f0){ +var _f1=$.data(_f0,"tree"); +var _f2=_f1.options; +var _f3=_f1.tree; +_f1.disabledNodes=[]; +_f2.dnd=true; +_f3.find("div.tree-node").draggable({disabled:false,revert:true,cursor:"pointer",proxy:function(_f4){ var p=$("
").appendTo("body"); -p.html(" "+$(_e9).find(".tree-title").html()); +p.html(" "+$(_f4).find(".tree-title").html()); p.hide(); return p; },deltaX:15,deltaY:15,onBeforeDrag:function(e){ -if(_e7.onBeforeDrag.call(_e5,_df(_e5,this))==false){ +if(_f2.onBeforeDrag.call(_f0,_ea(_f0,this))==false){ return false; } if($(e.target).hasClass("tree-hit")||$(e.target).hasClass("tree-checkbox")){ @@ -1353,20 +1451,23 @@ return false; if(e.which!=1){ return false; } -$(this).next("ul").find("div.tree-node").droppable({accept:"no-accept"}); -var _ea=$(this).find("span.tree-indent"); -if(_ea.length){ -e.data.offsetWidth-=_ea.length*_ea.width(); +var _f5=$(this).find("span.tree-indent"); +if(_f5.length){ +e.data.offsetWidth-=_f5.length*_f5.width(); } -},onStartDrag:function(){ +},onStartDrag:function(e){ +$(this).next("ul").find("div.tree-node").each(function(){ +$(this).droppable("disable"); +_f1.disabledNodes.push(this); +}); $(this).draggable("proxy").css({left:-10000,top:-10000}); -_e7.onStartDrag.call(_e5,_df(_e5,this)); -var _eb=_df(_e5,this); -if(_eb.id==undefined){ -_eb.id="easyui_tree_node_id_temp"; -_11e(_e5,_eb); +_f2.onStartDrag.call(_f0,_ea(_f0,this)); +var _f6=_ea(_f0,this); +if(_f6.id==undefined){ +_f6.id="easyui_tree_node_id_temp"; +_12c(_f0,_f6); } -_e6.draggingNodeId=_eb.id; +_f1.draggingNodeId=_f6.id; },onDrag:function(e){ var x1=e.pageX,y1=e.pageY,x2=e.data.startX,y2=e.data.startY; var d=Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); @@ -1375,300 +1476,323 @@ $(this).draggable("proxy").show(); } this.pageY=e.pageY; },onStopDrag:function(){ -$(this).next("ul").find("div.tree-node").droppable({accept:"div.tree-node"}); -for(var i=0;i<_e6.disabledNodes.length;i++){ -$(_e6.disabledNodes[i]).droppable("enable"); -} -_e6.disabledNodes=[]; -var _ec=_179(_e5,_e6.draggingNodeId); -if(_ec&&_ec.id=="easyui_tree_node_id_temp"){ -_ec.id=""; -_11e(_e5,_ec); -} -_e7.onStopDrag.call(_e5,_ec); -}}).droppable({accept:"div.tree-node",onDragEnter:function(e,_ed){ -if(_e7.onDragEnter.call(_e5,this,_ee(_ed))==false){ -_ef(_ed,false); +for(var i=0;i<_f1.disabledNodes.length;i++){ +$(_f1.disabledNodes[i]).droppable("enable"); +} +_f1.disabledNodes=[]; +var _f7=_182(_f0,_f1.draggingNodeId); +if(_f7&&_f7.id=="easyui_tree_node_id_temp"){ +_f7.id=""; +_12c(_f0,_f7); +} +_f2.onStopDrag.call(_f0,_f7); +}}).droppable({accept:"div.tree-node",onDragEnter:function(e,_f8){ +if(_f2.onDragEnter.call(_f0,this,_f9(_f8))==false){ +_fa(_f8,false); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); $(this).droppable("disable"); -_e6.disabledNodes.push(this); +_f1.disabledNodes.push(this); } -},onDragOver:function(e,_f0){ +},onDragOver:function(e,_fb){ if($(this).droppable("options").disabled){ return; } -var _f1=_f0.pageY; +var _fc=_fb.pageY; var top=$(this).offset().top; -var _f2=top+$(this).outerHeight(); -_ef(_f0,true); +var _fd=top+$(this).outerHeight(); +_fa(_fb,true); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); -if(_f1>top+(_f2-top)/2){ -if(_f2-_f1<5){ +if(_fc>top+(_fd-top)/2){ +if(_fd-_fc<5){ $(this).addClass("tree-node-bottom"); }else{ $(this).addClass("tree-node-append"); } }else{ -if(_f1-top<5){ +if(_fc-top<5){ $(this).addClass("tree-node-top"); }else{ $(this).addClass("tree-node-append"); } } -if(_e7.onDragOver.call(_e5,this,_ee(_f0))==false){ -_ef(_f0,false); +if(_f2.onDragOver.call(_f0,this,_f9(_fb))==false){ +_fa(_fb,false); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); $(this).droppable("disable"); -_e6.disabledNodes.push(this); +_f1.disabledNodes.push(this); } -},onDragLeave:function(e,_f3){ -_ef(_f3,false); +},onDragLeave:function(e,_fe){ +_fa(_fe,false); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); -_e7.onDragLeave.call(_e5,this,_ee(_f3)); -},onDrop:function(e,_f4){ -var _f5=this; -var _f6,_f7; +_f2.onDragLeave.call(_f0,this,_f9(_fe)); +},onDrop:function(e,_ff){ +var dest=this; +var _100,_101; if($(this).hasClass("tree-node-append")){ -_f6=_f8; -_f7="append"; +_100=_102; +_101="append"; }else{ -_f6=_f9; -_f7=$(this).hasClass("tree-node-top")?"top":"bottom"; +_100=_103; +_101=$(this).hasClass("tree-node-top")?"top":"bottom"; } -if(_e7.onBeforeDrop.call(_e5,_f5,_ee(_f4),_f7)==false){ +if(_f2.onBeforeDrop.call(_f0,dest,_f9(_ff),_101)==false){ $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); return; } -_f6(_f4,_f5,_f7); +_100(_ff,dest,_101); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); }}); -function _ee(_fa,pop){ -return $(_fa).closest("ul.tree").tree(pop?"pop":"getData",_fa); +function _f9(_104,pop){ +return $(_104).closest("ul.tree").tree(pop?"pop":"getData",_104); }; -function _ef(_fb,_fc){ -var _fd=$(_fb).draggable("proxy").find("span.tree-dnd-icon"); -_fd.removeClass("tree-dnd-yes tree-dnd-no").addClass(_fc?"tree-dnd-yes":"tree-dnd-no"); +function _fa(_105,_106){ +var icon=$(_105).draggable("proxy").find("span.tree-dnd-icon"); +icon.removeClass("tree-dnd-yes tree-dnd-no").addClass(_106?"tree-dnd-yes":"tree-dnd-no"); }; -function _f8(_fe,_ff){ -if(_df(_e5,_ff).state=="closed"){ -_133(_e5,_ff,function(){ -_100(); +function _102(_107,dest){ +if(_ea(_f0,dest).state=="closed"){ +_13d(_f0,dest,function(){ +_108(); }); }else{ -_100(); +_108(); } -function _100(){ -var node=_ee(_fe,true); -$(_e5).tree("append",{parent:_ff,data:[node]}); -_e7.onDrop.call(_e5,_ff,node,"append"); +function _108(){ +var node=_f9(_107,true); +$(_f0).tree("append",{parent:dest,data:[node]}); +_f2.onDrop.call(_f0,dest,node,"append"); }; }; -function _f9(_101,dest,_102){ -var _103={}; -if(_102=="top"){ -_103.before=dest; +function _103(_109,dest,_10a){ +var _10b={}; +if(_10a=="top"){ +_10b.before=dest; }else{ -_103.after=dest; +_10b.after=dest; } -var node=_ee(_101,true); -_103.data=node; -$(_e5).tree("insert",_103); -_e7.onDrop.call(_e5,dest,node,_102); +var node=_f9(_109,true); +_10b.data=node; +$(_f0).tree("insert",_10b); +_f2.onDrop.call(_f0,dest,node,_10a); }; }; -function _104(_105,_106,_107){ -var opts=$.data(_105,"tree").options; +function _10c(_10d,_10e,_10f,_110){ +var _111=$.data(_10d,"tree"); +var opts=_111.options; if(!opts.checkbox){ return; } -var _108=_df(_105,_106); -if(opts.onBeforeCheck.call(_105,_108,_107)==false){ +var _112=_ea(_10d,_10e); +if(!_112.checkState){ return; } -var node=$(_106); -var ck=node.find(".tree-checkbox"); -ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); -if(_107){ -ck.addClass("tree-checkbox1"); +var ck=$(_10e).find(".tree-checkbox"); +if(_10f==undefined){ +if(ck.hasClass("tree-checkbox1")){ +_10f=false; +}else{ +if(ck.hasClass("tree-checkbox0")){ +_10f=true; }else{ -ck.addClass("tree-checkbox0"); +if(_112._checked==undefined){ +_112._checked=$(_10e).find(".tree-checkbox").hasClass("tree-checkbox1"); } -if(opts.cascadeCheck){ -_109(node); -_10a(node); +_10f=!_112._checked; } -opts.onCheck.call(_105,_108,_107); -function _10a(node){ -var _10b=node.next().find(".tree-checkbox"); -_10b.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); -if(node.find(".tree-checkbox").hasClass("tree-checkbox1")){ -_10b.addClass("tree-checkbox1"); -}else{ -_10b.addClass("tree-checkbox0"); } -}; -function _109(node){ -var _10c=_146(_105,node[0]); -if(_10c){ -var ck=$(_10c.target).find(".tree-checkbox"); -ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); -if(_10d(node)){ -ck.addClass("tree-checkbox1"); -}else{ -if(_10e(node)){ -ck.addClass("tree-checkbox0"); +} +_112._checked=_10f; +if(_10f){ +if(ck.hasClass("tree-checkbox1")){ +return; +} }else{ -ck.addClass("tree-checkbox2"); +if(ck.hasClass("tree-checkbox0")){ +return; } } -_109($(_10c.target)); +if(!_110){ +if(opts.onBeforeCheck.call(_10d,_112,_10f)==false){ +return; } -function _10d(n){ -var ck=n.find(".tree-checkbox"); -if(ck.hasClass("tree-checkbox0")||ck.hasClass("tree-checkbox2")){ -return false; } -var b=true; -n.parent().siblings().each(function(){ -if(!$(this).children("div.tree-node").children(".tree-checkbox").hasClass("tree-checkbox1")){ -b=false; +if(opts.cascadeCheck){ +_113(_10d,_112,_10f); +_114(_10d,_112); +}else{ +_115(_10d,_112,_10f?"1":"0"); +} +if(!_110){ +opts.onCheck.call(_10d,_112,_10f); } -}); -return b; }; -function _10e(n){ -var ck=n.find(".tree-checkbox"); -if(ck.hasClass("tree-checkbox1")||ck.hasClass("tree-checkbox2")){ -return false; +function _113(_116,_117,_118){ +var opts=$.data(_116,"tree").options; +var flag=_118?1:0; +_115(_116,_117,flag); +if(opts.deepCheck){ +$.easyui.forEach(_117.children||[],true,function(n){ +_115(_116,n,flag); +}); +}else{ +var _119=[]; +if(_117.children&&_117.children.length){ +_119.push(_117); +} +$.easyui.forEach(_117.children||[],true,function(n){ +if(!n.hidden){ +_115(_116,n,flag); +if(n.children&&n.children.length){ +_119.push(n); } -var b=true; -n.parent().siblings().each(function(){ -if(!$(this).children("div.tree-node").children(".tree-checkbox").hasClass("tree-checkbox0")){ -b=false; } }); -return b; -}; -}; +for(var i=_119.length-1;i>=0;i--){ +var node=_119[i]; +_115(_116,node,_11a(node)); +} +} }; -function _10f(_110,_111){ -var opts=$.data(_110,"tree").options; -if(!opts.checkbox){ +function _115(_11b,_11c,flag){ +var opts=$.data(_11b,"tree").options; +if(!_11c.checkState||flag==undefined){ return; } -var node=$(_111); -if(_112(_110,_111)){ -var ck=node.find(".tree-checkbox"); -if(ck.length){ -if(ck.hasClass("tree-checkbox1")){ -_104(_110,_111,true); -}else{ -_104(_110,_111,false); +if(_11c.hidden&&!opts.deepCheck){ +return; +} +var ck=$("#"+_11c.domId).find(".tree-checkbox"); +_11c.checkState=["unchecked","checked","indeterminate"][flag]; +_11c.checked=(_11c.checkState=="checked"); +ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); +ck.addClass("tree-checkbox"+flag); +}; +function _114(_11d,_11e){ +var pd=_11f(_11d,$("#"+_11e.domId)[0]); +if(pd){ +_115(_11d,pd,_11a(pd)); +_114(_11d,pd); } +}; +function _11a(row){ +var c0=0; +var c1=0; +var len=0; +$.easyui.forEach(row.children||[],false,function(r){ +if(r.checkState){ +len++; +if(r.checkState=="checked"){ +c1++; }else{ -if(opts.onlyLeafCheck){ -$("").insertBefore(node.find(".tree-title")); +if(r.checkState=="unchecked"){ +c0++; } } +} +}); +if(len==0){ +return undefined; +} +var flag=0; +if(c0==len){ +flag=0; }else{ -var ck=node.find(".tree-checkbox"); -if(opts.onlyLeafCheck){ -ck.remove(); -}else{ -if(ck.hasClass("tree-checkbox1")){ -_104(_110,_111,true); -}else{ -if(ck.hasClass("tree-checkbox2")){ -var _113=true; -var _114=true; -var _115=_116(_110,_111); -for(var i=0;i<_115.length;i++){ -if(_115[i].checked){ -_114=false; +if(c1==len){ +flag=1; }else{ -_113=false; +flag=2; } } -if(_113){ -_104(_110,_111,true); +return flag; +}; +function _120(_121,_122){ +var opts=$.data(_121,"tree").options; +if(!opts.checkbox){ +return; } -if(_114){ -_104(_110,_111,false); +var node=$(_122); +var ck=node.find(".tree-checkbox"); +var _123=_ea(_121,_122); +if(opts.view.hasCheckbox(_121,_123)){ +if(!ck.length){ +_123.checkState=_123.checkState||"unchecked"; +$("").insertBefore(node.find(".tree-title")); } +if(_123.checkState=="checked"){ +_10c(_121,_122,true,true); +}else{ +if(_123.checkState=="unchecked"){ +_10c(_121,_122,false,true); +}else{ +var flag=_11a(_123); +if(flag===0){ +_10c(_121,_122,false,true); +}else{ +if(flag===1){ +_10c(_121,_122,true,true); } } } } -}; -function _117(_118,ul,data,_119){ -var _11a=$.data(_118,"tree"); -var opts=_11a.options; -var _11b=$(ul).prevAll("div.tree-node:first"); -data=opts.loadFilter.call(_118,data,_11b[0]); -var _11c=_11d(_118,"domId",_11b.attr("id")); -if(!_119){ -_11c?_11c.children=data:_11a.data=data; +}else{ +ck.remove(); +_123.checkState=undefined; +_123.checked=undefined; +_114(_121,_123); +} +}; +function _124(_125,ul,data,_126,_127){ +var _128=$.data(_125,"tree"); +var opts=_128.options; +var _129=$(ul).prevAll("div.tree-node:first"); +data=opts.loadFilter.call(_125,data,_129[0]); +var _12a=_12b(_125,"domId",_129.attr("id")); +if(!_126){ +_12a?_12a.children=data:_128.data=data; $(ul).empty(); }else{ -if(_11c){ -_11c.children?_11c.children=_11c.children.concat(data):_11c.children=data; +if(_12a){ +_12a.children?_12a.children=_12a.children.concat(data):_12a.children=data; }else{ -_11a.data=_11a.data.concat(data); +_128.data=_128.data.concat(data); } } -opts.view.render.call(opts.view,_118,ul,data); +opts.view.render.call(opts.view,_125,ul,data); if(opts.dnd){ -_e4(_118); -} -if(_11c){ -_11e(_118,_11c); -} -var _11f=[]; -var _120=[]; -for(var i=0;i1){ -$(_126[0].target).addClass("tree-root-first"); +if(!_12f){ +_12f=true; +$(_12e).find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); +$(_12e).find("div.tree-node").removeClass("tree-node-last tree-root-first tree-root-one"); +var _130=$(_12e).tree("getRoots"); +if(_130.length>1){ +$(_130[0].target).addClass("tree-root-first"); }else{ -if(_126.length==1){ -$(_126[0].target).addClass("tree-root-one"); +if(_130.length==1){ +$(_130[0].target).addClass("tree-root-one"); } } } @@ -1677,178 +1801,178 @@ var node=$(this).children("div.tree-node"); var ul=node.next("ul"); if(ul.length){ if($(this).next().length){ -_127(node); +_131(node); } -_123(_124,ul,_125); +_12d(_12e,ul,_12f); }else{ -_128(node); +_132(node); } }); -var _129=$(ul).children("li:last").children("div.tree-node").addClass("tree-node-last"); -_129.children("span.tree-join").removeClass("tree-join").addClass("tree-joinbottom"); -function _128(node,_12a){ +var _133=$(ul).children("li:last").children("div.tree-node").addClass("tree-node-last"); +_133.children("span.tree-join").removeClass("tree-join").addClass("tree-joinbottom"); +function _132(node,_134){ var icon=node.find("span.tree-icon"); icon.prev("span.tree-indent").addClass("tree-join"); }; -function _127(node){ -var _12b=node.find("span.tree-indent, span.tree-hit").length; +function _131(node){ +var _135=node.find("span.tree-indent, span.tree-hit").length; node.next().find("div.tree-node").each(function(){ -$(this).children("span:eq("+(_12b-1)+")").addClass("tree-line"); +$(this).children("span:eq("+(_135-1)+")").addClass("tree-line"); }); }; }; -function _12c(_12d,ul,_12e,_12f){ -var opts=$.data(_12d,"tree").options; -_12e=$.extend({},opts.queryParams,_12e||{}); -var _130=null; -if(_12d!=ul){ +function _136(_137,ul,_138,_139){ +var opts=$.data(_137,"tree").options; +_138=$.extend({},opts.queryParams,_138||{}); +var _13a=null; +if(_137!=ul){ var node=$(ul).prev(); -_130=_df(_12d,node[0]); +_13a=_ea(_137,node[0]); } -if(opts.onBeforeLoad.call(_12d,_130,_12e)==false){ +if(opts.onBeforeLoad.call(_137,_13a,_138)==false){ return; } -var _131=$(ul).prev().children("span.tree-folder"); -_131.addClass("tree-loading"); -var _132=opts.loader.call(_12d,_12e,function(data){ -_131.removeClass("tree-loading"); -_117(_12d,ul,data); -if(_12f){ -_12f(); +var _13b=$(ul).prev().children("span.tree-folder"); +_13b.addClass("tree-loading"); +var _13c=opts.loader.call(_137,_138,function(data){ +_13b.removeClass("tree-loading"); +_124(_137,ul,data); +if(_139){ +_139(); } },function(){ -_131.removeClass("tree-loading"); -opts.onLoadError.apply(_12d,arguments); -if(_12f){ -_12f(); +_13b.removeClass("tree-loading"); +opts.onLoadError.apply(_137,arguments); +if(_139){ +_139(); } }); -if(_132==false){ -_131.removeClass("tree-loading"); +if(_13c==false){ +_13b.removeClass("tree-loading"); } }; -function _133(_134,_135,_136){ -var opts=$.data(_134,"tree").options; -var hit=$(_135).children("span.tree-hit"); +function _13d(_13e,_13f,_140){ +var opts=$.data(_13e,"tree").options; +var hit=$(_13f).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ return; } -var node=_df(_134,_135); -if(opts.onBeforeExpand.call(_134,node)==false){ +var node=_ea(_13e,_13f); +if(opts.onBeforeExpand.call(_13e,node)==false){ return; } hit.removeClass("tree-collapsed tree-collapsed-hover").addClass("tree-expanded"); hit.next().addClass("tree-folder-open"); -var ul=$(_135).next(); +var ul=$(_13f).next(); if(ul.length){ if(opts.animate){ ul.slideDown("normal",function(){ node.state="open"; -opts.onExpand.call(_134,node); -if(_136){ -_136(); +opts.onExpand.call(_13e,node); +if(_140){ +_140(); } }); }else{ ul.css("display","block"); node.state="open"; -opts.onExpand.call(_134,node); -if(_136){ -_136(); +opts.onExpand.call(_13e,node); +if(_140){ +_140(); } } }else{ -var _137=$("
    ").insertAfter(_135); -_12c(_134,_137[0],{id:node.id},function(){ -if(_137.is(":empty")){ -_137.remove(); +var _141=$("
      ").insertAfter(_13f); +_136(_13e,_141[0],{id:node.id},function(){ +if(_141.is(":empty")){ +_141.remove(); } if(opts.animate){ -_137.slideDown("normal",function(){ +_141.slideDown("normal",function(){ node.state="open"; -opts.onExpand.call(_134,node); -if(_136){ -_136(); +opts.onExpand.call(_13e,node); +if(_140){ +_140(); } }); }else{ -_137.css("display","block"); +_141.css("display","block"); node.state="open"; -opts.onExpand.call(_134,node); -if(_136){ -_136(); +opts.onExpand.call(_13e,node); +if(_140){ +_140(); } } }); } }; -function _138(_139,_13a){ -var opts=$.data(_139,"tree").options; -var hit=$(_13a).children("span.tree-hit"); +function _142(_143,_144){ +var opts=$.data(_143,"tree").options; +var hit=$(_144).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-collapsed")){ return; } -var node=_df(_139,_13a); -if(opts.onBeforeCollapse.call(_139,node)==false){ +var node=_ea(_143,_144); +if(opts.onBeforeCollapse.call(_143,node)==false){ return; } hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); hit.next().removeClass("tree-folder-open"); -var ul=$(_13a).next(); +var ul=$(_144).next(); if(opts.animate){ ul.slideUp("normal",function(){ node.state="closed"; -opts.onCollapse.call(_139,node); +opts.onCollapse.call(_143,node); }); }else{ ul.css("display","none"); node.state="closed"; -opts.onCollapse.call(_139,node); +opts.onCollapse.call(_143,node); } }; -function _13b(_13c,_13d){ -var hit=$(_13d).children("span.tree-hit"); +function _145(_146,_147){ +var hit=$(_147).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ -_138(_13c,_13d); +_142(_146,_147); }else{ -_133(_13c,_13d); +_13d(_146,_147); } }; -function _13e(_13f,_140){ -var _141=_116(_13f,_140); -if(_140){ -_141.unshift(_df(_13f,_140)); +function _148(_149,_14a){ +var _14b=_14c(_149,_14a); +if(_14a){ +_14b.unshift(_ea(_149,_14a)); } -for(var i=0;i<_141.length;i++){ -_133(_13f,_141[i].target); +for(var i=0;i<_14b.length;i++){ +_13d(_149,_14b[i].target); } }; -function _142(_143,_144){ -var _145=[]; -var p=_146(_143,_144); +function _14d(_14e,_14f){ +var _150=[]; +var p=_11f(_14e,_14f); while(p){ -_145.unshift(p); -p=_146(_143,p.target); +_150.unshift(p); +p=_11f(_14e,p.target); } -for(var i=0;i<_145.length;i++){ -_133(_143,_145[i].target); +for(var i=0;i<_150.length;i++){ +_13d(_14e,_150[i].target); } }; -function _147(_148,_149){ -var c=$(_148).parent(); +function _151(_152,_153){ +var c=$(_152).parent(); while(c[0].tagName!="BODY"&&c.css("overflow-y")!="auto"){ c=c.parent(); } -var n=$(_149); +var n=$(_153); var ntop=n.offset().top; if(c[0].tagName!="BODY"){ var ctop=c.offset().top; @@ -1863,18 +1987,18 @@ c.scrollTop(c.scrollTop()+ntop+n.outerHeight()-ctop-c.outerHeight()+18); c.scrollTop(ntop); } }; -function _14a(_14b,_14c){ -var _14d=_116(_14b,_14c); -if(_14c){ -_14d.unshift(_df(_14b,_14c)); +function _154(_155,_156){ +var _157=_14c(_155,_156); +if(_156){ +_157.unshift(_ea(_155,_156)); } -for(var i=0;i<_14d.length;i++){ -_138(_14b,_14d[i].target); +for(var i=0;i<_157.length;i++){ +_142(_155,_157[i].target); } }; -function _14e(_14f,_150){ -var node=$(_150.parent); -var data=_150.data; +function _158(_159,_15a){ +var node=$(_15a.parent); +var data=_15a.data; if(!data){ return; } @@ -1884,12 +2008,12 @@ return; } var ul; if(node.length==0){ -ul=$(_14f); +ul=$(_159); }else{ -if(_112(_14f,node[0])){ -var _151=node.find("span.tree-icon"); -_151.removeClass("tree-file").addClass("tree-folder tree-folder-open"); -var hit=$("").insertBefore(_151); +if(_15b(_159,node[0])){ +var _15c=node.find("span.tree-icon"); +_15c.removeClass("tree-file").addClass("tree-folder tree-folder-open"); +var hit=$("").insertBefore(_15c); if(hit.prev().length){ hit.prev().remove(); } @@ -1899,13 +2023,12 @@ if(!ul.length){ ul=$("
        ").insertAfter(node); } } -_117(_14f,ul[0],data,true); -_10f(_14f,ul.prev()); +_124(_159,ul[0],data,true,true); }; -function _152(_153,_154){ -var ref=_154.before||_154.after; -var _155=_146(_153,ref); -var data=_154.data; +function _15d(_15e,_15f){ +var ref=_15f.before||_15f.after; +var _160=_11f(_15e,ref); +var data=_15f.data; if(!data){ return; } @@ -1913,14 +2036,14 @@ data=$.isArray(data)?data:[data]; if(!data.length){ return; } -_14e(_153,{parent:(_155?_155.target:null),data:data}); -var _156=_155?_155.children:$(_153).tree("getRoots"); -for(var i=0;i<_156.length;i++){ -if(_156[i].domId==$(ref).attr("id")){ +_158(_15e,{parent:(_160?_160.target:null),data:data}); +var _161=_160?_160.children:$(_15e).tree("getRoots"); +for(var i=0;i<_161.length;i++){ +if(_161[i].domId==$(ref).attr("id")){ for(var j=data.length-1;j>=0;j--){ -_156.splice((_154.before?i:(i+1)),0,data[j]); +_161.splice((_15f.before?i:(i+1)),0,data[j]); } -_156.splice(_156.length-data.length,data.length); +_161.splice(_161.length-data.length,data.length); break; } } @@ -1928,198 +2051,161 @@ var li=$(); for(var i=0;i").prependTo(node); node.next().remove(); } -_11e(_158,_15a); -_10f(_158,_15a.target); +_12c(_163,_165); } -_123(_158,_158); -function del(_15b){ -var id=$(_15b).attr("id"); -var _15c=_146(_158,_15b); -var cc=_15c?_15c.children:$.data(_158,"tree").data; +_12d(_163,_163); +function del(_166){ +var id=$(_166).attr("id"); +var _167=_11f(_163,_166); +var cc=_167?_167.children:$.data(_163,"tree").data; for(var i=0;i=0;i--){ -_180.unshift(node.children[i]); -} -} -} -}; -function _181(_182,_183){ -var opts=$.data(_182,"tree").options; -var node=_df(_182,_183); -if(opts.onBeforeSelect.call(_182,node)==false){ +function _188(_189,_18a){ +var opts=$.data(_189,"tree").options; +var node=_ea(_189,_18a); +if(opts.onBeforeSelect.call(_189,node)==false){ return; } -$(_182).find("div.tree-node-selected").removeClass("tree-node-selected"); -$(_183).addClass("tree-node-selected"); -opts.onSelect.call(_182,node); +$(_189).find("div.tree-node-selected").removeClass("tree-node-selected"); +$(_18a).addClass("tree-node-selected"); +opts.onSelect.call(_189,node); }; -function _112(_184,_185){ -return $(_185).children("span.tree-hit").length==0; +function _15b(_18b,_18c){ +return $(_18c).children("span.tree-hit").length==0; }; -function _186(_187,_188){ -var opts=$.data(_187,"tree").options; -var node=_df(_187,_188); -if(opts.onBeforeEdit.call(_187,node)==false){ +function _18d(_18e,_18f){ +var opts=$.data(_18e,"tree").options; +var node=_ea(_18e,_18f); +if(opts.onBeforeEdit.call(_18e,node)==false){ return; } -$(_188).css("position","relative"); -var nt=$(_188).find(".tree-title"); -var _189=nt.outerWidth(); +$(_18f).css("position","relative"); +var nt=$(_18f).find(".tree-title"); +var _190=nt.outerWidth(); nt.empty(); -var _18a=$("").appendTo(nt); -_18a.val(node.text).focus(); -_18a.width(_189+20); -_18a.height(document.compatMode=="CSS1Compat"?(18-(_18a.outerHeight()-_18a.height())):18); -_18a.bind("click",function(e){ +var _191=$("").appendTo(nt); +_191.val(node.text).focus(); +_191.width(_190+20); +_191._outerHeight(18); +_191.bind("click",function(e){ return false; }).bind("mousedown",function(e){ e.stopPropagation(); @@ -2127,193 +2213,223 @@ e.stopPropagation(); e.stopPropagation(); }).bind("keydown",function(e){ if(e.keyCode==13){ -_18b(_187,_188); +_192(_18e,_18f); return false; }else{ if(e.keyCode==27){ -_18f(_187,_188); +_196(_18e,_18f); return false; } } }).bind("blur",function(e){ e.stopPropagation(); -_18b(_187,_188); +_192(_18e,_18f); }); }; -function _18b(_18c,_18d){ -var opts=$.data(_18c,"tree").options; -$(_18d).css("position",""); -var _18e=$(_18d).find("input.tree-editor"); -var val=_18e.val(); -_18e.remove(); -var node=_df(_18c,_18d); +function _192(_193,_194){ +var opts=$.data(_193,"tree").options; +$(_194).css("position",""); +var _195=$(_194).find("input.tree-editor"); +var val=_195.val(); +_195.remove(); +var node=_ea(_193,_194); node.text=val; -_11e(_18c,node); -opts.onAfterEdit.call(_18c,node); -}; -function _18f(_190,_191){ -var opts=$.data(_190,"tree").options; -$(_191).css("position",""); -$(_191).find("input.tree-editor").remove(); -var node=_df(_190,_191); -_11e(_190,node); -opts.onCancelEdit.call(_190,node); -}; -$.fn.tree=function(_192,_193){ -if(typeof _192=="string"){ -return $.fn.tree.methods[_192](this,_193); -} -var _192=_192||{}; +_12c(_193,node); +opts.onAfterEdit.call(_193,node); +}; +function _196(_197,_198){ +var opts=$.data(_197,"tree").options; +$(_198).css("position",""); +$(_198).find("input.tree-editor").remove(); +var node=_ea(_197,_198); +_12c(_197,node); +opts.onCancelEdit.call(_197,node); +}; +function _199(_19a,q){ +var _19b=$.data(_19a,"tree"); +var opts=_19b.options; +var ids={}; +$.easyui.forEach(_19b.data,true,function(node){ +if(opts.filter.call(_19a,q,node)){ +$("#"+node.domId).removeClass("tree-node-hidden"); +ids[node.domId]=1; +node.hidden=false; +}else{ +$("#"+node.domId).addClass("tree-node-hidden"); +node.hidden=true; +} +}); +for(var id in ids){ +_19c(id); +} +function _19c(_19d){ +var p=$(_19a).tree("getParent",$("#"+_19d)[0]); +while(p){ +$(p.target).removeClass("tree-node-hidden"); +p.hidden=false; +p=$(_19a).tree("getParent",p.target); +} +}; +}; +$.fn.tree=function(_19e,_19f){ +if(typeof _19e=="string"){ +return $.fn.tree.methods[_19e](this,_19f); +} +var _19e=_19e||{}; return this.each(function(){ -var _194=$.data(this,"tree"); +var _1a0=$.data(this,"tree"); var opts; -if(_194){ -opts=$.extend(_194.options,_192); -_194.options=opts; +if(_1a0){ +opts=$.extend(_1a0.options,_19e); +_1a0.options=opts; }else{ -opts=$.extend({},$.fn.tree.defaults,$.fn.tree.parseOptions(this),_192); -$.data(this,"tree",{options:opts,tree:_d4(this),data:[]}); +opts=$.extend({},$.fn.tree.defaults,$.fn.tree.parseOptions(this),_19e); +$.data(this,"tree",{options:opts,tree:_df(this),data:[],tmpIds:[]}); var data=$.fn.tree.parseData(this); if(data.length){ -_117(this,this,data); +_124(this,this,data); } } -_d7(this); +_e2(this); if(opts.data){ -_117(this,this,$.extend(true,[],opts.data)); +_124(this,this,$.extend(true,[],opts.data)); } -_12c(this,this); +_136(this,this); }); }; $.fn.tree.methods={options:function(jq){ return $.data(jq[0],"tree").options; },loadData:function(jq,data){ return jq.each(function(){ -_117(this,this,data); +_124(this,this,data); }); -},getNode:function(jq,_195){ -return _df(jq[0],_195); -},getData:function(jq,_196){ -return _174(jq[0],_196); -},reload:function(jq,_197){ +},getNode:function(jq,_1a1){ +return _ea(jq[0],_1a1); +},getData:function(jq,_1a2){ +return _17d(jq[0],_1a2); +},reload:function(jq,_1a3){ return jq.each(function(){ -if(_197){ -var node=$(_197); +if(_1a3){ +var node=$(_1a3); var hit=node.children("span.tree-hit"); hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); node.next().remove(); -_133(this,_197); +_13d(this,_1a3); }else{ $(this).empty(); -_12c(this,this); +_136(this,this); } }); -},getRoot:function(jq,_198){ -return _160(jq[0],_198); +},getRoot:function(jq,_1a4){ +return _16a(jq[0],_1a4); },getRoots:function(jq){ -return _164(jq[0]); -},getParent:function(jq,_199){ -return _146(jq[0],_199); -},getChildren:function(jq,_19a){ -return _116(jq[0],_19a); -},getChecked:function(jq,_19b){ -return _16d(jq[0],_19b); +return _16e(jq[0]); +},getParent:function(jq,_1a5){ +return _11f(jq[0],_1a5); +},getChildren:function(jq,_1a6){ +return _14c(jq[0],_1a6); +},getChecked:function(jq,_1a7){ +return _177(jq[0],_1a7); },getSelected:function(jq){ -return _172(jq[0]); -},isLeaf:function(jq,_19c){ -return _112(jq[0],_19c); +return _17b(jq[0]); +},isLeaf:function(jq,_1a8){ +return _15b(jq[0],_1a8); },find:function(jq,id){ -return _179(jq[0],id); -},select:function(jq,_19d){ +return _182(jq[0],id); +},select:function(jq,_1a9){ return jq.each(function(){ -_181(this,_19d); +_188(this,_1a9); }); -},check:function(jq,_19e){ +},check:function(jq,_1aa){ return jq.each(function(){ -_104(this,_19e,true); +_10c(this,_1aa,true); }); -},uncheck:function(jq,_19f){ +},uncheck:function(jq,_1ab){ return jq.each(function(){ -_104(this,_19f,false); +_10c(this,_1ab,false); }); -},collapse:function(jq,_1a0){ +},collapse:function(jq,_1ac){ return jq.each(function(){ -_138(this,_1a0); +_142(this,_1ac); }); -},expand:function(jq,_1a1){ +},expand:function(jq,_1ad){ return jq.each(function(){ -_133(this,_1a1); +_13d(this,_1ad); }); -},collapseAll:function(jq,_1a2){ +},collapseAll:function(jq,_1ae){ return jq.each(function(){ -_14a(this,_1a2); +_154(this,_1ae); }); -},expandAll:function(jq,_1a3){ +},expandAll:function(jq,_1af){ return jq.each(function(){ -_13e(this,_1a3); +_148(this,_1af); }); -},expandTo:function(jq,_1a4){ +},expandTo:function(jq,_1b0){ return jq.each(function(){ -_142(this,_1a4); +_14d(this,_1b0); }); -},scrollTo:function(jq,_1a5){ +},scrollTo:function(jq,_1b1){ return jq.each(function(){ -_147(this,_1a5); +_151(this,_1b1); }); -},toggle:function(jq,_1a6){ +},toggle:function(jq,_1b2){ return jq.each(function(){ -_13b(this,_1a6); +_145(this,_1b2); }); -},append:function(jq,_1a7){ +},append:function(jq,_1b3){ return jq.each(function(){ -_14e(this,_1a7); +_158(this,_1b3); }); -},insert:function(jq,_1a8){ +},insert:function(jq,_1b4){ return jq.each(function(){ -_152(this,_1a8); +_15d(this,_1b4); }); -},remove:function(jq,_1a9){ +},remove:function(jq,_1b5){ return jq.each(function(){ -_157(this,_1a9); +_162(this,_1b5); }); -},pop:function(jq,_1aa){ -var node=jq.tree("getData",_1aa); -jq.tree("remove",_1aa); +},pop:function(jq,_1b6){ +var node=jq.tree("getData",_1b6); +jq.tree("remove",_1b6); return node; -},update:function(jq,_1ab){ +},update:function(jq,_1b7){ return jq.each(function(){ -_11e(this,_1ab); +_12c(this,$.extend({},_1b7,{checkState:_1b7.checked?"checked":(_1b7.checked===false?"unchecked":undefined)})); }); },enableDnd:function(jq){ return jq.each(function(){ -_e4(this); +_ef(this); }); },disableDnd:function(jq){ return jq.each(function(){ -_e0(this); +_eb(this); +}); +},beginEdit:function(jq,_1b8){ +return jq.each(function(){ +_18d(this,_1b8); }); -},beginEdit:function(jq,_1ac){ +},endEdit:function(jq,_1b9){ return jq.each(function(){ -_186(this,_1ac); +_192(this,_1b9); }); -},endEdit:function(jq,_1ad){ +},cancelEdit:function(jq,_1ba){ return jq.each(function(){ -_18b(this,_1ad); +_196(this,_1ba); }); -},cancelEdit:function(jq,_1ae){ +},doFilter:function(jq,q){ return jq.each(function(){ -_18f(this,_1ae); +_199(this,q); }); }}; -$.fn.tree.parseOptions=function(_1af){ -var t=$(_1af); -return $.extend({},$.parser.parseOptions(_1af,["url","method",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean",lines:"boolean",dnd:"boolean"}])); +$.fn.tree.parseOptions=function(_1bb){ +var t=$(_1bb); +return $.extend({},$.parser.parseOptions(_1bb,["url","method",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean",lines:"boolean",dnd:"boolean"}])); }; -$.fn.tree.parseData=function(_1b0){ +$.fn.tree.parseData=function(_1bc){ var data=[]; -_1b1(data,$(_1b0)); +_1bd(data,$(_1bc)); return data; -function _1b1(aa,tree){ +function _1bd(aa,tree){ tree.children("li").each(function(){ var node=$(this); var item=$.extend({},$.parser.parseOptions(this,["id","iconCls","state"]),{checked:(node.attr("checked")?true:undefined)}); @@ -2321,35 +2437,37 @@ item.text=node.children("span").html(); if(!item.text){ item.text=node.html(); } -var _1b2=node.children("ul"); -if(_1b2.length){ +var _1be=node.children("ul"); +if(_1be.length){ item.children=[]; -_1b1(item.children,_1b2); +_1bd(item.children,_1be); } aa.push(item); }); }; }; -var _1b3=1; -var _1b4={render:function(_1b5,ul,data){ -var opts=$.data(_1b5,"tree").options; -var _1b6=$(ul).prev("div.tree-node").find("span.tree-indent, span.tree-hit").length; -var cc=_1b7(_1b6,data); +var _1bf=1; +var _1c0={render:function(_1c1,ul,data){ +var _1c2=$.data(_1c1,"tree"); +var opts=_1c2.options; +var _1c3=$(ul).prev(".tree-node"); +var _1c4=_1c3.length?$(_1c1).tree("getNode",_1c3[0]):null; +var _1c5=_1c3.find("span.tree-indent, span.tree-hit").length; +var cc=_1c6.call(this,_1c5,data); $(ul).append(cc.join("")); -function _1b7(_1b8,_1b9){ +function _1c6(_1c7,_1c8){ var cc=[]; -for(var i=0;i<_1b9.length;i++){ -var item=_1b9[i]; +for(var i=0;i<_1c8.length;i++){ +var item=_1c8[i]; if(item.state!="open"&&item.state!="closed"){ item.state="open"; } -item.domId="_easyui_tree_"+_1b3++; +item.domId="_easyui_tree_"+_1bf++; cc.push("
      • "); cc.push("
        "); -for(var j=0;j<_1b8;j++){ +for(var j=0;j<_1c7;j++){ cc.push(""); } -var _1ba=false; if(item.state=="closed"){ cc.push(""); cc.push(""); @@ -2360,18 +2478,28 @@ cc.push(""); cc.push(""); -_1ba=true; } } -if(opts.checkbox){ -if((!opts.onlyLeafCheck)||_1ba){ -cc.push(""); +if(this.hasCheckbox(_1c1,item)){ +var flag=0; +if(_1c4&&_1c4.checkState=="checked"&&opts.cascadeCheck){ +flag=1; +item.checked=true; +}else{ +if(item.checked){ +$.easyui.addArrayItem(_1c2.tmpIds,item.domId); } } -cc.push(""+opts.formatter.call(_1b5,item)+""); +item.checkState=flag?"checked":"unchecked"; +cc.push(""); +}else{ +item.checkState=undefined; +item.checked=undefined; +} +cc.push(""+opts.formatter.call(_1c1,item)+""); cc.push("
        "); if(item.children&&item.children.length){ -var tmp=_1b7(_1b8+1,item.children); +var tmp=_1c6.call(this,_1c7+1,item.children); cc.push("
          "); cc=cc.concat(tmp); cc.push("
        "); @@ -2380,22 +2508,58 @@ cc.push("
      • "); } return cc; }; +},hasCheckbox:function(_1c9,item){ +var _1ca=$.data(_1c9,"tree"); +var opts=_1ca.options; +if(opts.checkbox){ +if($.isFunction(opts.checkbox)){ +if(opts.checkbox.call(_1c9,item)){ +return true; +}else{ +return false; +} +}else{ +if(opts.onlyLeafCheck){ +if(item.state=="open"&&!(item.children&&item.children.length)){ +return true; +} +}else{ +return true; +} +} +} +return false; }}; $.fn.tree.defaults={url:null,method:"post",animate:false,checkbox:false,cascadeCheck:true,onlyLeafCheck:false,lines:false,dnd:false,data:null,queryParams:{},formatter:function(node){ return node.text; -},loader:function(_1bb,_1bc,_1bd){ +},filter:function(q,node){ +var qq=[]; +$.map($.isArray(q)?q:[q],function(q){ +q=$.trim(q); +if(q){ +qq.push(q); +} +}); +for(var i=0;i=0){ +return true; +} +} +return !qq.length; +},loader:function(_1cc,_1cd,_1ce){ var opts=$(this).tree("options"); if(!opts.url){ return false; } -$.ajax({type:opts.method,url:opts.url,data:_1bb,dataType:"json",success:function(data){ -_1bc(data); +$.ajax({type:opts.method,url:opts.url,data:_1cc,dataType:"json",success:function(data){ +_1cd(data); },error:function(){ -_1bd.apply(this,arguments); +_1ce.apply(this,arguments); }}); -},loadFilter:function(data,_1be){ +},loadFilter:function(data,_1cf){ return data; -},view:_1b4,onBeforeLoad:function(node,_1bf){ +},view:_1c0,onBeforeLoad:function(node,_1d0){ },onLoadSuccess:function(node,data){ },onLoadError:function(){ },onClick:function(node){ @@ -2404,177 +2568,184 @@ return data; },onExpand:function(node){ },onBeforeCollapse:function(node){ },onCollapse:function(node){ -},onBeforeCheck:function(node,_1c0){ -},onCheck:function(node,_1c1){ +},onBeforeCheck:function(node,_1d1){ +},onCheck:function(node,_1d2){ },onBeforeSelect:function(node){ },onSelect:function(node){ },onContextMenu:function(e,node){ },onBeforeDrag:function(node){ },onStartDrag:function(node){ },onStopDrag:function(node){ -},onDragEnter:function(_1c2,_1c3){ -},onDragOver:function(_1c4,_1c5){ -},onDragLeave:function(_1c6,_1c7){ -},onBeforeDrop:function(_1c8,_1c9,_1ca){ -},onDrop:function(_1cb,_1cc,_1cd){ +},onDragEnter:function(_1d3,_1d4){ +},onDragOver:function(_1d5,_1d6){ +},onDragLeave:function(_1d7,_1d8){ +},onBeforeDrop:function(_1d9,_1da,_1db){ +},onDrop:function(_1dc,_1dd,_1de){ },onBeforeEdit:function(node){ },onAfterEdit:function(node){ },onCancelEdit:function(node){ }}; })(jQuery); (function($){ -function init(_1ce){ -$(_1ce).addClass("progressbar"); -$(_1ce).html("
        "); -$(_1ce).bind("_resize",function(e,_1cf){ -if($(this).hasClass("easyui-fluid")||_1cf){ -_1d0(_1ce); +function init(_1df){ +$(_1df).addClass("progressbar"); +$(_1df).html("
        "); +$(_1df).bind("_resize",function(e,_1e0){ +if($(this).hasClass("easyui-fluid")||_1e0){ +_1e1(_1df); } return false; }); -return $(_1ce); +return $(_1df); }; -function _1d0(_1d1,_1d2){ -var opts=$.data(_1d1,"progressbar").options; -var bar=$.data(_1d1,"progressbar").bar; -if(_1d2){ -opts.width=_1d2; +function _1e1(_1e2,_1e3){ +var opts=$.data(_1e2,"progressbar").options; +var bar=$.data(_1e2,"progressbar").bar; +if(_1e3){ +opts.width=_1e3; } bar._size(opts); bar.find("div.progressbar-text").css("width",bar.width()); bar.find("div.progressbar-text,div.progressbar-value").css({height:bar.height()+"px",lineHeight:bar.height()+"px"}); }; -$.fn.progressbar=function(_1d3,_1d4){ -if(typeof _1d3=="string"){ -var _1d5=$.fn.progressbar.methods[_1d3]; -if(_1d5){ -return _1d5(this,_1d4); +$.fn.progressbar=function(_1e4,_1e5){ +if(typeof _1e4=="string"){ +var _1e6=$.fn.progressbar.methods[_1e4]; +if(_1e6){ +return _1e6(this,_1e5); } } -_1d3=_1d3||{}; +_1e4=_1e4||{}; return this.each(function(){ -var _1d6=$.data(this,"progressbar"); -if(_1d6){ -$.extend(_1d6.options,_1d3); +var _1e7=$.data(this,"progressbar"); +if(_1e7){ +$.extend(_1e7.options,_1e4); }else{ -_1d6=$.data(this,"progressbar",{options:$.extend({},$.fn.progressbar.defaults,$.fn.progressbar.parseOptions(this),_1d3),bar:init(this)}); +_1e7=$.data(this,"progressbar",{options:$.extend({},$.fn.progressbar.defaults,$.fn.progressbar.parseOptions(this),_1e4),bar:init(this)}); } -$(this).progressbar("setValue",_1d6.options.value); -_1d0(this); +$(this).progressbar("setValue",_1e7.options.value); +_1e1(this); }); }; $.fn.progressbar.methods={options:function(jq){ return $.data(jq[0],"progressbar").options; -},resize:function(jq,_1d7){ +},resize:function(jq,_1e8){ return jq.each(function(){ -_1d0(this,_1d7); +_1e1(this,_1e8); }); +},setText: function(jq, text) { +return jq.each(function() { +var opts = $.data(this, 'progressbar').options; +opts.text = text; +}) },getValue:function(jq){ return $.data(jq[0],"progressbar").options.value; -},setValue:function(jq,_1d8){ -if(_1d8<0){ -_1d8=0; +},setValue:function(jq,_1e9){ +if(_1e9<0){ +_1e9=0; } -if(_1d8>100){ -_1d8=100; +if(_1e9>100){ +_1e9=100; } return jq.each(function(){ var opts=$.data(this,"progressbar").options; -var text=opts.text.replace(/{value}/,_1d8); -var _1d9=opts.value; -opts.value=_1d8; -$(this).find("div.progressbar-value").width(_1d8+"%"); +var text=opts.text.replace(/{value}/,_1e9); +var _1ea=opts.value; +opts.value=_1e9; +$(this).find("div.progressbar-value").width(_1e9+"%"); $(this).find("div.progressbar-text").html(text); -if(_1d9!=_1d8){ -opts.onChange.call(this,_1d8,_1d9); +if(_1ea!=_1e9){ +opts.onChange.call(this,_1e9,_1ea); } }); }}; -$.fn.progressbar.parseOptions=function(_1da){ -return $.extend({},$.parser.parseOptions(_1da,["width","height","text",{value:"number"}])); +$.fn.progressbar.parseOptions=function(_1eb){ +return $.extend({},$.parser.parseOptions(_1eb,["width","height","text",{value:"number"}])); }; -$.fn.progressbar.defaults={width:"auto",height:22,value:0,text:"{value}%",onChange:function(_1db,_1dc){ +$.fn.progressbar.defaults={width:"auto",height:22,value:0,text:"{value}%",onChange:function(_1ec,_1ed){ }}; })(jQuery); (function($){ -function init(_1dd){ -$(_1dd).addClass("tooltip-f"); +function init(_1ee){ +$(_1ee).addClass("tooltip-f"); }; -function _1de(_1df){ -var opts=$.data(_1df,"tooltip").options; -$(_1df).unbind(".tooltip").bind(opts.showEvent+".tooltip",function(e){ -$(_1df).tooltip("show",e); +function _1ef(_1f0){ +var opts=$.data(_1f0,"tooltip").options; +$(_1f0).unbind(".tooltip").bind(opts.showEvent+".tooltip",function(e){ +$(_1f0).tooltip("show",e); }).bind(opts.hideEvent+".tooltip",function(e){ -$(_1df).tooltip("hide",e); +$(_1f0).tooltip("hide",e); }).bind("mousemove.tooltip",function(e){ if(opts.trackMouse){ opts.trackMouseX=e.pageX; opts.trackMouseY=e.pageY; -$(_1df).tooltip("reposition"); +$(_1f0).tooltip("reposition"); } }); }; -function _1e0(_1e1){ -var _1e2=$.data(_1e1,"tooltip"); -if(_1e2.showTimer){ -clearTimeout(_1e2.showTimer); -_1e2.showTimer=null; +function _1f1(_1f2){ +var _1f3=$.data(_1f2,"tooltip"); +if(_1f3.showTimer){ +clearTimeout(_1f3.showTimer); +_1f3.showTimer=null; } -if(_1e2.hideTimer){ -clearTimeout(_1e2.hideTimer); -_1e2.hideTimer=null; +if(_1f3.hideTimer){ +clearTimeout(_1f3.hideTimer); +_1f3.hideTimer=null; } }; -function _1e3(_1e4){ -var _1e5=$.data(_1e4,"tooltip"); -if(!_1e5||!_1e5.tip){ +function _1f4(_1f5){ +var _1f6=$.data(_1f5,"tooltip"); +if(!_1f6||!_1f6.tip){ return; } -var opts=_1e5.options; -var tip=_1e5.tip; +var opts=_1f6.options; +var tip=_1f6.tip; var pos={left:-100000,top:-100000}; -if($(_1e4).is(":visible")){ -pos=_1e6(opts.position); +if($(_1f5).is(":visible")){ +pos=_1f7(opts.position); if(opts.position=="top"&&pos.top<0){ -pos=_1e6("bottom"); +pos=_1f7("bottom"); }else{ if((opts.position=="bottom")&&(pos.top+tip._outerHeight()>$(window)._outerHeight()+$(document).scrollTop())){ -pos=_1e6("top"); +pos=_1f7("top"); } } if(pos.left<0){ if(opts.position=="left"){ -pos=_1e6("right"); +pos=_1f7("right"); }else{ -$(_1e4).tooltip("arrow").css("left",tip._outerWidth()/2+pos.left); +$(_1f5).tooltip("arrow").css("left",tip._outerWidth()/2+pos.left); pos.left=0; } }else{ if(pos.left+tip._outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){ if(opts.position=="right"){ -pos=_1e6("left"); +pos=_1f7("left"); }else{ var left=pos.left; pos.left=$(window)._outerWidth()+$(document)._scrollLeft()-tip._outerWidth(); -$(_1e4).tooltip("arrow").css("left",tip._outerWidth()/2-(pos.left-left)); +$(_1f5).tooltip("arrow").css("left",tip._outerWidth()/2-(pos.left-left)); } } } } tip.css({left:pos.left,top:pos.top,zIndex:(opts.zIndex!=undefined?opts.zIndex:($.fn.window?$.fn.window.defaults.zIndex++:""))}); -opts.onPosition.call(_1e4,pos.left,pos.top); -function _1e6(_1e7){ -opts.position=_1e7||"bottom"; +opts.onPosition.call(_1f5,pos.left,pos.top); +function _1f7(_1f8){ +opts.position=_1f8||"bottom"; tip.removeClass("tooltip-top tooltip-bottom tooltip-left tooltip-right").addClass("tooltip-"+opts.position); var left,top; +var _1f9=$.isFunction(opts.deltaX)?opts.deltaX.call(_1f5,opts.position):opts.deltaX; +var _1fa=$.isFunction(opts.deltaY)?opts.deltaY.call(_1f5,opts.position):opts.deltaY; if(opts.trackMouse){ t=$(); -left=opts.trackMouseX+opts.deltaX; -top=opts.trackMouseY+opts.deltaY; +left=opts.trackMouseX+_1f9; +top=opts.trackMouseY+_1fa; }else{ -var t=$(_1e4); -left=t.offset().left+opts.deltaX; -top=t.offset().top+opts.deltaY; +var t=$(_1f5); +left=t.offset().left+_1f9; +top=t.offset().top+_1fa; } switch(opts.position){ case "right": @@ -2597,82 +2768,82 @@ break; return {left:left,top:top}; }; }; -function _1e8(_1e9,e){ -var _1ea=$.data(_1e9,"tooltip"); -var opts=_1ea.options; -var tip=_1ea.tip; +function _1fb(_1fc,e){ +var _1fd=$.data(_1fc,"tooltip"); +var opts=_1fd.options; +var tip=_1fd.tip; if(!tip){ tip=$("
        "+"
        "+"
        "+"
        "+"
        ").appendTo("body"); -_1ea.tip=tip; -_1eb(_1e9); +_1fd.tip=tip; +_1fe(_1fc); } -_1e0(_1e9); -_1ea.showTimer=setTimeout(function(){ -$(_1e9).tooltip("reposition"); +_1f1(_1fc); +_1fd.showTimer=setTimeout(function(){ +$(_1fc).tooltip("reposition"); tip.show(); -opts.onShow.call(_1e9,e); -var _1ec=tip.children(".tooltip-arrow-outer"); -var _1ed=tip.children(".tooltip-arrow"); +opts.onShow.call(_1fc,e); +var _1ff=tip.children(".tooltip-arrow-outer"); +var _200=tip.children(".tooltip-arrow"); var bc="border-"+opts.position+"-color"; -_1ec.add(_1ed).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""}); -_1ec.css(bc,tip.css(bc)); -_1ed.css(bc,tip.css("backgroundColor")); +_1ff.add(_200).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""}); +_1ff.css(bc,tip.css(bc)); +_200.css(bc,tip.css("backgroundColor")); },opts.showDelay); }; -function _1ee(_1ef,e){ -var _1f0=$.data(_1ef,"tooltip"); -if(_1f0&&_1f0.tip){ -_1e0(_1ef); -_1f0.hideTimer=setTimeout(function(){ -_1f0.tip.hide(); -_1f0.options.onHide.call(_1ef,e); -},_1f0.options.hideDelay); +function _201(_202,e){ +var _203=$.data(_202,"tooltip"); +if(_203&&_203.tip){ +_1f1(_202); +_203.hideTimer=setTimeout(function(){ +_203.tip.hide(); +_203.options.onHide.call(_202,e); +},_203.options.hideDelay); } }; -function _1eb(_1f1,_1f2){ -var _1f3=$.data(_1f1,"tooltip"); -var opts=_1f3.options; -if(_1f2){ -opts.content=_1f2; +function _1fe(_204,_205){ +var _206=$.data(_204,"tooltip"); +var opts=_206.options; +if(_205){ +opts.content=_205; } -if(!_1f3.tip){ +if(!_206.tip){ return; } -var cc=typeof opts.content=="function"?opts.content.call(_1f1):opts.content; -_1f3.tip.children(".tooltip-content").html(cc); -opts.onUpdate.call(_1f1,cc); +var cc=typeof opts.content=="function"?opts.content.call(_204):opts.content; +_206.tip.children(".tooltip-content").html(cc); +opts.onUpdate.call(_204,cc); }; -function _1f4(_1f5){ -var _1f6=$.data(_1f5,"tooltip"); -if(_1f6){ -_1e0(_1f5); -var opts=_1f6.options; -if(_1f6.tip){ -_1f6.tip.remove(); +function _207(_208){ +var _209=$.data(_208,"tooltip"); +if(_209){ +_1f1(_208); +var opts=_209.options; +if(_209.tip){ +_209.tip.remove(); } if(opts._title){ -$(_1f5).attr("title",opts._title); +$(_208).attr("title",opts._title); } -$.removeData(_1f5,"tooltip"); -$(_1f5).unbind(".tooltip").removeClass("tooltip-f"); -opts.onDestroy.call(_1f5); +$.removeData(_208,"tooltip"); +$(_208).unbind(".tooltip").removeClass("tooltip-f"); +opts.onDestroy.call(_208); } }; -$.fn.tooltip=function(_1f7,_1f8){ -if(typeof _1f7=="string"){ -return $.fn.tooltip.methods[_1f7](this,_1f8); +$.fn.tooltip=function(_20a,_20b){ +if(typeof _20a=="string"){ +return $.fn.tooltip.methods[_20a](this,_20b); } -_1f7=_1f7||{}; +_20a=_20a||{}; return this.each(function(){ -var _1f9=$.data(this,"tooltip"); -if(_1f9){ -$.extend(_1f9.options,_1f7); +var _20c=$.data(this,"tooltip"); +if(_20c){ +$.extend(_20c.options,_20a); }else{ -$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_1f7)}); +$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_20a)}); init(this); } -_1de(this); -_1eb(this); +_1ef(this); +_1fe(this); }); }; $.fn.tooltip.methods={options:function(jq){ @@ -2683,28 +2854,28 @@ return $.data(jq[0],"tooltip").tip; return jq.tooltip("tip").children(".tooltip-arrow-outer,.tooltip-arrow"); },show:function(jq,e){ return jq.each(function(){ -_1e8(this,e); +_1fb(this,e); }); },hide:function(jq,e){ return jq.each(function(){ -_1ee(this,e); +_201(this,e); }); -},update:function(jq,_1fa){ +},update:function(jq,_20d){ return jq.each(function(){ -_1eb(this,_1fa); +_1fe(this,_20d); }); },reposition:function(jq){ return jq.each(function(){ -_1e3(this); +_1f4(this); }); },destroy:function(jq){ return jq.each(function(){ -_1f4(this); +_207(this); }); }}; -$.fn.tooltip.parseOptions=function(_1fb){ -var t=$(_1fb); -var opts=$.extend({},$.parser.parseOptions(_1fb,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")}); +$.fn.tooltip.parseOptions=function(_20e){ +var t=$(_20e); +var opts=$.extend({},$.parser.parseOptions(_20e,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")}); t.attr("title",""); if(!opts.content){ opts.content=opts._title; @@ -2713,7 +2884,7 @@ return opts; }; $.fn.tooltip.defaults={position:"bottom",content:null,trackMouse:false,deltaX:0,deltaY:0,showEvent:"mouseenter",hideEvent:"mouseleave",showDelay:200,hideDelay:100,onShow:function(e){ },onHide:function(e){ -},onUpdate:function(_1fc){ +},onUpdate:function(_20f){ },onPosition:function(left,top){ },onDestroy:function(){ }}; @@ -2729,113 +2900,152 @@ catch(err){ } }); }; -function _1fd(node){ +function _210(node){ node._remove(); }; -function _1fe(_1ff,_200){ -var _201=$.data(_1ff,"panel"); -var opts=_201.options; -var _202=_201.panel; -var _203=_202.children("div.panel-header"); -var _204=_202.children("div.panel-body"); -var _205=_202.children("div.panel-footer"); -if(_200){ -$.extend(opts,{width:_200.width,height:_200.height,minWidth:_200.minWidth,maxWidth:_200.maxWidth,minHeight:_200.minHeight,maxHeight:_200.maxHeight,left:_200.left,top:_200.top}); -} -_202._size(opts); -_203.add(_204)._outerWidth(_202.width()); +function _211(_212,_213){ +var _214=$.data(_212,"panel"); +var opts=_214.options; +var _215=_214.panel; +var _216=_215.children(".panel-header"); +var _217=_215.children(".panel-body"); +var _218=_215.children(".panel-footer"); +var _219=(opts.halign=="left"||opts.halign=="right"); +if(_213){ +$.extend(opts,{width:_213.width,height:_213.height,minWidth:_213.minWidth,maxWidth:_213.maxWidth,minHeight:_213.minHeight,maxHeight:_213.maxHeight,left:_213.left,top:_213.top}); +} +_215._size(opts); +if(!_219){ +_216._outerWidth(_215.width()); +} +_217._outerWidth(_215.width()); if(!isNaN(parseInt(opts.height))){ -_204._outerHeight(_202.height()-_203._outerHeight()-_205._outerHeight()); -}else{ -_204.css("height",""); -var min=$.parser.parseValue("minHeight",opts.minHeight,_202.parent()); -var max=$.parser.parseValue("maxHeight",opts.maxHeight,_202.parent()); -var _206=_203._outerHeight()+_205._outerHeight()+_202._outerHeight()-_202.height(); -_204._size("minHeight",min?(min-_206):""); -_204._size("maxHeight",max?(max-_206):""); -} -_202.css({height:"",minHeight:"",maxHeight:"",left:opts.left,top:opts.top}); -opts.onResize.apply(_1ff,[opts.width,opts.height]); -$(_1ff).panel("doLayout"); -}; -function _207(_208,_209){ -var opts=$.data(_208,"panel").options; -var _20a=$.data(_208,"panel").panel; -if(_209){ -if(_209.left!=null){ -opts.left=_209.left; -} -if(_209.top!=null){ -opts.top=_209.top; -} -} -_20a.css({left:opts.left,top:opts.top}); -opts.onMove.apply(_208,[opts.left,opts.top]); -}; -function _20b(_20c){ -$(_20c).addClass("panel-body")._size("clear"); -var _20d=$("
        ").insertBefore(_20c); -_20d[0].appendChild(_20c); -_20d.bind("_resize",function(e,_20e){ -if($(this).hasClass("easyui-fluid")||_20e){ -_1fe(_20c); +if(_219){ +if(opts.header){ +var _21a=$(opts.header)._outerWidth(); +}else{ +_216.css("width",""); +var _21a=_216._outerWidth(); +} +var _21b=_216.find(".panel-title"); +_21a+=Math.min(_21b._outerWidth(),_21b._outerHeight()); +var _21c=_215.height(); +_216._outerWidth(_21a)._outerHeight(_21c); +_21b._outerWidth(_216.height()); +_217._outerWidth(_215.width()-_21a-_218._outerWidth())._outerHeight(_21c); +_218._outerHeight(_21c); +_217.css({left:"",right:""}).css(opts.halign,(_216.position()[opts.halign]+_21a)+"px"); +opts.panelCssWidth=_215.css("width"); +if(opts.collapsed){ +_215._outerWidth(_21a+_218._outerWidth()); +} +}else{ +_217._outerHeight(_215.height()-_216._outerHeight()-_218._outerHeight()); +} +}else{ +_217.css("height",""); +var min=$.parser.parseValue("minHeight",opts.minHeight,_215.parent()); +var max=$.parser.parseValue("maxHeight",opts.maxHeight,_215.parent()); +var _21d=_216._outerHeight()+_218._outerHeight()+_215._outerHeight()-_215.height(); +_217._size("minHeight",min?(min-_21d):""); +_217._size("maxHeight",max?(max-_21d):""); +} +_215.css({height:(_219?undefined:""),minHeight:"",maxHeight:"",left:opts.left,top:opts.top}); +opts.onResize.apply(_212,[opts.width,opts.height]); +$(_212).panel("doLayout"); +}; +function _21e(_21f,_220){ +var _221=$.data(_21f,"panel"); +var opts=_221.options; +var _222=_221.panel; +if(_220){ +if(_220.left!=null){ +opts.left=_220.left; +} +if(_220.top!=null){ +opts.top=_220.top; +} +} +_222.css({left:opts.left,top:opts.top}); +_222.find(".tooltip-f").each(function(){ +$(this).tooltip("reposition"); +}); +opts.onMove.apply(_21f,[opts.left,opts.top]); +}; +function _223(_224){ +$(_224).addClass("panel-body")._size("clear"); +var _225=$("
        ").insertBefore(_224); +_225[0].appendChild(_224); +_225.bind("_resize",function(e,_226){ +if($(this).hasClass("easyui-fluid")||_226){ +_211(_224); } return false; }); -return _20d; -}; -function _20f(_210){ -var _211=$.data(_210,"panel"); -var opts=_211.options; -var _212=_211.panel; -_212.css(opts.style); -_212.addClass(opts.cls); -_213(); -_214(); -var _215=$(_210).panel("header"); -var body=$(_210).panel("body"); -var _216=$(_210).siblings("div.panel-footer"); +return _225; +}; +function _227(_228){ +var _229=$.data(_228,"panel"); +var opts=_229.options; +var _22a=_229.panel; +_22a.css(opts.style); +_22a.addClass(opts.cls); +_22a.removeClass("panel-hleft panel-hright").addClass("panel-h"+opts.halign); +_22b(); +_22c(); +var _22d=$(_228).panel("header"); +var body=$(_228).panel("body"); +var _22e=$(_228).siblings(".panel-footer"); if(opts.border){ -_215.removeClass("panel-header-noborder"); +_22d.removeClass("panel-header-noborder"); body.removeClass("panel-body-noborder"); -_216.removeClass("panel-footer-noborder"); +_22e.removeClass("panel-footer-noborder"); }else{ -_215.addClass("panel-header-noborder"); +_22d.addClass("panel-header-noborder"); body.addClass("panel-body-noborder"); -_216.addClass("panel-footer-noborder"); +_22e.addClass("panel-footer-noborder"); } -_215.addClass(opts.headerCls); +_22d.addClass(opts.headerCls); body.addClass(opts.bodyCls); -$(_210).attr("id",opts.id||""); +$(_228).attr("id",opts.id||""); if(opts.content){ -$(_210).panel("clear"); -$(_210).html(opts.content); -$.parser.parse($(_210)); -} -function _213(){ -if(opts.tools&&typeof opts.tools=="string"){ -_212.find(">div.panel-header>div.panel-tool .panel-tool-a").appendTo(opts.tools); -} -_1fd(_212.children("div.panel-header")); -if(opts.title&&!opts.noheader){ -var _217=$("
        ").prependTo(_212); -var _218=$("
        ").html(opts.title).appendTo(_217); +$(_228).panel("clear"); +$(_228).html(opts.content); +$.parser.parse($(_228)); +} +function _22b(){ +if(opts.noheader||(!opts.title&&!opts.header)){ +_210(_22a.children(".panel-header")); +_22a.children(".panel-body").addClass("panel-body-noheader"); +}else{ +if(opts.header){ +$(opts.header).addClass("panel-header").prependTo(_22a); +}else{ +var _22f=_22a.children(".panel-header"); +if(!_22f.length){ +_22f=$("
        ").prependTo(_22a); +} +if(!$.isArray(opts.tools)){ +_22f.find("div.panel-tool .panel-tool-a").appendTo(opts.tools); +} +_22f.empty(); +var _230=$("
        ").html(opts.title).appendTo(_22f); if(opts.iconCls){ -_218.addClass("panel-with-icon"); -$("
        ").addClass(opts.iconCls).appendTo(_217); +_230.addClass("panel-with-icon"); +$("
        ").addClass(opts.iconCls).appendTo(_22f); } -var tool=$("
        ").appendTo(_217); +if(opts.halign=="left"||opts.halign=="right"){ +_230.addClass("panel-title-"+opts.titleDirection); +} +var tool=$("
        ").appendTo(_22f); tool.bind("click",function(e){ e.stopPropagation(); }); if(opts.tools){ if($.isArray(opts.tools)){ -for(var i=0;i").addClass(opts.tools[i].iconCls).appendTo(tool); -if(opts.tools[i].handler){ -t.bind("click",eval(opts.tools[i].handler)); -} -} +$.map(opts.tools,function(t){ +_231(tool,t.iconCls,eval(t.handler)); +}); }else{ $(opts.tools).children().each(function(){ $(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(tool); @@ -2843,84 +3053,84 @@ $(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(tool } } if(opts.collapsible){ -$("").appendTo(tool).bind("click",function(){ +_231(tool,"panel-tool-collapse",function(){ if(opts.collapsed==true){ -_235(_210,true); +_251(_228,true); }else{ -_228(_210,true); +_242(_228,true); } -return false; }); } if(opts.minimizable){ -$("").appendTo(tool).bind("click",function(){ -_23b(_210); -return false; +_231(tool,"panel-tool-min",function(){ +_257(_228); }); } if(opts.maximizable){ -$("").appendTo(tool).bind("click",function(){ +_231(tool,"panel-tool-max",function(){ if(opts.maximized==true){ -_23e(_210); +_25a(_228); }else{ -_227(_210); +_241(_228); } -return false; }); } if(opts.closable){ -$("").appendTo(tool).bind("click",function(){ -_229(_210); -return false; +_231(tool,"panel-tool-close",function(){ +_243(_228); }); } -_212.children("div.panel-body").removeClass("panel-body-noheader"); -}else{ -_212.children("div.panel-body").addClass("panel-body-noheader"); +} +_22a.children("div.panel-body").removeClass("panel-body-noheader"); } }; -function _214(){ +function _231(c,icon,_232){ +var a=$("").addClass(icon).appendTo(c); +a.bind("click",_232); +}; +function _22c(){ if(opts.footer){ -$(opts.footer).addClass("panel-footer").appendTo(_212); -$(_210).addClass("panel-body-nobottom"); +$(opts.footer).addClass("panel-footer").appendTo(_22a); +$(_228).addClass("panel-body-nobottom"); }else{ -_212.children("div.panel-footer").remove(); -$(_210).removeClass("panel-body-nobottom"); +_22a.children(".panel-footer").remove(); +$(_228).removeClass("panel-body-nobottom"); } }; }; -function _219(_21a,_21b){ -var _21c=$.data(_21a,"panel"); -var opts=_21c.options; -if(_21d){ -opts.queryParams=_21b; +function _233(_234,_235){ +var _236=$.data(_234,"panel"); +var opts=_236.options; +if(_237){ +opts.queryParams=_235; } if(!opts.href){ return; } -if(!_21c.isLoaded||!opts.cache){ -var _21d=$.extend({},opts.queryParams); -if(opts.onBeforeLoad.call(_21a,_21d)==false){ +if(!_236.isLoaded||!opts.cache){ +var _237=$.extend({},opts.queryParams); +if(opts.onBeforeLoad.call(_234,_237)==false){ return; } -_21c.isLoaded=false; -$(_21a).panel("clear"); +_236.isLoaded=false; if(opts.loadingMessage){ -$(_21a).html($("
        ").html(opts.loadingMessage)); -} -opts.loader.call(_21a,_21d,function(data){ -var _21e=opts.extractor.call(_21a,data); -$(_21a).html(_21e); -$.parser.parse($(_21a)); -opts.onLoad.apply(_21a,arguments); -_21c.isLoaded=true; +$(_234).panel("clear"); +$(_234).html($("
        ").html(opts.loadingMessage)); +} +opts.loader.call(_234,_237,function(data){ +var _238=opts.extractor.call(_234,data); +$(_234).panel("clear"); +$(_234).html(_238); +$.parser.parse($(_234)); +opts.onLoad.apply(_234,arguments); +_236.isLoaded=true; },function(){ -opts.onLoadError.apply(_21a,arguments); +opts.onLoadError.apply(_234,arguments); }); } }; -function _21f(_220){ -var t=$(_220); +function _239(_23a){ +var t=$(_23a); t.find(".combo-f").each(function(){ $(this).combo("destroy"); }); @@ -2938,245 +3148,274 @@ $(this)._size("unfit"); }); t.empty(); }; -function _221(_222){ -$(_222).panel("doLayout",true); +function _23b(_23c){ +$(_23c).panel("doLayout",true); }; -function _223(_224,_225){ -var opts=$.data(_224,"panel").options; -var _226=$.data(_224,"panel").panel; -if(_225!=true){ -if(opts.onBeforeOpen.call(_224)==false){ +function _23d(_23e,_23f){ +var opts=$.data(_23e,"panel").options; +var _240=$.data(_23e,"panel").panel; +if(_23f!=true){ +if(opts.onBeforeOpen.call(_23e)==false){ return; } } -_226.stop(true,true); +_240.stop(true,true); if($.isFunction(opts.openAnimation)){ -opts.openAnimation.call(_224,cb); +opts.openAnimation.call(_23e,cb); }else{ switch(opts.openAnimation){ case "slide": -_226.slideDown(opts.openDuration,cb); +_240.slideDown(opts.openDuration,cb); break; case "fade": -_226.fadeIn(opts.openDuration,cb); +_240.fadeIn(opts.openDuration,cb); break; case "show": -_226.show(opts.openDuration,cb); +_240.show(opts.openDuration,cb); break; default: -_226.show(); +_240.show(); cb(); } } function cb(){ opts.closed=false; opts.minimized=false; -var tool=_226.children("div.panel-header").find("a.panel-tool-restore"); +var tool=_240.children(".panel-header").find("a.panel-tool-restore"); if(tool.length){ opts.maximized=true; } -opts.onOpen.call(_224); +opts.onOpen.call(_23e); if(opts.maximized==true){ opts.maximized=false; -_227(_224); +_241(_23e); } if(opts.collapsed==true){ opts.collapsed=false; -_228(_224); +_242(_23e); } if(!opts.collapsed){ -_219(_224); -_221(_224); +_233(_23e); +_23b(_23e); } }; }; -function _229(_22a,_22b){ -var opts=$.data(_22a,"panel").options; -var _22c=$.data(_22a,"panel").panel; -if(_22b!=true){ -if(opts.onBeforeClose.call(_22a)==false){ +function _243(_244,_245){ +var _246=$.data(_244,"panel"); +var opts=_246.options; +var _247=_246.panel; +if(_245!=true){ +if(opts.onBeforeClose.call(_244)==false){ return; } } -_22c.stop(true,true); -_22c._size("unfit"); +_247.find(".tooltip-f").each(function(){ +$(this).tooltip("hide"); +}); +_247.stop(true,true); +_247._size("unfit"); if($.isFunction(opts.closeAnimation)){ -opts.closeAnimation.call(_22a,cb); +opts.closeAnimation.call(_244,cb); }else{ switch(opts.closeAnimation){ case "slide": -_22c.slideUp(opts.closeDuration,cb); +_247.slideUp(opts.closeDuration,cb); break; case "fade": -_22c.fadeOut(opts.closeDuration,cb); +_247.fadeOut(opts.closeDuration,cb); break; case "hide": -_22c.hide(opts.closeDuration,cb); +_247.hide(opts.closeDuration,cb); break; default: -_22c.hide(); +_247.hide(); cb(); } } function cb(){ opts.closed=true; -opts.onClose.call(_22a); +opts.onClose.call(_244); }; }; -function _22d(_22e,_22f){ -var _230=$.data(_22e,"panel"); -var opts=_230.options; -var _231=_230.panel; -if(_22f!=true){ -if(opts.onBeforeDestroy.call(_22e)==false){ +function _248(_249,_24a){ +var _24b=$.data(_249,"panel"); +var opts=_24b.options; +var _24c=_24b.panel; +if(_24a!=true){ +if(opts.onBeforeDestroy.call(_249)==false){ return; } } -$(_22e).panel("clear").panel("clear","footer"); -_1fd(_231); -opts.onDestroy.call(_22e); +$(_249).panel("clear").panel("clear","footer"); +_210(_24c); +opts.onDestroy.call(_249); }; -function _228(_232,_233){ -var opts=$.data(_232,"panel").options; -var _234=$.data(_232,"panel").panel; -var body=_234.children("div.panel-body"); -var tool=_234.children("div.panel-header").find("a.panel-tool-collapse"); +function _242(_24d,_24e){ +var opts=$.data(_24d,"panel").options; +var _24f=$.data(_24d,"panel").panel; +var body=_24f.children(".panel-body"); +var _250=_24f.children(".panel-header"); +var tool=_250.find("a.panel-tool-collapse"); if(opts.collapsed==true){ return; } body.stop(true,true); -if(opts.onBeforeCollapse.call(_232)==false){ +if(opts.onBeforeCollapse.call(_24d)==false){ return; } tool.addClass("panel-tool-expand"); -if(_233==true){ +if(_24e==true){ +if(opts.halign=="left"||opts.halign=="right"){ +_24f.animate({width:_250._outerWidth()+_24f.children(".panel-footer")._outerWidth()},function(){ +cb(); +}); +}else{ body.slideUp("normal",function(){ -opts.collapsed=true; -opts.onCollapse.call(_232); +cb(); }); +} }else{ +if(opts.halign=="left"||opts.halign=="right"){ +_24f._outerWidth(_250._outerWidth()+_24f.children(".panel-footer")._outerWidth()); +} +cb(); +} +function cb(){ body.hide(); opts.collapsed=true; -opts.onCollapse.call(_232); -} +opts.onCollapse.call(_24d); +}; }; -function _235(_236,_237){ -var opts=$.data(_236,"panel").options; -var _238=$.data(_236,"panel").panel; -var body=_238.children("div.panel-body"); -var tool=_238.children("div.panel-header").find("a.panel-tool-collapse"); +function _251(_252,_253){ +var opts=$.data(_252,"panel").options; +var _254=$.data(_252,"panel").panel; +var body=_254.children(".panel-body"); +var tool=_254.children(".panel-header").find("a.panel-tool-collapse"); if(opts.collapsed==false){ return; } body.stop(true,true); -if(opts.onBeforeExpand.call(_236)==false){ +if(opts.onBeforeExpand.call(_252)==false){ return; } tool.removeClass("panel-tool-expand"); -if(_237==true){ +if(_253==true){ +if(opts.halign=="left"||opts.halign=="right"){ +body.show(); +_254.animate({width:opts.panelCssWidth},function(){ +cb(); +}); +}else{ body.slideDown("normal",function(){ -opts.collapsed=false; -opts.onExpand.call(_236); -_219(_236); -_221(_236); +cb(); }); +} }else{ +if(opts.halign=="left"||opts.halign=="right"){ +_254.css("width",opts.panelCssWidth); +} +cb(); +} +function cb(){ body.show(); opts.collapsed=false; -opts.onExpand.call(_236); -_219(_236); -_221(_236); -} +opts.onExpand.call(_252); +_233(_252); +_23b(_252); }; -function _227(_239){ -var opts=$.data(_239,"panel").options; -var _23a=$.data(_239,"panel").panel; -var tool=_23a.children("div.panel-header").find("a.panel-tool-max"); +}; +function _241(_255){ +var opts=$.data(_255,"panel").options; +var _256=$.data(_255,"panel").panel; +var tool=_256.children(".panel-header").find("a.panel-tool-max"); if(opts.maximized==true){ return; } tool.addClass("panel-tool-restore"); -if(!$.data(_239,"panel").original){ -$.data(_239,"panel").original={width:opts.width,height:opts.height,left:opts.left,top:opts.top,fit:opts.fit}; +if(!$.data(_255,"panel").original){ +$.data(_255,"panel").original={width:opts.width,height:opts.height,left:opts.left,top:opts.top,fit:opts.fit}; } opts.left=0; opts.top=0; opts.fit=true; -_1fe(_239); +_211(_255); opts.minimized=false; opts.maximized=true; -opts.onMaximize.call(_239); +opts.onMaximize.call(_255); }; -function _23b(_23c){ -var opts=$.data(_23c,"panel").options; -var _23d=$.data(_23c,"panel").panel; -_23d._size("unfit"); -_23d.hide(); +function _257(_258){ +var opts=$.data(_258,"panel").options; +var _259=$.data(_258,"panel").panel; +_259._size("unfit"); +_259.hide(); opts.minimized=true; opts.maximized=false; -opts.onMinimize.call(_23c); +opts.onMinimize.call(_258); }; -function _23e(_23f){ -var opts=$.data(_23f,"panel").options; -var _240=$.data(_23f,"panel").panel; -var tool=_240.children("div.panel-header").find("a.panel-tool-max"); +function _25a(_25b){ +var opts=$.data(_25b,"panel").options; +var _25c=$.data(_25b,"panel").panel; +var tool=_25c.children(".panel-header").find("a.panel-tool-max"); if(opts.maximized==false){ return; } -_240.show(); +_25c.show(); tool.removeClass("panel-tool-restore"); -$.extend(opts,$.data(_23f,"panel").original); -_1fe(_23f); +$.extend(opts,$.data(_25b,"panel").original); +_211(_25b); opts.minimized=false; opts.maximized=false; -$.data(_23f,"panel").original=null; -opts.onRestore.call(_23f); +$.data(_25b,"panel").original=null; +opts.onRestore.call(_25b); }; -function _241(_242,_243){ -$.data(_242,"panel").options.title=_243; -$(_242).panel("header").find("div.panel-title").html(_243); +function _25d(_25e,_25f){ +$.data(_25e,"panel").options.title=_25f; +$(_25e).panel("header").find("div.panel-title").html(_25f); }; -var _244=null; +var _260=null; $(window).unbind(".panel").bind("resize.panel",function(){ -if(_244){ -clearTimeout(_244); +if(_260){ +clearTimeout(_260); } -_244=setTimeout(function(){ -var _245=$("body.layout"); -if(_245.length){ -_245.layout("resize"); -$("body").children(".easyui-fluid:visible").trigger("_resize"); +_260=setTimeout(function(){ +var _261=$("body.layout"); +if(_261.length){ +_261.layout("resize"); +$("body").children(".easyui-fluid:visible").each(function(){ +$(this).triggerHandler("_resize"); +}); }else{ $("body").panel("doLayout"); } -_244=null; +_260=null; },100); }); -$.fn.panel=function(_246,_247){ -if(typeof _246=="string"){ -return $.fn.panel.methods[_246](this,_247); +$.fn.panel=function(_262,_263){ +if(typeof _262=="string"){ +return $.fn.panel.methods[_262](this,_263); } -_246=_246||{}; +_262=_262||{}; return this.each(function(){ -var _248=$.data(this,"panel"); +var _264=$.data(this,"panel"); var opts; -if(_248){ -opts=$.extend(_248.options,_246); -_248.isLoaded=false; +if(_264){ +opts=$.extend(_264.options,_262); +_264.isLoaded=false; }else{ -opts=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_246); +opts=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_262); $(this).attr("title",""); -_248=$.data(this,"panel",{options:opts,panel:_20b(this),isLoaded:false}); +_264=$.data(this,"panel",{options:opts,panel:_223(this),isLoaded:false}); } -_20f(this); +_227(this); +$(this).show(); if(opts.doSize==true){ -_248.panel.css("display","block"); -_1fe(this); +_264.panel.css("display","block"); +_211(this); } if(opts.closed==true||opts.minimized==true){ -_248.panel.hide(); +_264.panel.hide(); }else{ -_223(this); +_23d(this); } }); }; @@ -3185,112 +3424,116 @@ return $.data(jq[0],"panel").options; },panel:function(jq){ return $.data(jq[0],"panel").panel; },header:function(jq){ -return $.data(jq[0],"panel").panel.find(">div.panel-header"); +return $.data(jq[0],"panel").panel.children(".panel-header"); },footer:function(jq){ return jq.panel("panel").children(".panel-footer"); },body:function(jq){ -return $.data(jq[0],"panel").panel.find(">div.panel-body"); -},setTitle:function(jq,_249){ +return $.data(jq[0],"panel").panel.children(".panel-body"); +},setTitle:function(jq,_265){ return jq.each(function(){ -_241(this,_249); +_25d(this,_265); }); -},open:function(jq,_24a){ +},open:function(jq,_266){ return jq.each(function(){ -_223(this,_24a); +_23d(this,_266); }); -},close:function(jq,_24b){ +},close:function(jq,_267){ return jq.each(function(){ -_229(this,_24b); +_243(this,_267); }); -},destroy:function(jq,_24c){ +},destroy:function(jq,_268){ return jq.each(function(){ -_22d(this,_24c); +_248(this,_268); }); },clear:function(jq,type){ return jq.each(function(){ -_21f(type=="footer"?$(this).panel("footer"):this); +_239(type=="footer"?$(this).panel("footer"):this); }); },refresh:function(jq,href){ return jq.each(function(){ -var _24d=$.data(this,"panel"); -_24d.isLoaded=false; +var _269=$.data(this,"panel"); +_269.isLoaded=false; if(href){ if(typeof href=="string"){ -_24d.options.href=href; +_269.options.href=href; }else{ -_24d.options.queryParams=href; +_269.options.queryParams=href; } } -_219(this); +_233(this); }); -},resize:function(jq,_24e){ +},resize:function(jq,_26a){ return jq.each(function(){ -_1fe(this,_24e); +_211(this,_26a); }); },doLayout:function(jq,all){ return jq.each(function(){ -_24f(this,"body"); -_24f($(this).siblings("div.panel-footer")[0],"footer"); -function _24f(_250,type){ -if(!_250){ +_26b(this,"body"); +_26b($(this).siblings(".panel-footer")[0],"footer"); +function _26b(_26c,type){ +if(!_26c){ return; } -var _251=_250==$("body")[0]; -var s=$(_250).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_252,el){ -var p=$(el).parents("div.panel-"+type+":first"); -return _251?p.length==0:p[0]==_250; +var _26d=_26c==$("body")[0]; +var s=$(_26c).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_26e,el){ +var p=$(el).parents(".panel-"+type+":first"); +return _26d?p.length==0:p[0]==_26c; +}); +s.each(function(){ +$(this).triggerHandler("_resize",[all||false]); }); -s.trigger("_resize",[all||false]); }; }); -},move:function(jq,_253){ +},move:function(jq,_26f){ return jq.each(function(){ -_207(this,_253); +_21e(this,_26f); }); },maximize:function(jq){ return jq.each(function(){ -_227(this); +_241(this); }); },minimize:function(jq){ return jq.each(function(){ -_23b(this); +_257(this); }); },restore:function(jq){ return jq.each(function(){ -_23e(this); +_25a(this); }); -},collapse:function(jq,_254){ +},collapse:function(jq,_270){ return jq.each(function(){ -_228(this,_254); +_242(this,_270); }); -},expand:function(jq,_255){ +},expand:function(jq,_271){ return jq.each(function(){ -_235(this,_255); +_251(this,_271); }); }}; -$.fn.panel.parseOptions=function(_256){ -var t=$(_256); -return $.extend({},$.parser.parseOptions(_256,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined)}); +$.fn.panel.parseOptions=function(_272){ +var t=$(_272); +var hh=t.children(".panel-header,header"); +var ff=t.children(".panel-footer,footer"); +return $.extend({},$.parser.parseOptions(_272,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method","header","footer","halign","titleDirection",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined),header:(hh.length?hh.removeClass("panel-header"):undefined),footer:(ff.length?ff.removeClass("panel-footer"):undefined)}); }; -$.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_257,_258,_259){ +$.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,halign:"top",titleDirection:"down",collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,header:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_273,_274,_275){ var opts=$(this).panel("options"); if(!opts.href){ return false; } -$.ajax({type:opts.method,url:opts.href,cache:false,data:_257,dataType:"html",success:function(data){ -_258(data); +$.ajax({type:opts.method,url:opts.href,cache:false,data:_273,dataType:"html",success:function(data){ +_274(data); },error:function(){ -_259.apply(this,arguments); +_275.apply(this,arguments); }}); },extractor:function(data){ -var _25a=/]*>((.|[\n\r])*)<\/body>/im; -var _25b=_25a.exec(data); -if(_25b){ -return _25b[1]; +var _276=/]*>((.|[\n\r])*)<\/body>/im; +var _277=_276.exec(data); +if(_277){ +return _277[1]; }else{ return data; } -},onBeforeLoad:function(_25c){ +},onBeforeLoad:function(_278){ },onLoad:function(){ },onLoadError:function(){ },onBeforeOpen:function(){ @@ -3299,7 +3542,7 @@ return data; },onClose:function(){ },onBeforeDestroy:function(){ },onDestroy:function(){ -},onResize:function(_25d,_25e){ +},onResize:function(_279,_27a){ },onMove:function(left,top){ },onMaximize:function(){ },onRestore:function(){ @@ -3311,279 +3554,329 @@ return data; }}; })(jQuery); (function($){ -function _25f(_260,_261){ -var _262=$.data(_260,"window"); -if(_261){ -if(_261.left!=null){ -_262.options.left=_261.left; +function _27b(_27c,_27d){ +var _27e=$.data(_27c,"window"); +if(_27d){ +if(_27d.left!=null){ +_27e.options.left=_27d.left; } -if(_261.top!=null){ -_262.options.top=_261.top; +if(_27d.top!=null){ +_27e.options.top=_27d.top; } } -$(_260).panel("move",_262.options); -if(_262.shadow){ -_262.shadow.css({left:_262.options.left,top:_262.options.top}); +$(_27c).panel("move",_27e.options); +if(_27e.shadow){ +_27e.shadow.css({left:_27e.options.left,top:_27e.options.top}); } }; -function _263(_264,_265){ -var opts=$.data(_264,"window").options; -var pp=$(_264).window("panel"); -var _266=pp._outerWidth(); +function _27f(_280,_281){ +var opts=$.data(_280,"window").options; +var pp=$(_280).window("panel"); +var _282=pp._outerWidth(); if(opts.inline){ -var _267=pp.parent(); -opts.left=Math.ceil((_267.width()-_266)/2+_267.scrollLeft()); +var _283=pp.parent(); +opts.left=Math.ceil((_283.width()-_282)/2+_283.scrollLeft()); }else{ -opts.left=Math.ceil(($(window)._outerWidth()-_266)/2+$(document).scrollLeft()); +opts.left=Math.ceil(($(window)._outerWidth()-_282)/2+$(document).scrollLeft()); } -if(_265){ -_25f(_264); +if(_281){ +_27b(_280); } }; -function _268(_269,_26a){ -var opts=$.data(_269,"window").options; -var pp=$(_269).window("panel"); -var _26b=pp._outerHeight(); +function _284(_285,_286){ +var opts=$.data(_285,"window").options; +var pp=$(_285).window("panel"); +var _287=pp._outerHeight(); if(opts.inline){ -var _26c=pp.parent(); -opts.top=Math.ceil((_26c.height()-_26b)/2+_26c.scrollTop()); +var _288=pp.parent(); +opts.top=Math.ceil((_288.height()-_287)/2+_288.scrollTop()); }else{ -opts.top=Math.ceil(($(window)._outerHeight()-_26b)/2+$(document).scrollTop()); +opts.top=Math.ceil(($(window)._outerHeight()-_287)/2+$(document).scrollTop()); } -if(_26a){ -_25f(_269); +if(_286){ +_27b(_285); } }; -function _26d(_26e){ -var _26f=$.data(_26e,"window"); -var opts=_26f.options; -var win=$(_26e).panel($.extend({},_26f.options,{border:false,doSize:true,closed:true,cls:"window",headerCls:"window-header",bodyCls:"window-body "+(opts.noheader?"window-body-noheader":""),onBeforeDestroy:function(){ -if(opts.onBeforeDestroy.call(_26e)==false){ +function _289(_28a){ +var _28b=$.data(_28a,"window"); +var opts=_28b.options; +var win=$(_28a).panel($.extend({},_28b.options,{border:false,doSize:true,closed:true,cls:"window "+(!opts.border?"window-thinborder window-noborder ":(opts.border=="thin"?"window-thinborder ":""))+(opts.cls||""),headerCls:"window-header "+(opts.headerCls||""),bodyCls:"window-body "+(opts.noheader?"window-body-noheader ":" ")+(opts.bodyCls||""),onBeforeDestroy:function(){ +if(opts.onBeforeDestroy.call(_28a)==false){ return false; } -if(_26f.shadow){ -_26f.shadow.remove(); +if(_28b.shadow){ +_28b.shadow.remove(); } -if(_26f.mask){ -_26f.mask.remove(); +if(_28b.mask){ +_28b.mask.remove(); } },onClose:function(){ -if(_26f.shadow){ -_26f.shadow.hide(); +if(_28b.shadow){ +_28b.shadow.hide(); } -if(_26f.mask){ -_26f.mask.hide(); +if(_28b.mask){ +_28b.mask.hide(); } -opts.onClose.call(_26e); +opts.onClose.call(_28a); },onOpen:function(){ -if(_26f.mask){ -_26f.mask.css({display:"block",zIndex:$.fn.window.defaults.zIndex++}); +if(_28b.mask){ +_28b.mask.css($.extend({display:"block",zIndex:$.fn.window.defaults.zIndex++},$.fn.window.getMaskSize(_28a))); } -if(_26f.shadow){ -_26f.shadow.css({display:"block",zIndex:$.fn.window.defaults.zIndex++,left:opts.left,top:opts.top,width:_26f.window._outerWidth(),height:_26f.window._outerHeight()}); +if(_28b.shadow){ +_28b.shadow.css({display:"block",zIndex:$.fn.window.defaults.zIndex++,left:opts.left,top:opts.top,width:_28b.window._outerWidth(),height:_28b.window._outerHeight()}); } -_26f.window.css("z-index",$.fn.window.defaults.zIndex++); -opts.onOpen.call(_26e); -},onResize:function(_270,_271){ -var _272=$(this).panel("options"); -$.extend(opts,{width:_272.width,height:_272.height,left:_272.left,top:_272.top}); -if(_26f.shadow){ -_26f.shadow.css({left:opts.left,top:opts.top,width:_26f.window._outerWidth(),height:_26f.window._outerHeight()}); +_28b.window.css("z-index",$.fn.window.defaults.zIndex++); +opts.onOpen.call(_28a); +},onResize:function(_28c,_28d){ +var _28e=$(this).panel("options"); +$.extend(opts,{width:_28e.width,height:_28e.height,left:_28e.left,top:_28e.top}); +if(_28b.shadow){ +_28b.shadow.css({left:opts.left,top:opts.top,width:_28b.window._outerWidth(),height:_28b.window._outerHeight()}); } -opts.onResize.call(_26e,_270,_271); +opts.onResize.call(_28a,_28c,_28d); },onMinimize:function(){ -if(_26f.shadow){ -_26f.shadow.hide(); +if(_28b.shadow){ +_28b.shadow.hide(); } -if(_26f.mask){ -_26f.mask.hide(); +if(_28b.mask){ +_28b.mask.hide(); } -_26f.options.onMinimize.call(_26e); +_28b.options.onMinimize.call(_28a); },onBeforeCollapse:function(){ -if(opts.onBeforeCollapse.call(_26e)==false){ +if(opts.onBeforeCollapse.call(_28a)==false){ return false; } -if(_26f.shadow){ -_26f.shadow.hide(); +if(_28b.shadow){ +_28b.shadow.hide(); } },onExpand:function(){ -if(_26f.shadow){ -_26f.shadow.show(); +if(_28b.shadow){ +_28b.shadow.show(); } -opts.onExpand.call(_26e); +opts.onExpand.call(_28a); }})); -_26f.window=win.panel("panel"); -if(_26f.mask){ -_26f.mask.remove(); +_28b.window=win.panel("panel"); +if(_28b.mask){ +_28b.mask.remove(); } -if(opts.modal==true){ -_26f.mask=$("
        ").insertAfter(_26f.window); -_26f.mask.css({width:(opts.inline?_26f.mask.parent().width():_273().width),height:(opts.inline?_26f.mask.parent().height():_273().height),display:"none"}); +if(opts.modal){ +_28b.mask=$("
        ").insertAfter(_28b.window); } -if(_26f.shadow){ -_26f.shadow.remove(); +if(_28b.shadow){ +_28b.shadow.remove(); } -if(opts.shadow==true){ -_26f.shadow=$("
        ").insertAfter(_26f.window); -_26f.shadow.css({display:"none"}); +if(opts.shadow){ +_28b.shadow=$("
        ").insertAfter(_28b.window); } +var _28f=opts.closed; if(opts.left==null){ -_263(_26e); +_27f(_28a); } if(opts.top==null){ -_268(_26e); +_284(_28a); } -_25f(_26e); -if(!opts.closed){ +_27b(_28a); +if(!_28f){ win.window("open"); } }; -function _274(_275){ -var _276=$.data(_275,"window"); -_276.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_276.options.draggable==false,onStartDrag:function(e){ -if(_276.mask){ -_276.mask.css("z-index",$.fn.window.defaults.zIndex++); +function _290(left,top,_291,_292){ +var _293=this; +var _294=$.data(_293,"window"); +var opts=_294.options; +if(!opts.constrain){ +return {}; +} +if($.isFunction(opts.constrain)){ +return opts.constrain.call(_293,left,top,_291,_292); } -if(_276.shadow){ -_276.shadow.css("z-index",$.fn.window.defaults.zIndex++); +var win=$(_293).window("window"); +var _295=opts.inline?win.parent():$(window); +if(left<0){ +left=0; } -_276.window.css("z-index",$.fn.window.defaults.zIndex++); -if(!_276.proxy){ -_276.proxy=$("
        ").insertAfter(_276.window); +if(top<_295.scrollTop()){ +top=_295.scrollTop(); } -_276.proxy.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); -_276.proxy._outerWidth(_276.window._outerWidth()); -_276.proxy._outerHeight(_276.window._outerHeight()); -setTimeout(function(){ -if(_276.proxy){ -_276.proxy.show(); +if(left+_291>_295.width()){ +if(_291==win.outerWidth()){ +left=_295.width()-_291; +}else{ +_291=_295.width()-left; } -},500); +} +if(top-_295.scrollTop()+_292>_295.height()){ +if(_292==win.outerHeight()){ +top=_295.height()-_292+_295.scrollTop(); +}else{ +_292=_295.height()-top+_295.scrollTop(); +} +} +return {left:left,top:top,width:_291,height:_292}; +}; +function _296(_297){ +var _298=$.data(_297,"window"); +_298.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_298.options.draggable==false,onBeforeDrag:function(e){ +if(_298.mask){ +_298.mask.css("z-index",$.fn.window.defaults.zIndex++); +} +if(_298.shadow){ +_298.shadow.css("z-index",$.fn.window.defaults.zIndex++); +} +_298.window.css("z-index",$.fn.window.defaults.zIndex++); +},onStartDrag:function(e){ +_299(e); },onDrag:function(e){ -_276.proxy.css({display:"block",left:e.data.left,top:e.data.top}); +_29a(e); return false; },onStopDrag:function(e){ -_276.options.left=e.data.left; -_276.options.top=e.data.top; -$(_275).window("move"); -_276.proxy.remove(); -_276.proxy=null; +_29b(e,"move"); }}); -_276.window.resizable({disabled:_276.options.resizable==false,onStartResize:function(e){ -if(_276.pmask){ -_276.pmask.remove(); -} -_276.pmask=$("
        ").insertAfter(_276.window); -_276.pmask.css({zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_276.window._outerWidth(),height:_276.window._outerHeight()}); -if(_276.proxy){ -_276.proxy.remove(); -} -_276.proxy=$("
        ").insertAfter(_276.window); -_276.proxy.css({zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); -_276.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); +_298.window.resizable({disabled:_298.options.resizable==false,onStartResize:function(e){ +_299(e); },onResize:function(e){ -_276.proxy.css({left:e.data.left,top:e.data.top}); -_276.proxy._outerWidth(e.data.width); -_276.proxy._outerHeight(e.data.height); +_29a(e); return false; },onStopResize:function(e){ -$(_275).window("resize",e.data); -_276.pmask.remove(); -_276.pmask=null; -_276.proxy.remove(); -_276.proxy=null; +_29b(e,"resize"); }}); -}; -function _273(){ -if(document.compatMode=="BackCompat"){ -return {width:Math.max(document.body.scrollWidth,document.body.clientWidth),height:Math.max(document.body.scrollHeight,document.body.clientHeight)}; -}else{ -return {width:Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth),height:Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)}; +function _299(e){ +if(_298.pmask){ +_298.pmask.remove(); +} +_298.pmask=$("
        ").insertAfter(_298.window); +_298.pmask.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_298.window._outerWidth(),height:_298.window._outerHeight()}); +if(_298.proxy){ +_298.proxy.remove(); +} +_298.proxy=$("
        ").insertAfter(_298.window); +_298.proxy.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); +_298.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); +_298.proxy.hide(); +setTimeout(function(){ +if(_298.pmask){ +_298.pmask.show(); } +if(_298.proxy){ +_298.proxy.show(); +} +},500); +}; +function _29a(e){ +$.extend(e.data,_290.call(_297,e.data.left,e.data.top,e.data.width,e.data.height)); +_298.pmask.show(); +_298.proxy.css({display:"block",left:e.data.left,top:e.data.top}); +_298.proxy._outerWidth(e.data.width); +_298.proxy._outerHeight(e.data.height); +}; +function _29b(e,_29c){ +$.extend(e.data,_290.call(_297,e.data.left,e.data.top,e.data.width+0.1,e.data.height+0.1)); +$(_297).window(_29c,e.data); +_298.pmask.remove(); +_298.pmask=null; +_298.proxy.remove(); +_298.proxy=null; }; +}; +$(function(){ +if(!$._positionFixed){ $(window).resize(function(){ -$("body>div.window-mask").css({width:$(window)._outerWidth(),height:$(window)._outerHeight()}); +$("body>div.window-mask:visible").css({width:"",height:""}); setTimeout(function(){ -$("body>div.window-mask").css({width:_273().width,height:_273().height}); +$("body>div.window-mask:visible").css($.fn.window.getMaskSize()); },50); }); -$.fn.window=function(_277,_278){ -if(typeof _277=="string"){ -var _279=$.fn.window.methods[_277]; -if(_279){ -return _279(this,_278); +} +}); +$.fn.window=function(_29d,_29e){ +if(typeof _29d=="string"){ +var _29f=$.fn.window.methods[_29d]; +if(_29f){ +return _29f(this,_29e); }else{ -return this.panel(_277,_278); +return this.panel(_29d,_29e); } } -_277=_277||{}; +_29d=_29d||{}; return this.each(function(){ -var _27a=$.data(this,"window"); -if(_27a){ -$.extend(_27a.options,_277); +var _2a0=$.data(this,"window"); +if(_2a0){ +$.extend(_2a0.options,_29d); }else{ -_27a=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_277)}); -if(!_27a.options.inline){ +_2a0=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_29d)}); +if(!_2a0.options.inline){ document.body.appendChild(this); } } -_26d(this); -_274(this); +_289(this); +_296(this); }); }; $.fn.window.methods={options:function(jq){ -var _27b=jq.panel("options"); -var _27c=$.data(jq[0],"window").options; -return $.extend(_27c,{closed:_27b.closed,collapsed:_27b.collapsed,minimized:_27b.minimized,maximized:_27b.maximized}); +var _2a1=jq.panel("options"); +var _2a2=$.data(jq[0],"window").options; +return $.extend(_2a2,{closed:_2a1.closed,collapsed:_2a1.collapsed,minimized:_2a1.minimized,maximized:_2a1.maximized}); },window:function(jq){ return $.data(jq[0],"window").window; -},move:function(jq,_27d){ +},move:function(jq,_2a3){ return jq.each(function(){ -_25f(this,_27d); +_27b(this,_2a3); }); },hcenter:function(jq){ return jq.each(function(){ -_263(this,true); +_27f(this,true); }); },vcenter:function(jq){ return jq.each(function(){ -_268(this,true); +_284(this,true); }); },center:function(jq){ return jq.each(function(){ -_263(this); -_268(this); -_25f(this); +_27f(this); +_284(this); +_27b(this); }); }}; -$.fn.window.parseOptions=function(_27e){ -return $.extend({},$.fn.panel.parseOptions(_27e),$.parser.parseOptions(_27e,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}])); +$.fn.window.getMaskSize=function(_2a4){ +var _2a5=$(_2a4).data("window"); +if(_2a5&&_2a5.options.inline){ +return {}; +}else{ +if($._positionFixed){ +return {position:"fixed"}; +}else{ +return {width:$(document).width(),height:$(document).height()}; +} +} }; -$.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false}); +$.fn.window.parseOptions=function(_2a6){ +return $.extend({},$.fn.panel.parseOptions(_2a6),$.parser.parseOptions(_2a6,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}])); +}; +$.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,border:true,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false,constrain:false}); })(jQuery); (function($){ -function _27f(_280){ -var opts=$.data(_280,"dialog").options; +function _2a7(_2a8){ +var opts=$.data(_2a8,"dialog").options; opts.inited=false; -$(_280).window($.extend({},opts,{onResize:function(w,h){ +$(_2a8).window($.extend({},opts,{onResize:function(w,h){ if(opts.inited){ -_284(this); +_2ad(this); opts.onResize.call(this,w,h); } }})); -var win=$(_280).window("window"); +var win=$(_2a8).window("window"); if(opts.toolbar){ if($.isArray(opts.toolbar)){ -$(_280).siblings("div.dialog-toolbar").remove(); -var _281=$("
        ").appendTo(win); -var tr=_281.find("tr"); +$(_2a8).siblings("div.dialog-toolbar").remove(); +var _2a9=$("
        ").appendTo(win); +var tr=_2a9.find("tr"); for(var i=0;i
        ").appendTo(tr); }else{ var td=$("").appendTo(tr); -var tool=$("").appendTo(td); +var tool=$("").appendTo(td); tool[0].onclick=eval(btn.handler||function(){ }); tool.linkbutton($.extend({},btn,{plain:true})); @@ -3594,278 +3887,263 @@ $(opts.toolbar).addClass("dialog-toolbar").appendTo(win); $(opts.toolbar).show(); } }else{ -$(_280).siblings("div.dialog-toolbar").remove(); +$(_2a8).siblings("div.dialog-toolbar").remove(); } if(opts.buttons){ if($.isArray(opts.buttons)){ -$(_280).siblings("div.dialog-button").remove(); -var _282=$("
        ").appendTo(win); +$(_2a8).siblings("div.dialog-button").remove(); +var _2aa=$("
        ").appendTo(win); for(var i=0;i").appendTo(_282); +var _2ab=$("").appendTo(_2aa); if(p.handler){ -_283[0].onclick=p.handler; +_2ab[0].onclick=p.handler; } -_283.linkbutton(p); +_2ab.linkbutton(p); } }else{ $(opts.buttons).addClass("dialog-button").appendTo(win); $(opts.buttons).show(); } }else{ -$(_280).siblings("div.dialog-button").remove(); +$(_2a8).siblings("div.dialog-button").remove(); } opts.inited=true; +var _2ac=opts.closed; win.show(); -$(_280).window("resize"); -if(opts.closed){ +$(_2a8).window("resize"); +if(_2ac){ win.hide(); } }; -function _284(_285,_286){ -var t=$(_285); +function _2ad(_2ae,_2af){ +var t=$(_2ae); var opts=t.dialog("options"); -var _287=opts.noheader; +var _2b0=opts.noheader; var tb=t.siblings(".dialog-toolbar"); var bb=t.siblings(".dialog-button"); -tb.insertBefore(_285).css({position:"relative",borderTopWidth:(_287?1:0),top:(_287?tb.length:0)}); -bb.insertAfter(_285).css({position:"relative",top:-1}); +tb.insertBefore(_2ae).css({borderTopWidth:(_2b0?1:0),top:(_2b0?tb.length:0)}); +bb.insertAfter(_2ae); +tb.add(bb)._outerWidth(t._outerWidth()).find(".easyui-fluid:visible").each(function(){ +$(this).triggerHandler("_resize"); +}); +var _2b1=tb._outerHeight()+bb._outerHeight(); if(!isNaN(parseInt(opts.height))){ -t._outerHeight(t._outerHeight()-tb._outerHeight()-bb._outerHeight()); +t._outerHeight(t._outerHeight()-_2b1); +}else{ +var _2b2=t._size("min-height"); +if(_2b2){ +t._size("min-height",_2b2-_2b1); +} +var _2b3=t._size("max-height"); +if(_2b3){ +t._size("max-height",_2b3-_2b1); } -tb.add(bb)._outerWidth(t._outerWidth()); -var _288=$.data(_285,"window").shadow; -if(_288){ +} +var _2b4=$.data(_2ae,"window").shadow; +if(_2b4){ var cc=t.panel("panel"); -_288.css({width:cc._outerWidth(),height:cc._outerHeight()}); +_2b4.css({width:cc._outerWidth(),height:cc._outerHeight()}); } }; -$.fn.dialog=function(_289,_28a){ -if(typeof _289=="string"){ -var _28b=$.fn.dialog.methods[_289]; -if(_28b){ -return _28b(this,_28a); +$.fn.dialog=function(_2b5,_2b6){ +if(typeof _2b5=="string"){ +var _2b7=$.fn.dialog.methods[_2b5]; +if(_2b7){ +return _2b7(this,_2b6); }else{ -return this.window(_289,_28a); +return this.window(_2b5,_2b6); } } -_289=_289||{}; +_2b5=_2b5||{}; return this.each(function(){ -var _28c=$.data(this,"dialog"); -if(_28c){ -$.extend(_28c.options,_289); +var _2b8=$.data(this,"dialog"); +if(_2b8){ +$.extend(_2b8.options,_2b5); }else{ -$.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_289)}); +$.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_2b5)}); } -_27f(this); +_2a7(this); }); }; $.fn.dialog.methods={options:function(jq){ -var _28d=$.data(jq[0],"dialog").options; -var _28e=jq.panel("options"); -$.extend(_28d,{width:_28e.width,height:_28e.height,left:_28e.left,top:_28e.top,closed:_28e.closed,collapsed:_28e.collapsed,minimized:_28e.minimized,maximized:_28e.maximized}); -return _28d; +var _2b9=$.data(jq[0],"dialog").options; +var _2ba=jq.panel("options"); +$.extend(_2b9,{width:_2ba.width,height:_2ba.height,left:_2ba.left,top:_2ba.top,closed:_2ba.closed,collapsed:_2ba.collapsed,minimized:_2ba.minimized,maximized:_2ba.maximized}); +return _2b9; },dialog:function(jq){ return jq.window("window"); }}; -$.fn.dialog.parseOptions=function(_28f){ -return $.extend({},$.fn.window.parseOptions(_28f),$.parser.parseOptions(_28f,["toolbar","buttons"])); +$.fn.dialog.parseOptions=function(_2bb){ +var t=$(_2bb); +return $.extend({},$.fn.window.parseOptions(_2bb),$.parser.parseOptions(_2bb,["toolbar","buttons"]),{toolbar:(t.children(".dialog-toolbar").length?t.children(".dialog-toolbar").removeClass("dialog-toolbar"):undefined),buttons:(t.children(".dialog-button").length?t.children(".dialog-button").removeClass("dialog-button"):undefined)}); }; $.fn.dialog.defaults=$.extend({},$.fn.window.defaults,{title:"New Dialog",collapsible:false,minimizable:false,maximizable:false,resizable:false,toolbar:null,buttons:null}); })(jQuery); (function($){ -function show(el,type,_290,_291){ -var win=$(el).window("window"); -if(!win){ +function _2bc(){ +$(document).unbind(".messager").bind("keydown.messager",function(e){ +if(e.keyCode==27){ +$("body").children("div.messager-window").children("div.messager-body").each(function(){ +$(this).dialog("close"); +}); +}else{ +if(e.keyCode==9){ +var win=$("body").children("div.messager-window"); +if(!win.length){ return; } -switch(type){ -case null: -win.show(); -break; -case "slide": -win.slideDown(_290); -break; -case "fade": -win.fadeIn(_290); -break; -case "show": -win.show(_290); -break; -} -var _292=null; -if(_291>0){ -_292=setTimeout(function(){ -hide(el,type,_290); -},_291); +var _2bd=win.find(".messager-input,.messager-button .l-btn"); +for(var i=0;i<_2bd.length;i++){ +if($(_2bd[i]).is(":focus")){ +$(_2bd[i>=_2bd.length-1?0:i+1]).focus(); +return false; } -win.hover(function(){ -if(_292){ -clearTimeout(_292); } -},function(){ -if(_291>0){ -_292=setTimeout(function(){ -hide(el,type,_290); -},_291); +}else{ +if(e.keyCode==13){ +var _2be=$(e.target).closest("input.messager-input"); +if(_2be.length){ +var dlg=_2be.closest(".messager-body"); +_2bf(dlg,_2be.val()); } -}); -}; -function hide(el,type,_293){ -if(el.locked==true){ -return; } -el.locked=true; -var win=$(el).window("window"); -if(!win){ -return; } -switch(type){ -case null: -win.hide(); -break; -case "slide": -win.slideUp(_293); -break; -case "fade": -win.fadeOut(_293); -break; -case "show": -win.hide(_293); -break; } -setTimeout(function(){ -$(el).window("destroy"); -},_293); +}); }; -function _294(_295){ -var opts=$.extend({},$.fn.window.defaults,{collapsible:false,minimizable:false,maximizable:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},onBeforeOpen:function(){ -show(this,opts.showType,opts.showSpeed,opts.timeout); -return false; -},onBeforeClose:function(){ -hide(this,opts.showType,opts.showSpeed); -return false; -}},{title:"",width:250,height:100,showType:"slide",showSpeed:600,msg:"",timeout:4000},_295); -opts.style.zIndex=$.fn.window.defaults.zIndex++; -var win=$("
        ").html(opts.msg).appendTo("body"); -win.window(opts); -win.window("window").css(opts.style); -win.window("open"); -return win; +function _2c0(){ +$(document).unbind(".messager"); }; -function _296(_297,_298,_299){ -var win=$("
        ").appendTo("body"); -win.append(_298); -if(_299){ -var tb=$("
        ").appendTo(win); -for(var _29a in _299){ -$("").attr("href","javascript:void(0)").text(_29a).css("margin-left",10).bind("click",eval(_299[_29a])).appendTo(tb).linkbutton(); -} +function _2c1(_2c2){ +var opts=$.extend({},$.messager.defaults,{modal:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},title:"",width:250,height:100,minHeight:0,showType:"slide",showSpeed:600,content:_2c2.msg,timeout:4000},_2c2); +var dlg=$("
        ").appendTo("body"); +dlg.dialog($.extend({},opts,{noheader:(opts.title?false:true),openAnimation:(opts.showType),closeAnimation:(opts.showType=="show"?"hide":opts.showType),openDuration:opts.showSpeed,closeDuration:opts.showSpeed,onOpen:function(){ +dlg.dialog("dialog").hover(function(){ +if(opts.timer){ +clearTimeout(opts.timer); } -win.window({title:_297,noheader:(_297?false:true),width:300,height:"auto",modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,onClose:function(){ -setTimeout(function(){ -win.window("destroy"); -},100); -}}); -win.window("window").addClass("messager-window"); -win.children("div.messager-button").children("a:first").focus(); -return win; -}; -$.messager={show:function(_29b){ -return _294(_29b); -},alert:function(_29c,msg,icon,fn){ -var _29d="
        "+msg+"
        "; -switch(icon){ -case "error": -_29d="
        "+_29d; -break; -case "info": -_29d="
        "+_29d; -break; -case "question": -_29d="
        "+_29d; -break; -case "warning": -_29d="
        "+_29d; -break; +},function(){ +_2c3(); +}); +_2c3(); +function _2c3(){ +if(opts.timeout>0){ +opts.timer=setTimeout(function(){ +if(dlg.length&&dlg.data("dialog")){ +dlg.dialog("close"); } -_29d+="
        "; -var _29e={}; -_29e[$.messager.defaults.ok]=function(){ -win.window("close"); -if(fn){ -fn(); -return false; +},opts.timeout); } }; -var win=_296(_29c,_29d,_29e); -return win; -},confirm:function(_29f,msg,fn){ -var _2a0="
        "+"
        "+msg+"
        "+"
        "; -var _2a1={}; -_2a1[$.messager.defaults.ok]=function(){ -win.window("close"); -if(fn){ -fn(true); -return false; +if(_2c2.onOpen){ +_2c2.onOpen.call(this); +}else{ +opts.onOpen.call(this); } -}; -_2a1[$.messager.defaults.cancel]=function(){ -win.window("close"); -if(fn){ -fn(false); -return false; +},onClose:function(){ +if(opts.timer){ +clearTimeout(opts.timer); } -}; -var win=_296(_29f,_2a0,_2a1); -return win; -},prompt:function(_2a2,msg,fn){ -var _2a3="
        "+"
        "+msg+"
        "+"
        "+"
        "+"
        "; -var _2a4={}; -_2a4[$.messager.defaults.ok]=function(){ -win.window("close"); -if(fn){ -fn($(".messager-input",win).val()); -return false; +if(_2c2.onClose){ +_2c2.onClose.call(this); +}else{ +opts.onClose.call(this); } -}; -_2a4[$.messager.defaults.cancel]=function(){ -win.window("close"); -if(fn){ -fn(); -return false; +dlg.dialog("destroy"); +}})); +dlg.dialog("dialog").css(opts.style); +dlg.dialog("open"); +return dlg; +}; +function _2c4(_2c5){ +_2bc(); +var dlg=$("
        ").appendTo("body"); +dlg.dialog($.extend({},_2c5,{noheader:(_2c5.title?false:true),onClose:function(){ +_2c0(); +if(_2c5.onClose){ +_2c5.onClose.call(this); } -}; -var win=_296(_2a2,_2a3,_2a4); -win.children("input.messager-input").focus(); -return win; -},progress:function(_2a5){ -var _2a6={bar:function(){ +setTimeout(function(){ +dlg.dialog("destroy"); +},100); +}})); +var win=dlg.dialog("dialog").addClass("messager-window"); +win.find(".dialog-button").addClass("messager-button").find("a:first").focus(); +return dlg; +}; +function _2bf(dlg,_2c6){ +dlg.dialog("close"); +dlg.dialog("options").fn(_2c6); +}; +$.messager={show:function(_2c7){ +return _2c1(_2c7); +},alert:function(_2c8,msg,icon,fn){ +var opts=typeof _2c8=="object"?_2c8:{title:_2c8,msg:msg,icon:icon,fn:fn}; +var cls=opts.icon?"messager-icon messager-"+opts.icon:""; +opts=$.extend({},$.messager.defaults,{content:"
        "+"
        "+opts.msg+"
        "+"
        "},opts); +if(!opts.buttons){ +opts.buttons=[{text:opts.ok,onClick:function(){ +_2bf(dlg); +}}]; +} +var dlg=_2c4(opts); +return dlg; +},confirm:function(_2c9,msg,fn){ +var opts=typeof _2c9=="object"?_2c9:{title:_2c9,msg:msg,fn:fn}; +opts=$.extend({},$.messager.defaults,{content:"
        "+"
        "+opts.msg+"
        "+"
        "},opts); +if(!opts.buttons){ +opts.buttons=[{text:opts.ok,onClick:function(){ +_2bf(dlg,true); +}},{text:opts.cancel,onClick:function(){ +_2bf(dlg,false); +}}]; +} +var dlg=_2c4(opts); +return dlg; +},prompt:function(_2ca,msg,fn){ +var opts=typeof _2ca=="object"?_2ca:{title:_2ca,msg:msg,fn:fn}; +opts=$.extend({},$.messager.defaults,{content:"
        "+"
        "+opts.msg+"
        "+"
        "+"
        "+"
        "},opts); +if(!opts.buttons){ +opts.buttons=[{text:opts.ok,onClick:function(){ +_2bf(dlg,dlg.find(".messager-input").val()); +}},{text:opts.cancel,onClick:function(){ +_2bf(dlg); +}}]; +} +var dlg=_2c4(opts); +dlg.find(".messager-input").focus(); +return dlg; +},progress:function(_2cb){ +var _2cc={bar:function(){ return $("body>div.messager-window").find("div.messager-p-bar"); },close:function(){ -var win=$("body>div.messager-window>div.messager-body:has(div.messager-progress)"); -if(win.length){ -win.window("close"); +var dlg=$("body>div.messager-window>div.messager-body:has(div.messager-progress)"); +if(dlg.length){ +dlg.dialog("close"); } }}; -if(typeof _2a5=="string"){ -var _2a7=_2a6[_2a5]; -return _2a7(); -} -var opts=$.extend({title:"",msg:"",text:undefined,interval:300},_2a5||{}); -var _2a8="
        "; -var win=_296(opts.title,_2a8,null); -win.find("div.messager-p-msg").html(opts.msg); -var bar=win.find("div.messager-p-bar"); -bar.progressbar({text:opts.text}); -win.window({closable:false,onClose:function(){ +if(typeof _2cb=="string"){ +var _2cd=_2cc[_2cb]; +return _2cd(); +} +_2cb=_2cb||{}; +var opts=$.extend({},{title:"",minHeight:0,content:undefined,msg:"",text:undefined,interval:300},_2cb); +var dlg=_2c4($.extend({},$.messager.defaults,{content:"
        "+opts.msg+"
        ",closable:false,doSize:false},opts,{onClose:function(){ if(this.timer){ clearInterval(this.timer); } -$(this).window("destroy"); -}}); +if(_2cb.onClose){ +_2cb.onClose.call(this); +}else{ +$.messager.defaults.onClose.call(this); +} +}})); +var bar=dlg.find("div.messager-p-bar"); +bar.progressbar({text:opts.text}); +dlg.dialog("resize"); if(opts.interval){ -win[0].timer=setInterval(function(){ +dlg[0].timer=setInterval(function(){ var v=bar.progressbar("getValue"); v+=10; if(v>100){ @@ -3874,494 +4152,553 @@ v=0; bar.progressbar("setValue",v); },opts.interval); } -return win; +return dlg; }}; -$.messager.defaults={ok:"Ok",cancel:"Cancel"}; +$.messager.defaults=$.extend({},$.fn.dialog.defaults,{ok:"Ok",cancel:"Cancel",width:300,height:"auto",minHeight:150,modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,fn:function(){ +}}); })(jQuery); (function($){ -function _2a9(_2aa,_2ab){ -var _2ac=$.data(_2aa,"accordion"); -var opts=_2ac.options; -var _2ad=_2ac.panels; -var cc=$(_2aa); -if(_2ab){ -$.extend(opts,{width:_2ab.width,height:_2ab.height}); +function _2ce(_2cf,_2d0){ +var _2d1=$.data(_2cf,"accordion"); +var opts=_2d1.options; +var _2d2=_2d1.panels; +var cc=$(_2cf); +var _2d3=(opts.halign=="left"||opts.halign=="right"); +cc.children(".panel-last").removeClass("panel-last"); +cc.children(".panel:last").addClass("panel-last"); +if(_2d0){ +$.extend(opts,{width:_2d0.width,height:_2d0.height}); } cc._size(opts); -var _2ae=0; -var _2af="auto"; -var _2b0=cc.find(">div.panel>div.accordion-header"); -if(_2b0.length){ -_2ae=$(_2b0[0]).css("height","")._outerHeight(); +var _2d4=0; +var _2d5="auto"; +var _2d6=cc.find(">.panel>.accordion-header"); +if(_2d6.length){ +if(_2d3){ +$(_2d2[0]).panel("resize",{width:cc.width(),height:cc.height()}); +_2d4=$(_2d6[0])._outerWidth(); +}else{ +_2d4=$(_2d6[0]).css("height","")._outerHeight(); +} } if(!isNaN(parseInt(opts.height))){ -_2af=cc.height()-_2ae*_2b0.length; +if(_2d3){ +_2d5=cc.width()-_2d4*_2d6.length; +}else{ +_2d5=cc.height()-_2d4*_2d6.length; +} +} +_2d7(true,_2d5-_2d7(false)); +function _2d7(_2d8,_2d9){ +var _2da=0; +for(var i=0;i<_2d2.length;i++){ +var p=_2d2[i]; +if(_2d3){ +var h=p.panel("header")._outerWidth(_2d4); +}else{ +var h=p.panel("header")._outerHeight(_2d4); +} +if(p.panel("options").collapsible==_2d8){ +var _2db=isNaN(_2d9)?undefined:(_2d9+_2d4*h.length); +if(_2d3){ +p.panel("resize",{height:cc.height(),width:(_2d8?_2db:undefined)}); +_2da+=p.panel("panel")._outerWidth()-_2d4*h.length; +}else{ +p.panel("resize",{width:cc.width(),height:(_2d8?_2db:undefined)}); +_2da+=p.panel("panel").outerHeight()-_2d4*h.length; } -_2b1(true,_2af-_2b1(false)+1); -function _2b1(_2b2,_2b3){ -var _2b4=0; -for(var i=0;i<_2ad.length;i++){ -var p=_2ad[i]; -var h=p.panel("header")._outerHeight(_2ae); -if(p.panel("options").collapsible==_2b2){ -var _2b5=isNaN(_2b3)?undefined:(_2b3+_2ae*h.length); -p.panel("resize",{width:cc.width(),height:(_2b2?_2b5:undefined)}); -_2b4+=p.panel("panel").outerHeight()-_2ae*h.length; } } -return _2b4; +return _2da; }; }; -function _2b6(_2b7,_2b8,_2b9,all){ -var _2ba=$.data(_2b7,"accordion").panels; +function _2dc(_2dd,_2de,_2df,all){ +var _2e0=$.data(_2dd,"accordion").panels; var pp=[]; -for(var i=0;i<_2ba.length;i++){ -var p=_2ba[i]; -if(_2b8){ -if(p.panel("options")[_2b8]==_2b9){ +for(var i=0;i<_2e0.length;i++){ +var p=_2e0[i]; +if(_2de){ +if(p.panel("options")[_2de]==_2df){ pp.push(p); } }else{ -if(p[0]==$(_2b9)[0]){ +if(p[0]==$(_2df)[0]){ return i; } } } -if(_2b8){ +if(_2de){ return all?pp:(pp.length?pp[0]:null); }else{ return -1; } }; -function _2bb(_2bc){ -return _2b6(_2bc,"collapsed",false,true); +function _2e1(_2e2){ +return _2dc(_2e2,"collapsed",false,true); }; -function _2bd(_2be){ -var pp=_2bb(_2be); +function _2e3(_2e4){ +var pp=_2e1(_2e4); return pp.length?pp[0]:null; }; -function _2bf(_2c0,_2c1){ -return _2b6(_2c0,null,_2c1); +function _2e5(_2e6,_2e7){ +return _2dc(_2e6,null,_2e7); }; -function _2c2(_2c3,_2c4){ -var _2c5=$.data(_2c3,"accordion").panels; -if(typeof _2c4=="number"){ -if(_2c4<0||_2c4>=_2c5.length){ +function _2e8(_2e9,_2ea){ +var _2eb=$.data(_2e9,"accordion").panels; +if(typeof _2ea=="number"){ +if(_2ea<0||_2ea>=_2eb.length){ return null; }else{ -return _2c5[_2c4]; +return _2eb[_2ea]; } } -return _2b6(_2c3,"title",_2c4); +return _2dc(_2e9,"title",_2ea); }; -function _2c6(_2c7){ -var opts=$.data(_2c7,"accordion").options; -var cc=$(_2c7); +function _2ec(_2ed){ +var opts=$.data(_2ed,"accordion").options; +var cc=$(_2ed); if(opts.border){ cc.removeClass("accordion-noborder"); }else{ cc.addClass("accordion-noborder"); } }; -function init(_2c8){ -var _2c9=$.data(_2c8,"accordion"); -var cc=$(_2c8); +function init(_2ee){ +var _2ef=$.data(_2ee,"accordion"); +var cc=$(_2ee); cc.addClass("accordion"); -_2c9.panels=[]; +_2ef.panels=[]; cc.children("div").each(function(){ var opts=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); var pp=$(this); -_2c9.panels.push(pp); -_2cb(_2c8,pp,opts); +_2ef.panels.push(pp); +_2f1(_2ee,pp,opts); }); -cc.bind("_resize",function(e,_2ca){ -if($(this).hasClass("easyui-fluid")||_2ca){ -_2a9(_2c8); +cc.bind("_resize",function(e,_2f0){ +if($(this).hasClass("easyui-fluid")||_2f0){ +_2ce(_2ee); } return false; }); }; -function _2cb(_2cc,pp,_2cd){ -var opts=$.data(_2cc,"accordion").options; -pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body"},_2cd,{onBeforeExpand:function(){ -if(_2cd.onBeforeExpand){ -if(_2cd.onBeforeExpand.call(this)==false){ +function _2f1(_2f2,pp,_2f3){ +var opts=$.data(_2f2,"accordion").options; +pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body",halign:opts.halign},_2f3,{onBeforeExpand:function(){ +if(_2f3.onBeforeExpand){ +if(_2f3.onBeforeExpand.call(this)==false){ return false; } } if(!opts.multiple){ -var all=$.grep(_2bb(_2cc),function(p){ +var all=$.grep(_2e1(_2f2),function(p){ return p.panel("options").collapsible; }); for(var i=0;i.panel-last>.accordion-header").removeClass("accordion-header-border"); +if(_2f3.onExpand){ +_2f3.onExpand.call(this); } -opts.onSelect.call(_2cc,$(this).panel("options").title,_2bf(_2cc,this)); +opts.onSelect.call(_2f2,$(this).panel("options").title,_2e5(_2f2,this)); },onBeforeCollapse:function(){ -if(_2cd.onBeforeCollapse){ -if(_2cd.onBeforeCollapse.call(this)==false){ +if(_2f3.onBeforeCollapse){ +if(_2f3.onBeforeCollapse.call(this)==false){ return false; } } -var _2cf=$(this).panel("header"); -_2cf.removeClass("accordion-header-selected"); -_2cf.find(".accordion-collapse").addClass("accordion-expand"); +$(_2f2).find(">.panel-last>.accordion-header").addClass("accordion-header-border"); +var _2f5=$(this).panel("header"); +_2f5.removeClass("accordion-header-selected"); +_2f5.find(".accordion-collapse").addClass("accordion-expand"); },onCollapse:function(){ -if(_2cd.onCollapse){ -_2cd.onCollapse.call(this); +if(isNaN(parseInt(opts.height))){ +$(_2f2).find(">.panel-last>.accordion-header").removeClass("accordion-header-border"); +} +if(_2f3.onCollapse){ +_2f3.onCollapse.call(this); } -opts.onUnselect.call(_2cc,$(this).panel("options").title,_2bf(_2cc,this)); +opts.onUnselect.call(_2f2,$(this).panel("options").title,_2e5(_2f2,this)); }})); -var _2d0=pp.panel("header"); -var tool=_2d0.children("div.panel-tool"); +var _2f6=pp.panel("header"); +var tool=_2f6.children("div.panel-tool"); tool.children("a.panel-tool-collapse").hide(); -var t=$("").addClass("accordion-collapse accordion-expand").appendTo(tool); +var t=$("").addClass("accordion-collapse accordion-expand").appendTo(tool); t.bind("click",function(){ -var _2d1=_2bf(_2cc,pp); -if(pp.panel("options").collapsed){ -_2d2(_2cc,_2d1); -}else{ -_2d6(_2cc,_2d1); -} +_2f7(pp); return false; }); pp.panel("options").collapsible?t.show():t.hide(); -_2d0.click(function(){ -$(this).find("a.accordion-collapse:visible").triggerHandler("click"); +if(opts.halign=="left"||opts.halign=="right"){ +t.hide(); +} +_2f6.click(function(){ +_2f7(pp); return false; }); +function _2f7(p){ +var _2f8=p.panel("options"); +if(_2f8.collapsible){ +var _2f9=_2e5(_2f2,p); +if(_2f8.collapsed){ +_2fa(_2f2,_2f9); +}else{ +_2fb(_2f2,_2f9); +} +} }; -function _2d2(_2d3,_2d4){ -var p=_2c2(_2d3,_2d4); +}; +function _2fa(_2fc,_2fd){ +var p=_2e8(_2fc,_2fd); if(!p){ return; } -_2d5(_2d3); -var opts=$.data(_2d3,"accordion").options; +_2fe(_2fc); +var opts=$.data(_2fc,"accordion").options; p.panel("expand",opts.animate); }; -function _2d6(_2d7,_2d8){ -var p=_2c2(_2d7,_2d8); +function _2fb(_2ff,_300){ +var p=_2e8(_2ff,_300); if(!p){ return; } -_2d5(_2d7); -var opts=$.data(_2d7,"accordion").options; +_2fe(_2ff); +var opts=$.data(_2ff,"accordion").options; p.panel("collapse",opts.animate); }; -function _2d9(_2da){ -var opts=$.data(_2da,"accordion").options; -var p=_2b6(_2da,"selected",true); +function _301(_302){ +var opts=$.data(_302,"accordion").options; +$(_302).find(">.panel-last>.accordion-header").addClass("accordion-header-border"); +var p=_2dc(_302,"selected",true); if(p){ -_2db(_2bf(_2da,p)); +_303(_2e5(_302,p)); }else{ -_2db(opts.selected); +_303(opts.selected); } -function _2db(_2dc){ -var _2dd=opts.animate; +function _303(_304){ +var _305=opts.animate; opts.animate=false; -_2d2(_2da,_2dc); -opts.animate=_2dd; +_2fa(_302,_304); +opts.animate=_305; }; }; -function _2d5(_2de){ -var _2df=$.data(_2de,"accordion").panels; -for(var i=0;i<_2df.length;i++){ -_2df[i].stop(true,true); +function _2fe(_306){ +var _307=$.data(_306,"accordion").panels; +for(var i=0;i<_307.length;i++){ +_307[i].stop(true,true); } }; -function add(_2e0,_2e1){ -var _2e2=$.data(_2e0,"accordion"); -var opts=_2e2.options; -var _2e3=_2e2.panels; -if(_2e1.selected==undefined){ -_2e1.selected=true; +function add(_308,_309){ +var _30a=$.data(_308,"accordion"); +var opts=_30a.options; +var _30b=_30a.panels; +if(_309.selected==undefined){ +_309.selected=true; } -_2d5(_2e0); -var pp=$("
        ").appendTo(_2e0); -_2e3.push(pp); -_2cb(_2e0,pp,_2e1); -_2a9(_2e0); -opts.onAdd.call(_2e0,_2e1.title,_2e3.length-1); -if(_2e1.selected){ -_2d2(_2e0,_2e3.length-1); +_2fe(_308); +var pp=$("
        ").appendTo(_308); +_30b.push(pp); +_2f1(_308,pp,_309); +_2ce(_308); +opts.onAdd.call(_308,_309.title,_30b.length-1); +if(_309.selected){ +_2fa(_308,_30b.length-1); } }; -function _2e4(_2e5,_2e6){ -var _2e7=$.data(_2e5,"accordion"); -var opts=_2e7.options; -var _2e8=_2e7.panels; -_2d5(_2e5); -var _2e9=_2c2(_2e5,_2e6); -var _2ea=_2e9.panel("options").title; -var _2eb=_2bf(_2e5,_2e9); -if(!_2e9){ +function _30c(_30d,_30e){ +var _30f=$.data(_30d,"accordion"); +var opts=_30f.options; +var _310=_30f.panels; +_2fe(_30d); +var _311=_2e8(_30d,_30e); +var _312=_311.panel("options").title; +var _313=_2e5(_30d,_311); +if(!_311){ return; } -if(opts.onBeforeRemove.call(_2e5,_2ea,_2eb)==false){ +if(opts.onBeforeRemove.call(_30d,_312,_313)==false){ return; } -_2e8.splice(_2eb,1); -_2e9.panel("destroy"); -if(_2e8.length){ -_2a9(_2e5); -var curr=_2bd(_2e5); +_310.splice(_313,1); +_311.panel("destroy"); +if(_310.length){ +_2ce(_30d); +var curr=_2e3(_30d); if(!curr){ -_2d2(_2e5,0); +_2fa(_30d,0); } } -opts.onRemove.call(_2e5,_2ea,_2eb); +opts.onRemove.call(_30d,_312,_313); }; -$.fn.accordion=function(_2ec,_2ed){ -if(typeof _2ec=="string"){ -return $.fn.accordion.methods[_2ec](this,_2ed); +$.fn.accordion=function(_314,_315){ +if(typeof _314=="string"){ +return $.fn.accordion.methods[_314](this,_315); } -_2ec=_2ec||{}; +_314=_314||{}; return this.each(function(){ -var _2ee=$.data(this,"accordion"); -if(_2ee){ -$.extend(_2ee.options,_2ec); +var _316=$.data(this,"accordion"); +if(_316){ +$.extend(_316.options,_314); }else{ -$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_2ec),accordion:$(this).addClass("accordion"),panels:[]}); +$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_314),accordion:$(this).addClass("accordion"),panels:[]}); init(this); } -_2c6(this); -_2a9(this); -_2d9(this); +_2ec(this); +_2ce(this); +_301(this); }); }; $.fn.accordion.methods={options:function(jq){ return $.data(jq[0],"accordion").options; },panels:function(jq){ return $.data(jq[0],"accordion").panels; -},resize:function(jq,_2ef){ +},resize:function(jq,_317){ return jq.each(function(){ -_2a9(this,_2ef); +_2ce(this,_317); }); },getSelections:function(jq){ -return _2bb(jq[0]); +return _2e1(jq[0]); },getSelected:function(jq){ -return _2bd(jq[0]); -},getPanel:function(jq,_2f0){ -return _2c2(jq[0],_2f0); -},getPanelIndex:function(jq,_2f1){ -return _2bf(jq[0],_2f1); -},select:function(jq,_2f2){ +return _2e3(jq[0]); +},getPanel:function(jq,_318){ +return _2e8(jq[0],_318); +},getPanelIndex:function(jq,_319){ +return _2e5(jq[0],_319); +},select:function(jq,_31a){ return jq.each(function(){ -_2d2(this,_2f2); +_2fa(this,_31a); }); -},unselect:function(jq,_2f3){ +},unselect:function(jq,_31b){ return jq.each(function(){ -_2d6(this,_2f3); +_2fb(this,_31b); }); -},add:function(jq,_2f4){ +},add:function(jq,_31c){ return jq.each(function(){ -add(this,_2f4); +add(this,_31c); }); -},remove:function(jq,_2f5){ +},remove:function(jq,_31d){ return jq.each(function(){ -_2e4(this,_2f5); +_30c(this,_31d); }); }}; -$.fn.accordion.parseOptions=function(_2f6){ -var t=$(_2f6); -return $.extend({},$.parser.parseOptions(_2f6,["width","height",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}])); -}; -$.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,onSelect:function(_2f7,_2f8){ -},onUnselect:function(_2f9,_2fa){ -},onAdd:function(_2fb,_2fc){ -},onBeforeRemove:function(_2fd,_2fe){ -},onRemove:function(_2ff,_300){ +$.fn.accordion.parseOptions=function(_31e){ +var t=$(_31e); +return $.extend({},$.parser.parseOptions(_31e,["width","height","halign",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}])); +}; +$.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,halign:"top",onSelect:function(_31f,_320){ +},onUnselect:function(_321,_322){ +},onAdd:function(_323,_324){ +},onBeforeRemove:function(_325,_326){ +},onRemove:function(_327,_328){ }}; })(jQuery); (function($){ -function _301(_302){ -var opts=$.data(_302,"tabs").options; +function _329(c){ +var w=0; +$(c).children().each(function(){ +w+=$(this).outerWidth(true); +}); +return w; +}; +function _32a(_32b){ +var opts=$.data(_32b,"tabs").options; if(opts.tabPosition=="left"||opts.tabPosition=="right"||!opts.showHeader){ return; } -var _303=$(_302).children("div.tabs-header"); -var tool=_303.children("div.tabs-tool"); -var _304=_303.children("div.tabs-scroller-left"); -var _305=_303.children("div.tabs-scroller-right"); -var wrap=_303.children("div.tabs-wrap"); -var _306=_303.outerHeight(); +var _32c=$(_32b).children("div.tabs-header"); +var tool=_32c.children("div.tabs-tool:not(.tabs-tool-hidden)"); +var _32d=_32c.children("div.tabs-scroller-left"); +var _32e=_32c.children("div.tabs-scroller-right"); +var wrap=_32c.children("div.tabs-wrap"); +var _32f=_32c.outerHeight(); if(opts.plain){ -_306-=_306-_303.height(); +_32f-=_32f-_32c.height(); } -tool._outerHeight(_306); -var _307=0; -$("ul.tabs li",_303).each(function(){ -_307+=$(this).outerWidth(true); -}); -var _308=_303.width()-tool._outerWidth(); -if(_307>_308){ -_304.add(_305).show()._outerHeight(_306); +tool._outerHeight(_32f); +var _330=_329(_32c.find("ul.tabs")); +var _331=_32c.width()-tool._outerWidth(); +if(_330>_331){ +_32d.add(_32e).show()._outerHeight(_32f); if(opts.toolPosition=="left"){ -tool.css({left:_304.outerWidth(),right:""}); -wrap.css({marginLeft:_304.outerWidth()+tool._outerWidth(),marginRight:_305._outerWidth(),width:_308-_304.outerWidth()-_305.outerWidth()}); +tool.css({left:_32d.outerWidth(),right:""}); +wrap.css({marginLeft:_32d.outerWidth()+tool._outerWidth(),marginRight:_32e._outerWidth(),width:_331-_32d.outerWidth()-_32e.outerWidth()}); }else{ -tool.css({left:"",right:_305.outerWidth()}); -wrap.css({marginLeft:_304.outerWidth(),marginRight:_305.outerWidth()+tool._outerWidth(),width:_308-_304.outerWidth()-_305.outerWidth()}); +tool.css({left:"",right:_32e.outerWidth()}); +wrap.css({marginLeft:_32d.outerWidth(),marginRight:_32e.outerWidth()+tool._outerWidth(),width:_331-_32d.outerWidth()-_32e.outerWidth()}); } }else{ -_304.add(_305).hide(); +_32d.add(_32e).hide(); if(opts.toolPosition=="left"){ tool.css({left:0,right:""}); -wrap.css({marginLeft:tool._outerWidth(),marginRight:0,width:_308}); +wrap.css({marginLeft:tool._outerWidth(),marginRight:0,width:_331}); }else{ tool.css({left:"",right:0}); -wrap.css({marginLeft:0,marginRight:tool._outerWidth(),width:_308}); +wrap.css({marginLeft:0,marginRight:tool._outerWidth(),width:_331}); } } }; -function _309(_30a){ -var opts=$.data(_30a,"tabs").options; -var _30b=$(_30a).children("div.tabs-header"); +function _332(_333){ +var opts=$.data(_333,"tabs").options; +var _334=$(_333).children("div.tabs-header"); if(opts.tools){ if(typeof opts.tools=="string"){ -$(opts.tools).addClass("tabs-tool").appendTo(_30b); +$(opts.tools).addClass("tabs-tool").appendTo(_334); $(opts.tools).show(); }else{ -_30b.children("div.tabs-tool").remove(); -var _30c=$("
        ").appendTo(_30b); -var tr=_30c.find("tr"); +_334.children("div.tabs-tool").remove(); +var _335=$("
        ").appendTo(_334); +var tr=_335.find("tr"); for(var i=0;i").appendTo(tr); -var tool=$("").appendTo(td); +var tool=$("").appendTo(td); tool[0].onclick=eval(opts.tools[i].handler||function(){ }); tool.linkbutton($.extend({},opts.tools[i],{plain:true})); } } }else{ -_30b.children("div.tabs-tool").remove(); +_334.children("div.tabs-tool").remove(); } }; -function _30d(_30e,_30f){ -var _310=$.data(_30e,"tabs"); -var opts=_310.options; -var cc=$(_30e); -if(_30f){ -$.extend(opts,{width:_30f.width,height:_30f.height}); +function _336(_337,_338){ +var _339=$.data(_337,"tabs"); +var opts=_339.options; +var cc=$(_337); +if(!opts.doSize){ +return; +} +if(_338){ +$.extend(opts,{width:_338.width,height:_338.height}); } cc._size(opts); -var _311=cc.children("div.tabs-header"); -var _312=cc.children("div.tabs-panels"); -var wrap=_311.find("div.tabs-wrap"); +var _33a=cc.children("div.tabs-header"); +var _33b=cc.children("div.tabs-panels"); +var wrap=_33a.find("div.tabs-wrap"); var ul=wrap.find(".tabs"); -for(var i=0;i<_310.tabs.length;i++){ -var _313=_310.tabs[i].panel("options"); -var p_t=_313.tab.find("a.tabs-inner"); -var _314=parseInt(_313.tabWidth||opts.tabWidth)||undefined; -if(_314){ -p_t._outerWidth(_314); -}else{ -p_t.css("width",""); -} -p_t._outerHeight(opts.tabHeight); -p_t.css("lineHeight",p_t.height()+"px"); -} +ul.children("li").removeClass("tabs-first tabs-last"); +ul.children("li:first").addClass("tabs-first"); +ul.children("li:last").addClass("tabs-last"); if(opts.tabPosition=="left"||opts.tabPosition=="right"){ -_311._outerWidth(opts.showHeader?opts.headerWidth:0); -_312._outerWidth(cc.width()-_311.outerWidth()); -_311.add(_312)._outerHeight(opts.height); -wrap._outerWidth(_311.width()); +_33a._outerWidth(opts.showHeader?opts.headerWidth:0); +_33b._outerWidth(cc.width()-_33a.outerWidth()); +_33a.add(_33b)._size("height",isNaN(parseInt(opts.height))?"":cc.height()); +wrap._outerWidth(_33a.width()); ul._outerWidth(wrap.width()).css("height",""); }else{ -var lrt=_311.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool"); -_311._outerWidth(opts.width).css("height",""); +_33a.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)").css("display",opts.showHeader?"block":"none"); +_33a._outerWidth(cc.width()).css("height",""); if(opts.showHeader){ -_311.css("background-color",""); +_33a.css("background-color",""); wrap.css("height",""); -lrt.show(); }else{ -_311.css("background-color","transparent"); -_311._outerHeight(0); +_33a.css("background-color","transparent"); +_33a._outerHeight(0); wrap._outerHeight(0); -lrt.hide(); } ul._outerHeight(opts.tabHeight).css("width",""); -_301(_30e); -_312._size("height",isNaN(opts.height)?"":(opts.height-_311.outerHeight())); -_312._size("width",isNaN(opts.width)?"":opts.width); +ul._outerHeight(ul.outerHeight()-ul.height()-1+opts.tabHeight).css("width",""); +_33b._size("height",isNaN(parseInt(opts.height))?"":(cc.height()-_33a.outerHeight())); +_33b._size("width",cc.width()); +} +if(_339.tabs.length){ +var d1=ul.outerWidth(true)-ul.width(); +var li=ul.children("li:first"); +var d2=li.outerWidth(true)-li.width(); +var _33c=_33a.width()-_33a.children(".tabs-tool:not(.tabs-tool-hidden)")._outerWidth(); +var _33d=Math.floor((_33c-d1-d2*_339.tabs.length)/_339.tabs.length); +$.map(_339.tabs,function(p){ +_33e(p,(opts.justified&&$.inArray(opts.tabPosition,["top","bottom"])>=0)?_33d:undefined); +}); +if(opts.justified&&$.inArray(opts.tabPosition,["top","bottom"])>=0){ +var _33f=_33c-d1-_329(ul); +_33e(_339.tabs[_339.tabs.length-1],_33d+_33f); +} +} +_32a(_337); +function _33e(p,_340){ +var _341=p.panel("options"); +var p_t=_341.tab.find("a.tabs-inner"); +var _340=_340?_340:(parseInt(_341.tabWidth||opts.tabWidth||undefined)); +if(_340){ +p_t._outerWidth(_340); +}else{ +p_t.css("width",""); } +p_t._outerHeight(opts.tabHeight); +p_t.css("lineHeight",p_t.height()+"px"); +p_t.find(".easyui-fluid:visible").triggerHandler("_resize"); }; -function _315(_316){ -var opts=$.data(_316,"tabs").options; -var tab=_317(_316); +}; +function _342(_343){ +var opts=$.data(_343,"tabs").options; +var tab=_344(_343); if(tab){ -var _318=$(_316).children("div.tabs-panels"); -var _319=opts.width=="auto"?"auto":_318.width(); -var _31a=opts.height=="auto"?"auto":_318.height(); -tab.panel("resize",{width:_319,height:_31a}); +var _345=$(_343).children("div.tabs-panels"); +var _346=opts.width=="auto"?"auto":_345.width(); +var _347=opts.height=="auto"?"auto":_345.height(); +tab.panel("resize",{width:_346,height:_347}); } }; -function _31b(_31c){ -var tabs=$.data(_31c,"tabs").tabs; -var cc=$(_31c); -cc.addClass("tabs-container"); -var pp=$("
        ").insertBefore(cc); +function _348(_349){ +var tabs=$.data(_349,"tabs").tabs; +var cc=$(_349).addClass("tabs-container"); +var _34a=$("
        ").insertBefore(cc); cc.children("div").each(function(){ -pp[0].appendChild(this); +_34a[0].appendChild(this); }); -cc[0].appendChild(pp[0]); -$("
        "+"
        "+"
        "+"
        "+"
          "+"
          "+"
          ").prependTo(_31c); +cc[0].appendChild(_34a[0]); +$("
          "+"
          "+"
          "+"
          "+"
            "+"
            "+"
            ").prependTo(_349); cc.children("div.tabs-panels").children("div").each(function(i){ -var opts=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); -var pp=$(this); -tabs.push(pp); -_329(_31c,pp,opts); +var opts=$.extend({},$.parser.parseOptions(this),{disabled:($(this).attr("disabled")?true:undefined),selected:($(this).attr("selected")?true:undefined)}); +_357(_349,opts,$(this)); }); cc.children("div.tabs-header").find(".tabs-scroller-left, .tabs-scroller-right").hover(function(){ $(this).addClass("tabs-scroller-over"); },function(){ $(this).removeClass("tabs-scroller-over"); }); -cc.bind("_resize",function(e,_31d){ -if($(this).hasClass("easyui-fluid")||_31d){ -_30d(_31c); -_315(_31c); +cc.bind("_resize",function(e,_34b){ +if($(this).hasClass("easyui-fluid")||_34b){ +_336(_349); +_342(_349); } return false; }); }; -function _31e(_31f){ -var _320=$.data(_31f,"tabs"); -var opts=_320.options; -$(_31f).children("div.tabs-header").unbind().bind("click",function(e){ +function _34c(_34d){ +var _34e=$.data(_34d,"tabs"); +var opts=_34e.options; +$(_34d).children("div.tabs-header").unbind().bind("click",function(e){ if($(e.target).hasClass("tabs-scroller-left")){ -$(_31f).tabs("scrollBy",-opts.scrollIncrement); +$(_34d).tabs("scrollBy",-opts.scrollIncrement); }else{ if($(e.target).hasClass("tabs-scroller-right")){ -$(_31f).tabs("scrollBy",opts.scrollIncrement); +$(_34d).tabs("scrollBy",opts.scrollIncrement); }else{ var li=$(e.target).closest("li"); if(li.hasClass("tabs-disabled")){ -return; +return false; } var a=$(e.target).closest("a.tabs-close"); if(a.length){ -_33b(_31f,_321(li)); +_370(_34d,_34f(li)); }else{ if(li.length){ -var _322=_321(li); -var _323=_320.tabs[_322].panel("options"); -if(_323.collapsible){ -_323.closed?_331(_31f,_322):_352(_31f,_322); +var _350=_34f(li); +var _351=_34e.tabs[_350].panel("options"); +if(_351.collapsible){ +_351.closed?_367(_34d,_350):_384(_34d,_350); }else{ -_331(_31f,_322); +_367(_34d,_350); } } } +return false; } } }).bind("contextmenu",function(e){ @@ -4370,130 +4707,204 @@ if(li.hasClass("tabs-disabled")){ return; } if(li.length){ -opts.onContextMenu.call(_31f,e,li.find("span.tabs-title").html(),_321(li)); +opts.onContextMenu.call(_34d,e,li.find("span.tabs-title").html(),_34f(li)); } }); -function _321(li){ -var _324=0; +function _34f(li){ +var _352=0; li.parent().children("li").each(function(i){ if(li[0]==this){ -_324=i; +_352=i; return false; } }); -return _324; +return _352; }; }; -function _325(_326){ -var opts=$.data(_326,"tabs").options; -var _327=$(_326).children("div.tabs-header"); -var _328=$(_326).children("div.tabs-panels"); -_327.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right"); -_328.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right"); +function _353(_354){ +var opts=$.data(_354,"tabs").options; +var _355=$(_354).children("div.tabs-header"); +var _356=$(_354).children("div.tabs-panels"); +_355.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right"); +_356.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right"); if(opts.tabPosition=="top"){ -_327.insertBefore(_328); +_355.insertBefore(_356); }else{ if(opts.tabPosition=="bottom"){ -_327.insertAfter(_328); -_327.addClass("tabs-header-bottom"); -_328.addClass("tabs-panels-top"); +_355.insertAfter(_356); +_355.addClass("tabs-header-bottom"); +_356.addClass("tabs-panels-top"); }else{ if(opts.tabPosition=="left"){ -_327.addClass("tabs-header-left"); -_328.addClass("tabs-panels-right"); +_355.addClass("tabs-header-left"); +_356.addClass("tabs-panels-right"); }else{ if(opts.tabPosition=="right"){ -_327.addClass("tabs-header-right"); -_328.addClass("tabs-panels-left"); +_355.addClass("tabs-header-right"); +_356.addClass("tabs-panels-left"); } } } } if(opts.plain==true){ -_327.addClass("tabs-header-plain"); +_355.addClass("tabs-header-plain"); }else{ -_327.removeClass("tabs-header-plain"); +_355.removeClass("tabs-header-plain"); } +_355.removeClass("tabs-header-narrow").addClass(opts.narrow?"tabs-header-narrow":""); +var tabs=_355.find(".tabs"); +tabs.removeClass("tabs-pill").addClass(opts.pill?"tabs-pill":""); +tabs.removeClass("tabs-narrow").addClass(opts.narrow?"tabs-narrow":""); +tabs.removeClass("tabs-justified").addClass(opts.justified?"tabs-justified":""); if(opts.border==true){ -_327.removeClass("tabs-header-noborder"); -_328.removeClass("tabs-panels-noborder"); +_355.removeClass("tabs-header-noborder"); +_356.removeClass("tabs-panels-noborder"); }else{ -_327.addClass("tabs-header-noborder"); -_328.addClass("tabs-panels-noborder"); +_355.addClass("tabs-header-noborder"); +_356.addClass("tabs-panels-noborder"); } +opts.doSize=true; }; -function _329(_32a,pp,_32b){ -var _32c=$.data(_32a,"tabs"); -_32b=_32b||{}; -pp.panel($.extend({},_32b,{border:false,noheader:true,closed:true,doSize:false,iconCls:(_32b.icon?_32b.icon:undefined),onLoad:function(){ -if(_32b.onLoad){ -_32b.onLoad.call(this,arguments); +function _357(_358,_359,pp){ +_359=_359||{}; +var _35a=$.data(_358,"tabs"); +var tabs=_35a.tabs; +if(_359.index==undefined||_359.index>tabs.length){ +_359.index=tabs.length; } -_32c.options.onLoad.call(_32a,$(this)); -}})); -var opts=pp.panel("options"); -var tabs=$(_32a).children("div.tabs-header").find("ul.tabs"); -opts.tab=$("
          • ").appendTo(tabs); -opts.tab.append(""+""+""+""); -$(_32a).tabs("update",{tab:pp,options:opts,type:"header"}); -}; -function _32d(_32e,_32f){ -var _330=$.data(_32e,"tabs"); -var opts=_330.options; -var tabs=_330.tabs; -if(_32f.selected==undefined){ -_32f.selected=true; -} -var pp=$("
            ").appendTo($(_32e).children("div.tabs-panels")); +if(_359.index<0){ +_359.index=0; +} +var ul=$(_358).children("div.tabs-header").find("ul.tabs"); +var _35b=$(_358).children("div.tabs-panels"); +var tab=$("
          • "+""+""+""+""+"
          • "); +if(!pp){ +pp=$("
            "); +} +if(_359.index>=tabs.length){ +tab.appendTo(ul); +pp.appendTo(_35b); tabs.push(pp); -_329(_32e,pp,_32f); -opts.onAdd.call(_32e,_32f.title,tabs.length-1); -_30d(_32e); -if(_32f.selected){ -_331(_32e,tabs.length-1); -} -}; -function _332(_333,_334){ -_334.type=_334.type||"all"; -var _335=$.data(_333,"tabs").selectHis; -var pp=_334.tab; -var _336=pp.panel("options").title; -if(_334.type=="all"||_334=="body"){ -pp.panel($.extend({},_334.options,{iconCls:(_334.options.icon?_334.options.icon:undefined)})); -} -if(_334.type=="all"||_334.type=="header"){ +}else{ +tab.insertBefore(ul.children("li:eq("+_359.index+")")); +pp.insertBefore(_35b.children("div.panel:eq("+_359.index+")")); +tabs.splice(_359.index,0,pp); +} +pp.panel($.extend({},_359,{tab:tab,border:false,noheader:true,closed:true,doSize:false,iconCls:(_359.icon?_359.icon:undefined),onLoad:function(){ +if(_359.onLoad){ +_359.onLoad.call(this,arguments); +} +_35a.options.onLoad.call(_358,$(this)); +},onBeforeOpen:function(){ +if(_359.onBeforeOpen){ +if(_359.onBeforeOpen.call(this)==false){ +return false; +} +} +var p=$(_358).tabs("getSelected"); +if(p){ +if(p[0]!=this){ +$(_358).tabs("unselect",_362(_358,p)); +p=$(_358).tabs("getSelected"); +if(p){ +return false; +} +}else{ +_342(_358); +return false; +} +} +var _35c=$(this).panel("options"); +_35c.tab.addClass("tabs-selected"); +var wrap=$(_358).find(">div.tabs-header>div.tabs-wrap"); +var left=_35c.tab.position().left; +var _35d=left+_35c.tab.outerWidth(); +if(left<0||_35d>wrap.width()){ +var _35e=left-(wrap.width()-_35c.tab.width())/2; +$(_358).tabs("scrollBy",_35e); +}else{ +$(_358).tabs("scrollBy",0); +} +var _35f=$(this).panel("panel"); +_35f.css("display","block"); +_342(_358); +_35f.css("display","none"); +},onOpen:function(){ +if(_359.onOpen){ +_359.onOpen.call(this); +} +var _360=$(this).panel("options"); +_35a.selectHis.push(_360.title); +_35a.options.onSelect.call(_358,_360.title,_362(_358,this)); +},onBeforeClose:function(){ +if(_359.onBeforeClose){ +if(_359.onBeforeClose.call(this)==false){ +return false; +} +} +$(this).panel("options").tab.removeClass("tabs-selected"); +},onClose:function(){ +if(_359.onClose){ +_359.onClose.call(this); +} +var _361=$(this).panel("options"); +_35a.options.onUnselect.call(_358,_361.title,_362(_358,this)); +}})); +$(_358).tabs("update",{tab:pp,options:pp.panel("options"),type:"header"}); +}; +function _363(_364,_365){ +var _366=$.data(_364,"tabs"); +var opts=_366.options; +if(_365.selected==undefined){ +_365.selected=true; +} +_357(_364,_365); +opts.onAdd.call(_364,_365.title,_365.index); +if(_365.selected){ +_367(_364,_365.index); +} +}; +function _368(_369,_36a){ +_36a.type=_36a.type||"all"; +var _36b=$.data(_369,"tabs").selectHis; +var pp=_36a.tab; var opts=pp.panel("options"); +var _36c=opts.title; +$.extend(opts,_36a.options,{iconCls:(_36a.options.icon?_36a.options.icon:undefined)}); +if(_36a.type=="all"||_36a.type=="body"){ +pp.panel(); +} +if(_36a.type=="all"||_36a.type=="header"){ var tab=opts.tab; -var _337=tab.find("span.tabs-title"); -var _338=tab.find("span.tabs-icon"); -_337.html(opts.title); -_338.attr("class","tabs-icon"); +if(opts.header){ +tab.find(".tabs-inner").html($(opts.header)); +}else{ +var _36d=tab.find("span.tabs-title"); +var _36e=tab.find("span.tabs-icon"); +_36d.html(opts.title); +_36e.attr("class","tabs-icon"); tab.find("a.tabs-close").remove(); if(opts.closable){ -_337.addClass("tabs-closable"); -$("").appendTo(tab); +_36d.addClass("tabs-closable"); +$("").appendTo(tab); }else{ -_337.removeClass("tabs-closable"); +_36d.removeClass("tabs-closable"); } if(opts.iconCls){ -_337.addClass("tabs-with-icon"); -_338.addClass(opts.iconCls); +_36d.addClass("tabs-with-icon"); +_36e.addClass(opts.iconCls); }else{ -_337.removeClass("tabs-with-icon"); -} -if(_336!=opts.title){ -for(var i=0;i<_335.length;i++){ -if(_335[i]==_336){ -_335[i]=opts.title; -} -} +_36d.removeClass("tabs-with-icon"); } -tab.find("span.tabs-p-tool").remove(); if(opts.tools){ -var _339=$("").insertAfter(tab.find("a.tabs-inner")); +var _36f=tab.find("span.tabs-p-tool"); +if(!_36f.length){ +var _36f=$("").insertAfter(tab.find("a.tabs-inner")); +} if($.isArray(opts.tools)){ +_36f.empty(); for(var i=0;i").appendTo(_339); +var t=$("").appendTo(_36f); t.addClass(opts.tools[i].iconCls); if(opts.tools[i].handler){ t.bind("click",{handler:opts.tools[i].handler},function(e){ @@ -4505,80 +4916,100 @@ e.data.handler.call(this); } } }else{ -$(opts.tools).children().appendTo(_339); +$(opts.tools).children().appendTo(_36f); } -var pr=_339.children().length*12; +var pr=_36f.children().length*12; if(opts.closable){ pr+=8; +_36f.css("right",""); }else{ pr-=3; -_339.css("right","5px"); +_36f.css("right","5px"); +} +_36d.css("padding-right",pr+"px"); +}else{ +tab.find("span.tabs-p-tool").remove(); +_36d.css("padding-right",""); +} +} +if(_36c!=opts.title){ +for(var i=0;i<_36b.length;i++){ +if(_36b[i]==_36c){ +_36b[i]=opts.title; +} } -_337.css("padding-right",pr+"px"); } } -_30d(_333); -$.data(_333,"tabs").options.onUpdate.call(_333,opts.title,_33a(_333,pp)); +if(opts.disabled){ +opts.tab.addClass("tabs-disabled"); +}else{ +opts.tab.removeClass("tabs-disabled"); +} +_336(_369); +$.data(_369,"tabs").options.onUpdate.call(_369,opts.title,_362(_369,pp)); }; -function _33b(_33c,_33d){ -var opts=$.data(_33c,"tabs").options; -var tabs=$.data(_33c,"tabs").tabs; -var _33e=$.data(_33c,"tabs").selectHis; -if(!_33f(_33c,_33d)){ +function _370(_371,_372){ +var opts=$.data(_371,"tabs").options; +var tabs=$.data(_371,"tabs").tabs; +var _373=$.data(_371,"tabs").selectHis; +if(!_374(_371,_372)){ return; } -var tab=_340(_33c,_33d); -var _341=tab.panel("options").title; -var _342=_33a(_33c,tab); -if(opts.onBeforeClose.call(_33c,_341,_342)==false){ +var tab=_375(_371,_372); +var _376=tab.panel("options").title; +var _377=_362(_371,tab); +if(opts.onBeforeClose.call(_371,_376,_377)==false){ return; } -var tab=_340(_33c,_33d,true); +var tab=_375(_371,_372,true); tab.panel("options").tab.remove(); tab.panel("destroy"); -opts.onClose.call(_33c,_341,_342); -_30d(_33c); -for(var i=0;i<_33e.length;i++){ -if(_33e[i]==_341){ -_33e.splice(i,1); +opts.onClose.call(_371,_376,_377); +_336(_371); +for(var i=0;i<_373.length;i++){ +if(_373[i]==_376){ +_373.splice(i,1); i--; } } -var _343=_33e.pop(); -if(_343){ -_331(_33c,_343); +var _378=_373.pop(); +if(_378){ +_367(_371,_378); }else{ if(tabs.length){ -_331(_33c,0); +_367(_371,0); } } }; -function _340(_344,_345,_346){ -var tabs=$.data(_344,"tabs").tabs; -if(typeof _345=="number"){ -if(_345<0||_345>=tabs.length){ -return null; -}else{ -var tab=tabs[_345]; -if(_346){ -tabs.splice(_345,1); -} -return tab; +function _375(_379,_37a,_37b){ +var tabs=$.data(_379,"tabs").tabs; +var tab=null; +if(typeof _37a=="number"){ +if(_37a>=0&&_37a"); for(var i=0;idiv.tabs-header>div.tabs-wrap"); -var left=tab.position().left; -var _354=left+tab.outerWidth(); -if(left<0||_354>wrap.width()){ -var _355=left-(wrap.width()-tab.width())/2; -$(_34c).tabs("scrollBy",_355); -}else{ -$(_34c).tabs("scrollBy",0); } -_315(_34c); -opts.onSelect.call(_34c,_353,_33a(_34c,_350)); }; -function _352(_356,_357){ -var _358=$.data(_356,"tabs"); -var p=_340(_356,_357); -if(p){ -var opts=p.panel("options"); -if(!opts.closed){ +function _384(_385,_386){ +var p=_375(_385,_386); +if(p&&p.is(":visible")){ +_383(_385); p.panel("close"); -if(opts.closed){ -opts.tab.removeClass("tabs-selected"); -_358.options.onUnselect.call(_356,opts.title,_33a(_356,p)); -} -} } }; -function _33f(_359,_35a){ -return _340(_359,_35a)!=null; +function _383(_387){ +$(_387).children("div.tabs-panels").each(function(){ +$(this).stop(true,true); +}); +}; +function _374(_388,_389){ +return _375(_388,_389)!=null; }; -function _35b(_35c,_35d){ -var opts=$.data(_35c,"tabs").options; -opts.showHeader=_35d; -$(_35c).tabs("resize"); +function _38a(_38b,_38c){ +var opts=$.data(_38b,"tabs").options; +opts.showHeader=_38c; +$(_38b).tabs("resize"); }; -$.fn.tabs=function(_35e,_35f){ -if(typeof _35e=="string"){ -return $.fn.tabs.methods[_35e](this,_35f); +function _38d(_38e,_38f){ +var tool=$(_38e).find(">.tabs-header>.tabs-tool"); +if(_38f){ +tool.removeClass("tabs-tool-hidden").show(); +}else{ +tool.addClass("tabs-tool-hidden").hide(); } -_35e=_35e||{}; +$(_38e).tabs("resize").tabs("scrollBy",0); +}; +$.fn.tabs=function(_390,_391){ +if(typeof _390=="string"){ +return $.fn.tabs.methods[_390](this,_391); +} +_390=_390||{}; return this.each(function(){ -var _360=$.data(this,"tabs"); -if(_360){ -$.extend(_360.options,_35e); +var _392=$.data(this,"tabs"); +if(_392){ +$.extend(_392.options,_390); }else{ -$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_35e),tabs:[],selectHis:[]}); -_31b(this); +$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_390),tabs:[],selectHis:[]}); +_348(this); } -_309(this); -_325(this); -_30d(this); -_31e(this); -_349(this); +_332(this); +_353(this); +_336(this); +_34c(this); +_37e(this); }); }; $.fn.tabs.methods={options:function(jq){ var cc=jq[0]; var opts=$.data(cc,"tabs").options; -var s=_317(cc); -opts.selected=s?_33a(cc,s):-1; +var s=_344(cc); +opts.selected=s?_362(cc,s):-1; return opts; },tabs:function(jq){ return $.data(jq[0],"tabs").tabs; -},resize:function(jq,_361){ +},resize:function(jq,_393){ return jq.each(function(){ -_30d(this,_361); -_315(this); +_336(this,_393); +_342(this); }); -},add:function(jq,_362){ +},add:function(jq,_394){ return jq.each(function(){ -_32d(this,_362); +_363(this,_394); }); -},close:function(jq,_363){ +},close:function(jq,_395){ return jq.each(function(){ -_33b(this,_363); +_370(this,_395); }); -},getTab:function(jq,_364){ -return _340(jq[0],_364); +},getTab:function(jq,_396){ +return _375(jq[0],_396); },getTabIndex:function(jq,tab){ -return _33a(jq[0],tab); +return _362(jq[0],tab); },getSelected:function(jq){ -return _317(jq[0]); -},select:function(jq,_365){ +return _344(jq[0]); +},select:function(jq,_397){ return jq.each(function(){ -_331(this,_365); +_367(this,_397); }); -},unselect:function(jq,_366){ +},unselect:function(jq,_398){ return jq.each(function(){ -_352(this,_366); +_384(this,_398); }); -},exists:function(jq,_367){ -return _33f(jq[0],_367); -},update:function(jq,_368){ +},exists:function(jq,_399){ +return _374(jq[0],_399); +},update:function(jq,_39a){ return jq.each(function(){ -_332(this,_368); +_368(this,_39a); }); -},enableTab:function(jq,_369){ +},enableTab:function(jq,_39b){ return jq.each(function(){ -$(this).tabs("getTab",_369).panel("options").tab.removeClass("tabs-disabled"); +var opts=$(this).tabs("getTab",_39b).panel("options"); +opts.tab.removeClass("tabs-disabled"); +opts.disabled=false; }); -},disableTab:function(jq,_36a){ +},disableTab:function(jq,_39c){ return jq.each(function(){ -$(this).tabs("getTab",_36a).panel("options").tab.addClass("tabs-disabled"); +var opts=$(this).tabs("getTab",_39c).panel("options"); +opts.tab.addClass("tabs-disabled"); +opts.disabled=true; }); },showHeader:function(jq){ return jq.each(function(){ -_35b(this,true); +_38a(this,true); }); },hideHeader:function(jq){ return jq.each(function(){ -_35b(this,false); +_38a(this,false); +}); +},showTool:function(jq){ +return jq.each(function(){ +_38d(this,true); +}); +},hideTool:function(jq){ +return jq.each(function(){ +_38d(this,false); }); -},scrollBy:function(jq,_36b){ +},scrollBy:function(jq,_39d){ return jq.each(function(){ var opts=$(this).tabs("options"); var wrap=$(this).find(">div.tabs-header>div.tabs-wrap"); -var pos=Math.min(wrap._scrollLeft()+_36b,_36c()); +var pos=Math.min(wrap._scrollLeft()+_39d,_39e()); wrap.animate({scrollLeft:pos},opts.scrollDuration); -function _36c(){ +function _39e(){ var w=0; var ul=wrap.children("ul"); ul.children("li").each(function(){ @@ -4762,51 +5182,51 @@ return w-wrap.width()+(ul.outerWidth()-ul.width()); }; }); }}; -$.fn.tabs.parseOptions=function(_36d){ -return $.extend({},$.parser.parseOptions(_36d,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean",headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number",showHeader:"boolean"}])); -}; -$.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:27,selected:0,showHeader:true,plain:false,fit:false,border:true,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_36e){ -},onSelect:function(_36f,_370){ -},onUnselect:function(_371,_372){ -},onBeforeClose:function(_373,_374){ -},onClose:function(_375,_376){ -},onAdd:function(_377,_378){ -},onUpdate:function(_379,_37a){ -},onContextMenu:function(e,_37b,_37c){ +$.fn.tabs.parseOptions=function(_39f){ +return $.extend({},$.parser.parseOptions(_39f,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean"},{headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number"},{showHeader:"boolean",justified:"boolean",narrow:"boolean",pill:"boolean"}])); +}; +$.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:27,selected:0,showHeader:true,plain:false,fit:false,border:true,justified:false,narrow:false,pill:false,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_3a0){ +},onSelect:function(_3a1,_3a2){ +},onUnselect:function(_3a3,_3a4){ +},onBeforeClose:function(_3a5,_3a6){ +},onClose:function(_3a7,_3a8){ +},onAdd:function(_3a9,_3aa){ +},onUpdate:function(_3ab,_3ac){ +},onContextMenu:function(e,_3ad,_3ae){ }}; })(jQuery); (function($){ -var _37d=false; -function _37e(_37f,_380){ -var _381=$.data(_37f,"layout"); -var opts=_381.options; -var _382=_381.panels; -var cc=$(_37f); -if(_380){ -$.extend(opts,{width:_380.width,height:_380.height}); -} -if(_37f.tagName.toLowerCase()=="body"){ +var _3af=false; +function _3b0(_3b1,_3b2){ +var _3b3=$.data(_3b1,"layout"); +var opts=_3b3.options; +var _3b4=_3b3.panels; +var cc=$(_3b1); +if(_3b2){ +$.extend(opts,{width:_3b2.width,height:_3b2.height}); +} +if(_3b1.tagName.toLowerCase()=="body"){ cc._size("fit"); }else{ cc._size(opts); } var cpos={top:0,left:0,width:cc.width(),height:cc.height()}; -_383(_384(_382.expandNorth)?_382.expandNorth:_382.north,"n"); -_383(_384(_382.expandSouth)?_382.expandSouth:_382.south,"s"); -_385(_384(_382.expandEast)?_382.expandEast:_382.east,"e"); -_385(_384(_382.expandWest)?_382.expandWest:_382.west,"w"); -_382.center.panel("resize",cpos); -function _383(pp,type){ -if(!pp.length||!_384(pp)){ +_3b5(_3b6(_3b4.expandNorth)?_3b4.expandNorth:_3b4.north,"n"); +_3b5(_3b6(_3b4.expandSouth)?_3b4.expandSouth:_3b4.south,"s"); +_3b7(_3b6(_3b4.expandEast)?_3b4.expandEast:_3b4.east,"e"); +_3b7(_3b6(_3b4.expandWest)?_3b4.expandWest:_3b4.west,"w"); +_3b4.center.panel("resize",cpos); +function _3b5(pp,type){ +if(!pp.length||!_3b6(pp)){ return; } var opts=pp.panel("options"); pp.panel("resize",{width:cc.width(),height:opts.height}); -var _386=pp.panel("panel").outerHeight(); -pp.panel("move",{left:0,top:(type=="n"?0:cc.height()-_386)}); -cpos.height-=_386; +var _3b8=pp.panel("panel").outerHeight(); +pp.panel("move",{left:0,top:(type=="n"?0:cc.height()-_3b8)}); +cpos.height-=_3b8; if(type=="n"){ -cpos.top+=_386; +cpos.top+=_3b8; if(!opts.split&&opts.border){ cpos.top--; } @@ -4815,17 +5235,17 @@ if(!opts.split&&opts.border){ cpos.height++; } }; -function _385(pp,type){ -if(!pp.length||!_384(pp)){ +function _3b7(pp,type){ +if(!pp.length||!_3b6(pp)){ return; } var opts=pp.panel("options"); pp.panel("resize",{width:opts.width,height:cpos.height}); -var _387=pp.panel("panel").outerWidth(); -pp.panel("move",{left:(type=="e"?cc.width()-_387:0),top:cpos.top}); -cpos.width-=_387; +var _3b9=pp.panel("panel").outerWidth(); +pp.panel("move",{left:(type=="e"?cc.width()-_3b9:0),top:cpos.top}); +cpos.width-=_3b9; if(type=="w"){ -cpos.left+=_387; +cpos.left+=_3b9; if(!opts.split&&opts.border){ cpos.left--; } @@ -4835,204 +5255,238 @@ cpos.width++; } }; }; -function init(_388){ -var cc=$(_388); +function init(_3ba){ +var cc=$(_3ba); cc.addClass("layout"); -function _389(cc){ -cc.children("div").each(function(){ -var opts=$.fn.layout.parsePanelOptions(this); -if("north,south,east,west,center".indexOf(opts.region)>=0){ -_38b(_388,opts,this); +function _3bb(el){ +var _3bc=$.fn.layout.parsePanelOptions(el); +if("north,south,east,west,center".indexOf(_3bc.region)>=0){ +_3bf(_3ba,_3bc,el); } -}); }; -cc.children("form").length?_389(cc.children("form")):_389(cc); +var opts=cc.layout("options"); +var _3bd=opts.onAdd; +opts.onAdd=function(){ +}; +cc.find(">div,>form>div").each(function(){ +_3bb(this); +}); +opts.onAdd=_3bd; cc.append("
            "); -cc.bind("_resize",function(e,_38a){ -if($(this).hasClass("easyui-fluid")||_38a){ -_37e(_388); +cc.bind("_resize",function(e,_3be){ +if($(this).hasClass("easyui-fluid")||_3be){ +_3b0(_3ba); } return false; }); }; -function _38b(_38c,_38d,el){ -_38d.region=_38d.region||"center"; -var _38e=$.data(_38c,"layout").panels; -var cc=$(_38c); -var dir=_38d.region; -if(_38e[dir].length){ +function _3bf(_3c0,_3c1,el){ +_3c1.region=_3c1.region||"center"; +var _3c2=$.data(_3c0,"layout").panels; +var cc=$(_3c0); +var dir=_3c1.region; +if(_3c2[dir].length){ return; } var pp=$(el); if(!pp.length){ pp=$("
            ").appendTo(cc); } -var _38f=$.extend({},$.fn.layout.paneldefaults,{width:(pp.length?parseInt(pp[0].style.width)||pp.outerWidth():"auto"),height:(pp.length?parseInt(pp[0].style.height)||pp.outerHeight():"auto"),doSize:false,collapsible:true,cls:("layout-panel layout-panel-"+dir),bodyCls:"layout-body",onOpen:function(){ +var _3c3=$.extend({},$.fn.layout.paneldefaults,{width:(pp.length?parseInt(pp[0].style.width)||pp.outerWidth():"auto"),height:(pp.length?parseInt(pp[0].style.height)||pp.outerHeight():"auto"),doSize:false,collapsible:true,onOpen:function(){ var tool=$(this).panel("header").children("div.panel-tool"); tool.children("a.panel-tool-collapse").hide(); -var _390={north:"up",south:"down",east:"right",west:"left"}; -if(!_390[dir]){ +var _3c4={north:"up",south:"down",east:"right",west:"left"}; +if(!_3c4[dir]){ return; } -var _391="layout-button-"+_390[dir]; -var t=tool.children("a."+_391); +var _3c5="layout-button-"+_3c4[dir]; +var t=tool.children("a."+_3c5); if(!t.length){ -t=$("").addClass(_391).appendTo(tool); +t=$("").addClass(_3c5).appendTo(tool); t.bind("click",{dir:dir},function(e){ -_39d(_38c,e.data.dir); +_3dc(_3c0,e.data.dir); return false; }); } $(this).panel("options").collapsible?t.show():t.hide(); -}},_38d); -pp.panel(_38f); -_38e[dir]=pp; +}},_3c1,{cls:((_3c1.cls||"")+" layout-panel layout-panel-"+dir),bodyCls:((_3c1.bodyCls||"")+" layout-body")}); +pp.panel(_3c3); +_3c2[dir]=pp; +var _3c6={north:"s",south:"n",east:"w",west:"e"}; +var _3c7=pp.panel("panel"); if(pp.panel("options").split){ -var _392=pp.panel("panel"); -_392.addClass("layout-split-"+dir); -var _393=""; -if(dir=="north"){ -_393="s"; -} -if(dir=="south"){ -_393="n"; +_3c7.addClass("layout-split-"+dir); } -if(dir=="east"){ -_393="w"; -} -if(dir=="west"){ -_393="e"; -} -_392.resizable($.extend({},{handles:_393,onStartResize:function(e){ -_37d=true; +_3c7.resizable($.extend({},{handles:(_3c6[dir]||""),disabled:(!pp.panel("options").split),onStartResize:function(e){ +_3af=true; if(dir=="north"||dir=="south"){ -var _394=$(">div.layout-split-proxy-v",_38c); +var _3c8=$(">div.layout-split-proxy-v",_3c0); }else{ -var _394=$(">div.layout-split-proxy-h",_38c); +var _3c8=$(">div.layout-split-proxy-h",_3c0); } -var top=0,left=0,_395=0,_396=0; +var top=0,left=0,_3c9=0,_3ca=0; var pos={display:"block"}; if(dir=="north"){ -pos.top=parseInt(_392.css("top"))+_392.outerHeight()-_394.height(); -pos.left=parseInt(_392.css("left")); -pos.width=_392.outerWidth(); -pos.height=_394.height(); +pos.top=parseInt(_3c7.css("top"))+_3c7.outerHeight()-_3c8.height(); +pos.left=parseInt(_3c7.css("left")); +pos.width=_3c7.outerWidth(); +pos.height=_3c8.height(); }else{ if(dir=="south"){ -pos.top=parseInt(_392.css("top")); -pos.left=parseInt(_392.css("left")); -pos.width=_392.outerWidth(); -pos.height=_394.height(); +pos.top=parseInt(_3c7.css("top")); +pos.left=parseInt(_3c7.css("left")); +pos.width=_3c7.outerWidth(); +pos.height=_3c8.height(); }else{ if(dir=="east"){ -pos.top=parseInt(_392.css("top"))||0; -pos.left=parseInt(_392.css("left"))||0; -pos.width=_394.width(); -pos.height=_392.outerHeight(); +pos.top=parseInt(_3c7.css("top"))||0; +pos.left=parseInt(_3c7.css("left"))||0; +pos.width=_3c8.width(); +pos.height=_3c7.outerHeight(); }else{ if(dir=="west"){ -pos.top=parseInt(_392.css("top"))||0; -pos.left=_392.outerWidth()-_394.width(); -pos.width=_394.width(); -pos.height=_392.outerHeight(); +pos.top=parseInt(_3c7.css("top"))||0; +pos.left=_3c7.outerWidth()-_3c8.width(); +pos.width=_3c8.width(); +pos.height=_3c7.outerHeight(); } } } } -_394.css(pos); +_3c8.css(pos); $("
            ").css({left:0,top:0,width:cc.width(),height:cc.height()}).appendTo(cc); },onResize:function(e){ if(dir=="north"||dir=="south"){ -var _397=$(">div.layout-split-proxy-v",_38c); -_397.css("top",e.pageY-$(_38c).offset().top-_397.height()/2); -}else{ -var _397=$(">div.layout-split-proxy-h",_38c); -_397.css("left",e.pageX-$(_38c).offset().left-_397.width()/2); +var _3cb=_3cc(this); +$(this).resizable("options").maxHeight=_3cb; +var _3cd=$(">div.layout-split-proxy-v",_3c0); +var top=dir=="north"?e.data.height-_3cd.height():$(_3c0).height()-e.data.height; +_3cd.css("top",top); +}else{ +var _3ce=_3cc(this); +$(this).resizable("options").maxWidth=_3ce; +var _3cd=$(">div.layout-split-proxy-h",_3c0); +var left=dir=="west"?e.data.width-_3cd.width():$(_3c0).width()-e.data.width; +_3cd.css("left",left); } return false; },onStopResize:function(e){ cc.children("div.layout-split-proxy-v,div.layout-split-proxy-h").hide(); pp.panel("resize",e.data); -_37e(_38c); -_37d=false; +_3b0(_3c0); +_3af=false; cc.find(">div.layout-mask").remove(); -}},_38d)); -} -}; -function _398(_399,_39a){ -var _39b=$.data(_399,"layout").panels; -if(_39b[_39a].length){ -_39b[_39a].panel("destroy"); -_39b[_39a]=$(); -var _39c="expand"+_39a.substring(0,1).toUpperCase()+_39a.substring(1); -if(_39b[_39c]){ -_39b[_39c].panel("destroy"); -_39b[_39c]=undefined; -} -} -}; -function _39d(_39e,_39f,_3a0){ -if(_3a0==undefined){ -_3a0="normal"; -} -var _3a1=$.data(_39e,"layout").panels; -var p=_3a1[_39f]; -var _3a2=p.panel("options"); -if(_3a2.onBeforeCollapse.call(p)==false){ -return; -} -var _3a3="expand"+_39f.substring(0,1).toUpperCase()+_39f.substring(1); -if(!_3a1[_3a3]){ -_3a1[_3a3]=_3a4(_39f); -_3a1[_3a3].panel("panel").bind("click",function(){ +}},_3c1)); +cc.layout("options").onAdd.call(_3c0,dir); +function _3cc(p){ +var _3cf="expand"+dir.substring(0,1).toUpperCase()+dir.substring(1); +var _3d0=_3c2["center"]; +var _3d1=(dir=="north"||dir=="south")?"minHeight":"minWidth"; +var _3d2=(dir=="north"||dir=="south")?"maxHeight":"maxWidth"; +var _3d3=(dir=="north"||dir=="south")?"_outerHeight":"_outerWidth"; +var _3d4=$.parser.parseValue(_3d2,_3c2[dir].panel("options")[_3d2],$(_3c0)); +var _3d5=$.parser.parseValue(_3d1,_3d0.panel("options")[_3d1],$(_3c0)); +var _3d6=_3d0.panel("panel")[_3d3]()-_3d5; +if(_3b6(_3c2[_3cf])){ +_3d6+=_3c2[_3cf][_3d3]()-1; +}else{ +_3d6+=$(p)[_3d3](); +} +if(_3d6>_3d4){ +_3d6=_3d4; +} +return _3d6; +}; +}; +function _3d7(_3d8,_3d9){ +var _3da=$.data(_3d8,"layout").panels; +if(_3da[_3d9].length){ +_3da[_3d9].panel("destroy"); +_3da[_3d9]=$(); +var _3db="expand"+_3d9.substring(0,1).toUpperCase()+_3d9.substring(1); +if(_3da[_3db]){ +_3da[_3db].panel("destroy"); +_3da[_3db]=undefined; +} +$(_3d8).layout("options").onRemove.call(_3d8,_3d9); +} +}; +function _3dc(_3dd,_3de,_3df){ +if(_3df==undefined){ +_3df="normal"; +} +var _3e0=$.data(_3dd,"layout").panels; +var p=_3e0[_3de]; +var _3e1=p.panel("options"); +if(_3e1.onBeforeCollapse.call(p)==false){ +return; +} +var _3e2="expand"+_3de.substring(0,1).toUpperCase()+_3de.substring(1); +if(!_3e0[_3e2]){ +_3e0[_3e2]=_3e3(_3de); +var ep=_3e0[_3e2].panel("panel"); +if(!_3e1.expandMode){ +ep.css("cursor","default"); +}else{ +ep.bind("click",function(){ +if(_3e1.expandMode=="dock"){ +_3ef(_3dd,_3de); +}else{ p.panel("expand",false).panel("open"); -var _3a5=_3a6(); -p.panel("resize",_3a5.collapse); -p.panel("panel").animate(_3a5.expand,function(){ -$(this).unbind(".layout").bind("mouseleave.layout",{region:_39f},function(e){ -if(_37d==true){ +var _3e4=_3e5(); +p.panel("resize",_3e4.collapse); +p.panel("panel").animate(_3e4.expand,function(){ +$(this).unbind(".layout").bind("mouseleave.layout",{region:_3de},function(e){ +if(_3af==true){ return; } if($("body>div.combo-p>div.combo-panel:visible").length){ return; } -_39d(_39e,e.data.region); +_3dc(_3dd,e.data.region); }); +$(_3dd).layout("options").onExpand.call(_3dd,_3de); }); +} return false; }); } -var _3a7=_3a6(); -if(!_384(_3a1[_3a3])){ -_3a1.center.panel("resize",_3a7.resizeC); } -p.panel("panel").animate(_3a7.collapse,_3a0,function(){ +var _3e6=_3e5(); +if(!_3b6(_3e0[_3e2])){ +_3e0.center.panel("resize",_3e6.resizeC); +} +p.panel("panel").animate(_3e6.collapse,_3df,function(){ p.panel("collapse",false).panel("close"); -_3a1[_3a3].panel("open").panel("resize",_3a7.expandP); +_3e0[_3e2].panel("open").panel("resize",_3e6.expandP); $(this).unbind(".layout"); -}); -function _3a4(dir){ -var icon; -if(dir=="east"){ -icon="layout-button-left"; -}else{ -if(dir=="west"){ -icon="layout-button-right"; -}else{ -if(dir=="north"){ -icon="layout-button-down"; -}else{ -if(dir=="south"){ -icon="layout-button-up"; -} +$(_3dd).layout("options").onCollapse.call(_3dd,_3de); +}); +function _3e3(dir){ +var _3e7={"east":"left","west":"right","north":"down","south":"up"}; +var isns=(_3e1.region=="north"||_3e1.region=="south"); +var icon="layout-button-"+_3e7[dir]; +var p=$("
            ").appendTo(_3dd); +p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",titleDirection:_3e1.titleDirection,iconCls:(_3e1.hideCollapsedContent?null:_3e1.iconCls),closed:true,minWidth:0,minHeight:0,doSize:false,region:_3e1.region,collapsedSize:_3e1.collapsedSize,noheader:(!isns&&_3e1.hideExpandTool),tools:((isns&&_3e1.hideExpandTool)?null:[{iconCls:icon,handler:function(){ +_3ef(_3dd,_3de); +return false; +}}]),onResize:function(){ +var _3e8=$(this).children(".layout-expand-title"); +if(_3e8.length){ +_3e8._outerWidth($(this).height()); +var left=($(this).width()-Math.min(_3e8._outerWidth(),_3e8._outerHeight()))/2; +var top=Math.max(_3e8._outerWidth(),_3e8._outerHeight()); +if(_3e8.hasClass("layout-expand-title-down")){ +left+=Math.min(_3e8._outerWidth(),_3e8._outerHeight()); +top=0; } +_3e8.css({left:(left+"px"),top:(top+"px")}); } +}})); +if(!_3e1.hideCollapsedContent){ +var _3e9=typeof _3e1.collapsedContent=="function"?_3e1.collapsedContent.call(p[0],_3e1.title):_3e1.collapsedContent; +isns?p.panel("setTitle",_3e9):p.html(_3e9); } -var p=$("
            ").appendTo(_39e); -p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",closed:true,minWidth:0,minHeight:0,doSize:false,tools:[{iconCls:icon,handler:function(){ -_3ad(_39e,_39f); -return false; -}}]})); p.panel("panel").hover(function(){ $(this).addClass("layout-expand-over"); },function(){ @@ -5040,80 +5494,81 @@ $(this).removeClass("layout-expand-over"); }); return p; }; -function _3a6(){ -var cc=$(_39e); -var _3a8=_3a1.center.panel("options"); -var _3a9=_3a2.collapsedSize; -if(_39f=="east"){ -var _3aa=p.panel("panel")._outerWidth(); -var _3ab=_3a8.width+_3aa-_3a9; -if(_3a2.split||!_3a2.border){ -_3ab++; +function _3e5(){ +var cc=$(_3dd); +var _3ea=_3e0.center.panel("options"); +var _3eb=_3e1.collapsedSize; +if(_3de=="east"){ +var _3ec=p.panel("panel")._outerWidth(); +var _3ed=_3ea.width+_3ec-_3eb; +if(_3e1.split||!_3e1.border){ +_3ed++; } -return {resizeC:{width:_3ab},expand:{left:cc.width()-_3aa},expandP:{top:_3a8.top,left:cc.width()-_3a9,width:_3a9,height:_3a8.height},collapse:{left:cc.width(),top:_3a8.top,height:_3a8.height}}; +return {resizeC:{width:_3ed},expand:{left:cc.width()-_3ec},expandP:{top:_3ea.top,left:cc.width()-_3eb,width:_3eb,height:_3ea.height},collapse:{left:cc.width(),top:_3ea.top,height:_3ea.height}}; }else{ -if(_39f=="west"){ -var _3aa=p.panel("panel")._outerWidth(); -var _3ab=_3a8.width+_3aa-_3a9; -if(_3a2.split||!_3a2.border){ -_3ab++; +if(_3de=="west"){ +var _3ec=p.panel("panel")._outerWidth(); +var _3ed=_3ea.width+_3ec-_3eb; +if(_3e1.split||!_3e1.border){ +_3ed++; } -return {resizeC:{width:_3ab,left:_3a9-1},expand:{left:0},expandP:{left:0,top:_3a8.top,width:_3a9,height:_3a8.height},collapse:{left:-_3aa,top:_3a8.top,height:_3a8.height}}; +return {resizeC:{width:_3ed,left:_3eb-1},expand:{left:0},expandP:{left:0,top:_3ea.top,width:_3eb,height:_3ea.height},collapse:{left:-_3ec,top:_3ea.top,height:_3ea.height}}; }else{ -if(_39f=="north"){ -var _3ac=p.panel("panel")._outerHeight(); -var hh=_3a8.height; -if(!_384(_3a1.expandNorth)){ -hh+=_3ac-_3a9+((_3a2.split||!_3a2.border)?1:0); +if(_3de=="north"){ +var _3ee=p.panel("panel")._outerHeight(); +var hh=_3ea.height; +if(!_3b6(_3e0.expandNorth)){ +hh+=_3ee-_3eb+((_3e1.split||!_3e1.border)?1:0); } -_3a1.east.add(_3a1.west).add(_3a1.expandEast).add(_3a1.expandWest).panel("resize",{top:_3a9-1,height:hh}); -return {resizeC:{top:_3a9-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_3a9},collapse:{top:-_3ac,width:cc.width()}}; +_3e0.east.add(_3e0.west).add(_3e0.expandEast).add(_3e0.expandWest).panel("resize",{top:_3eb-1,height:hh}); +return {resizeC:{top:_3eb-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_3eb},collapse:{top:-_3ee,width:cc.width()}}; }else{ -if(_39f=="south"){ -var _3ac=p.panel("panel")._outerHeight(); -var hh=_3a8.height; -if(!_384(_3a1.expandSouth)){ -hh+=_3ac-_3a9+((_3a2.split||!_3a2.border)?1:0); +if(_3de=="south"){ +var _3ee=p.panel("panel")._outerHeight(); +var hh=_3ea.height; +if(!_3b6(_3e0.expandSouth)){ +hh+=_3ee-_3eb+((_3e1.split||!_3e1.border)?1:0); } -_3a1.east.add(_3a1.west).add(_3a1.expandEast).add(_3a1.expandWest).panel("resize",{height:hh}); -return {resizeC:{height:hh},expand:{top:cc.height()-_3ac},expandP:{top:cc.height()-_3a9,left:0,width:cc.width(),height:_3a9},collapse:{top:cc.height(),width:cc.width()}}; +_3e0.east.add(_3e0.west).add(_3e0.expandEast).add(_3e0.expandWest).panel("resize",{height:hh}); +return {resizeC:{height:hh},expand:{top:cc.height()-_3ee},expandP:{top:cc.height()-_3eb,left:0,width:cc.width(),height:_3eb},collapse:{top:cc.height(),width:cc.width()}}; } } } } }; }; -function _3ad(_3ae,_3af){ -var _3b0=$.data(_3ae,"layout").panels; -var p=_3b0[_3af]; -var _3b1=p.panel("options"); -if(_3b1.onBeforeExpand.call(p)==false){ +function _3ef(_3f0,_3f1){ +var _3f2=$.data(_3f0,"layout").panels; +var p=_3f2[_3f1]; +var _3f3=p.panel("options"); +if(_3f3.onBeforeExpand.call(p)==false){ return; } -var _3b2="expand"+_3af.substring(0,1).toUpperCase()+_3af.substring(1); -if(_3b0[_3b2]){ -_3b0[_3b2].panel("close"); +var _3f4="expand"+_3f1.substring(0,1).toUpperCase()+_3f1.substring(1); +if(_3f2[_3f4]){ +_3f2[_3f4].panel("close"); p.panel("panel").stop(true,true); p.panel("expand",false).panel("open"); -var _3b3=_3b4(); -p.panel("resize",_3b3.collapse); -p.panel("panel").animate(_3b3.expand,function(){ -_37e(_3ae); +var _3f5=_3f6(); +p.panel("resize",_3f5.collapse); +p.panel("panel").animate(_3f5.expand,function(){ +_3b0(_3f0); +$(_3f0).layout("options").onExpand.call(_3f0,_3f1); }); } -function _3b4(){ -var cc=$(_3ae); -var _3b5=_3b0.center.panel("options"); -if(_3af=="east"&&_3b0.expandEast){ -return {collapse:{left:cc.width(),top:_3b5.top,height:_3b5.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}}; +function _3f6(){ +var cc=$(_3f0); +var _3f7=_3f2.center.panel("options"); +if(_3f1=="east"&&_3f2.expandEast){ +return {collapse:{left:cc.width(),top:_3f7.top,height:_3f7.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}}; }else{ -if(_3af=="west"&&_3b0.expandWest){ -return {collapse:{left:-p.panel("panel")._outerWidth(),top:_3b5.top,height:_3b5.height},expand:{left:0}}; +if(_3f1=="west"&&_3f2.expandWest){ +return {collapse:{left:-p.panel("panel")._outerWidth(),top:_3f7.top,height:_3f7.height},expand:{left:0}}; }else{ -if(_3af=="north"&&_3b0.expandNorth){ +if(_3f1=="north"&&_3f2.expandNorth){ return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}}; }else{ -if(_3af=="south"&&_3b0.expandSouth){ +if(_3f1=="south"&&_3f2.expandSouth){ return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.panel("panel")._outerHeight()}}; } } @@ -5121,7 +5576,7 @@ return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.pa } }; }; -function _384(pp){ +function _3b6(pp){ if(!pp){ return false; } @@ -5131,269 +5586,364 @@ return pp.panel("panel").is(":visible"); return false; } }; -function _3b6(_3b7){ -var _3b8=$.data(_3b7,"layout").panels; -if(_3b8.east.length&&_3b8.east.panel("options").collapsed){ -_39d(_3b7,"east",0); -} -if(_3b8.west.length&&_3b8.west.panel("options").collapsed){ -_39d(_3b7,"west",0); -} -if(_3b8.north.length&&_3b8.north.panel("options").collapsed){ -_39d(_3b7,"north",0); +function _3f8(_3f9){ +var _3fa=$.data(_3f9,"layout"); +var opts=_3fa.options; +var _3fb=_3fa.panels; +var _3fc=opts.onCollapse; +opts.onCollapse=function(){ +}; +_3fd("east"); +_3fd("west"); +_3fd("north"); +_3fd("south"); +opts.onCollapse=_3fc; +function _3fd(_3fe){ +var p=_3fb[_3fe]; +if(p.length&&p.panel("options").collapsed){ +_3dc(_3f9,_3fe,0); } -if(_3b8.south.length&&_3b8.south.panel("options").collapsed){ -_39d(_3b7,"south",0); +}; +}; +function _3ff(_400,_401,_402){ +var p=$(_400).layout("panel",_401); +p.panel("options").split=_402; +var cls="layout-split-"+_401; +var _403=p.panel("panel").removeClass(cls); +if(_402){ +_403.addClass(cls); } +_403.resizable({disabled:(!_402)}); +_3b0(_400); }; -$.fn.layout=function(_3b9,_3ba){ -if(typeof _3b9=="string"){ -return $.fn.layout.methods[_3b9](this,_3ba); +$.fn.layout=function(_404,_405){ +if(typeof _404=="string"){ +return $.fn.layout.methods[_404](this,_405); } -_3b9=_3b9||{}; +_404=_404||{}; return this.each(function(){ -var _3bb=$.data(this,"layout"); -if(_3bb){ -$.extend(_3bb.options,_3b9); +var _406=$.data(this,"layout"); +if(_406){ +$.extend(_406.options,_404); }else{ -var opts=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_3b9); +var opts=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_404); $.data(this,"layout",{options:opts,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}}); init(this); } -_37e(this); -_3b6(this); +_3b0(this); +_3f8(this); }); }; $.fn.layout.methods={options:function(jq){ return $.data(jq[0],"layout").options; -},resize:function(jq,_3bc){ +},resize:function(jq,_407){ return jq.each(function(){ -_37e(this,_3bc); +_3b0(this,_407); }); -},panel:function(jq,_3bd){ -return $.data(jq[0],"layout").panels[_3bd]; -},collapse:function(jq,_3be){ +},panel:function(jq,_408){ +return $.data(jq[0],"layout").panels[_408]; +},collapse:function(jq,_409){ return jq.each(function(){ -_39d(this,_3be); +_3dc(this,_409); }); -},expand:function(jq,_3bf){ +},expand:function(jq,_40a){ return jq.each(function(){ -_3ad(this,_3bf); +_3ef(this,_40a); }); -},add:function(jq,_3c0){ +},add:function(jq,_40b){ return jq.each(function(){ -_38b(this,_3c0); -_37e(this); -if($(this).layout("panel",_3c0.region).panel("options").collapsed){ -_39d(this,_3c0.region,0); +_3bf(this,_40b); +_3b0(this); +if($(this).layout("panel",_40b.region).panel("options").collapsed){ +_3dc(this,_40b.region,0); } }); -},remove:function(jq,_3c1){ +},remove:function(jq,_40c){ return jq.each(function(){ -_398(this,_3c1); -_37e(this); +_3d7(this,_40c); +_3b0(this); +}); +},split:function(jq,_40d){ +return jq.each(function(){ +_3ff(this,_40d,true); +}); +},unsplit:function(jq,_40e){ +return jq.each(function(){ +_3ff(this,_40e,false); }); }}; -$.fn.layout.parseOptions=function(_3c2){ -return $.extend({},$.parser.parseOptions(_3c2,[{fit:"boolean"}])); +$.fn.layout.parseOptions=function(_40f){ +return $.extend({},$.parser.parseOptions(_40f,[{fit:"boolean"}])); }; -$.fn.layout.defaults={fit:false}; -$.fn.layout.parsePanelOptions=function(_3c3){ -var t=$(_3c3); -return $.extend({},$.fn.panel.parseOptions(_3c3),$.parser.parseOptions(_3c3,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}])); +$.fn.layout.defaults={fit:false,onExpand:function(_410){ +},onCollapse:function(_411){ +},onAdd:function(_412){ +},onRemove:function(_413){ +}}; +$.fn.layout.parsePanelOptions=function(_414){ +var t=$(_414); +return $.extend({},$.fn.panel.parseOptions(_414),$.parser.parseOptions(_414,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}])); }; -$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapsedSize:28,minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000}); +$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapsedSize:28,expandMode:"float",hideExpandTool:false,hideCollapsedContent:true,collapsedContent:function(_415){ +var p=$(this); +var opts=p.panel("options"); +if(opts.region=="north"||opts.region=="south"){ +return _415; +} +var cc=[]; +if(opts.iconCls){ +cc.push("
            "); +} +cc.push("
            "); +cc.push(_415); +cc.push("
            "); +return cc.join(""); +},minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000}); })(jQuery); (function($){ -function init(_3c4){ -$(_3c4).appendTo("body"); -$(_3c4).addClass("menu-top"); +$(function(){ $(document).unbind(".menu").bind("mousedown.menu",function(e){ var m=$(e.target).closest("div.menu,div.combo-p"); if(m.length){ return; } -$("body>div.menu-top:visible").menu("hide"); +$("body>div.menu-top:visible").not(".menu-inline").menu("hide"); +_416($("body>div.menu:visible").not(".menu-inline")); +}); +}); +function init(_417){ +var opts=$.data(_417,"menu").options; +$(_417).addClass("menu-top"); +opts.inline?$(_417).addClass("menu-inline"):$(_417).appendTo("body"); +$(_417).bind("_resize",function(e,_418){ +if($(this).hasClass("easyui-fluid")||_418){ +$(_417).menu("resize",_417); +} +return false; }); -var _3c5=_3c6($(_3c4)); -for(var i=0;i<_3c5.length;i++){ -_3c7(_3c5[i]); +var _419=_41a($(_417)); +for(var i=0;i<_419.length;i++){ +_41d(_417,_419[i]); } -function _3c6(menu){ -var _3c8=[]; +function _41a(menu){ +var _41b=[]; menu.addClass("menu"); -_3c8.push(menu); +_41b.push(menu); if(!menu.hasClass("menu-content")){ menu.children("div").each(function(){ -var _3c9=$(this).children("div"); -if(_3c9.length){ -_3c9.insertAfter(_3c4); -this.submenu=_3c9; -var mm=_3c6(_3c9); -_3c8=_3c8.concat(mm); +var _41c=$(this).children("div"); +if(_41c.length){ +_41c.appendTo("body"); +this.submenu=_41c; +var mm=_41a(_41c); +_41b=_41b.concat(mm); } }); } -return _3c8; +return _41b; }; -function _3c7(menu){ -var wh=$.parser.parseOptions(menu[0],["width","height"]); -menu[0].originalHeight=wh.height||0; -if(menu.hasClass("menu-content")){ -menu[0].originalWidth=wh.width||menu._outerWidth(); -}else{ -menu[0].originalWidth=wh.width||0; +}; +function _41d(_41e,div){ +var menu=$(div).addClass("menu"); +if(!menu.data("menu")){ +menu.data("menu",{options:$.parser.parseOptions(menu[0],["width","height"])}); +} +if(!menu.hasClass("menu-content")){ menu.children("div").each(function(){ -var item=$(this); -var _3ca=$.extend({},$.parser.parseOptions(this,["name","iconCls","href",{separator:"boolean"}]),{disabled:(item.attr("disabled")?true:undefined)}); -if(_3ca.separator){ +_41f(_41e,this); +}); +$("
            ").prependTo(menu); +} +_420(_41e,menu); +if(!menu.hasClass("menu-inline")){ +menu.hide(); +} +_421(_41e,menu); +}; +function _41f(_422,div,_423){ +var item=$(div); +var _424=$.extend({},$.parser.parseOptions(item[0],["id","name","iconCls","href",{separator:"boolean"}]),{disabled:(item.attr("disabled")?true:undefined),text:$.trim(item.html()),onclick:item[0].onclick},_423||{}); +_424.onclick=_424.onclick||_424.handler||null; +item.data("menuitem",{options:_424}); +if(_424.separator){ item.addClass("menu-sep"); } if(!item.hasClass("menu-sep")){ -item[0].itemName=_3ca.name||""; -item[0].itemHref=_3ca.href||""; -var text=item.addClass("menu-item").html(); -item.empty().append($("
            ").html(text)); -if(_3ca.iconCls){ -$("
            ").addClass(_3ca.iconCls).appendTo(item); +item.addClass("menu-item"); +item.empty().append($("
            ").html(_424.text)); +if(_424.iconCls){ +$("
            ").addClass(_424.iconCls).appendTo(item); +} +if(_424.id){ +item.attr("id",_424.id); +} +if(_424.onclick){ +if(typeof _424.onclick=="string"){ +item.attr("onclick",_424.onclick); +}else{ +item[0].onclick=eval(_424.onclick); } -if(_3ca.disabled){ -_3cb(_3c4,item[0],true); +} +if(_424.disabled){ +_425(_422,item[0],true); } if(item[0].submenu){ $("
            ").appendTo(item); } -_3cc(_3c4,item); -} -}); -$("
            ").prependTo(menu); } -_3cd(_3c4,menu); -menu.hide(); -_3ce(_3c4,menu); -}; }; -function _3cd(_3cf,menu){ -var opts=$.data(_3cf,"menu").options; -var _3d0=menu.attr("style")||""; +function _420(_426,menu){ +var opts=$.data(_426,"menu").options; +var _427=menu.attr("style")||""; +var _428=menu.is(":visible"); menu.css({display:"block",left:-10000,height:"auto",overflow:"hidden"}); -var el=menu[0]; -var _3d1=el.originalWidth||0; -if(!_3d1){ -_3d1=0; +menu.find(".menu-item").each(function(){ +$(this)._outerHeight(opts.itemHeight); +$(this).find(".menu-text").css({height:(opts.itemHeight-2)+"px",lineHeight:(opts.itemHeight-2)+"px"}); +}); +menu.removeClass("menu-noline").addClass(opts.noline?"menu-noline":""); +var _429=menu.data("menu").options; +var _42a=_429.width; +var _42b=_429.height; +if(isNaN(parseInt(_42a))){ +_42a=0; menu.find("div.menu-text").each(function(){ -if(_3d1<$(this)._outerWidth()){ -_3d1=$(this)._outerWidth(); +if(_42a<$(this).outerWidth()){ +_42a=$(this).outerWidth(); } -$(this).closest("div.menu-item")._outerHeight($(this)._outerHeight()+2); }); -_3d1+=40; +_42a=_42a?_42a+40:""; } -_3d1=Math.max(_3d1,opts.minWidth); -var _3d2=el.originalHeight||0; -if(!_3d2){ -_3d2=menu.outerHeight(); +var _42c=menu.outerHeight(); +if(isNaN(parseInt(_42b))){ +_42b=_42c; if(menu.hasClass("menu-top")&&opts.alignTo){ var at=$(opts.alignTo); var h1=at.offset().top-$(document).scrollTop(); var h2=$(window)._outerHeight()+$(document).scrollTop()-at.offset().top-at._outerHeight(); -_3d2=Math.min(_3d2,Math.max(h1,h2)); +_42b=Math.min(_42b,Math.max(h1,h2)); }else{ -if(_3d2>$(window)._outerHeight()){ -_3d2=$(window).height(); -_3d0+=";overflow:auto"; -}else{ -_3d0+=";overflow:hidden"; -} +if(_42b>$(window)._outerHeight()){ +_42b=$(window).height(); } } -var _3d3=Math.max(el.originalHeight,menu.outerHeight())-2; -menu._outerWidth(_3d1)._outerHeight(_3d2); -menu.children("div.menu-line")._outerHeight(_3d3); -_3d0+=";width:"+el.style.width+";height:"+el.style.height; -menu.attr("style",_3d0); -}; -function _3ce(_3d4,menu){ -var _3d5=$.data(_3d4,"menu"); -menu.unbind(".menu").bind("mouseenter.menu",function(){ -if(_3d5.timer){ -clearTimeout(_3d5.timer); -_3d5.timer=null; } -}).bind("mouseleave.menu",function(){ -if(_3d5.options.hideOnUnhover){ -_3d5.timer=setTimeout(function(){ -_3d6(_3d4); -},_3d5.options.duration); +menu.attr("style",_427); +menu.show(); +menu._size($.extend({},_429,{width:_42a,height:_42b,minWidth:_429.minWidth||opts.minWidth,maxWidth:_429.maxWidth||opts.maxWidth})); +menu.find(".easyui-fluid").triggerHandler("_resize",[true]); +menu.css("overflow",menu.outerHeight()<_42c?"auto":"hidden"); +menu.children("div.menu-line")._outerHeight(_42c-2); +if(!_428){ +menu.hide(); } -}); }; -function _3cc(_3d7,item){ -if(!item.hasClass("menu-item")){ -return; +function _421(_42d,menu){ +var _42e=$.data(_42d,"menu"); +var opts=_42e.options; +menu.unbind(".menu"); +for(var _42f in opts.events){ +menu.bind(_42f+".menu",{target:_42d},opts.events[_42f]); } -item.unbind(".menu"); -item.bind("click.menu",function(){ -if($(this).hasClass("menu-item-disabled")){ -return; -} -if(!this.submenu){ -_3d6(_3d7); -var href=this.itemHref; -if(href){ -location.href=href; +}; +function _430(e){ +var _431=e.data.target; +var _432=$.data(_431,"menu"); +if(_432.timer){ +clearTimeout(_432.timer); +_432.timer=null; } +}; +function _433(e){ +var _434=e.data.target; +var _435=$.data(_434,"menu"); +if(_435.options.hideOnUnhover){ +_435.timer=setTimeout(function(){ +_436(_434,$(_434).hasClass("menu-inline")); +},_435.options.duration); } -var item=$(_3d7).menu("getItem",this); -$.data(_3d7,"menu").options.onClick.call(_3d7,item); -}).bind("mouseenter.menu",function(e){ +}; +function _437(e){ +var _438=e.data.target; +var item=$(e.target).closest(".menu-item"); +if(item.length){ item.siblings().each(function(){ if(this.submenu){ -_3da(this.submenu); +_416(this.submenu); } $(this).removeClass("menu-active"); }); item.addClass("menu-active"); -if($(this).hasClass("menu-item-disabled")){ +if(item.hasClass("menu-item-disabled")){ item.addClass("menu-active-disabled"); return; } -var _3d8=item[0].submenu; -if(_3d8){ -$(_3d7).menu("show",{menu:_3d8,parent:item}); +var _439=item[0].submenu; +if(_439){ +$(_438).menu("show",{menu:_439,parent:item}); +} } -}).bind("mouseleave.menu",function(e){ +}; +function _43a(e){ +var item=$(e.target).closest(".menu-item"); +if(item.length){ item.removeClass("menu-active menu-active-disabled"); -var _3d9=item[0].submenu; -if(_3d9){ -if(e.pageX>=parseInt(_3d9.css("left"))){ +var _43b=item[0].submenu; +if(_43b){ +if(e.pageX>=parseInt(_43b.css("left"))){ item.addClass("menu-active"); }else{ -_3da(_3d9); +_416(_43b); } }else{ item.removeClass("menu-active"); } -}); +} +}; +function _43c(e){ +var _43d=e.data.target; +var item=$(e.target).closest(".menu-item"); +if(item.length){ +var opts=$(_43d).data("menu").options; +var _43e=item.data("menuitem").options; +if(_43e.disabled){ +return; +} +if(!item[0].submenu){ +_436(_43d,opts.inline); +if(_43e.href){ +location.href=_43e.href; +} +} +item.trigger("mouseenter"); +opts.onClick.call(_43d,$(_43d).menu("getItem",item[0])); +} }; -function _3d6(_3db){ -var _3dc=$.data(_3db,"menu"); -if(_3dc){ -if($(_3db).is(":visible")){ -_3da($(_3db)); -_3dc.options.onHide.call(_3db); +function _436(_43f,_440){ +var _441=$.data(_43f,"menu"); +if(_441){ +if($(_43f).is(":visible")){ +_416($(_43f)); +if(_440){ +$(_43f).show(); +}else{ +_441.options.onHide.call(_43f); +} } } return false; }; -function _3dd(_3de,_3df){ +function _442(_443,_444){ +_444=_444||{}; var left,top; -_3df=_3df||{}; -var menu=$(_3df.menu||_3de); -$(_3de).menu("resize",menu[0]); +var opts=$.data(_443,"menu").options; +var menu=$(_444.menu||_443); +$(_443).menu("resize",menu[0]); if(menu.hasClass("menu-top")){ -var opts=$.data(_3de,"menu").options; -$.extend(opts,_3df); +$.extend(opts,_444); left=opts.left; top=opts.top; if(opts.alignTo){ @@ -5410,19 +5960,19 @@ left=$(window)._outerWidth()+$(document).scrollLeft()-menu.outerWidth()-5; if(left<0){ left=0; } -top=_3e0(top,opts.alignTo); +top=_445(top,opts.alignTo); }else{ -var _3e1=_3df.parent; -left=_3e1.offset().left+_3e1.outerWidth()-2; +var _446=_444.parent; +left=_446.offset().left+_446.outerWidth()-2; if(left+menu.outerWidth()+5>$(window)._outerWidth()+$(document).scrollLeft()){ -left=_3e1.offset().left-menu.outerWidth()+2; +left=_446.offset().left-menu.outerWidth()+2; } -top=_3e0(_3e1.offset().top-3); +top=_445(_446.offset().top-3); } -function _3e0(top,_3e2){ +function _445(top,_447){ if(top+menu.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ -if(_3e2){ -top=$(_3e2).offset().top-menu._outerHeight(); +if(_447){ +top=$(_447).offset().top-menu._outerHeight(); }else{ top=$(window)._outerHeight()+$(document).scrollTop()-menu.outerHeight(); } @@ -5432,30 +5982,29 @@ top=0; } return top; }; -menu.css({left:left,top:top}); +menu.css(opts.position.call(_443,menu[0],left,top)); menu.show(0,function(){ if(!menu[0].shadow){ menu[0].shadow=$("
            ").insertAfter(menu); } -menu[0].shadow.css({display:"block",zIndex:$.fn.menu.defaults.zIndex++,left:menu.css("left"),top:menu.css("top"),width:menu.outerWidth(),height:menu.outerHeight()}); +menu[0].shadow.css({display:(menu.hasClass("menu-inline")?"none":"block"),zIndex:$.fn.menu.defaults.zIndex++,left:menu.css("left"),top:menu.css("top"),width:menu.outerWidth(),height:menu.outerHeight()}); menu.css("z-index",$.fn.menu.defaults.zIndex++); if(menu.hasClass("menu-top")){ -$.data(menu[0],"menu").options.onShow.call(menu[0]); +opts.onShow.call(_443); } }); }; -function _3da(menu){ -if(!menu){ -return; -} -_3e3(menu); +function _416(menu){ +if(menu&&menu.length){ +_448(menu); menu.find("div.menu-item").each(function(){ if(this.submenu){ -_3da(this.submenu); +_416(this.submenu); } $(this).removeClass("menu-active"); }); -function _3e3(m){ +} +function _448(m){ m.stop(true,true); if(m[0].shadow){ m[0].shadow.hide(); @@ -5463,290 +6012,249 @@ m[0].shadow.hide(); m.hide(); }; }; -function _3e4(_3e5,text){ -var _3e6=null; +function _449(_44a,text){ +var _44b=null; var tmp=$("
            "); function find(menu){ menu.children("div.menu-item").each(function(){ -var item=$(_3e5).menu("getItem",this); +var item=$(_44a).menu("getItem",this); var s=tmp.empty().html(item.text).text(); if(text==$.trim(s)){ -_3e6=item; +_44b=item; }else{ -if(this.submenu&&!_3e6){ +if(this.submenu&&!_44b){ find(this.submenu); } } }); }; -find($(_3e5)); +find($(_44a)); tmp.remove(); -return _3e6; -}; -function _3cb(_3e7,_3e8,_3e9){ -var t=$(_3e8); -if(!t.hasClass("menu-item")){ -return; -} -if(_3e9){ +return _44b; +}; +function _425(_44c,_44d,_44e){ +var t=$(_44d); +if(t.hasClass("menu-item")){ +var opts=t.data("menuitem").options; +opts.disabled=_44e; +if(_44e){ t.addClass("menu-item-disabled"); -if(_3e8.onclick){ -_3e8.onclick1=_3e8.onclick; -_3e8.onclick=null; -} +t[0].onclick=null; }else{ t.removeClass("menu-item-disabled"); -if(_3e8.onclick1){ -_3e8.onclick=_3e8.onclick1; -_3e8.onclick1=null; +t[0].onclick=opts.onclick; } } }; -function _3ea(_3eb,_3ec){ -var menu=$(_3eb); -if(_3ec.parent){ -if(!_3ec.parent.submenu){ -var _3ed=$("
            ").appendTo("body"); -_3ed.hide(); -_3ec.parent.submenu=_3ed; -$("
            ").appendTo(_3ec.parent); -} -menu=_3ec.parent.submenu; -} -if(_3ec.separator){ -var item=$("
            ").appendTo(menu); -}else{ -var item=$("
            ").appendTo(menu); -$("
            ").html(_3ec.text).appendTo(item); -} -if(_3ec.iconCls){ -$("
            ").addClass(_3ec.iconCls).appendTo(item); +function _44f(_450,_451){ +var opts=$.data(_450,"menu").options; +var menu=$(_450); +if(_451.parent){ +if(!_451.parent.submenu){ +var _452=$("
            ").appendTo("body"); +_451.parent.submenu=_452; +$("
            ").appendTo(_451.parent); +_41d(_450,_452); } -if(_3ec.id){ -item.attr("id",_3ec.id); +menu=_451.parent.submenu; } -if(_3ec.name){ -item[0].itemName=_3ec.name; -} -if(_3ec.href){ -item[0].itemHref=_3ec.href; -} -if(_3ec.onclick){ -if(typeof _3ec.onclick=="string"){ -item.attr("onclick",_3ec.onclick); -}else{ -item[0].onclick=eval(_3ec.onclick); -} -} -if(_3ec.handler){ -item[0].onclick=eval(_3ec.handler); -} -if(_3ec.disabled){ -_3cb(_3eb,item[0],true); -} -_3cc(_3eb,item); -_3ce(_3eb,menu); -_3cd(_3eb,menu); +var div=$("
            ").appendTo(menu); +_41f(_450,div,_451); }; -function _3ee(_3ef,_3f0){ -function _3f1(el){ +function _453(_454,_455){ +function _456(el){ if(el.submenu){ el.submenu.children("div.menu-item").each(function(){ -_3f1(this); +_456(this); }); -var _3f2=el.submenu[0].shadow; -if(_3f2){ -_3f2.remove(); +var _457=el.submenu[0].shadow; +if(_457){ +_457.remove(); } el.submenu.remove(); } $(el).remove(); }; -var menu=$(_3f0).parent(); -_3f1(_3f0); -_3cd(_3ef,menu); +_456(_455); }; -function _3f3(_3f4,_3f5,_3f6){ -var menu=$(_3f5).parent(); -if(_3f6){ -$(_3f5).show(); +function _458(_459,_45a,_45b){ +var menu=$(_45a).parent(); +if(_45b){ +$(_45a).show(); }else{ -$(_3f5).hide(); +$(_45a).hide(); } -_3cd(_3f4,menu); +_420(_459,menu); }; -function _3f7(_3f8){ -$(_3f8).children("div.menu-item").each(function(){ -_3ee(_3f8,this); +function _45c(_45d){ +$(_45d).children("div.menu-item").each(function(){ +_453(_45d,this); }); -if(_3f8.shadow){ -_3f8.shadow.remove(); +if(_45d.shadow){ +_45d.shadow.remove(); } -$(_3f8).remove(); +$(_45d).remove(); }; -$.fn.menu=function(_3f9,_3fa){ -if(typeof _3f9=="string"){ -return $.fn.menu.methods[_3f9](this,_3fa); +$.fn.menu=function(_45e,_45f){ +if(typeof _45e=="string"){ +return $.fn.menu.methods[_45e](this,_45f); } -_3f9=_3f9||{}; +_45e=_45e||{}; return this.each(function(){ -var _3fb=$.data(this,"menu"); -if(_3fb){ -$.extend(_3fb.options,_3f9); +var _460=$.data(this,"menu"); +if(_460){ +$.extend(_460.options,_45e); }else{ -_3fb=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_3f9)}); +_460=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_45e)}); init(this); } -$(this).css({left:_3fb.options.left,top:_3fb.options.top}); +$(this).css({left:_460.options.left,top:_460.options.top}); }); }; $.fn.menu.methods={options:function(jq){ return $.data(jq[0],"menu").options; },show:function(jq,pos){ return jq.each(function(){ -_3dd(this,pos); +_442(this,pos); }); },hide:function(jq){ return jq.each(function(){ -_3d6(this); +_436(this); }); },destroy:function(jq){ return jq.each(function(){ -_3f7(this); +_45c(this); }); -},setText:function(jq,_3fc){ +},setText:function(jq,_461){ return jq.each(function(){ -$(_3fc.target).children("div.menu-text").html(_3fc.text); +var item=$(_461.target).data("menuitem").options; +item.text=_461.text; +$(_461.target).children("div.menu-text").html(_461.text); }); -},setIcon:function(jq,_3fd){ +},setIcon:function(jq,_462){ return jq.each(function(){ -$(_3fd.target).children("div.menu-icon").remove(); -if(_3fd.iconCls){ -$("
            ").addClass(_3fd.iconCls).appendTo(_3fd.target); +var item=$(_462.target).data("menuitem").options; +item.iconCls=_462.iconCls; +$(_462.target).children("div.menu-icon").remove(); +if(_462.iconCls){ +$("
            ").addClass(_462.iconCls).appendTo(_462.target); } }); -},getItem:function(jq,_3fe){ -var t=$(_3fe); -var item={target:_3fe,id:t.attr("id"),text:$.trim(t.children("div.menu-text").html()),disabled:t.hasClass("menu-item-disabled"),name:_3fe.itemName,href:_3fe.itemHref,onclick:_3fe.onclick}; -var icon=t.children("div.menu-icon"); -if(icon.length){ -var cc=[]; -var aa=icon.attr("class").split(" "); -for(var i=0;i").addClass(opts.cls.arrow).appendTo(_408); -$("").addClass("m-btn-line").appendTo(_408); +var _46e=btn.find(".l-btn-left"); +$("").addClass(opts.cls.arrow).appendTo(_46e); +$("").addClass("m-btn-line").appendTo(_46e); +} +$(_46d).menubutton("resize"); if(opts.menu){ $(opts.menu).menu({duration:opts.duration}); -var _409=$(opts.menu).menu("options"); -var _40a=_409.onShow; -var _40b=_409.onHide; -$.extend(_409,{onShow:function(){ -var _40c=$(this).menu("options"); -var btn=$(_40c.alignTo); +var _46f=$(opts.menu).menu("options"); +var _470=_46f.onShow; +var _471=_46f.onHide; +$.extend(_46f,{onShow:function(){ +var _472=$(this).menu("options"); +var btn=$(_472.alignTo); var opts=btn.menubutton("options"); btn.addClass((opts.plain==true)?opts.cls.btn2:opts.cls.btn1); -_40a.call(this); +_470.call(this); },onHide:function(){ -var _40d=$(this).menu("options"); -var btn=$(_40d.alignTo); +var _473=$(this).menu("options"); +var btn=$(_473.alignTo); var opts=btn.menubutton("options"); btn.removeClass((opts.plain==true)?opts.cls.btn2:opts.cls.btn1); -_40b.call(this); +_471.call(this); }}); } }; -function _40e(_40f){ -var opts=$.data(_40f,"menubutton").options; -var btn=$(_40f); +function _474(_475){ +var opts=$.data(_475,"menubutton").options; +var btn=$(_475); var t=btn.find("."+opts.cls.trigger); if(!t.length){ t=btn; } t.unbind(".menubutton"); -var _410=null; +var _476=null; t.bind("click.menubutton",function(){ -if(!_411()){ -_412(_40f); +if(!_477()){ +_478(_475); return false; } }).bind("mouseenter.menubutton",function(){ -if(!_411()){ -_410=setTimeout(function(){ -_412(_40f); +if(!_477()){ +_476=setTimeout(function(){ +_478(_475); },opts.duration); return false; } }).bind("mouseleave.menubutton",function(){ -if(_410){ -clearTimeout(_410); +if(_476){ +clearTimeout(_476); } $(opts.menu).triggerHandler("mouseleave"); }); -function _411(){ -return $(_40f).linkbutton("options").disabled; +function _477(){ +return $(_475).linkbutton("options").disabled; }; }; -function _412(_413){ -var opts=$(_413).menubutton("options"); +function _478(_479){ +var opts=$(_479).menubutton("options"); if(opts.disabled||!opts.menu){ return; } $("body>div.menu-top").menu("hide"); -var btn=$(_413); +var btn=$(_479); var mm=$(opts.menu); if(mm.length){ mm.menu("options").alignTo=btn; @@ -5754,31 +6262,31 @@ mm.menu("show",{alignTo:btn,align:opts.menuAlign}); } btn.blur(); }; -$.fn.menubutton=function(_414,_415){ -if(typeof _414=="string"){ -var _416=$.fn.menubutton.methods[_414]; -if(_416){ -return _416(this,_415); +$.fn.menubutton=function(_47a,_47b){ +if(typeof _47a=="string"){ +var _47c=$.fn.menubutton.methods[_47a]; +if(_47c){ +return _47c(this,_47b); }else{ -return this.linkbutton(_414,_415); +return this.linkbutton(_47a,_47b); } } -_414=_414||{}; +_47a=_47a||{}; return this.each(function(){ -var _417=$.data(this,"menubutton"); -if(_417){ -$.extend(_417.options,_414); +var _47d=$.data(this,"menubutton"); +if(_47d){ +$.extend(_47d.options,_47a); }else{ -$.data(this,"menubutton",{options:$.extend({},$.fn.menubutton.defaults,$.fn.menubutton.parseOptions(this),_414)}); +$.data(this,"menubutton",{options:$.extend({},$.fn.menubutton.defaults,$.fn.menubutton.parseOptions(this),_47a)}); $(this).removeAttr("disabled"); } init(this); -_40e(this); +_474(this); }); }; $.fn.menubutton.methods={options:function(jq){ -var _418=jq.linkbutton("options"); -return $.extend($.data(jq[0],"menubutton").options,{toggle:_418.toggle,selected:_418.selected,disabled:_418.disabled}); +var _47e=jq.linkbutton("options"); +return $.extend($.data(jq[0],"menubutton").options,{toggle:_47e.toggle,selected:_47e.selected,disabled:_47e.disabled}); },destroy:function(jq){ return jq.each(function(){ var opts=$(this).menubutton("options"); @@ -5788,208 +6296,402 @@ $(opts.menu).menu("destroy"); $(this).remove(); }); }}; -$.fn.menubutton.parseOptions=function(_419){ -var t=$(_419); -return $.extend({},$.fn.linkbutton.parseOptions(_419),$.parser.parseOptions(_419,["menu",{plain:"boolean",duration:"number"}])); +$.fn.menubutton.parseOptions=function(_47f){ +var t=$(_47f); +return $.extend({},$.fn.linkbutton.parseOptions(_47f),$.parser.parseOptions(_47f,["menu",{plain:"boolean",hasDownArrow:"boolean",duration:"number"}])); }; -$.fn.menubutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,menu:null,menuAlign:"left",duration:100,cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}}); +$.fn.menubutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,hasDownArrow:true,menu:null,menuAlign:"left",duration:100,cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}}); })(jQuery); (function($){ -function init(_41a){ -var opts=$.data(_41a,"splitbutton").options; -$(_41a).menubutton(opts); -$(_41a).addClass("s-btn"); +function init(_480){ +var opts=$.data(_480,"splitbutton").options; +$(_480).menubutton(opts); +$(_480).addClass("s-btn"); }; -$.fn.splitbutton=function(_41b,_41c){ -if(typeof _41b=="string"){ -var _41d=$.fn.splitbutton.methods[_41b]; -if(_41d){ -return _41d(this,_41c); +$.fn.splitbutton=function(_481,_482){ +if(typeof _481=="string"){ +var _483=$.fn.splitbutton.methods[_481]; +if(_483){ +return _483(this,_482); }else{ -return this.menubutton(_41b,_41c); +return this.menubutton(_481,_482); } } -_41b=_41b||{}; +_481=_481||{}; return this.each(function(){ -var _41e=$.data(this,"splitbutton"); -if(_41e){ -$.extend(_41e.options,_41b); +var _484=$.data(this,"splitbutton"); +if(_484){ +$.extend(_484.options,_481); }else{ -$.data(this,"splitbutton",{options:$.extend({},$.fn.splitbutton.defaults,$.fn.splitbutton.parseOptions(this),_41b)}); +$.data(this,"splitbutton",{options:$.extend({},$.fn.splitbutton.defaults,$.fn.splitbutton.parseOptions(this),_481)}); $(this).removeAttr("disabled"); } init(this); }); }; $.fn.splitbutton.methods={options:function(jq){ -var _41f=jq.menubutton("options"); -var _420=$.data(jq[0],"splitbutton").options; -$.extend(_420,{disabled:_41f.disabled,toggle:_41f.toggle,selected:_41f.selected}); -return _420; +var _485=jq.menubutton("options"); +var _486=$.data(jq[0],"splitbutton").options; +$.extend(_486,{disabled:_485.disabled,toggle:_485.toggle,selected:_485.selected}); +return _486; }}; -$.fn.splitbutton.parseOptions=function(_421){ -var t=$(_421); -return $.extend({},$.fn.linkbutton.parseOptions(_421),$.parser.parseOptions(_421,["menu",{plain:"boolean",duration:"number"}])); +$.fn.splitbutton.parseOptions=function(_487){ +var t=$(_487); +return $.extend({},$.fn.linkbutton.parseOptions(_487),$.parser.parseOptions(_487,["menu",{plain:"boolean",duration:"number"}])); }; $.fn.splitbutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,menu:null,duration:100,cls:{btn1:"m-btn-active s-btn-active",btn2:"m-btn-plain-active s-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn-line"}}); })(jQuery); (function($){ -function init(_422){ -$(_422).addClass("validatebox-text"); +function init(_488){ +var _489=$(""+""+""+""+""+""+""+"").insertAfter(_488); +var t=$(_488); +t.addClass("switchbutton-f").hide(); +var name=t.attr("name"); +if(name){ +t.removeAttr("name").attr("switchbuttonName",name); +_489.find(".switchbutton-value").attr("name",name); +} +_489.bind("_resize",function(e,_48a){ +if($(this).hasClass("easyui-fluid")||_48a){ +_48b(_488); +} +return false; +}); +return _489; +}; +function _48b(_48c,_48d){ +var _48e=$.data(_48c,"switchbutton"); +var opts=_48e.options; +var _48f=_48e.switchbutton; +if(_48d){ +$.extend(opts,_48d); +} +var _490=_48f.is(":visible"); +if(!_490){ +_48f.appendTo("body"); +} +_48f._size(opts); +var w=_48f.width(); +var h=_48f.height(); +var w=_48f.outerWidth(); +var h=_48f.outerHeight(); +var _491=parseInt(opts.handleWidth)||_48f.height(); +var _492=w*2-_491; +_48f.find(".switchbutton-inner").css({width:_492+"px",height:h+"px",lineHeight:h+"px"}); +_48f.find(".switchbutton-handle")._outerWidth(_491)._outerHeight(h).css({marginLeft:-_491/2+"px"}); +_48f.find(".switchbutton-on").css({width:(w-_491/2)+"px",textIndent:(opts.reversed?"":"-")+_491/2+"px"}); +_48f.find(".switchbutton-off").css({width:(w-_491/2)+"px",textIndent:(opts.reversed?"-":"")+_491/2+"px"}); +opts.marginWidth=w-_491; +_493(_48c,opts.checked,false); +if(!_490){ +_48f.insertAfter(_48c); +} +}; +function _494(_495){ +var _496=$.data(_495,"switchbutton"); +var opts=_496.options; +var _497=_496.switchbutton; +var _498=_497.find(".switchbutton-inner"); +var on=_498.find(".switchbutton-on").html(opts.onText); +var off=_498.find(".switchbutton-off").html(opts.offText); +var _499=_498.find(".switchbutton-handle").html(opts.handleText); +if(opts.reversed){ +off.prependTo(_498); +on.insertAfter(_499); +}else{ +on.prependTo(_498); +off.insertAfter(_499); +} +_497.find(".switchbutton-value")._propAttr("checked",opts.checked); +_497.removeClass("switchbutton-disabled").addClass(opts.disabled?"switchbutton-disabled":""); +_497.removeClass("switchbutton-reversed").addClass(opts.reversed?"switchbutton-reversed":""); +_493(_495,opts.checked); +_49a(_495,opts.readonly); +$(_495).switchbutton("setValue",opts.value); +}; +function _493(_49b,_49c,_49d){ +var _49e=$.data(_49b,"switchbutton"); +var opts=_49e.options; +opts.checked=_49c; +var _49f=_49e.switchbutton.find(".switchbutton-inner"); +var _4a0=_49f.find(".switchbutton-on"); +var _4a1=opts.reversed?(opts.checked?opts.marginWidth:0):(opts.checked?0:opts.marginWidth); +var dir=_4a0.css("float").toLowerCase(); +var css={}; +css["margin-"+dir]=-_4a1+"px"; +_49d?_49f.animate(css,200):_49f.css(css); +var _4a2=_49f.find(".switchbutton-value"); +var ck=_4a2.is(":checked"); +$(_49b).add(_4a2)._propAttr("checked",opts.checked); +if(ck!=opts.checked){ +opts.onChange.call(_49b,opts.checked); +} +}; +function _4a3(_4a4,_4a5){ +var _4a6=$.data(_4a4,"switchbutton"); +var opts=_4a6.options; +var _4a7=_4a6.switchbutton; +var _4a8=_4a7.find(".switchbutton-value"); +if(_4a5){ +opts.disabled=true; +$(_4a4).add(_4a8).attr("disabled","disabled"); +_4a7.addClass("switchbutton-disabled"); +}else{ +opts.disabled=false; +$(_4a4).add(_4a8).removeAttr("disabled"); +_4a7.removeClass("switchbutton-disabled"); +} +}; +function _49a(_4a9,mode){ +var _4aa=$.data(_4a9,"switchbutton"); +var opts=_4aa.options; +opts.readonly=mode==undefined?true:mode; +_4aa.switchbutton.removeClass("switchbutton-readonly").addClass(opts.readonly?"switchbutton-readonly":""); +}; +function _4ab(_4ac){ +var _4ad=$.data(_4ac,"switchbutton"); +var opts=_4ad.options; +_4ad.switchbutton.unbind(".switchbutton").bind("click.switchbutton",function(){ +if(!opts.disabled&&!opts.readonly){ +_493(_4ac,opts.checked?false:true,true); +} +}); +}; +$.fn.switchbutton=function(_4ae,_4af){ +if(typeof _4ae=="string"){ +return $.fn.switchbutton.methods[_4ae](this,_4af); +} +_4ae=_4ae||{}; +return this.each(function(){ +var _4b0=$.data(this,"switchbutton"); +if(_4b0){ +$.extend(_4b0.options,_4ae); +}else{ +_4b0=$.data(this,"switchbutton",{options:$.extend({},$.fn.switchbutton.defaults,$.fn.switchbutton.parseOptions(this),_4ae),switchbutton:init(this)}); +} +_4b0.options.originalChecked=_4b0.options.checked; +_494(this); +_48b(this); +_4ab(this); +}); +}; +$.fn.switchbutton.methods={options:function(jq){ +var _4b1=jq.data("switchbutton"); +return $.extend(_4b1.options,{value:_4b1.switchbutton.find(".switchbutton-value").val()}); +},resize:function(jq,_4b2){ +return jq.each(function(){ +_48b(this,_4b2); +}); +},enable:function(jq){ +return jq.each(function(){ +_4a3(this,false); +}); +},disable:function(jq){ +return jq.each(function(){ +_4a3(this,true); +}); +},readonly:function(jq,mode){ +return jq.each(function(){ +_49a(this,mode); +}); +},check:function(jq){ +return jq.each(function(){ +_493(this,true); +}); +},uncheck:function(jq){ +return jq.each(function(){ +_493(this,false); +}); +},clear:function(jq){ +return jq.each(function(){ +_493(this,false); +}); +},reset:function(jq){ +return jq.each(function(){ +var opts=$(this).switchbutton("options"); +_493(this,opts.originalChecked); +}); +},setValue:function(jq,_4b3){ +return jq.each(function(){ +$(this).val(_4b3); +$.data(this,"switchbutton").switchbutton.find(".switchbutton-value").val(_4b3); +}); +}}; +$.fn.switchbutton.parseOptions=function(_4b4){ +var t=$(_4b4); +return $.extend({},$.parser.parseOptions(_4b4,["onText","offText","handleText",{handleWidth:"number",reversed:"boolean"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)}); +}; +$.fn.switchbutton.defaults={handleWidth:"auto",width:60,height:26,checked:false,disabled:false,readonly:false,reversed:false,onText:"ON",offText:"OFF",handleText:"",value:"on",onChange:function(_4b5){ +}}; +})(jQuery); +(function($){ +function init(_4b6){ +$(_4b6).addClass("validatebox-text"); }; -function _423(_424){ -var _425=$.data(_424,"validatebox"); -_425.validating=false; -if(_425.timer){ -clearTimeout(_425.timer); +function _4b7(_4b8){ +var _4b9=$.data(_4b8,"validatebox"); +_4b9.validating=false; +if(_4b9.vtimer){ +clearTimeout(_4b9.vtimer); } -$(_424).tooltip("destroy"); -$(_424).unbind(); -$(_424).remove(); +if(_4b9.ftimer){ +clearTimeout(_4b9.ftimer); +} +$(_4b8).tooltip("destroy"); +$(_4b8).unbind(); +$(_4b8).remove(); }; -function _426(_427){ -var opts=$.data(_427,"validatebox").options; -var box=$(_427); -box.unbind(".validatebox"); -if(opts.novalidate||box.is(":disabled")){ +function _4ba(_4bb){ +var opts=$.data(_4bb,"validatebox").options; +$(_4bb).unbind(".validatebox"); +if(opts.novalidate||opts.disabled){ return; } -for(var _428 in opts.events){ -$(_427).bind(_428+".validatebox",{target:_427},opts.events[_428]); +for(var _4bc in opts.events){ +$(_4bb).bind(_4bc+".validatebox",{target:_4bb},opts.events[_4bc]); } }; -function _429(e){ -var _42a=e.data.target; -var _42b=$.data(_42a,"validatebox"); -var box=$(_42a); -if($(_42a).attr("readonly")){ +function _4bd(e){ +var _4be=e.data.target; +var _4bf=$.data(_4be,"validatebox"); +var opts=_4bf.options; +if($(_4be).attr("readonly")){ return; } -_42b.validating=true; -_42b.value=undefined; +_4bf.validating=true; +_4bf.value=opts.val(_4be); (function(){ -if(_42b.validating){ -if(_42b.value!=box.val()){ -_42b.value=box.val(); -if(_42b.timer){ -clearTimeout(_42b.timer); -} -_42b.timer=setTimeout(function(){ -$(_42a).validatebox("validate"); -},_42b.options.delay); +if(!$(_4be).is(":visible")){ +_4bf.validating=false; +} +if(_4bf.validating){ +var _4c0=opts.val(_4be); +if(_4bf.value!=_4c0){ +_4bf.value=_4c0; +if(_4bf.vtimer){ +clearTimeout(_4bf.vtimer); +} +_4bf.vtimer=setTimeout(function(){ +$(_4be).validatebox("validate"); +},opts.delay); }else{ -_42c(_42a); +if(_4bf.message){ +opts.err(_4be,_4bf.message); } -setTimeout(arguments.callee,200); +} +_4bf.ftimer=setTimeout(arguments.callee,opts.interval); } })(); }; -function _42d(e){ -var _42e=e.data.target; -var _42f=$.data(_42e,"validatebox"); -if(_42f.timer){ -clearTimeout(_42f.timer); -_42f.timer=undefined; -} -_42f.validating=false; -_430(_42e); -}; -function _431(e){ -var _432=e.data.target; -if($(_432).hasClass("validatebox-invalid")){ -_433(_432); -} -}; -function _434(e){ -var _435=e.data.target; -var _436=$.data(_435,"validatebox"); -if(!_436.validating){ -_430(_435); -} -}; -function _433(_437){ -var _438=$.data(_437,"validatebox"); -var opts=_438.options; -$(_437).tooltip($.extend({},opts.tipOptions,{content:_438.message,position:opts.tipPosition,deltaX:opts.deltaX})).tooltip("show"); -_438.tip=true; -}; -function _42c(_439){ -var _43a=$.data(_439,"validatebox"); -if(_43a&&_43a.tip){ -$(_439).tooltip("reposition"); -} -}; -function _430(_43b){ -var _43c=$.data(_43b,"validatebox"); -_43c.tip=false; -$(_43b).tooltip("hide"); -}; -function _43d(_43e){ -var _43f=$.data(_43e,"validatebox"); -var opts=_43f.options; -var box=$(_43e); -opts.onBeforeValidate.call(_43e); -var _440=_441(); -opts.onValidate.call(_43e,_440); -return _440; -function _442(msg){ -_43f.message=msg; -}; -function _443(_444,_445){ -var _446=box.val(); -var _447=/([a-zA-Z_]+)(.*)/.exec(_444); -var rule=opts.rules[_447[1]]; -if(rule&&_446){ -var _448=_445||opts.validParams||eval(_447[2]); -if(!rule["validator"].call(_43e,_446,_448)){ -box.addClass("validatebox-invalid"); -var _449=rule["message"]; -if(_448){ -for(var i=0;i<_448.length;i++){ -_449=_449.replace(new RegExp("\\{"+i+"\\}","g"),_448[i]); -} -} -_442(opts.invalidMessage||_449); -if(_43f.validating){ -_433(_43e); +function _4c1(e){ +var _4c2=e.data.target; +var _4c3=$.data(_4c2,"validatebox"); +var opts=_4c3.options; +_4c3.validating=false; +if(_4c3.vtimer){ +clearTimeout(_4c3.vtimer); +_4c3.vtimer=undefined; +} +if(_4c3.ftimer){ +clearTimeout(_4c3.ftimer); +_4c3.ftimer=undefined; +} +if(opts.validateOnBlur){ +setTimeout(function(){ +$(_4c2).validatebox("validate"); +},0); } +opts.err(_4c2,_4c3.message,"hide"); +}; +function _4c4(e){ +var _4c5=e.data.target; +var _4c6=$.data(_4c5,"validatebox"); +_4c6.options.err(_4c5,_4c6.message,"show"); +}; +function _4c7(e){ +var _4c8=e.data.target; +var _4c9=$.data(_4c8,"validatebox"); +if(!_4c9.validating){ +_4c9.options.err(_4c8,_4c9.message,"hide"); +} +}; +function _4ca(_4cb,_4cc,_4cd){ +var _4ce=$.data(_4cb,"validatebox"); +var opts=_4ce.options; +var t=$(_4cb); +if(_4cd=="hide"||!_4cc){ +t.tooltip("hide"); +}else{ +if((t.is(":focus")&&_4ce.validating)||_4cd=="show"){ +t.tooltip($.extend({},opts.tipOptions,{content:_4cc,position:opts.tipPosition,deltaX:opts.deltaX,deltaY:opts.deltaY})).tooltip("show"); +} +} +}; +function _4cf(_4d0){ +var _4d1=$.data(_4d0,"validatebox"); +var opts=_4d1.options; +var box=$(_4d0); +opts.onBeforeValidate.call(_4d0); +var _4d2=_4d3(); +_4d2?box.removeClass("validatebox-invalid"):box.addClass("validatebox-invalid"); +opts.err(_4d0,_4d1.message); +opts.onValidate.call(_4d0,_4d2); +return _4d2; +function _4d4(msg){ +_4d1.message=msg; +}; +function _4d5(_4d6,_4d7){ +var _4d8=opts.val(_4d0); +var _4d9=/([a-zA-Z_]+)(.*)/.exec(_4d6); +var rule=opts.rules[_4d9[1]]; +if(rule&&_4d8){ +var _4da=_4d7||opts.validParams||eval(_4d9[2]); +if(!rule["validator"].call(_4d0,_4d8,_4da)){ +var _4db=rule["message"]; +if(_4da){ +for(var i=0;i<_4da.length;i++){ +_4db=_4db.replace(new RegExp("\\{"+i+"\\}","g"),_4da[i]); +} +} +_4d4(opts.invalidMessage||_4db); return false; } } return true; }; -function _441(){ -box.removeClass("validatebox-invalid"); -_430(_43e); -if(opts.novalidate||box.is(":disabled")){ +function _4d3(){ +_4d4(""); +if(!opts._validateOnCreate){ +setTimeout(function(){ +opts._validateOnCreate=true; +},0); return true; } -if(opts.required){ -if(box.val()==""){ -box.addClass("validatebox-invalid"); -_442(opts.missingMessage); -if(_43f.validating){ -_433(_43e); +if(opts.novalidate||opts.disabled){ +return true; } +if(opts.required){ +if(opts.val(_4d0)==""){ +_4d4(opts.missingMessage); return false; } } if(opts.validType){ if($.isArray(opts.validType)){ for(var i=0;i=_456[0]&&len<=_456[1]; -},message:"Please enter a value between {0} and {1}."},remote:{validator:function(_457,_458){ +}},rules:{email:{validator:function(_4eb){ +return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(_4eb); +},message:"Please enter a valid email address."},url:{validator:function(_4ec){ +return /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(_4ec); +},message:"Please enter a valid URL."},length:{validator:function(_4ed,_4ee){ +var len=$.trim(_4ed).length; +return len>=_4ee[0]&&len<=_4ee[1]; +},message:"Please enter a value between {0} and {1}."},remote:{validator:function(_4ef,_4f0){ var data={}; -data[_458[1]]=_457; -var _459=$.ajax({url:_458[0],dataType:"json",data:data,async:false,cache:false,type:"post"}).responseText; -return _459=="true"; +data[_4f0[1]]=_4ef; +var _4f1=$.ajax({url:_4f0[0],dataType:"json",data:data,async:false,cache:false,type:"post"}).responseText; +return _4f1=="true"; },message:"Please fix this field."}},onBeforeValidate:function(){ -},onValidate:function(_45a){ +},onValidate:function(_4f2){ }}; })(jQuery); (function($){ -function init(_45b){ -$(_45b).addClass("textbox-f").hide(); -var span=$(""+""+""+"").insertAfter(_45b); -var name=$(_45b).attr("name"); +var _4f3=0; +function init(_4f4){ +$(_4f4).addClass("textbox-f").hide(); +var span=$(""+""+""+"").insertAfter(_4f4); +var name=$(_4f4).attr("name"); if(name){ span.find("input.textbox-value").attr("name",name); -$(_45b).removeAttr("name").attr("textboxName",name); +$(_4f4).removeAttr("name").attr("textboxName",name); } return span; }; -function _45c(_45d){ -var _45e=$.data(_45d,"textbox"); -var opts=_45e.options; -var tb=_45e.textbox; +function _4f5(_4f6){ +var _4f7=$.data(_4f6,"textbox"); +var opts=_4f7.options; +var tb=_4f7.textbox; +var _4f8="_easyui_textbox_input"+(++_4f3); +tb.addClass(opts.cls); tb.find(".textbox-text").remove(); if(opts.multiline){ -$("").prependTo(tb); +$("").prependTo(tb); }else{ -$("").prependTo(tb); +$("").prependTo(tb); } +$("#"+_4f8).attr("tabindex",$(_4f6).attr("tabindex")||"").css("text-align",_4f6.style.textAlign||""); tb.find(".textbox-addon").remove(); var bb=opts.icons?$.extend(true,[],opts.icons):[]; if(opts.iconCls){ @@ -6108,95 +6858,180 @@ if(bb.length){ var bc=$("").prependTo(tb); bc.addClass("textbox-addon-"+opts.iconAlign); for(var i=0;i"); +bc.append(""); } } tb.find(".textbox-button").remove(); if(opts.buttonText||opts.buttonIcon){ -var btn=$("").prependTo(tb); -btn.addClass("textbox-button-"+opts.buttonAlign).linkbutton({text:opts.buttonText,iconCls:opts.buttonIcon}); +var btn=$("").prependTo(tb); +btn.addClass("textbox-button-"+opts.buttonAlign).linkbutton({text:opts.buttonText,iconCls:opts.buttonIcon,onClick:function(){ +var t=$(this).parent().prev(); +t.textbox("options").onClickButton.call(t[0]); +}}); +} +if(opts.label){ +if(typeof opts.label=="object"){ +_4f7.label=$(opts.label); +_4f7.label.attr("for",_4f8); +}else{ +$(_4f7.label).remove(); +_4f7.label=$("").html(opts.label); +_4f7.label.css("textAlign",opts.labelAlign).attr("for",_4f8); +if(opts.labelPosition=="after"){ +_4f7.label.insertAfter(tb); +}else{ +_4f7.label.insertBefore(_4f6); +} +_4f7.label.removeClass("textbox-label-left textbox-label-right textbox-label-top"); +_4f7.label.addClass("textbox-label-"+opts.labelPosition); +} +}else{ +$(_4f7.label).remove(); } -_45f(_45d,opts.disabled); -_460(_45d,opts.readonly); +_4f9(_4f6); +_4fa(_4f6,opts.disabled); +_4fb(_4f6,opts.readonly); }; -function _461(_462){ -var tb=$.data(_462,"textbox").textbox; +function _4fc(_4fd){ +var _4fe=$.data(_4fd,"textbox"); +var tb=_4fe.textbox; tb.find(".textbox-text").validatebox("destroy"); tb.remove(); -$(_462).remove(); +$(_4fe.label).remove(); +$(_4fd).remove(); }; -function _463(_464,_465){ -var _466=$.data(_464,"textbox"); -var opts=_466.options; -var tb=_466.textbox; -var _467=tb.parent(); -if(_465){ -opts.width=_465; +function _4ff(_500,_501){ +var _502=$.data(_500,"textbox"); +var opts=_502.options; +var tb=_502.textbox; +var _503=tb.parent(); +if(_501){ +if(typeof _501=="object"){ +$.extend(opts,_501); +}else{ +opts.width=_501; +} } if(isNaN(parseInt(opts.width))){ -var c=$(_464).clone(); +var c=$(_500).clone(); c.css("visibility","hidden"); -c.insertAfter(_464); +c.insertAfter(_500); opts.width=c.outerWidth(); c.remove(); } +var _504=tb.is(":visible"); +if(!_504){ tb.appendTo("body"); -var _468=tb.find(".textbox-text"); +} +var _505=tb.find(".textbox-text"); var btn=tb.find(".textbox-button"); -var _469=tb.find(".textbox-addon"); -var _46a=_469.find(".textbox-icon"); -tb._size(opts,_467); -btn.linkbutton("resize",{height:tb.height()}); -btn.css({left:(opts.buttonAlign=="left"?0:""),right:(opts.buttonAlign=="right"?0:"")}); -_469.css({left:(opts.iconAlign=="left"?(opts.buttonAlign=="left"?btn._outerWidth():0):""),right:(opts.iconAlign=="right"?(opts.buttonAlign=="right"?btn._outerWidth():0):"")}); -_46a.css({width:opts.iconWidth+"px",height:tb.height()+"px"}); -_468.css({paddingLeft:(_464.style.paddingLeft||""),paddingRight:(_464.style.paddingRight||""),marginLeft:_46b("left"),marginRight:_46b("right")}); -if(opts.multiline){ -_468.css({paddingTop:(_464.style.paddingTop||""),paddingBottom:(_464.style.paddingBottom||"")}); -_468._outerHeight(tb.height()); +var _506=tb.find(".textbox-addon"); +var _507=_506.find(".textbox-icon"); +if(opts.height=="auto"){ +_505.css({margin:"",paddingTop:"",paddingBottom:"",height:"",lineHeight:""}); +} +tb._size(opts,_503); +if(opts.label&&opts.labelPosition){ +if(opts.labelPosition=="top"){ +_502.label._size({width:opts.labelWidth=="auto"?tb.outerWidth():opts.labelWidth},tb); +if(opts.height!="auto"){ +tb._size("height",tb.outerHeight()-_502.label.outerHeight()); +} }else{ -var _46c=Math.floor((tb.height()-_468.height())/2); -_468.css({paddingTop:_46c+"px",paddingBottom:_46c+"px"}); +_502.label._size({width:opts.labelWidth,height:tb.outerHeight()},tb); +if(!opts.multiline){ +_502.label.css("lineHeight",_502.label.height()+"px"); } -_468._outerWidth(tb.width()-_46a.length*opts.iconWidth-btn._outerWidth()); -tb.insertAfter(_464); -opts.onResize.call(_464,opts.width,opts.height); -function _46b(_46d){ -return (opts.iconAlign==_46d?_469._outerWidth():0)+(opts.buttonAlign==_46d?btn._outerWidth():0); +tb._size("width",tb.outerWidth()-_502.label.outerWidth()); +} +} +if(opts.buttonAlign=="left"||opts.buttonAlign=="right"){ +btn.linkbutton("resize",{height:tb.height()}); +}else{ +btn.linkbutton("resize",{width:"100%"}); +} +var _508=tb.width()-_507.length*opts.iconWidth-_509("left")-_509("right"); +var _50a=opts.height=="auto"?_505.outerHeight():(tb.height()-_509("top")-_509("bottom")); +_506.css(opts.iconAlign,_509(opts.iconAlign)+"px"); +_506.css("top",_509("top")+"px"); +_507.css({width:opts.iconWidth+"px",height:_50a+"px"}); +_505.css({paddingLeft:(_500.style.paddingLeft||""),paddingRight:(_500.style.paddingRight||""),marginLeft:_50b("left"),marginRight:_50b("right"),marginTop:_509("top"),marginBottom:_509("bottom")}); +if(opts.multiline){ +_505.css({paddingTop:(_500.style.paddingTop||""),paddingBottom:(_500.style.paddingBottom||"")}); +_505._outerHeight(_50a); +}else{ +_505.css({paddingTop:0,paddingBottom:0,height:_50a+"px",lineHeight:_50a+"px"}); +} +_505._outerWidth(_508); +opts.onResizing.call(_500,opts.width,opts.height); +if(!_504){ +tb.insertAfter(_500); +} +opts.onResize.call(_500,opts.width,opts.height); +function _50b(_50c){ +return (opts.iconAlign==_50c?_506._outerWidth():0)+_509(_50c); +}; +function _509(_50d){ +var w=0; +btn.filter(".textbox-button-"+_50d).each(function(){ +if(_50d=="left"||_50d=="right"){ +w+=$(this).outerWidth(); +}else{ +w+=$(this).outerHeight(); +} +}); +return w; }; }; -function _46e(_46f){ -var opts=$(_46f).textbox("options"); -var _470=$(_46f).textbox("textbox"); -_470.validatebox($.extend({},opts,{deltaX:$(_46f).textbox("getTipX"),onBeforeValidate:function(){ +function _4f9(_50e){ +var opts=$(_50e).textbox("options"); +var _50f=$(_50e).textbox("textbox"); +_50f.validatebox($.extend({},opts,{deltaX:function(_510){ +return $(_50e).textbox("getTipX",_510); +},deltaY:function(_511){ +return $(_50e).textbox("getTipY",_511); +},onBeforeValidate:function(){ +opts.onBeforeValidate.call(_50e); var box=$(this); if(!box.is(":focus")){ +if(box.val()!==opts.value){ opts.oldInputValue=box.val(); box.val(opts.value); } -},onValidate:function(_471){ +} +},onValidate:function(_512){ var box=$(this); if(opts.oldInputValue!=undefined){ box.val(opts.oldInputValue); opts.oldInputValue=undefined; } var tb=box.parent(); -if(_471){ +if(_512){ tb.removeClass("textbox-invalid"); }else{ tb.addClass("textbox-invalid"); } +opts.onValidate.call(_50e,_512); }})); }; -function _472(_473){ -var _474=$.data(_473,"textbox"); -var opts=_474.options; -var tb=_474.textbox; -var _475=tb.find(".textbox-text"); -_475.attr("placeholder",opts.prompt); -_475.unbind(".textbox"); +function _513(_514){ +var _515=$.data(_514,"textbox"); +var opts=_515.options; +var tb=_515.textbox; +var _516=tb.find(".textbox-text"); +_516.attr("placeholder",opts.prompt); +_516.unbind(".textbox"); +$(_515.label).unbind(".textbox"); if(!opts.disabled&&!opts.readonly){ -_475.bind("blur.textbox",function(e){ +if(_515.label){ +$(_515.label).bind("click.textbox",function(e){ +if(!opts.hasFocusMe){ +_516.focus(); +$(_514).textbox("setSelectionRange",{start:0,end:_516.val().length}); +} +}); +} +_516.bind("blur.textbox",function(e){ if(!tb.hasClass("textbox-focused")){ return; } @@ -6208,6 +7043,7 @@ $(this).removeClass("textbox-prompt"); } tb.removeClass("textbox-focused"); }).bind("focus.textbox",function(e){ +opts.hasFocusMe=true; if(tb.hasClass("textbox-focused")){ return; } @@ -6217,24 +7053,24 @@ $(this).val(opts.value); $(this).removeClass("textbox-prompt"); tb.addClass("textbox-focused"); }); -for(var _476 in opts.inputEvents){ -_475.bind(_476+".textbox",{target:_473},opts.inputEvents[_476]); +for(var _517 in opts.inputEvents){ +_516.bind(_517+".textbox",{target:_514},opts.inputEvents[_517]); } } -var _477=tb.find(".textbox-addon"); -_477.unbind().bind("click",{target:_473},function(e){ +var _518=tb.find(".textbox-addon"); +_518.unbind().bind("click",{target:_514},function(e){ var icon=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)"); if(icon.length){ -var _478=parseInt(icon.attr("icon-index")); -var conf=opts.icons[_478]; +var _519=parseInt(icon.attr("icon-index")); +var conf=opts.icons[_519]; if(conf&&conf.handler){ conf.handler.call(icon[0],e); -opts.onClickIcon.call(_473,_478); } +opts.onClickIcon.call(_514,_519); } }); -_477.find(".textbox-icon").each(function(_479){ -var conf=opts.icons[_479]; +_518.find(".textbox-icon").each(function(_51a){ +var conf=opts.icons[_51a]; var icon=$(this); if(!conf||conf.disabled||opts.disabled||opts.readonly){ icon.addClass("textbox-icon-disabled"); @@ -6243,72 +7079,78 @@ icon.removeClass("textbox-icon-disabled"); } }); var btn=tb.find(".textbox-button"); -btn.unbind(".textbox").bind("click.textbox",function(){ -if(!btn.linkbutton("options").disabled){ -opts.onClickButton.call(_473); -} -}); btn.linkbutton((opts.disabled||opts.readonly)?"disable":"enable"); -tb.unbind(".textbox").bind("_resize.textbox",function(e,_47a){ -if($(this).hasClass("easyui-fluid")||_47a){ -_463(_473); +tb.unbind(".textbox").bind("_resize.textbox",function(e,_51b){ +if($(this).hasClass("easyui-fluid")||_51b){ +_4ff(_514); } return false; }); }; -function _45f(_47b,_47c){ -var _47d=$.data(_47b,"textbox"); -var opts=_47d.options; -var tb=_47d.textbox; -if(_47c){ -opts.disabled=true; -$(_47b).attr("disabled","disabled"); -tb.find(".textbox-text,.textbox-value").attr("disabled","disabled"); -}else{ -opts.disabled=false; -$(_47b).removeAttr("disabled"); -tb.find(".textbox-text,.textbox-value").removeAttr("disabled"); -} -}; -function _460(_47e,mode){ -var _47f=$.data(_47e,"textbox"); -var opts=_47f.options; +function _4fa(_51c,_51d){ +var _51e=$.data(_51c,"textbox"); +var opts=_51e.options; +var tb=_51e.textbox; +var _51f=tb.find(".textbox-text"); +var ss=$(_51c).add(tb.find(".textbox-value")); +opts.disabled=_51d; +if(opts.disabled){ +_51f.blur(); +_51f.validatebox("disable"); +tb.addClass("textbox-disabled"); +ss.attr("disabled","disabled"); +$(_51e.label).addClass("textbox-label-disabled"); +}else{ +_51f.validatebox("enable"); +tb.removeClass("textbox-disabled"); +ss.removeAttr("disabled"); +$(_51e.label).removeClass("textbox-label-disabled"); +} +}; +function _4fb(_520,mode){ +var _521=$.data(_520,"textbox"); +var opts=_521.options; +var tb=_521.textbox; +var _522=tb.find(".textbox-text"); opts.readonly=mode==undefined?true:mode; -var _480=_47f.textbox.find(".textbox-text"); -_480.removeAttr("readonly").removeClass("textbox-text-readonly"); -if(opts.readonly||!opts.editable){ -_480.attr("readonly","readonly").addClass("textbox-text-readonly"); +if(opts.readonly){ +_522.triggerHandler("blur.textbox"); } +_522.validatebox("readonly",opts.readonly); +tb.removeClass("textbox-readonly").addClass(opts.readonly?"textbox-readonly":""); }; -$.fn.textbox=function(_481,_482){ -if(typeof _481=="string"){ -var _483=$.fn.textbox.methods[_481]; -if(_483){ -return _483(this,_482); +$.fn.textbox=function(_523,_524){ +if(typeof _523=="string"){ +var _525=$.fn.textbox.methods[_523]; +if(_525){ +return _525(this,_524); }else{ return this.each(function(){ -var _484=$(this).textbox("textbox"); -_484.validatebox(_481,_482); +var _526=$(this).textbox("textbox"); +_526.validatebox(_523,_524); }); } } -_481=_481||{}; +_523=_523||{}; return this.each(function(){ -var _485=$.data(this,"textbox"); -if(_485){ -$.extend(_485.options,_481); -if(_481.value!=undefined){ -_485.options.originalValue=_481.value; +var _527=$.data(this,"textbox"); +if(_527){ +$.extend(_527.options,_523); +if(_523.value!=undefined){ +_527.options.originalValue=_523.value; } }else{ -_485=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_481),textbox:init(this)}); -_485.options.originalValue=_485.options.value; +_527=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_523),textbox:init(this)}); +_527.options.originalValue=_527.options.value; } -_45c(this); -_472(this); -_463(this); -_46e(this); -$(this).textbox("initValue",_485.options.value); +_4f5(this); +_513(this); +if(_527.options.doSize){ +_4ff(this); +} +var _528=_527.options.value; +_527.options.value=""; +$(this).textbox("initValue",_528); }); }; $.fn.textbox.methods={options:function(jq){ @@ -6322,45 +7164,59 @@ return; if(!$(from).data("textbox")){ $(from).textbox(); } +var opts=$.extend(true,{},$(from).textbox("options")); var name=t.attr("name")||""; t.addClass("textbox-f").hide(); t.removeAttr("name").attr("textboxName",name); var span=$(from).next().clone().insertAfter(t); -span.find("input.textbox-value").attr("name",name); -$.data(this,"textbox",{options:$.extend(true,{},$(from).textbox("options")),textbox:span}); -var _486=$(from).textbox("button"); -if(_486.length){ -t.textbox("button").linkbutton($.extend(true,{},_486.linkbutton("options"))); +var _529="_easyui_textbox_input"+(++_4f3); +span.find(".textbox-value").attr("name",name); +span.find(".textbox-text").attr("id",_529); +var _52a=$($(from).textbox("label")).clone(); +if(_52a.length){ +_52a.attr("for",_529); +if(opts.labelPosition=="after"){ +_52a.insertAfter(t.next()); +}else{ +_52a.insertBefore(t); } -_472(this); -_46e(this); +} +$.data(this,"textbox",{options:opts,textbox:span,label:(_52a.length?_52a:undefined)}); +var _52b=$(from).textbox("button"); +if(_52b.length){ +t.textbox("button").linkbutton($.extend(true,{},_52b.linkbutton("options"))); +} +_513(this); +_4f9(this); }); },textbox:function(jq){ return $.data(jq[0],"textbox").textbox.find(".textbox-text"); },button:function(jq){ return $.data(jq[0],"textbox").textbox.find(".textbox-button"); +},label:function(jq){ +return $.data(jq[0],"textbox").label; },destroy:function(jq){ return jq.each(function(){ -_461(this); +_4fc(this); }); -},resize:function(jq,_487){ +},resize:function(jq,_52c){ return jq.each(function(){ -_463(this,_487); +_4ff(this,_52c); }); },disable:function(jq){ return jq.each(function(){ -_45f(this,true); -_472(this); +_4fa(this,true); +_513(this); }); },enable:function(jq){ return jq.each(function(){ -_45f(this,false); -_472(this); +_4fa(this,false); +_513(this); }); },readonly:function(jq,mode){ return jq.each(function(){ -_460(this,mode); -_472(this); +_4fb(this,mode); +_513(this); }); },isValid:function(jq){ return jq.textbox("textbox").validatebox("isValid"); @@ -6368,44 +7224,45 @@ return jq.textbox("textbox").validatebox("isValid"); return jq.each(function(){ $(this).textbox("setValue",""); }); -},setText:function(jq,_488){ +},setText:function(jq,_52d){ return jq.each(function(){ var opts=$(this).textbox("options"); -var _489=$(this).textbox("textbox"); -if($(this).textbox("getText")!=_488){ -opts.value=_488; -_489.val(_488); +var _52e=$(this).textbox("textbox"); +_52d=_52d==undefined?"":String(_52d); +if($(this).textbox("getText")!=_52d){ +_52e.val(_52d); } -if(!_489.is(":focus")){ -if(_488){ -_489.removeClass("textbox-prompt"); +opts.value=_52d; +if(!_52e.is(":focus")){ +if(_52d){ +_52e.removeClass("textbox-prompt"); }else{ -_489.val(opts.prompt).addClass("textbox-prompt"); +_52e.val(opts.prompt).addClass("textbox-prompt"); } } $(this).textbox("validate"); }); -},initValue:function(jq,_48a){ +},initValue:function(jq,_52f){ return jq.each(function(){ -var _48b=$.data(this,"textbox"); -_48b.options.value=""; -$(this).textbox("setText",_48a); -_48b.textbox.find(".textbox-value").val(_48a); -$(this).val(_48a); +var _530=$.data(this,"textbox"); +$(this).textbox("setText",_52f); +_530.textbox.find(".textbox-value").val(_52f); +$(this).val(_52f); }); -},setValue:function(jq,_48c){ +},setValue:function(jq,_531){ return jq.each(function(){ var opts=$.data(this,"textbox").options; -var _48d=$(this).textbox("getValue"); -$(this).textbox("initValue",_48c); -if(_48d!=_48c){ -opts.onChange.call(this,_48c,_48d); +var _532=$(this).textbox("getValue"); +$(this).textbox("initValue",_531); +if(_532!=_531){ +opts.onChange.call(this,_531,_532); +$(this).closest("form").trigger("_change",[this]); } }); },getText:function(jq){ -var _48e=jq.textbox("textbox"); -if(_48e.is(":focus")){ -return _48e.val(); +var _533=jq.textbox("textbox"); +if(_533.is(":focus")){ +return _533.val(); }else{ return jq.textbox("options").value; } @@ -6414,66 +7271,267 @@ return jq.data("textbox").textbox.find(".textbox-value").val(); },reset:function(jq){ return jq.each(function(){ var opts=$(this).textbox("options"); +$(this).textbox("textbox").val(opts.originalValue); $(this).textbox("setValue",opts.originalValue); }); -},getIcon:function(jq,_48f){ -return jq.data("textbox").textbox.find(".textbox-icon:eq("+_48f+")"); -},getTipX:function(jq){ -var _490=jq.data("textbox"); -var opts=_490.options; -var tb=_490.textbox; -var _491=tb.find(".textbox-text"); -var _492=tb.find(".textbox-addon")._outerWidth(); -var _493=tb.find(".textbox-button")._outerWidth(); -if(opts.tipPosition=="right"){ -return (opts.iconAlign=="right"?_492:0)+(opts.buttonAlign=="right"?_493:0)+1; -}else{ -if(opts.tipPosition=="left"){ -return (opts.iconAlign=="left"?-_492:0)+(opts.buttonAlign=="left"?-_493:0)-1; +},getIcon:function(jq,_534){ +return jq.data("textbox").textbox.find(".textbox-icon:eq("+_534+")"); +},getTipX:function(jq,_535){ +var _536=jq.data("textbox"); +var opts=_536.options; +var tb=_536.textbox; +var _537=tb.find(".textbox-text"); +var _535=_535||opts.tipPosition; +var p1=tb.offset(); +var p2=_537.offset(); +var w1=tb.outerWidth(); +var w2=_537.outerWidth(); +if(_535=="right"){ +return w1-w2-p2.left+p1.left; +}else{ +if(_535=="left"){ +return p1.left-p2.left; +}else{ +return (w1-w2-p2.left+p1.left)/2-(p2.left-p1.left)/2; +} +} +},getTipY:function(jq,_538){ +var _539=jq.data("textbox"); +var opts=_539.options; +var tb=_539.textbox; +var _53a=tb.find(".textbox-text"); +var _538=_538||opts.tipPosition; +var p1=tb.offset(); +var p2=_53a.offset(); +var h1=tb.outerHeight(); +var h2=_53a.outerHeight(); +if(_538=="left"||_538=="right"){ +return (h1-h2-p2.top+p1.top)/2-(p2.top-p1.top)/2; +}else{ +if(_538=="bottom"){ +return (h1-h2-p2.top+p1.top); +}else{ +return (p1.top-p2.top); +} +} +},getSelectionStart:function(jq){ +return jq.textbox("getSelectionRange").start; +},getSelectionRange:function(jq){ +var _53b=jq.textbox("textbox")[0]; +var _53c=0; +var end=0; +if(typeof _53b.selectionStart=="number"){ +_53c=_53b.selectionStart; +end=_53b.selectionEnd; +}else{ +if(_53b.createTextRange){ +var s=document.selection.createRange(); +var _53d=_53b.createTextRange(); +_53d.setEndPoint("EndToStart",s); +_53c=_53d.text.length; +end=_53c+s.text.length; +} +} +return {start:_53c,end:end}; +},setSelectionRange:function(jq,_53e){ +return jq.each(function(){ +var _53f=$(this).textbox("textbox")[0]; +var _540=_53e.start; +var end=_53e.end; +if(_53f.setSelectionRange){ +_53f.setSelectionRange(_540,end); }else{ -return _492/2*(opts.iconAlign=="right"?1:-1); +if(_53f.createTextRange){ +var _541=_53f.createTextRange(); +_541.collapse(); +_541.moveEnd("character",end); +_541.moveStart("character",_540); +_541.select(); } } +}); }}; -$.fn.textbox.parseOptions=function(_494){ -var t=$(_494); -return $.extend({},$.fn.validatebox.parseOptions(_494),$.parser.parseOptions(_494,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign",{multiline:"boolean",editable:"boolean",iconWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)}); +$.fn.textbox.parseOptions=function(_542){ +var t=$(_542); +return $.extend({},$.fn.validatebox.parseOptions(_542),$.parser.parseOptions(_542,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign","label","labelPosition","labelAlign",{multiline:"boolean",iconWidth:"number",labelWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined)}); }; -$.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{width:"auto",height:22,prompt:"",value:"",type:"text",multiline:false,editable:true,disabled:false,readonly:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:18,buttonText:"",buttonIcon:null,buttonAlign:"right",inputEvents:{blur:function(e){ +$.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{doSize:true,width:"auto",height:"auto",cls:null,prompt:"",value:"",type:"text",multiline:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:18,buttonText:"",buttonIcon:null,buttonAlign:"right",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",inputEvents:{blur:function(e){ var t=$(e.data.target); var opts=t.textbox("options"); +if(t.textbox("getValue")!=opts.value){ t.textbox("setValue",opts.value); +} },keydown:function(e){ if(e.keyCode==13){ var t=$(e.data.target); t.textbox("setValue",t.textbox("getText")); } -}},onChange:function(_495,_496){ -},onResize:function(_497,_498){ +}},onChange:function(_543,_544){ +},onResizing:function(_545,_546){ +},onResize:function(_547,_548){ },onClickButton:function(){ -},onClickIcon:function(_499){ +},onClickIcon:function(_549){ }}); })(jQuery); (function($){ -var _49a=0; -function _49b(_49c){ -var _49d=$.data(_49c,"filebox"); -var opts=_49d.options; -var id="filebox_file_id_"+(++_49a); -$(_49c).addClass("filebox-f").textbox($.extend({},opts,{buttonText:opts.buttonText?(""):""})); -$(_49c).textbox("textbox").attr("readonly","readonly"); -_49d.filebox=$(_49c).next().addClass("filebox"); -_49d.filebox.find(".textbox-value").remove(); -opts.oldValue=""; -var file=$("").appendTo(_49d.filebox); -file.attr("id",id).attr("name",$(_49c).attr("textboxName")||""); -file.change(function(){ -$(_49c).filebox("setText",this.value); -opts.onChange.call(_49c,this.value,opts.oldValue); -opts.oldValue=this.value; +function _54a(_54b){ +var _54c=$.data(_54b,"passwordbox"); +var opts=_54c.options; +var _54d=$.extend(true,[],opts.icons); +if(opts.showEye){ +_54d.push({iconCls:"passwordbox-open",handler:function(e){ +opts.revealed=!opts.revealed; +_54e(_54b); +}}); +} +$(_54b).addClass("passwordbox-f").textbox($.extend({},opts,{icons:_54d})); +_54e(_54b); +}; +function _54f(_550,_551,all){ +var t=$(_550); +var opts=t.passwordbox("options"); +if(opts.revealed){ +t.textbox("setValue",_551); +return; +} +var _552=unescape(opts.passwordChar); +var cc=_551.split(""); +var vv=t.passwordbox("getValue").split(""); +for(var i=0;i").appendTo(btn); if(btn.linkbutton("options").disabled){ file.attr("disabled","disabled"); }else{ @@ -6481,110 +7539,149 @@ file.removeAttr("disabled"); } } }; -$.fn.filebox=function(_49e,_49f){ -if(typeof _49e=="string"){ -var _4a0=$.fn.filebox.methods[_49e]; -if(_4a0){ -return _4a0(this,_49f); +function _568(_569){ +var _56a=$.data(_569,"filebox"); +var opts=_56a.options; +_56a.filebox.find(".textbox-value").remove(); +opts.oldValue=""; +var file=$("").appendTo(_56a.filebox); +file.attr("id",opts.fileboxId).attr("name",$(_569).attr("textboxName")||""); +file.attr("accept",opts.accept); +file.attr("capture",opts.capture); +if(opts.multiple){ +file.attr("multiple","multiple"); +} +file.change(function(){ +var _56b=this.value; +if(this.files){ +_56b=$.map(this.files,function(file){ +return file.name; +}).join(opts.separator); +} +$(_569).filebox("setText",_56b); +opts.onChange.call(_569,_56b,opts.oldValue); +opts.oldValue=_56b; +}); +return file; +}; +$.fn.filebox=function(_56c,_56d){ +if(typeof _56c=="string"){ +var _56e=$.fn.filebox.methods[_56c]; +if(_56e){ +return _56e(this,_56d); }else{ -return this.textbox(_49e,_49f); +return this.textbox(_56c,_56d); } } -_49e=_49e||{}; +_56c=_56c||{}; return this.each(function(){ -var _4a1=$.data(this,"filebox"); -if(_4a1){ -$.extend(_4a1.options,_49e); +var _56f=$.data(this,"filebox"); +if(_56f){ +$.extend(_56f.options,_56c); }else{ -$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_49e)}); +$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_56c)}); } -_49b(this); +_565(this); }); }; $.fn.filebox.methods={options:function(jq){ var opts=jq.textbox("options"); return $.extend($.data(jq[0],"filebox").options,{width:opts.width,value:opts.value,originalValue:opts.originalValue,disabled:opts.disabled,readonly:opts.readonly}); +},clear:function(jq){ +return jq.each(function(){ +$(this).textbox("clear"); +_568(this); +}); +},reset:function(jq){ +return jq.each(function(){ +$(this).filebox("clear"); +}); +},setValue:function(jq){ +return jq; +},setValues:function(jq){ +return jq; }}; -$.fn.filebox.parseOptions=function(_4a2){ -return $.extend({},$.fn.textbox.parseOptions(_4a2),{}); +$.fn.filebox.parseOptions=function(_570){ +var t=$(_570); +return $.extend({},$.fn.textbox.parseOptions(_570),$.parser.parseOptions(_570,["accept","capture","separator"]),{multiple:(t.attr("multiple")?true:undefined)}); }; -$.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{}}); +$.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{},accept:"",capture:"",separator:",",multiple:false}); })(jQuery); (function($){ -function _4a3(_4a4){ -var _4a5=$.data(_4a4,"searchbox"); -var opts=_4a5.options; -var _4a6=$.extend(true,[],opts.icons); -_4a6.push({iconCls:"searchbox-button",handler:function(e){ +function _571(_572){ +var _573=$.data(_572,"searchbox"); +var opts=_573.options; +var _574=$.extend(true,[],opts.icons); +_574.push({iconCls:"searchbox-button",handler:function(e){ var t=$(e.data.target); var opts=t.searchbox("options"); opts.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName")); }}); -_4a7(); -var _4a8=_4a9(); -$(_4a4).addClass("searchbox-f").textbox($.extend({},opts,{icons:_4a6,buttonText:(_4a8?_4a8.text:"")})); -$(_4a4).attr("searchboxName",$(_4a4).attr("textboxName")); -_4a5.searchbox=$(_4a4).next(); -_4a5.searchbox.addClass("searchbox"); -_4aa(_4a8); -function _4a7(){ +_575(); +var _576=_577(); +$(_572).addClass("searchbox-f").textbox($.extend({},opts,{icons:_574,buttonText:(_576?_576.text:"")})); +$(_572).attr("searchboxName",$(_572).attr("textboxName")); +_573.searchbox=$(_572).next(); +_573.searchbox.addClass("searchbox"); +_578(_576); +function _575(){ if(opts.menu){ -_4a5.menu=$(opts.menu).menu(); -var _4ab=_4a5.menu.menu("options"); -var _4ac=_4ab.onClick; -_4ab.onClick=function(item){ -_4aa(item); -_4ac.call(this,item); +_573.menu=$(opts.menu).menu(); +var _579=_573.menu.menu("options"); +var _57a=_579.onClick; +_579.onClick=function(item){ +_578(item); +_57a.call(this,item); }; }else{ -if(_4a5.menu){ -_4a5.menu.menu("destroy"); +if(_573.menu){ +_573.menu.menu("destroy"); } -_4a5.menu=null; +_573.menu=null; } }; -function _4a9(){ -if(_4a5.menu){ -var item=_4a5.menu.children("div.menu-item:first"); -_4a5.menu.children("div.menu-item").each(function(){ -var _4ad=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); -if(_4ad.selected){ +function _577(){ +if(_573.menu){ +var item=_573.menu.children("div.menu-item:first"); +_573.menu.children("div.menu-item").each(function(){ +var _57b=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); +if(_57b.selected){ item=$(this); return false; } }); -return _4a5.menu.menu("getItem",item[0]); +return _573.menu.menu("getItem",item[0]); }else{ return null; } }; -function _4aa(item){ +function _578(item){ if(!item){ return; } -$(_4a4).textbox("button").menubutton({text:item.text,iconCls:(item.iconCls||null),menu:_4a5.menu,menuAlign:opts.buttonAlign,plain:false}); -_4a5.searchbox.find("input.textbox-value").attr("name",item.name||item.text); -$(_4a4).searchbox("resize"); +$(_572).textbox("button").menubutton({text:item.text,iconCls:(item.iconCls||null),menu:_573.menu,menuAlign:opts.buttonAlign,plain:false}); +_573.searchbox.find("input.textbox-value").attr("name",item.name||item.text); +$(_572).searchbox("resize"); }; }; -$.fn.searchbox=function(_4ae,_4af){ -if(typeof _4ae=="string"){ -var _4b0=$.fn.searchbox.methods[_4ae]; -if(_4b0){ -return _4b0(this,_4af); +$.fn.searchbox=function(_57c,_57d){ +if(typeof _57c=="string"){ +var _57e=$.fn.searchbox.methods[_57c]; +if(_57e){ +return _57e(this,_57d); }else{ -return this.textbox(_4ae,_4af); +return this.textbox(_57c,_57d); } } -_4ae=_4ae||{}; +_57c=_57c||{}; return this.each(function(){ -var _4b1=$.data(this,"searchbox"); -if(_4b1){ -$.extend(_4b1.options,_4ae); +var _57f=$.data(this,"searchbox"); +if(_57f){ +$.extend(_57f.options,_57c); }else{ -$.data(this,"searchbox",{options:$.extend({},$.fn.searchbox.defaults,$.fn.searchbox.parseOptions(this),_4ae)}); +$.data(this,"searchbox",{options:$.extend({},$.fn.searchbox.defaults,$.fn.searchbox.parseOptions(this),_57c)}); } -_4a3(this); +_571(this); }); }; $.fn.searchbox.methods={options:function(jq){ @@ -6616,9 +7713,9 @@ menu.menu("destroy"); $(this).textbox("destroy"); }); }}; -$.fn.searchbox.parseOptions=function(_4b2){ -var t=$(_4b2); -return $.extend({},$.fn.textbox.parseOptions(_4b2),$.parser.parseOptions(_4b2,["menu"]),{searcher:(t.attr("searcher")?eval(t.attr("searcher")):undefined)}); +$.fn.searchbox.parseOptions=function(_580){ +var t=$(_580); +return $.extend({},$.fn.textbox.parseOptions(_580),$.parser.parseOptions(_580,["menu"]),{searcher:(t.attr("searcher")?eval(t.attr("searcher")):undefined)}); }; $.fn.searchbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:$.extend({},$.fn.textbox.defaults.inputEvents,{keydown:function(e){ if(e.keyCode==13){ @@ -6629,64 +7726,102 @@ t.searchbox("setValue",$(this).val()); opts.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName")); return false; } -}}),buttonAlign:"left",menu:null,searcher:function(_4b3,name){ +}}),buttonAlign:"left",menu:null,searcher:function(_581,name){ }}); })(jQuery); (function($){ -function _4b4(_4b5,_4b6){ -var opts=$.data(_4b5,"form").options; -$.extend(opts,_4b6||{}); -var _4b7=$.extend({},opts.queryParams); -if(opts.onSubmit.call(_4b5,_4b7)==false){ -return; -} -$(_4b5).find(".textbox-text:focus").blur(); -var _4b8="easyui_frame_"+(new Date().getTime()); -var _4b9=$("").appendTo("body"); -_4b9.attr("src",window.ActiveXObject?"javascript:false":"about:blank"); -_4b9.css({position:"absolute",top:-1000,left:-1000}); -_4b9.bind("load",cb); -_4ba(_4b7); -function _4ba(_4bb){ -var form=$(_4b5); +function _582(_583,_584){ +var opts=$.data(_583,"form").options; +$.extend(opts,_584||{}); +var _585=$.extend({},opts.queryParams); +if(opts.onSubmit.call(_583,_585)==false){ +return; +} +var _586=$(_583).find(".textbox-text:focus"); +_586.triggerHandler("blur"); +_586.focus(); +var _587=null; +if(opts.dirty){ +var ff=[]; +$.map(opts.dirtyFields,function(f){ +if($(f).hasClass("textbox-f")){ +$(f).next().find(".textbox-value").each(function(){ +ff.push(this); +}); +}else{ +ff.push(f); +} +}); +_587=$(_583).find("input[name]:enabled,textarea[name]:enabled,select[name]:enabled").filter(function(){ +return $.inArray(this,ff)==-1; +}); +_587.attr("disabled","disabled"); +} +if(opts.ajax){ +if(opts.iframe){ +_588(_583,_585); +}else{ +if(window.FormData!==undefined){ +_589(_583,_585); +}else{ +_588(_583,_585); +} +} +}else{ +$(_583).submit(); +} +if(opts.dirty){ +_587.removeAttr("disabled"); +} +}; +function _588(_58a,_58b){ +var opts=$.data(_58a,"form").options; +var _58c="easyui_frame_"+(new Date().getTime()); +var _58d=$("").appendTo("body"); +_58d.attr("src",window.ActiveXObject?"javascript:false":"about:blank"); +_58d.css({position:"absolute",top:-1000,left:-1000}); +_58d.bind("load",cb); +_58e(_58b); +function _58e(_58f){ +var form=$(_58a); if(opts.url){ form.attr("action",opts.url); } var t=form.attr("target"),a=form.attr("action"); -form.attr("target",_4b8); -var _4bc=$(); +form.attr("target",_58c); +var _590=$(); try{ -for(var n in _4bb){ -var _4bd=$("").val(_4bb[n]).appendTo(form); -_4bc=_4bc.add(_4bd); +for(var n in _58f){ +var _591=$("").val(_58f[n]).appendTo(form); +_590=_590.add(_591); } -_4be(); +_592(); form[0].submit(); } finally{ form.attr("action",a); t?form.attr("target",t):form.removeAttr("target"); -_4bc.remove(); +_590.remove(); } }; -function _4be(){ -var f=$("#"+_4b8); +function _592(){ +var f=$("#"+_58c); if(!f.length){ return; } try{ var s=f.contents()[0].readyState; if(s&&s.toLowerCase()=="uninitialized"){ -setTimeout(_4be,100); +setTimeout(_592,100); } } catch(e){ cb(); } }; -var _4bf=10; +var _593=10; function cb(){ -var f=$("#"+_4b8); +var f=$("#"+_58c); if(!f.length){ return; } @@ -6696,7 +7831,7 @@ try{ var body=f.contents().find("body"); data=body.html(); if(data==""){ -if(--_4bf){ +if(--_593){ setTimeout(cb,100); return; } @@ -6713,91 +7848,120 @@ data=pre.html(); } catch(e){ } -opts.success(data); +opts.success.call(_58a,data); setTimeout(function(){ f.unbind(); f.remove(); },100); }; }; -function load(_4c0,data){ -var opts=$.data(_4c0,"form").options; +function _589(_594,_595){ +var opts=$.data(_594,"form").options; +var _596=new FormData($(_594)[0]); +for(var name in _595){ +_596.append(name,_595[name]); +} +$.ajax({url:opts.url,type:"post",xhr:function(){ +var xhr=$.ajaxSettings.xhr(); +if(xhr.upload){ +xhr.upload.addEventListener("progress",function(e){ +if(e.lengthComputable){ +var _597=e.total; +var _598=e.loaded||e.position; +var _599=Math.ceil(_598*100/_597); +opts.onProgress.call(_594,_599); +} +},false); +} +return xhr; +},data:_596,dataType:"html",cache:false,contentType:false,processData:false,complete:function(res){ +opts.success.call(_594,res.responseText); +}}); +}; +function load(_59a,data){ +var opts=$.data(_59a,"form").options; if(typeof data=="string"){ -var _4c1={}; -if(opts.onBeforeLoad.call(_4c0,_4c1)==false){ +var _59b={}; +if(opts.onBeforeLoad.call(_59a,_59b)==false){ return; } -$.ajax({url:data,data:_4c1,dataType:"json",success:function(data){ -_4c2(data); +$.ajax({url:data,data:_59b,dataType:"json",success:function(data){ +_59c(data); },error:function(){ -opts.onLoadError.apply(_4c0,arguments); +opts.onLoadError.apply(_59a,arguments); }}); }else{ -_4c2(data); +_59c(data); } -function _4c2(data){ -var form=$(_4c0); +function _59c(data){ +var form=$(_59a); for(var name in data){ var val=data[name]; -var rr=_4c3(name,val); -if(!rr.length){ -var _4c4=_4c5(name,val); -if(!_4c4){ -$("input[name=\""+name+"\"]",form).val(val); -$("textarea[name=\""+name+"\"]",form).val(val); -$("select[name=\""+name+"\"]",form).val(val); +if(!_59d(name,val)){ +if(!_59e(name,val)){ +form.find("input[name=\""+name+"\"]").val(val); +form.find("textarea[name=\""+name+"\"]").val(val); +form.find("select[name=\""+name+"\"]").val(val); } } -_4c6(name,val); } -opts.onLoadSuccess.call(_4c0,data); -_4cd(_4c0); +opts.onLoadSuccess.call(_59a,data); +form.form("validate"); }; -function _4c3(name,val){ -var rr=$(_4c0).find("input[name=\""+name+"\"][type=radio], input[name=\""+name+"\"][type=checkbox]"); -rr._propAttr("checked",false); -rr.each(function(){ -var f=$(this); -if(f.val()==String(val)||$.inArray(f.val(),$.isArray(val)?val:[val])>=0){ -f._propAttr("checked",true); +function _59d(name,val){ +var cc=$(_59a).find("[switchbuttonName=\""+name+"\"]"); +if(cc.length){ +cc.switchbutton("uncheck"); +cc.each(function(){ +if(_59f($(this).switchbutton("options").value,val)){ +$(this).switchbutton("check"); } }); -return rr; -}; -function _4c5(name,val){ -var _4c7=0; -var pp=["textbox","numberbox","slider"]; -for(var i=0;i=0){ +return true; +}else{ +return false; +} +}; +function _59e(name,val){ +var _5a0=$(_59a).find("[textboxName=\""+name+"\"],[sliderName=\""+name+"\"]"); +if(_5a0.length){ +for(var i=0;i=0;i--){ +var type=opts.fieldTypes[i]; +var _5a8=form.find("."+type+"-f"); +if(_5a8.length&&_5a8[type]){ +_5a8[type]("reset"); } } -_4cd(_4cf); +form.form("validate"); }; -function _4d2(_4d3){ -var _4d4=$.data(_4d3,"form").options; -$(_4d3).unbind(".form"); -if(_4d4.ajax){ -$(_4d3).bind("submit.form",function(){ +function _5a9(_5aa){ +var _5ab=$.data(_5aa,"form").options; +$(_5aa).unbind(".form"); +if(_5ab.ajax){ +$(_5aa).bind("submit.form",function(){ setTimeout(function(){ -_4b4(_4d3,_4d4); +_582(_5aa,_5ab); },0); return false; }); } -_4d5(_4d3,_4d4.novalidate); +$(_5aa).bind("_change.form",function(e,t){ +if($.inArray(t,_5ab.dirtyFields)==-1){ +_5ab.dirtyFields.push(t); +} +_5ab.onChange.call(this,t); +}).bind("change.form",function(e){ +var t=e.target; +if(!$(t).hasClass("textbox-text")){ +if($.inArray(t,_5ab.dirtyFields)==-1){ +_5ab.dirtyFields.push(t); +} +_5ab.onChange.call(this,t); +} +}); +_5ac(_5aa,_5ab.novalidate); }; -function _4d6(_4d7,_4d8){ -_4d8=_4d8||{}; -var _4d9=$.data(_4d7,"form"); -if(_4d9){ -$.extend(_4d9.options,_4d8); +function _5ad(_5ae,_5af){ +_5af=_5af||{}; +var _5b0=$.data(_5ae,"form"); +if(_5b0){ +$.extend(_5b0.options,_5af); }else{ -$.data(_4d7,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_4d7),_4d8)}); +$.data(_5ae,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_5ae),_5af)}); } }; -function _4cd(_4da){ +function _5b1(_5b2){ if($.fn.validatebox){ -var t=$(_4da); +var t=$(_5b2); t.find(".validatebox-text:not(:disabled)").validatebox("validate"); -var _4db=t.find(".validatebox-invalid"); -_4db.filter(":not(:disabled):first").focus(); -return _4db.length==0; +var _5b3=t.find(".validatebox-invalid"); +_5b3.filter(":not(:disabled):first").focus(); +return _5b3.length==0; } return true; }; -function _4d5(_4dc,_4dd){ -var opts=$.data(_4dc,"form").options; -opts.novalidate=_4dd; -$(_4dc).find(".validatebox-text:not(:disabled)").validatebox(_4dd?"disableValidation":"enableValidation"); +function _5ac(_5b4,_5b5){ +var opts=$.data(_5b4,"form").options; +opts.novalidate=_5b5; +$(_5b4).find(".validatebox-text:not(:disabled)").validatebox(_5b5?"disableValidation":"enableValidation"); }; -$.fn.form=function(_4de,_4df){ -if(typeof _4de=="string"){ +$.fn.form=function(_5b6,_5b7){ +if(typeof _5b6=="string"){ this.each(function(){ -_4d6(this); +_5ad(this); }); -return $.fn.form.methods[_4de](this,_4df); +return $.fn.form.methods[_5b6](this,_5b7); } return this.each(function(){ -_4d6(this,_4de); -_4d2(this); +_5ad(this,_5b6); +_5a9(this); }); }; $.fn.form.methods={options:function(jq){ return $.data(jq[0],"form").options; -},submit:function(jq,_4e0){ +},submit:function(jq,_5b8){ return jq.each(function(){ -_4b4(this,_4e0); +_582(this,_5b8); }); },load:function(jq,data){ return jq.each(function(){ @@ -6910,74 +8090,87 @@ load(this,data); }); },clear:function(jq){ return jq.each(function(){ -_4c8(this); +_5a2(this); }); },reset:function(jq){ return jq.each(function(){ -_4ce(this); +_5a6(this); }); },validate:function(jq){ -return _4cd(jq[0]); +return _5b1(jq[0]); },disableValidation:function(jq){ return jq.each(function(){ -_4d5(this,true); +_5ac(this,true); }); },enableValidation:function(jq){ return jq.each(function(){ -_4d5(this,false); +_5ac(this,false); +}); +},resetValidation:function(jq){ +return jq.each(function(){ +$(this).find(".validatebox-text:not(:disabled)").validatebox("resetValidation"); +}); +},resetDirty:function(jq){ +return jq.each(function(){ +$(this).form("options").dirtyFields=[]; }); }}; -$.fn.form.parseOptions=function(_4e1){ -var t=$(_4e1); -return $.extend({},$.parser.parseOptions(_4e1,[{ajax:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)}); +$.fn.form.parseOptions=function(_5b9){ +var t=$(_5b9); +return $.extend({},$.parser.parseOptions(_5b9,[{ajax:"boolean",dirty:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)}); }; -$.fn.form.defaults={novalidate:false,ajax:true,url:null,queryParams:{},onSubmit:function(_4e2){ +$.fn.form.defaults={fieldTypes:["combobox","combotree","combogrid","combotreegrid","datetimebox","datebox","combo","datetimespinner","timespinner","numberspinner","spinner","slider","searchbox","numberbox","passwordbox","filebox","textbox","switchbutton"],novalidate:false,ajax:true,iframe:true,dirty:false,dirtyFields:[],url:null,queryParams:{},onSubmit:function(_5ba){ return $(this).form("validate"); +},onProgress:function(_5bb){ },success:function(data){ -},onBeforeLoad:function(_4e3){ +},onBeforeLoad:function(_5bc){ },onLoadSuccess:function(data){ },onLoadError:function(){ +},onChange:function(_5bd){ }}; })(jQuery); (function($){ -function _4e4(_4e5){ -var _4e6=$.data(_4e5,"numberbox"); -var opts=_4e6.options; -$(_4e5).addClass("numberbox-f").textbox(opts); -$(_4e5).textbox("textbox").css({imeMode:"disabled"}); -$(_4e5).attr("numberboxName",$(_4e5).attr("textboxName")); -_4e6.numberbox=$(_4e5).next(); -_4e6.numberbox.addClass("numberbox"); -var _4e7=opts.parser.call(_4e5,opts.value); -var _4e8=opts.formatter.call(_4e5,_4e7); -$(_4e5).numberbox("initValue",_4e7).numberbox("setText",_4e8); -}; -function _4e9(_4ea,_4eb){ -var _4ec=$.data(_4ea,"numberbox"); -var opts=_4ec.options; -var _4eb=opts.parser.call(_4ea,_4eb); -var text=opts.formatter.call(_4ea,_4eb); -opts.value=_4eb; -$(_4ea).textbox("setValue",_4eb).textbox("setText",text); -}; -$.fn.numberbox=function(_4ed,_4ee){ -if(typeof _4ed=="string"){ -var _4ef=$.fn.numberbox.methods[_4ed]; -if(_4ef){ -return _4ef(this,_4ee); -}else{ -return this.textbox(_4ed,_4ee); -} -} -_4ed=_4ed||{}; +function _5be(_5bf){ +var _5c0=$.data(_5bf,"numberbox"); +var opts=_5c0.options; +$(_5bf).addClass("numberbox-f").textbox(opts); +$(_5bf).textbox("textbox").css({imeMode:"disabled"}); +$(_5bf).attr("numberboxName",$(_5bf).attr("textboxName")); +_5c0.numberbox=$(_5bf).next(); +_5c0.numberbox.addClass("numberbox"); +var _5c1=opts.parser.call(_5bf,opts.value); +var _5c2=opts.formatter.call(_5bf,_5c1); +$(_5bf).numberbox("initValue",_5c1).numberbox("setText",_5c2); +}; +function _5c3(_5c4,_5c5){ +var _5c6=$.data(_5c4,"numberbox"); +var opts=_5c6.options; +opts.value=parseFloat(_5c5); +var _5c5=opts.parser.call(_5c4,_5c5); +var text=opts.formatter.call(_5c4,_5c5); +opts.value=_5c5; +$(_5c4).textbox("setText",text).textbox("setValue",_5c5); +text=opts.formatter.call(_5c4,$(_5c4).textbox("getValue")); +$(_5c4).textbox("setText",text); +}; +$.fn.numberbox=function(_5c7,_5c8){ +if(typeof _5c7=="string"){ +var _5c9=$.fn.numberbox.methods[_5c7]; +if(_5c9){ +return _5c9(this,_5c8); +}else{ +return this.textbox(_5c7,_5c8); +} +} +_5c7=_5c7||{}; return this.each(function(){ -var _4f0=$.data(this,"numberbox"); -if(_4f0){ -$.extend(_4f0.options,_4ed); +var _5ca=$.data(this,"numberbox"); +if(_5ca){ +$.extend(_5ca.options,_5c7); }else{ -_4f0=$.data(this,"numberbox",{options:$.extend({},$.fn.numberbox.defaults,$.fn.numberbox.parseOptions(this),_4ed)}); +_5ca=$.data(this,"numberbox",{options:$.extend({},$.fn.numberbox.defaults,$.fn.numberbox.parseOptions(this),_5c7)}); } -_4e4(this); +_5be(this); }); }; $.fn.numberbox.methods={options:function(jq){ @@ -6985,11 +8178,14 @@ var opts=jq.data("textbox")?jq.textbox("options"):{}; return $.extend($.data(jq[0],"numberbox").options,{width:opts.width,originalValue:opts.originalValue,disabled:opts.disabled,readonly:opts.readonly}); },fix:function(jq){ return jq.each(function(){ -$(this).numberbox("setValue",$(this).numberbox("getText")); +var opts=$(this).numberbox("options"); +opts.value=null; +var _5cb=opts.parser.call(this,$(this).numberbox("getText")); +$(this).numberbox("setValue",_5cb); }); -},setValue:function(jq,_4f1){ +},setValue:function(jq,_5cc){ return jq.each(function(){ -_4e9(this,_4f1); +_5c3(this,_5cc); }); },clear:function(jq){ return jq.each(function(){ @@ -7002,60 +8198,60 @@ $(this).textbox("reset"); $(this).numberbox("setValue",$(this).numberbox("getValue")); }); }}; -$.fn.numberbox.parseOptions=function(_4f2){ -var t=$(_4f2); -return $.extend({},$.fn.textbox.parseOptions(_4f2),$.parser.parseOptions(_4f2,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)}); +$.fn.numberbox.parseOptions=function(_5cd){ +var t=$(_5cd); +return $.extend({},$.fn.textbox.parseOptions(_5cd),$.parser.parseOptions(_5cd,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)}); }; $.fn.numberbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{keypress:function(e){ -var _4f3=e.data.target; -var opts=$(_4f3).numberbox("options"); -return opts.filter.call(_4f3,e); +var _5ce=e.data.target; +var opts=$(_5ce).numberbox("options"); +return opts.filter.call(_5ce,e); },blur:function(e){ -var _4f4=e.data.target; -$(_4f4).numberbox("setValue",$(_4f4).numberbox("getText")); +$(e.data.target).numberbox("fix"); },keydown:function(e){ if(e.keyCode==13){ -var _4f5=e.data.target; -$(_4f5).numberbox("setValue",$(_4f5).numberbox("getText")); +$(e.data.target).numberbox("fix"); } }},min:null,max:null,precision:0,decimalSeparator:".",groupSeparator:"",prefix:"",suffix:"",filter:function(e){ var opts=$(this).numberbox("options"); var s=$(this).numberbox("getText"); -if(e.which==13){ +if(e.metaKey||e.ctrlKey){ return true; } -if(e.which==45){ -return (s.indexOf("-")==-1?true:false); +if($.inArray(String(e.which),["46","8","13","0"])>=0){ +return true; } -var c=String.fromCharCode(e.which); -if(c==opts.decimalSeparator){ -return (s.indexOf(c)==-1?true:false); -}else{ -if(c==opts.groupSeparator){ +var tmp=$(""); +tmp.html(String.fromCharCode(e.which)); +var c=tmp.text(); +tmp.remove(); +if(!c){ return true; +} +if(c=="-"||c==opts.decimalSeparator){ +return (s.indexOf(c)==-1)?true:false; }else{ -if((e.which>=48&&e.which<=57&&e.ctrlKey==false&&e.shiftKey==false)||e.which==0||e.which==8){ +if(c==opts.groupSeparator){ return true; }else{ -if(e.ctrlKey==true&&(e.which==99||e.which==118)){ +if("0123456789".indexOf(c)>=0){ return true; }else{ return false; } } } +},formatter:function(_5cf){ +if(!_5cf){ +return _5cf; } -},formatter:function(_4f6){ -if(!_4f6){ -return _4f6; -} -_4f6=_4f6+""; +_5cf=_5cf+""; var opts=$(this).numberbox("options"); -var s1=_4f6,s2=""; -var dpos=_4f6.indexOf("."); +var s1=_5cf,s2=""; +var dpos=_5cf.indexOf("."); if(dpos>=0){ -s1=_4f6.substring(0,dpos); -s2=_4f6.substring(dpos+1,_4f6.length); +s1=_5cf.substring(0,dpos); +s2=_5cf.substring(dpos+1,_5cf.length); } if(opts.groupSeparator){ var p=/(\d+)(\d{3})/; @@ -7071,13 +8267,13 @@ return opts.prefix+s1+opts.suffix; },parser:function(s){ s=s+""; var opts=$(this).numberbox("options"); -if(parseFloat(s)!=s){ if(opts.prefix){ s=$.trim(s.replace(new RegExp("\\"+$.trim(opts.prefix),"g"),"")); } if(opts.suffix){ s=$.trim(s.replace(new RegExp("\\"+$.trim(opts.suffix),"g"),"")); } +if(parseFloat(s)!=opts.value){ if(opts.groupSeparator){ s=$.trim(s.replace(new RegExp("\\"+opts.groupSeparator,"g"),"")); } @@ -7102,91 +8298,91 @@ return val; }}); })(jQuery); (function($){ -function _4f7(_4f8,_4f9){ -var opts=$.data(_4f8,"calendar").options; -var t=$(_4f8); -if(_4f9){ -$.extend(opts,{width:_4f9.width,height:_4f9.height}); +function _5d0(_5d1,_5d2){ +var opts=$.data(_5d1,"calendar").options; +var t=$(_5d1); +if(_5d2){ +$.extend(opts,{width:_5d2.width,height:_5d2.height}); } t._size(opts,t.parent()); t.find(".calendar-body")._outerHeight(t.height()-t.find(".calendar-header")._outerHeight()); if(t.find(".calendar-menu").is(":visible")){ -_4fa(_4f8); +_5d3(_5d1); } }; -function init(_4fb){ -$(_4fb).addClass("calendar").html("
            "+"
            "+"
            "+"
            "+"
            "+"
            "+""+"
            "+"
            "+"
            "+"
            "+"
            "+""+""+""+"
            "+"
            "+"
            "+"
            "+"
            "); -$(_4fb).bind("_resize",function(e,_4fc){ -if($(this).hasClass("easyui-fluid")||_4fc){ -_4f7(_4fb); +function init(_5d4){ +$(_5d4).addClass("calendar").html("
            "+"
            "+"
            "+"
            "+"
            "+"
            "+""+"
            "+"
            "+"
            "+"
            "+"
            "+""+""+""+"
            "+"
            "+"
            "+"
            "+"
            "); +$(_5d4).bind("_resize",function(e,_5d5){ +if($(this).hasClass("easyui-fluid")||_5d5){ +_5d0(_5d4); } return false; }); }; -function _4fd(_4fe){ -var opts=$.data(_4fe,"calendar").options; -var menu=$(_4fe).find(".calendar-menu"); +function _5d6(_5d7){ +var opts=$.data(_5d7,"calendar").options; +var menu=$(_5d7).find(".calendar-menu"); menu.find(".calendar-menu-year").unbind(".calendar").bind("keypress.calendar",function(e){ if(e.keyCode==13){ -_4ff(true); +_5d8(true); } }); -$(_4fe).unbind(".calendar").bind("mouseover.calendar",function(e){ -var t=_500(e.target); +$(_5d7).unbind(".calendar").bind("mouseover.calendar",function(e){ +var t=_5d9(e.target); if(t.hasClass("calendar-nav")||t.hasClass("calendar-text")||(t.hasClass("calendar-day")&&!t.hasClass("calendar-disabled"))){ t.addClass("calendar-nav-hover"); } }).bind("mouseout.calendar",function(e){ -var t=_500(e.target); +var t=_5d9(e.target); if(t.hasClass("calendar-nav")||t.hasClass("calendar-text")||(t.hasClass("calendar-day")&&!t.hasClass("calendar-disabled"))){ t.removeClass("calendar-nav-hover"); } }).bind("click.calendar",function(e){ -var t=_500(e.target); +var t=_5d9(e.target); if(t.hasClass("calendar-menu-next")||t.hasClass("calendar-nextyear")){ -_501(1); +_5da(1); }else{ if(t.hasClass("calendar-menu-prev")||t.hasClass("calendar-prevyear")){ -_501(-1); +_5da(-1); }else{ if(t.hasClass("calendar-menu-month")){ menu.find(".calendar-selected").removeClass("calendar-selected"); t.addClass("calendar-selected"); -_4ff(true); +_5d8(true); }else{ if(t.hasClass("calendar-prevmonth")){ -_502(-1); +_5db(-1); }else{ if(t.hasClass("calendar-nextmonth")){ -_502(1); +_5db(1); }else{ if(t.hasClass("calendar-text")){ if(menu.is(":visible")){ menu.hide(); }else{ -_4fa(_4fe); +_5d3(_5d7); } }else{ if(t.hasClass("calendar-day")){ if(t.hasClass("calendar-disabled")){ return; } -var _503=opts.current; +var _5dc=opts.current; t.closest("div.calendar-body").find(".calendar-selected").removeClass("calendar-selected"); t.addClass("calendar-selected"); -var _504=t.attr("abbr").split(","); -var y=parseInt(_504[0]); -var m=parseInt(_504[1]); -var d=parseInt(_504[2]); +var _5dd=t.attr("abbr").split(","); +var y=parseInt(_5dd[0]); +var m=parseInt(_5dd[1]); +var d=parseInt(_5dd[2]); opts.current=new Date(y,m-1,d); -opts.onSelect.call(_4fe,opts.current); -if(!_503||_503.getTime()!=opts.current.getTime()){ -opts.onChange.call(_4fe,opts.current,_503); +opts.onSelect.call(_5d7,opts.current); +if(!_5dc||_5dc.getTime()!=opts.current.getTime()){ +opts.onChange.call(_5d7,opts.current,_5dc); } if(opts.year!=y||opts.month!=m){ opts.year=y; opts.month=m; -show(_4fe); +show(_5d7); } } } @@ -7196,7 +8392,7 @@ show(_4fe); } } }); -function _500(t){ +function _5d9(t){ var day=$(t).closest(".calendar-day"); if(day.length){ return day; @@ -7204,26 +8400,26 @@ return day; return $(t); } }; -function _4ff(_505){ -var menu=$(_4fe).find(".calendar-menu"); +function _5d8(_5de){ +var menu=$(_5d7).find(".calendar-menu"); var year=menu.find(".calendar-menu-year").val(); -var _506=menu.find(".calendar-selected").attr("abbr"); +var _5df=menu.find(".calendar-selected").attr("abbr"); if(!isNaN(year)){ opts.year=parseInt(year); -opts.month=parseInt(_506); -show(_4fe); +opts.month=parseInt(_5df); +show(_5d7); } -if(_505){ +if(_5de){ menu.hide(); } }; -function _501(_507){ -opts.year+=_507; -show(_4fe); +function _5da(_5e0){ +opts.year+=_5e0; +show(_5d7); menu.find(".calendar-menu-year").val(opts.year); }; -function _502(_508){ -opts.month+=_508; +function _5db(_5e1){ +opts.month+=_5e1; if(opts.month>12){ opts.year++; opts.month=1; @@ -7233,17 +8429,17 @@ opts.year--; opts.month=12; } } -show(_4fe); +show(_5d7); menu.find("td.calendar-selected").removeClass("calendar-selected"); menu.find("td:eq("+(opts.month-1)+")").addClass("calendar-selected"); }; }; -function _4fa(_509){ -var opts=$.data(_509,"calendar").options; -$(_509).find(".calendar-menu").show(); -if($(_509).find(".calendar-menu-month-inner").is(":empty")){ -$(_509).find(".calendar-menu-month-inner").empty(); -var t=$("
            ").appendTo($(_509).find(".calendar-menu-month-inner")); +function _5d3(_5e2){ +var opts=$.data(_5e2,"calendar").options; +$(_5e2).find(".calendar-menu").show(); +if($(_5e2).find(".calendar-menu-month-inner").is(":empty")){ +$(_5e2).find(".calendar-menu-month-inner").empty(); +var t=$("
            ").appendTo($(_5e2).find(".calendar-menu-month-inner")); var idx=0; for(var i=0;i<3;i++){ var tr=$("").appendTo(t); @@ -7252,97 +8448,100 @@ $("").html(opts.months[idx++ } } } -var body=$(_509).find(".calendar-body"); -var sele=$(_509).find(".calendar-menu"); -var _50a=sele.find(".calendar-menu-year-inner"); -var _50b=sele.find(".calendar-menu-month-inner"); -_50a.find("input").val(opts.year).focus(); -_50b.find("td.calendar-selected").removeClass("calendar-selected"); -_50b.find("td:eq("+(opts.month-1)+")").addClass("calendar-selected"); +var body=$(_5e2).find(".calendar-body"); +var sele=$(_5e2).find(".calendar-menu"); +var _5e3=sele.find(".calendar-menu-year-inner"); +var _5e4=sele.find(".calendar-menu-month-inner"); +_5e3.find("input").val(opts.year).focus(); +_5e4.find("td.calendar-selected").removeClass("calendar-selected"); +_5e4.find("td:eq("+(opts.month-1)+")").addClass("calendar-selected"); sele._outerWidth(body._outerWidth()); sele._outerHeight(body._outerHeight()); -_50b._outerHeight(sele.height()-_50a._outerHeight()); -}; -function _50c(_50d,year,_50e){ -var opts=$.data(_50d,"calendar").options; -var _50f=[]; -var _510=new Date(year,_50e,0).getDate(); -for(var i=1;i<=_510;i++){ -_50f.push([year,_50e,i]); -} -var _511=[],week=[]; -var _512=-1; -while(_50f.length>0){ -var date=_50f.shift(); +_5e4._outerHeight(sele.height()-_5e3._outerHeight()); +}; +function _5e5(_5e6,year,_5e7){ +var opts=$.data(_5e6,"calendar").options; +var _5e8=[]; +var _5e9=new Date(year,_5e7,0).getDate(); +for(var i=1;i<=_5e9;i++){ +_5e8.push([year,_5e7,i]); +} +var _5ea=[],week=[]; +var _5eb=-1; +while(_5e8.length>0){ +var date=_5e8.shift(); week.push(date); var day=new Date(date[0],date[1]-1,date[2]).getDay(); -if(_512==day){ +if(_5eb==day){ day=0; }else{ if(day==(opts.firstDay==0?7:opts.firstDay)-1){ -_511.push(week); +_5ea.push(week); week=[]; } } -_512=day; +_5eb=day; } if(week.length){ -_511.push(week); +_5ea.push(week); } -var _513=_511[0]; -if(_513.length<7){ -while(_513.length<7){ -var _514=_513[0]; -var date=new Date(_514[0],_514[1]-1,_514[2]-1); -_513.unshift([date.getFullYear(),date.getMonth()+1,date.getDate()]); +var _5ec=_5ea[0]; +if(_5ec.length<7){ +while(_5ec.length<7){ +var _5ed=_5ec[0]; +var date=new Date(_5ed[0],_5ed[1]-1,_5ed[2]-1); +_5ec.unshift([date.getFullYear(),date.getMonth()+1,date.getDate()]); } }else{ -var _514=_513[0]; +var _5ed=_5ec[0]; var week=[]; for(var i=1;i<=7;i++){ -var date=new Date(_514[0],_514[1]-1,_514[2]-i); +var date=new Date(_5ed[0],_5ed[1]-1,_5ed[2]-i); week.unshift([date.getFullYear(),date.getMonth()+1,date.getDate()]); } -_511.unshift(week); +_5ea.unshift(week); } -var _515=_511[_511.length-1]; -while(_515.length<7){ -var _516=_515[_515.length-1]; -var date=new Date(_516[0],_516[1]-1,_516[2]+1); -_515.push([date.getFullYear(),date.getMonth()+1,date.getDate()]); +var _5ee=_5ea[_5ea.length-1]; +while(_5ee.length<7){ +var _5ef=_5ee[_5ee.length-1]; +var date=new Date(_5ef[0],_5ef[1]-1,_5ef[2]+1); +_5ee.push([date.getFullYear(),date.getMonth()+1,date.getDate()]); } -if(_511.length<6){ -var _516=_515[_515.length-1]; +if(_5ea.length<6){ +var _5ef=_5ee[_5ee.length-1]; var week=[]; for(var i=1;i<=7;i++){ -var date=new Date(_516[0],_516[1]-1,_516[2]+i); +var date=new Date(_5ef[0],_5ef[1]-1,_5ef[2]+i); week.push([date.getFullYear(),date.getMonth()+1,date.getDate()]); } -_511.push(week); +_5ea.push(week); } -return _511; +return _5ea; }; -function show(_517){ -var opts=$.data(_517,"calendar").options; -if(opts.current&&!opts.validator.call(_517,opts.current)){ +function show(_5f0){ +var opts=$.data(_5f0,"calendar").options; +if(opts.current&&!opts.validator.call(_5f0,opts.current)){ opts.current=null; } var now=new Date(); -var _518=now.getFullYear()+","+(now.getMonth()+1)+","+now.getDate(); -var _519=opts.current?(opts.current.getFullYear()+","+(opts.current.getMonth()+1)+","+opts.current.getDate()):""; -var _51a=6-opts.firstDay; -var _51b=_51a+1; -if(_51a>=7){ -_51a-=7; -} -if(_51b>=7){ -_51b-=7; -} -$(_517).find(".calendar-title span").html(opts.months[opts.month-1]+" "+opts.year); -var body=$(_517).find("div.calendar-body"); +var _5f1=now.getFullYear()+","+(now.getMonth()+1)+","+now.getDate(); +var _5f2=opts.current?(opts.current.getFullYear()+","+(opts.current.getMonth()+1)+","+opts.current.getDate()):""; +var _5f3=6-opts.firstDay; +var _5f4=_5f3+1; +if(_5f3>=7){ +_5f3-=7; +} +if(_5f4>=7){ +_5f4-=7; +} +$(_5f0).find(".calendar-title span").html(opts.months[opts.month-1]+" "+opts.year); +var body=$(_5f0).find("div.calendar-body"); body.children("table").remove(); var data=[""]; data.push(""); +if(opts.showWeek){ +data.push(""); +} for(var i=opts.firstDay;i"+opts.weeks[i]+""); } @@ -7351,48 +8550,52 @@ data.push(""); } data.push(""); data.push(""); -var _51c=_50c(_517,opts.year,opts.month); -for(var i=0;i<_51c.length;i++){ -var week=_51c[i]; +var _5f5=_5e5(_5f0,opts.year,opts.month); +for(var i=0;i<_5f5.length;i++){ +var week=_5f5[i]; var cls=""; if(i==0){ cls="calendar-first"; }else{ -if(i==_51c.length-1){ +if(i==_5f5.length-1){ cls="calendar-last"; } } data.push(""); +if(opts.showWeek){ +var _5f6=opts.getWeekNumber(new Date(week[0][0],parseInt(week[0][1])-1,week[0][2])); +data.push(""); +} for(var j=0;j"+d+""); +data.push(""); } data.push(""); } @@ -7415,279 +8618,319 @@ data.push(""); data.push("
            "+opts.weekNumberHeader+""+opts.weeks[i]+"
            "+_5f6+""+d+"
            "); body.append(data.join("")); body.children("table.calendar-dtable").prependTo(body); -opts.onNavigate.call(_517,opts.year,opts.month); +opts.onNavigate.call(_5f0,opts.year,opts.month); }; -$.fn.calendar=function(_520,_521){ -if(typeof _520=="string"){ -return $.fn.calendar.methods[_520](this,_521); +$.fn.calendar=function(_5fa,_5fb){ +if(typeof _5fa=="string"){ +return $.fn.calendar.methods[_5fa](this,_5fb); } -_520=_520||{}; +_5fa=_5fa||{}; return this.each(function(){ -var _522=$.data(this,"calendar"); -if(_522){ -$.extend(_522.options,_520); +var _5fc=$.data(this,"calendar"); +if(_5fc){ +$.extend(_5fc.options,_5fa); }else{ -_522=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_520)}); +_5fc=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_5fa)}); init(this); } -if(_522.options.border==false){ +if(_5fc.options.border==false){ $(this).addClass("calendar-noborder"); } -_4f7(this); -_4fd(this); +_5d0(this); +_5d6(this); show(this); $(this).find("div.calendar-menu").hide(); }); }; $.fn.calendar.methods={options:function(jq){ return $.data(jq[0],"calendar").options; -},resize:function(jq,_523){ +},resize:function(jq,_5fd){ return jq.each(function(){ -_4f7(this,_523); +_5d0(this,_5fd); }); },moveTo:function(jq,date){ return jq.each(function(){ +if(!date){ +var now=new Date(); +$(this).calendar({year:now.getFullYear(),month:now.getMonth()+1,current:date}); +return; +} var opts=$(this).calendar("options"); if(opts.validator.call(this,date)){ -var _524=opts.current; +var _5fe=opts.current; $(this).calendar({year:date.getFullYear(),month:date.getMonth()+1,current:date}); -if(!_524||_524.getTime()!=date.getTime()){ -opts.onChange.call(this,opts.current,_524); +if(!_5fe||_5fe.getTime()!=date.getTime()){ +opts.onChange.call(this,opts.current,_5fe); } } }); }}; -$.fn.calendar.parseOptions=function(_525){ -var t=$(_525); -return $.extend({},$.parser.parseOptions(_525,[{firstDay:"number",fit:"boolean",border:"boolean"}])); +$.fn.calendar.parseOptions=function(_5ff){ +var t=$(_5ff); +return $.extend({},$.parser.parseOptions(_5ff,["weekNumberHeader",{firstDay:"number",fit:"boolean",border:"boolean",showWeek:"boolean"}])); }; -$.fn.calendar.defaults={width:180,height:180,fit:false,border:true,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){ +$.fn.calendar.defaults={width:180,height:180,fit:false,border:true,showWeek:false,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){ var d=new Date(); return new Date(d.getFullYear(),d.getMonth(),d.getDate()); -})(),formatter:function(date){ +})(),weekNumberHeader:"",getWeekNumber:function(date){ +var _600=new Date(date.getTime()); +_600.setDate(_600.getDate()+4-(_600.getDay()||7)); +var time=_600.getTime(); +_600.setMonth(0); +_600.setDate(1); +return Math.floor(Math.round((time-_600)/86400000)/7)+1; +},formatter:function(date){ return date.getDate(); },styler:function(date){ return ""; },validator:function(date){ return true; },onSelect:function(date){ -},onChange:function(_526,_527){ -},onNavigate:function(year,_528){ +},onChange:function(_601,_602){ +},onNavigate:function(year,_603){ }}; })(jQuery); (function($){ -function _529(_52a){ -var _52b=$.data(_52a,"spinner"); -var opts=_52b.options; -var _52c=$.extend(true,[],opts.icons); -_52c.push({iconCls:"spinner-arrow",handler:function(e){ -_52d(e); +function _604(_605){ +var _606=$.data(_605,"spinner"); +var opts=_606.options; +var _607=$.extend(true,[],opts.icons); +if(opts.spinAlign=="left"||opts.spinAlign=="right"){ +opts.spinArrow=true; +opts.iconAlign=opts.spinAlign; +var _608={iconCls:"spinner-arrow",handler:function(e){ +var spin=$(e.target).closest(".spinner-arrow-up,.spinner-arrow-down"); +_612(e.data.target,spin.hasClass("spinner-arrow-down")); +}}; +if(opts.spinAlign=="left"){ +_607.unshift(_608); +}else{ +_607.push(_608); +} +}else{ +opts.spinArrow=false; +if(opts.spinAlign=="vertical"){ +if(opts.buttonAlign!="top"){ +opts.buttonAlign="bottom"; +} +opts.clsLeft="textbox-button-bottom"; +opts.clsRight="textbox-button-top"; +}else{ +opts.clsLeft="textbox-button-left"; +opts.clsRight="textbox-button-right"; +} +} +$(_605).addClass("spinner-f").textbox($.extend({},opts,{icons:_607,doSize:false,onResize:function(_609,_60a){ +if(!opts.spinArrow){ +var span=$(this).next(); +var btn=span.find(".textbox-button:not(.spinner-button)"); +if(btn.length){ +var _60b=btn.outerWidth(); +var _60c=btn.outerHeight(); +var _60d=span.find(".spinner-button."+opts.clsLeft); +var _60e=span.find(".spinner-button."+opts.clsRight); +if(opts.buttonAlign=="right"){ +_60e.css("marginRight",_60b+"px"); +}else{ +if(opts.buttonAlign=="left"){ +_60d.css("marginLeft",_60b+"px"); +}else{ +if(opts.buttonAlign=="top"){ +_60e.css("marginTop",_60c+"px"); +}else{ +_60d.css("marginBottom",_60c+"px"); +} +} +} +} +} +opts.onResize.call(this,_609,_60a); +}})); +$(_605).attr("spinnerName",$(_605).attr("textboxName")); +_606.spinner=$(_605).next(); +_606.spinner.addClass("spinner"); +if(opts.spinArrow){ +var _60f=_606.spinner.find(".spinner-arrow"); +_60f.append(""); +_60f.append(""); +}else{ +var _610=$("").addClass(opts.clsLeft).appendTo(_606.spinner); +var _611=$("").addClass(opts.clsRight).appendTo(_606.spinner); +_610.linkbutton({iconCls:opts.reversed?"spinner-button-up":"spinner-button-down",onClick:function(){ +_612(_605,!opts.reversed); +}}); +_611.linkbutton({iconCls:opts.reversed?"spinner-button-down":"spinner-button-up",onClick:function(){ +_612(_605,opts.reversed); }}); -$(_52a).addClass("spinner-f").textbox($.extend({},opts,{icons:_52c})); -var _52e=$(_52a).textbox("getIcon",_52c.length-1); -_52e.append(""); -_52e.append(""); -$(_52a).attr("spinnerName",$(_52a).attr("textboxName")); -_52b.spinner=$(_52a).next(); -_52b.spinner.addClass("spinner"); -}; -function _52d(e){ -var _52f=e.data.target; -var opts=$(_52f).spinner("options"); -var up=$(e.target).closest("a.spinner-arrow-up"); -if(up.length){ -opts.spin.call(_52f,false); -opts.onSpinUp.call(_52f); -$(_52f).spinner("validate"); -} -var down=$(e.target).closest("a.spinner-arrow-down"); -if(down.length){ -opts.spin.call(_52f,true); -opts.onSpinDown.call(_52f); -$(_52f).spinner("validate"); -} -}; -$.fn.spinner=function(_530,_531){ -if(typeof _530=="string"){ -var _532=$.fn.spinner.methods[_530]; -if(_532){ -return _532(this,_531); -}else{ -return this.textbox(_530,_531); -} -} -_530=_530||{}; +if(opts.disabled){ +$(_605).spinner("disable"); +} +if(opts.readonly){ +$(_605).spinner("readonly"); +} +} +$(_605).spinner("resize"); +}; +function _612(_613,down){ +var opts=$(_613).spinner("options"); +opts.spin.call(_613,down); +opts[down?"onSpinDown":"onSpinUp"].call(_613); +$(_613).spinner("validate"); +}; +$.fn.spinner=function(_614,_615){ +if(typeof _614=="string"){ +var _616=$.fn.spinner.methods[_614]; +if(_616){ +return _616(this,_615); +}else{ +return this.textbox(_614,_615); +} +} +_614=_614||{}; return this.each(function(){ -var _533=$.data(this,"spinner"); -if(_533){ -$.extend(_533.options,_530); +var _617=$.data(this,"spinner"); +if(_617){ +$.extend(_617.options,_614); }else{ -_533=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_530)}); +_617=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_614)}); } -_529(this); +_604(this); }); }; $.fn.spinner.methods={options:function(jq){ var opts=jq.textbox("options"); return $.extend($.data(jq[0],"spinner").options,{width:opts.width,value:opts.value,originalValue:opts.originalValue,disabled:opts.disabled,readonly:opts.readonly}); }}; -$.fn.spinner.parseOptions=function(_534){ -return $.extend({},$.fn.textbox.parseOptions(_534),$.parser.parseOptions(_534,["min","max",{increment:"number"}])); +$.fn.spinner.parseOptions=function(_618){ +return $.extend({},$.fn.textbox.parseOptions(_618),$.parser.parseOptions(_618,["min","max","spinAlign",{increment:"number",reversed:"boolean"}])); }; -$.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spin:function(down){ +$.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spinAlign:"right",reversed:false,spin:function(down){ },onSpinUp:function(){ },onSpinDown:function(){ }}); })(jQuery); (function($){ -function _535(_536){ -$(_536).addClass("numberspinner-f"); -var opts=$.data(_536,"numberspinner").options; -$(_536).numberbox(opts).spinner(opts); -$(_536).numberbox("setValue",opts.value); -}; -function _537(_538,down){ -var opts=$.data(_538,"numberspinner").options; -var v=parseFloat($(_538).numberbox("getValue")||opts.value)||0; +function _619(_61a){ +$(_61a).addClass("numberspinner-f"); +var opts=$.data(_61a,"numberspinner").options; +$(_61a).numberbox($.extend({},opts,{doSize:false})).spinner(opts); +$(_61a).numberbox("setValue",opts.value); +}; +function _61b(_61c,down){ +var opts=$.data(_61c,"numberspinner").options; +var v=parseFloat($(_61c).numberbox("getValue")||opts.value)||0; if(down){ v-=opts.increment; }else{ v+=opts.increment; } -$(_538).numberbox("setValue",v); +$(_61c).numberbox("setValue",v); }; -$.fn.numberspinner=function(_539,_53a){ -if(typeof _539=="string"){ -var _53b=$.fn.numberspinner.methods[_539]; -if(_53b){ -return _53b(this,_53a); +$.fn.numberspinner=function(_61d,_61e){ +if(typeof _61d=="string"){ +var _61f=$.fn.numberspinner.methods[_61d]; +if(_61f){ +return _61f(this,_61e); }else{ -return this.numberbox(_539,_53a); +return this.numberbox(_61d,_61e); } } -_539=_539||{}; +_61d=_61d||{}; return this.each(function(){ -var _53c=$.data(this,"numberspinner"); -if(_53c){ -$.extend(_53c.options,_539); +var _620=$.data(this,"numberspinner"); +if(_620){ +$.extend(_620.options,_61d); }else{ -$.data(this,"numberspinner",{options:$.extend({},$.fn.numberspinner.defaults,$.fn.numberspinner.parseOptions(this),_539)}); +$.data(this,"numberspinner",{options:$.extend({},$.fn.numberspinner.defaults,$.fn.numberspinner.parseOptions(this),_61d)}); } -_535(this); +_619(this); }); }; $.fn.numberspinner.methods={options:function(jq){ var opts=jq.numberbox("options"); return $.extend($.data(jq[0],"numberspinner").options,{width:opts.width,value:opts.value,originalValue:opts.originalValue,disabled:opts.disabled,readonly:opts.readonly}); }}; -$.fn.numberspinner.parseOptions=function(_53d){ -return $.extend({},$.fn.spinner.parseOptions(_53d),$.fn.numberbox.parseOptions(_53d),{}); +$.fn.numberspinner.parseOptions=function(_621){ +return $.extend({},$.fn.spinner.parseOptions(_621),$.fn.numberbox.parseOptions(_621),{}); }; $.fn.numberspinner.defaults=$.extend({},$.fn.spinner.defaults,$.fn.numberbox.defaults,{spin:function(down){ -_537(this,down); +_61b(this,down); }}); })(jQuery); (function($){ -function _53e(_53f){ -var _540=0; -if(_53f.selectionStart){ -_540=_53f.selectionStart; -}else{ -if(_53f.createTextRange){ -var _541=_53f.createTextRange(); -var s=document.selection.createRange(); -s.setEndPoint("StartToStart",_541); -_540=s.text.length; -} -} -return _540; -}; -function _542(_543,_544,end){ -if(_543.selectionStart){ -_543.setSelectionRange(_544,end); -}else{ -if(_543.createTextRange){ -var _545=_543.createTextRange(); -_545.collapse(); -_545.moveEnd("character",end); -_545.moveStart("character",_544); -_545.select(); -} -} -}; -function _546(_547){ -var opts=$.data(_547,"timespinner").options; -$(_547).addClass("timespinner-f").spinner(opts); -var _548=opts.formatter.call(_547,opts.parser.call(_547,opts.value)); -$(_547).timespinner("initValue",_548); -}; -function _549(e){ -var _54a=e.data.target; -var opts=$.data(_54a,"timespinner").options; -var _54b=_53e(this); +function _622(_623){ +var opts=$.data(_623,"timespinner").options; +$(_623).addClass("timespinner-f").spinner(opts); +var _624=opts.formatter.call(_623,opts.parser.call(_623,opts.value)); +$(_623).timespinner("initValue",_624); +}; +function _625(e){ +var _626=e.data.target; +var opts=$.data(_626,"timespinner").options; +var _627=$(_626).timespinner("getSelectionStart"); for(var i=0;i=_54c[0]&&_54b<=_54c[1]){ -_54d(_54a,i); +var _628=opts.selections[i]; +if(_627>=_628[0]&&_627<=_628[1]){ +_629(_626,i); return; } } }; -function _54d(_54e,_54f){ -var opts=$.data(_54e,"timespinner").options; -if(_54f!=undefined){ -opts.highlight=_54f; +function _629(_62a,_62b){ +var opts=$.data(_62a,"timespinner").options; +if(_62b!=undefined){ +opts.highlight=_62b; } -var _550=opts.selections[opts.highlight]; -if(_550){ -var tb=$(_54e).timespinner("textbox"); -_542(tb[0],_550[0],_550[1]); +var _62c=opts.selections[opts.highlight]; +if(_62c){ +var tb=$(_62a).timespinner("textbox"); +$(_62a).timespinner("setSelectionRange",{start:_62c[0],end:_62c[1]}); tb.focus(); } }; -function _551(_552,_553){ -var opts=$.data(_552,"timespinner").options; -var _553=opts.parser.call(_552,_553); -var text=opts.formatter.call(_552,_553); -$(_552).spinner("setValue",text); +function _62d(_62e,_62f){ +var opts=$.data(_62e,"timespinner").options; +var _62f=opts.parser.call(_62e,_62f); +var text=opts.formatter.call(_62e,_62f); +$(_62e).spinner("setValue",text); }; -function _554(_555,down){ -var opts=$.data(_555,"timespinner").options; -var s=$(_555).timespinner("getValue"); -var _556=opts.selections[opts.highlight]; -var s1=s.substring(0,_556[0]); -var s2=s.substring(_556[0],_556[1]); -var s3=s.substring(_556[1]); -var v=s1+((parseInt(s2)||0)+opts.increment*(down?-1:1))+s3; -$(_555).timespinner("setValue",v); -_54d(_555); +function _630(_631,down){ +var opts=$.data(_631,"timespinner").options; +var s=$(_631).timespinner("getValue"); +var _632=opts.selections[opts.highlight]; +var s1=s.substring(0,_632[0]); +var s2=s.substring(_632[0],_632[1]); +var s3=s.substring(_632[1]); +var v=s1+((parseInt(s2,10)||0)+opts.increment*(down?-1:1))+s3; +$(_631).timespinner("setValue",v); +_629(_631); }; -$.fn.timespinner=function(_557,_558){ -if(typeof _557=="string"){ -var _559=$.fn.timespinner.methods[_557]; -if(_559){ -return _559(this,_558); +$.fn.timespinner=function(_633,_634){ +if(typeof _633=="string"){ +var _635=$.fn.timespinner.methods[_633]; +if(_635){ +return _635(this,_634); }else{ -return this.spinner(_557,_558); +return this.spinner(_633,_634); } } -_557=_557||{}; +_633=_633||{}; return this.each(function(){ -var _55a=$.data(this,"timespinner"); -if(_55a){ -$.extend(_55a.options,_557); +var _636=$.data(this,"timespinner"); +if(_636){ +$.extend(_636.options,_633); }else{ -$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_557)}); +$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_633)}); } -_546(this); +_622(this); }); }; $.fn.timespinner.methods={options:function(jq){ var opts=jq.data("spinner")?jq.spinner("options"):{}; return $.extend($.data(jq[0],"timespinner").options,{width:opts.width,value:opts.value,originalValue:opts.originalValue,disabled:opts.disabled,readonly:opts.readonly}); -},setValue:function(jq,_55b){ +},setValue:function(jq,_637){ return jq.each(function(){ -_551(this,_55b); +_62d(this,_637); }); },getHours:function(jq){ var opts=$.data(jq[0],"timespinner").options; @@ -7702,11 +8945,11 @@ var opts=$.data(jq[0],"timespinner").options; var vv=jq.timespinner("getValue").split(opts.separator); return parseInt(vv[2],10)||0; }}; -$.fn.timespinner.parseOptions=function(_55c){ -return $.extend({},$.fn.spinner.parseOptions(_55c),$.parser.parseOptions(_55c,["separator",{showSeconds:"boolean",highlight:"number"}])); +$.fn.timespinner.parseOptions=function(_638){ +return $.extend({},$.fn.spinner.parseOptions(_638),$.parser.parseOptions(_638,["separator",{showSeconds:"boolean",highlight:"number"}])); }; $.fn.timespinner.defaults=$.extend({},$.fn.spinner.defaults,{inputEvents:$.extend({},$.fn.spinner.defaults.inputEvents,{click:function(e){ -_549.call(this,e); +_625.call(this,e); },blur:function(e){ var t=$(e.data.target); t.timespinner("setValue",t.timespinner("getText")); @@ -7720,20 +8963,20 @@ if(!date){ return ""; } var opts=$(this).timespinner("options"); -var tt=[_55d(date.getHours()),_55d(date.getMinutes())]; +var tt=[_639(date.getHours()),_639(date.getMinutes())]; if(opts.showSeconds){ -tt.push(_55d(date.getSeconds())); +tt.push(_639(date.getSeconds())); } return tt.join(opts.separator); -function _55d(_55e){ -return (_55e<10?"0":"")+_55e; +function _639(_63a){ +return (_63a<10?"0":"")+_63a; }; },parser:function(s){ var opts=$(this).timespinner("options"); -var date=_55f(s); +var date=_63b(s); if(date){ -var min=_55f(opts.min); -var max=_55f(opts.max); +var min=_63b(opts.min); +var max=_63b(opts.max); if(min&&min>date){ date=min; } @@ -7742,53 +8985,48 @@ date=max; } } return date; -function _55f(s){ +function _63b(s){ if(!s){ return null; } var tt=s.split(opts.separator); return new Date(1900,0,0,parseInt(tt[0],10)||0,parseInt(tt[1],10)||0,parseInt(tt[2],10)||0); }; -if(!s){ -return null; -} -var tt=s.split(opts.separator); -return new Date(1900,0,0,parseInt(tt[0],10)||0,parseInt(tt[1],10)||0,parseInt(tt[2],10)||0); },selections:[[0,2],[3,5],[6,8]],separator:":",showSeconds:false,highlight:0,spin:function(down){ -_554(this,down); +_630(this,down); }}); })(jQuery); (function($){ -function _560(_561){ -var opts=$.data(_561,"datetimespinner").options; -$(_561).addClass("datetimespinner-f").timespinner(opts); +function _63c(_63d){ +var opts=$.data(_63d,"datetimespinner").options; +$(_63d).addClass("datetimespinner-f").timespinner(opts); }; -$.fn.datetimespinner=function(_562,_563){ -if(typeof _562=="string"){ -var _564=$.fn.datetimespinner.methods[_562]; -if(_564){ -return _564(this,_563); +$.fn.datetimespinner=function(_63e,_63f){ +if(typeof _63e=="string"){ +var _640=$.fn.datetimespinner.methods[_63e]; +if(_640){ +return _640(this,_63f); }else{ -return this.timespinner(_562,_563); +return this.timespinner(_63e,_63f); } } -_562=_562||{}; +_63e=_63e||{}; return this.each(function(){ -var _565=$.data(this,"datetimespinner"); -if(_565){ -$.extend(_565.options,_562); +var _641=$.data(this,"datetimespinner"); +if(_641){ +$.extend(_641.options,_63e); }else{ -$.data(this,"datetimespinner",{options:$.extend({},$.fn.datetimespinner.defaults,$.fn.datetimespinner.parseOptions(this),_562)}); +$.data(this,"datetimespinner",{options:$.extend({},$.fn.datetimespinner.defaults,$.fn.datetimespinner.parseOptions(this),_63e)}); } -_560(this); +_63c(this); }); }; $.fn.datetimespinner.methods={options:function(jq){ var opts=jq.timespinner("options"); return $.extend($.data(jq[0],"datetimespinner").options,{width:opts.width,value:opts.value,originalValue:opts.originalValue,disabled:opts.disabled,readonly:opts.readonly}); }}; -$.fn.datetimespinner.parseOptions=function(_566){ -return $.extend({},$.fn.timespinner.parseOptions(_566),$.parser.parseOptions(_566,[])); +$.fn.datetimespinner.parseOptions=function(_642){ +return $.extend({},$.fn.timespinner.parseOptions(_642),$.parser.parseOptions(_642,[])); }; $.fn.datetimespinner.defaults=$.extend({},$.fn.timespinner.defaults,{formatter:function(date){ if(!date){ @@ -7801,257 +9039,237 @@ if(!s){ return null; } var dt=s.split(" "); -var _567=$.fn.datebox.defaults.parser.call(this,dt[0]); +var _643=$.fn.datebox.defaults.parser.call(this,dt[0]); if(dt.length<2){ -return _567; +return _643; } -var _568=$.fn.timespinner.defaults.parser.call(this,dt[1]); -return new Date(_567.getFullYear(),_567.getMonth(),_567.getDate(),_568.getHours(),_568.getMinutes(),_568.getSeconds()); +var _644=$.fn.timespinner.defaults.parser.call(this,dt[1]); +return new Date(_643.getFullYear(),_643.getMonth(),_643.getDate(),_644.getHours(),_644.getMinutes(),_644.getSeconds()); },selections:[[0,2],[3,5],[6,10],[11,13],[14,16],[17,19]]}); })(jQuery); (function($){ -var _569=0; -function _56a(a,o){ -for(var i=0,len=a.length;i"]; -for(var i=0;i<_573.length;i++){ -_572.cache[_573[i][0]]={width:_573[i][1]}; +for(var i=0;i<_650.length;i++){ +_64f.cache[_650[i][0]]={width:_650[i][1]}; } -var _574=0; -for(var s in _572.cache){ -var item=_572.cache[s]; -item.index=_574++; +var _651=0; +for(var s in _64f.cache){ +var item=_64f.cache[s]; +item.index=_651++; ss.push(s+"{width:"+item.width+"}"); } ss.push(""); $(ss.join("\n")).appendTo(cc); cc.children("style[easyui]:not(:last)").remove(); -},getRule:function(_575){ -var _576=cc.children("style[easyui]:last")[0]; -var _577=_576.styleSheet?_576.styleSheet:(_576.sheet||document.styleSheets[document.styleSheets.length-1]); -var _578=_577.cssRules||_577.rules; -return _578[_575]; -},set:function(_579,_57a){ -var item=_572.cache[_579]; +},getRule:function(_652){ +var _653=cc.children("style[easyui]:last")[0]; +var _654=_653.styleSheet?_653.styleSheet:(_653.sheet||document.styleSheets[document.styleSheets.length-1]); +var _655=_654.cssRules||_654.rules; +return _655[_652]; +},set:function(_656,_657){ +var item=_64f.cache[_656]; if(item){ -item.width=_57a; +item.width=_657; var rule=this.getRule(item.index); if(rule){ -rule.style["width"]=_57a; +rule.style["width"]=_657; } } -},remove:function(_57b){ +},remove:function(_658){ var tmp=[]; -for(var s in _572.cache){ -if(s.indexOf(_57b)==-1){ -tmp.push([s,_572.cache[s].width]); +for(var s in _64f.cache){ +if(s.indexOf(_658)==-1){ +tmp.push([s,_64f.cache[s].width]); } } -_572.cache={}; +_64f.cache={}; this.add(tmp); -},dirty:function(_57c){ -if(_57c){ -_572.dirty.push(_57c); +},dirty:function(_659){ +if(_659){ +_64f.dirty.push(_659); } },clean:function(){ -for(var i=0;i<_572.dirty.length;i++){ -this.remove(_572.dirty[i]); +for(var i=0;i<_64f.dirty.length;i++){ +this.remove(_64f.dirty[i]); } -_572.dirty=[]; +_64f.dirty=[]; }}; }; -function _57d(_57e,_57f){ -var _580=$.data(_57e,"datagrid"); -var opts=_580.options; -var _581=_580.panel; -if(_57f){ -$.extend(opts,_57f); +function _65a(_65b,_65c){ +var _65d=$.data(_65b,"datagrid"); +var opts=_65d.options; +var _65e=_65d.panel; +if(_65c){ +$.extend(opts,_65c); } if(opts.fit==true){ -var p=_581.panel("panel").parent(); +var p=_65e.panel("panel").parent(); opts.width=p.width(); opts.height=p.height(); } -_581.panel("resize",opts); +_65e.panel("resize",opts); }; -function _582(_583){ -var _584=$.data(_583,"datagrid"); -var opts=_584.options; -var dc=_584.dc; -var wrap=_584.panel; -var _585=wrap.width(); -var _586=wrap.height(); +function _65f(_660){ +var _661=$.data(_660,"datagrid"); +var opts=_661.options; +var dc=_661.dc; +var wrap=_661.panel; +var _662=wrap.width(); +var _663=wrap.height(); var view=dc.view; -var _587=dc.view1; -var _588=dc.view2; -var _589=_587.children("div.datagrid-header"); -var _58a=_588.children("div.datagrid-header"); -var _58b=_589.find("table"); -var _58c=_58a.find("table"); -view.width(_585); -var _58d=_589.children("div.datagrid-header-inner").show(); -_587.width(_58d.find("table").width()); +var _664=dc.view1; +var _665=dc.view2; +var _666=_664.children("div.datagrid-header"); +var _667=_665.children("div.datagrid-header"); +var _668=_666.find("table"); +var _669=_667.find("table"); +view.width(_662); +var _66a=_666.children("div.datagrid-header-inner").show(); +_664.width(_66a.find("table").width()); if(!opts.showHeader){ -_58d.hide(); -} -_588.width(_585-_587._outerWidth()); -_587.children("div.datagrid-header,div.datagrid-body,div.datagrid-footer").width(_587.width()); -_588.children("div.datagrid-header,div.datagrid-body,div.datagrid-footer").width(_588.width()); -var hh; -_589.add(_58a).css("height",""); -_58b.add(_58c).css("height",""); -hh=Math.max(_58b.height(),_58c.height()); -_58b.add(_58c).height(hh); -_589.add(_58a)._outerHeight(hh); +_66a.hide(); +} +_665.width(_662-_664._outerWidth()); +_664.children()._outerWidth(_664.width()); +_665.children()._outerWidth(_665.width()); +var all=_666.add(_667).add(_668).add(_669); +all.css("height",""); +var hh=Math.max(_668.height(),_669.height()); +all._outerHeight(hh); +view.children(".datagrid-empty").css("top",hh+"px"); dc.body1.add(dc.body2).children("table.datagrid-btable-frozen").css({position:"absolute",top:dc.header2._outerHeight()}); -var _58e=dc.body2.children("table.datagrid-btable-frozen")._outerHeight(); -var _58f=_58e+_588.children("div.datagrid-header")._outerHeight()+_588.children("div.datagrid-footer")._outerHeight()+wrap.children("div.datagrid-toolbar")._outerHeight(); -wrap.children("div.datagrid-pager").each(function(){ -_58f+=$(this)._outerHeight(); -}); -var _590=wrap.outerHeight()-wrap.height(); -var _591=wrap._size("minHeight")||""; -var _592=wrap._size("maxHeight")||""; -_587.add(_588).children("div.datagrid-body").css({marginTop:_58e,height:(isNaN(parseInt(opts.height))?"":(_586-_58f)),minHeight:(_591?_591-_590-_58f:""),maxHeight:(_592?_592-_590-_58f:"")}); -view.height(_588.height()); -}; -function _593(_594,_595,_596){ -var rows=$.data(_594,"datagrid").data.rows; -var opts=$.data(_594,"datagrid").options; -var dc=$.data(_594,"datagrid").dc; -if(!dc.body1.is(":empty")&&(!opts.nowrap||opts.autoRowHeight||_596)){ -if(_595!=undefined){ -var tr1=opts.finder.getTr(_594,_595,"body",1); -var tr2=opts.finder.getTr(_594,_595,"body",2); -_597(tr1,tr2); -}else{ -var tr1=opts.finder.getTr(_594,0,"allbody",1); -var tr2=opts.finder.getTr(_594,0,"allbody",2); -_597(tr1,tr2); +var _66b=dc.body2.children("table.datagrid-btable-frozen")._outerHeight(); +var _66c=_66b+_667._outerHeight()+_665.children(".datagrid-footer")._outerHeight(); +wrap.children(":not(.datagrid-view,.datagrid-mask,.datagrid-mask-msg)").each(function(){ +_66c+=$(this)._outerHeight(); +}); +var _66d=wrap.outerHeight()-wrap.height(); +var _66e=wrap._size("minHeight")||""; +var _66f=wrap._size("maxHeight")||""; +_664.add(_665).children("div.datagrid-body").css({marginTop:_66b,height:(isNaN(parseInt(opts.height))?"":(_663-_66c)),minHeight:(_66e?_66e-_66d-_66c:""),maxHeight:(_66f?_66f-_66d-_66c:"")}); +view.height(_665.height()); +}; +function _670(_671,_672,_673){ +var rows=$.data(_671,"datagrid").data.rows; +var opts=$.data(_671,"datagrid").options; +var dc=$.data(_671,"datagrid").dc; +if(!dc.body1.is(":empty")&&(!opts.nowrap||opts.autoRowHeight||_673)){ +if(_672!=undefined){ +var tr1=opts.finder.getTr(_671,_672,"body",1); +var tr2=opts.finder.getTr(_671,_672,"body",2); +_674(tr1,tr2); +}else{ +var tr1=opts.finder.getTr(_671,0,"allbody",1); +var tr2=opts.finder.getTr(_671,0,"allbody",2); +_674(tr1,tr2); if(opts.showFooter){ -var tr1=opts.finder.getTr(_594,0,"allfooter",1); -var tr2=opts.finder.getTr(_594,0,"allfooter",2); -_597(tr1,tr2); +var tr1=opts.finder.getTr(_671,0,"allfooter",1); +var tr2=opts.finder.getTr(_671,0,"allfooter",2); +_674(tr1,tr2); } } } -_582(_594); +_65f(_671); if(opts.height=="auto"){ -var _598=dc.body1.parent(); -var _599=dc.body2; -var _59a=_59b(_599); -var _59c=_59a.height; -if(_59a.width>_599.width()){ -_59c+=18; -} -_59c-=parseInt(_599.css("marginTop"))||0; -_598.height(_59c); -_599.height(_59c); +var _675=dc.body1.parent(); +var _676=dc.body2; +var _677=_678(_676); +var _679=_677.height; +if(_677.width>_676.width()){ +_679+=18; +} +_679-=parseInt(_676.css("marginTop"))||0; +_675.height(_679); +_676.height(_679); dc.view.height(dc.view2.height()); } dc.body2.triggerHandler("scroll"); -function _597(trs1,trs2){ +function _674(trs1,trs2){ for(var i=0;i"); } -_5a4(true); -_5a4(false); -_582(_5a1); -function _5a4(_5a5){ -var _5a6=_5a5?1:2; -var tr=opts.finder.getTr(_5a1,_5a2,"body",_5a6); -(_5a5?dc.body1:dc.body2).children("table.datagrid-btable-frozen").append(tr); +_681(true); +_681(false); +_65f(_67e); +function _681(_682){ +var _683=_682?1:2; +var tr=opts.finder.getTr(_67e,_67f,"body",_683); +(_682?dc.body1:dc.body2).children("table.datagrid-btable-frozen").append(tr); }; }; -function _5a7(_5a8,_5a9){ -function _5aa(){ -var _5ab=[]; -var _5ac=[]; -$(_5a8).children("thead").each(function(){ +function _684(_685,_686){ +function _687(){ +var _688=[]; +var _689=[]; +$(_685).children("thead").each(function(){ var opt=$.parser.parseOptions(this,[{frozen:"boolean"}]); $(this).find("tr").each(function(){ var cols=[]; $(this).find("th").each(function(){ var th=$(this); -var col=$.extend({},$.parser.parseOptions(this,["field","align","halign","order","width",{sortable:"boolean",checkbox:"boolean",resizable:"boolean",fixed:"boolean"},{rowspan:"number",colspan:"number"}]),{title:(th.html()||undefined),hidden:(th.attr("hidden")?true:undefined),formatter:(th.attr("formatter")?eval(th.attr("formatter")):undefined),styler:(th.attr("styler")?eval(th.attr("styler")):undefined),sorter:(th.attr("sorter")?eval(th.attr("sorter")):undefined)}); +var col=$.extend({},$.parser.parseOptions(this,["id","field","align","halign","order","width",{sortable:"boolean",checkbox:"boolean",resizable:"boolean",fixed:"boolean"},{rowspan:"number",colspan:"number"}]),{title:(th.html()||undefined),hidden:(th.attr("hidden")?true:undefined),formatter:(th.attr("formatter")?eval(th.attr("formatter")):undefined),styler:(th.attr("styler")?eval(th.attr("styler")):undefined),sorter:(th.attr("sorter")?eval(th.attr("sorter")):undefined)}); if(col.width&&String(col.width).indexOf("%")==-1){ col.width=parseInt(col.width); } @@ -8065,49 +9283,49 @@ col.editor=s; } cols.push(col); }); -opt.frozen?_5ab.push(cols):_5ac.push(cols); +opt.frozen?_688.push(cols):_689.push(cols); }); }); -return [_5ab,_5ac]; +return [_688,_689]; }; -var _5ad=$("
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+""+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+""+"
            "+"
            "+"
            "+"
            ").insertAfter(_5a8); -_5ad.panel({doSize:false,cls:"datagrid"}); -$(_5a8).addClass("datagrid-f").hide().appendTo(_5ad.children("div.datagrid-view")); -var cc=_5aa(); -var view=_5ad.children("div.datagrid-view"); -var _5ae=view.children("div.datagrid-view1"); -var _5af=view.children("div.datagrid-view2"); -return {panel:_5ad,frozenColumns:cc[0],columns:cc[1],dc:{view:view,view1:_5ae,view2:_5af,header1:_5ae.children("div.datagrid-header").children("div.datagrid-header-inner"),header2:_5af.children("div.datagrid-header").children("div.datagrid-header-inner"),body1:_5ae.children("div.datagrid-body").children("div.datagrid-body-inner"),body2:_5af.children("div.datagrid-body"),footer1:_5ae.children("div.datagrid-footer").children("div.datagrid-footer-inner"),footer2:_5af.children("div.datagrid-footer").children("div.datagrid-footer-inner")}}; +var _68a=$("
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+""+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+"
            "+""+"
            "+"
            "+"
            "+"
            ").insertAfter(_685); +_68a.panel({doSize:false,cls:"datagrid"}); +$(_685).addClass("datagrid-f").hide().appendTo(_68a.children("div.datagrid-view")); +var cc=_687(); +var view=_68a.children("div.datagrid-view"); +var _68b=view.children("div.datagrid-view1"); +var _68c=view.children("div.datagrid-view2"); +return {panel:_68a,frozenColumns:cc[0],columns:cc[1],dc:{view:view,view1:_68b,view2:_68c,header1:_68b.children("div.datagrid-header").children("div.datagrid-header-inner"),header2:_68c.children("div.datagrid-header").children("div.datagrid-header-inner"),body1:_68b.children("div.datagrid-body").children("div.datagrid-body-inner"),body2:_68c.children("div.datagrid-body"),footer1:_68b.children("div.datagrid-footer").children("div.datagrid-footer-inner"),footer2:_68c.children("div.datagrid-footer").children("div.datagrid-footer-inner")}}; }; -function _5b0(_5b1){ -var _5b2=$.data(_5b1,"datagrid"); -var opts=_5b2.options; -var dc=_5b2.dc; -var _5b3=_5b2.panel; -_5b2.ss=$(_5b1).datagrid("createStyleSheet"); -_5b3.panel($.extend({},opts,{id:null,doSize:false,onResize:function(_5b4,_5b5){ -setTimeout(function(){ -if($.data(_5b1,"datagrid")){ -_582(_5b1); -_5f7(_5b1); -opts.onResize.call(_5b3,_5b4,_5b5); +function _68d(_68e){ +var _68f=$.data(_68e,"datagrid"); +var opts=_68f.options; +var dc=_68f.dc; +var _690=_68f.panel; +_68f.ss=$(_68e).datagrid("createStyleSheet"); +_690.panel($.extend({},opts,{id:null,doSize:false,onResize:function(_691,_692){ +if($.data(_68e,"datagrid")){ +_65f(_68e); +$(_68e).datagrid("fitColumns"); +opts.onResize.call(_690,_691,_692); } -},0); },onExpand:function(){ -_593(_5b1); -opts.onExpand.call(_5b3); +if($.data(_68e,"datagrid")){ +$(_68e).datagrid("fixRowHeight").datagrid("fitColumns"); +opts.onExpand.call(_690); +} }})); -_5b2.rowIdPrefix="datagrid-row-r"+(++_569); -_5b2.cellClassPrefix="datagrid-cell-c"+_569; -_5b6(dc.header1,opts.frozenColumns,true); -_5b6(dc.header2,opts.columns,false); -_5b7(); +_68f.rowIdPrefix="datagrid-row-r"+(++_645); +_68f.cellClassPrefix="datagrid-cell-c"+_645; +_693(dc.header1,opts.frozenColumns,true); +_693(dc.header2,opts.columns,false); +_694(); dc.header1.add(dc.header2).css("display",opts.showHeader?"block":"none"); dc.footer1.add(dc.footer2).css("display",opts.showFooter?"block":"none"); if(opts.toolbar){ if($.isArray(opts.toolbar)){ -$("div.datagrid-toolbar",_5b3).remove(); -var tb=$("
            ").prependTo(_5b3); +$("div.datagrid-toolbar",_690).remove(); +var tb=$("
            ").prependTo(_690); var tr=tb.find("tr"); for(var i=0;i
            ").appendTo(tr); }else{ var td=$("").appendTo(tr); -var tool=$("").appendTo(td); +var tool=$("").appendTo(td); tool[0].onclick=eval(btn.handler||function(){ }); tool.linkbutton($.extend({},btn,{plain:true})); } } }else{ -$(opts.toolbar).addClass("datagrid-toolbar").prependTo(_5b3); +$(opts.toolbar).addClass("datagrid-toolbar").prependTo(_690); $(opts.toolbar).show(); } }else{ -$("div.datagrid-toolbar",_5b3).remove(); +$("div.datagrid-toolbar",_690).remove(); } -$("div.datagrid-pager",_5b3).remove(); +$("div.datagrid-pager",_690).remove(); if(opts.pagination){ -var _5b8=$("
            "); +var _695=$("
            "); if(opts.pagePosition=="bottom"){ -_5b8.appendTo(_5b3); +_695.appendTo(_690); }else{ if(opts.pagePosition=="top"){ -_5b8.addClass("datagrid-pager-top").prependTo(_5b3); +_695.addClass("datagrid-pager-top").prependTo(_690); }else{ -var ptop=$("
            ").prependTo(_5b3); -_5b8.appendTo(_5b3); -_5b8=_5b8.add(ptop); +var ptop=$("
            ").prependTo(_690); +_695.appendTo(_690); +_695=_695.add(ptop); } } -_5b8.pagination({total:(opts.pageNumber*opts.pageSize),pageNumber:opts.pageNumber,pageSize:opts.pageSize,pageList:opts.pageList,onSelectPage:function(_5b9,_5ba){ -opts.pageNumber=_5b9||1; -opts.pageSize=_5ba; -_5b8.pagination("refresh",{pageNumber:_5b9,pageSize:_5ba}); -_5f5(_5b1); +_695.pagination({total:0,pageNumber:opts.pageNumber,pageSize:opts.pageSize,pageList:opts.pageList,onSelectPage:function(_696,_697){ +opts.pageNumber=_696||1; +opts.pageSize=_697; +_695.pagination("refresh",{pageNumber:_696,pageSize:_697}); +_6df(_68e); }}); -opts.pageSize=_5b8.pagination("options").pageSize; +opts.pageSize=_695.pagination("options").pageSize; } -function _5b6(_5bb,_5bc,_5bd){ -if(!_5bc){ +function _693(_698,_699,_69a){ +if(!_699){ return; } -$(_5bb).show(); -$(_5bb).empty(); -var _5be=[]; -var _5bf=[]; +$(_698).show(); +$(_698).empty(); +var tmp=$("
            ").appendTo("body"); +tmp._outerWidth(99); +var _69b=100-parseInt(tmp[0].style.width); +tmp.remove(); +var _69c=[]; +var _69d=[]; +var _69e=[]; if(opts.sortName){ -_5be=opts.sortName.split(","); -_5bf=opts.sortOrder.split(","); +_69c=opts.sortName.split(","); +_69d=opts.sortOrder.split(","); } -var t=$("
            ").appendTo(_5bb); -for(var i=0;i<_5bc.length;i++){ +var t=$("
            ").appendTo(_698); +for(var i=0;i<_699.length;i++){ var tr=$("").appendTo($("tbody",t)); -var cols=_5bc[i]; +var cols=_699[i]; for(var j=0;j").appendTo(tr); if(col.checkbox){ @@ -8183,37 +9412,39 @@ $("
            ").html("
            "); -$("span",td).html(col.title); -$("span.datagrid-sort-icon",td).html(" "); +td.find("span:first").html(col.title); var cell=td.find("div.datagrid-cell"); -var pos=_56a(_5be,col.field); +var pos=_646(_69c,col.field); if(pos>=0){ -cell.addClass("datagrid-sort-"+_5bf[pos]); +cell.addClass("datagrid-sort-"+_69d[pos]); +} +if(col.sortable){ +cell.addClass("datagrid-sort"); } if(col.resizable==false){ cell.attr("resizable","false"); } if(col.width){ -var _5c0=$.parser.parseValue("width",col.width,dc.view,opts.scrollbarSize); -cell._outerWidth(_5c0-1); -col.boxWidth=parseInt(cell[0].style.width); -col.deltaWidth=_5c0-col.boxWidth; +var _69f=$.parser.parseValue("width",col.width,dc.view,opts.scrollbarSize+(opts.rownumbers?opts.rownumberWidth:0)); +col.deltaWidth=_69b; +col.boxWidth=_69f-_69b; }else{ col.auto=true; } cell.css("text-align",(col.halign||col.align||"")); -col.cellClass=_5b2.cellClassPrefix+"-"+col.field.replace(/[\.|\s]/g,"-"); -cell.addClass(col.cellClass).css("width",""); +col.cellClass=_68f.cellClassPrefix+"-"+col.field.replace(/[\.|\s]/g,"-"); +cell.addClass(col.cellClass); }else{ $("
            ").html(col.title).appendTo(td); } } if(col.hidden){ td.hide(); +_69e.push(col.field); } } } -if(_5bd&&opts.rownumbers){ +if(_69a&&opts.rownumbers){ var td=$("
            "); if($("tr",t).length==0){ td.wrap("").parent().appendTo($("tbody",t)); @@ -8221,120 +9452,89 @@ td.wrap("").parent().appendTo($("tbody",t td.prependTo($("tr:first",t)); } } +for(var i=0;i<_69e.length;i++){ +_6e1(_68e,_69e[i],-1); +} }; -function _5b7(){ -var _5c1=[]; -var _5c2=_5c3(_5b1,true).concat(_5c3(_5b1)); -for(var i=0;i<_5c2.length;i++){ -var col=_5c4(_5b1,_5c2[i]); +function _694(){ +var _6a0=[[".datagrid-header-rownumber",(opts.rownumberWidth-1)+"px"],[".datagrid-cell-rownumber",(opts.rownumberWidth-1)+"px"]]; +var _6a1=_6a2(_68e,true).concat(_6a2(_68e)); +for(var i=0;i<_6a1.length;i++){ +var col=_6a3(_68e,_6a1[i]); if(col&&!col.checkbox){ -_5c1.push(["."+col.cellClass,col.boxWidth?col.boxWidth+"px":"auto"]); -} +_6a0.push(["."+col.cellClass,col.boxWidth?col.boxWidth+"px":"auto"]); +} +} +_68f.ss.add(_6a0); +_68f.ss.dirty(_68f.cellSelectorPrefix); +_68f.cellSelectorPrefix="."+_68f.cellClassPrefix; +}; +}; +function _6a4(_6a5){ +var _6a6=$.data(_6a5,"datagrid"); +var _6a7=_6a6.panel; +var opts=_6a6.options; +var dc=_6a6.dc; +var _6a8=dc.header1.add(dc.header2); +_6a8.unbind(".datagrid"); +for(var _6a9 in opts.headerEvents){ +_6a8.bind(_6a9+".datagrid",opts.headerEvents[_6a9]); +} +var _6aa=_6a8.find("div.datagrid-cell"); +var _6ab=opts.resizeHandle=="right"?"e":(opts.resizeHandle=="left"?"w":"e,w"); +_6aa.each(function(){ +$(this).resizable({handles:_6ab,disabled:($(this).attr("resizable")?$(this).attr("resizable")=="false":false),minWidth:25,onStartResize:function(e){ +_6a6.resizing=true; +_6a8.css("cursor",$("body").css("cursor")); +if(!_6a6.proxy){ +_6a6.proxy=$("
            ").appendTo(dc.view); +} +_6a6.proxy.css({left:e.pageX-$(_6a7).offset().left-1,display:"none"}); +setTimeout(function(){ +if(_6a6.proxy){ +_6a6.proxy.show(); } -_5b2.ss.add(_5c1); -_5b2.ss.dirty(_5b2.cellSelectorPrefix); -_5b2.cellSelectorPrefix="."+_5b2.cellClassPrefix; -}; -}; -function _5c5(_5c6){ -var _5c7=$.data(_5c6,"datagrid"); -var _5c8=_5c7.panel; -var opts=_5c7.options; -var dc=_5c7.dc; -var _5c9=dc.header1.add(dc.header2); -_5c9.find("input[type=checkbox]").unbind(".datagrid").bind("click.datagrid",function(e){ -if(opts.singleSelect&&opts.selectOnCheck){ -return false; -} -if($(this).is(":checked")){ -_65d(_5c6); -}else{ -_663(_5c6); -} -e.stopPropagation(); -}); -var _5ca=_5c9.find("div.datagrid-cell"); -_5ca.closest("td").unbind(".datagrid").bind("mouseenter.datagrid",function(){ -if(_5c7.resizing){ -return; -} -$(this).addClass("datagrid-header-over"); -}).bind("mouseleave.datagrid",function(){ -$(this).removeClass("datagrid-header-over"); -}).bind("contextmenu.datagrid",function(e){ -var _5cb=$(this).attr("field"); -opts.onHeaderContextMenu.call(_5c6,e,_5cb); -}); -_5ca.unbind(".datagrid").bind("click.datagrid",function(e){ -var p1=$(this).offset().left+5; -var p2=$(this).offset().left+$(this)._outerWidth()-5; -if(e.pageXp1){ -_5ea(_5c6,$(this).parent().attr("field")); -} -}).bind("dblclick.datagrid",function(e){ -var p1=$(this).offset().left+5; -var p2=$(this).offset().left+$(this)._outerWidth()-5; -var cond=opts.resizeHandle=="right"?(e.pageX>p2):(opts.resizeHandle=="left"?(e.pageXp2)); -if(cond){ -var _5cc=$(this).parent().attr("field"); -var col=_5c4(_5c6,_5cc); -if(col.resizable==false){ -return; -} -$(_5c6).datagrid("autoSizeColumn",_5cc); -col.auto=false; -} -}); -var _5cd=opts.resizeHandle=="right"?"e":(opts.resizeHandle=="left"?"w":"e,w"); -_5ca.each(function(){ -$(this).resizable({handles:_5cd,disabled:($(this).attr("resizable")?$(this).attr("resizable")=="false":false),minWidth:25,onStartResize:function(e){ -_5c7.resizing=true; -_5c9.css("cursor",$("body").css("cursor")); -if(!_5c7.proxy){ -_5c7.proxy=$("
            ").appendTo(dc.view); -} -_5c7.proxy.css({left:e.pageX-$(_5c8).offset().left-1,display:"none"}); -setTimeout(function(){ -if(_5c7.proxy){ -_5c7.proxy.show(); -} -},500); -},onResize:function(e){ -_5c7.proxy.css({left:e.pageX-$(_5c8).offset().left-1,display:"block"}); +},500); +},onResize:function(e){ +_6a6.proxy.css({left:e.pageX-$(_6a7).offset().left-1,display:"block"}); return false; },onStopResize:function(e){ -_5c9.css("cursor",""); +_6a8.css("cursor",""); $(this).css("height",""); -var _5ce=$(this).parent().attr("field"); -var col=_5c4(_5c6,_5ce); +var _6ac=$(this).parent().attr("field"); +var col=_6a3(_6a5,_6ac); col.width=$(this)._outerWidth(); col.boxWidth=col.width-col.deltaWidth; col.auto=undefined; $(this).css("width",""); -_613(_5c6,_5ce); -_5c7.proxy.remove(); -_5c7.proxy=null; +$(_6a5).datagrid("fixColumnSize",_6ac); +_6a6.proxy.remove(); +_6a6.proxy=null; if($(this).parents("div:first.datagrid-header").parent().hasClass("datagrid-view1")){ -_582(_5c6); +_65f(_6a5); } -_5f7(_5c6); -opts.onResizeColumn.call(_5c6,_5ce,col.width); +$(_6a5).datagrid("fitColumns"); +opts.onResizeColumn.call(_6a5,_6ac,col.width); setTimeout(function(){ -_5c7.resizing=false; +_6a6.resizing=false; },0); }}); }); var bb=dc.body1.add(dc.body2); bb.unbind(); -for(var _5cf in opts.rowEvents){ -bb.bind(_5cf,opts.rowEvents[_5cf]); +for(var _6a9 in opts.rowEvents){ +bb.bind(_6a9,opts.rowEvents[_6a9]); } dc.body1.bind("mousewheel DOMMouseScroll",function(e){ +e.preventDefault(); var e1=e.originalEvent||window.event; -var _5d0=e1.wheelDelta||e1.detail*(-1); +var _6ad=e1.wheelDelta||e1.detail*(-1); +if("deltaY" in e1){ +_6ad=e1.deltaY*-1; +} var dg=$(e.target).closest("div.datagrid-view").children(".datagrid-f"); var dc=dg.data("datagrid").dc; -dc.body2.scrollTop(dc.body2.scrollTop()-_5d0); +dc.body2.scrollTop(dc.body2.scrollTop()-_6ad); }); dc.body2.bind("scroll",function(){ var b1=dc.view1.children("div.datagrid-body"); @@ -8352,239 +9552,333 @@ dc.view2.children("div.datagrid-header,div.datagrid-footer")._scrollLeft($(this) dc.body2.children("table.datagrid-btable-frozen").css("left",-$(this)._scrollLeft()); }); }; -function _5d1(_5d2){ +function _6ae(_6af){ +return function(e){ +var td=$(e.target).closest("td[field]"); +if(td.length){ +var _6b0=_6b1(td); +if(!$(_6b0).data("datagrid").resizing&&_6af){ +td.addClass("datagrid-header-over"); +}else{ +td.removeClass("datagrid-header-over"); +} +} +}; +}; +function _6b2(e){ +var _6b3=_6b1(e.target); +var opts=$(_6b3).datagrid("options"); +var ck=$(e.target).closest("input[type=checkbox]"); +if(ck.length){ +if(opts.singleSelect&&opts.selectOnCheck){ +return false; +} +if(ck.is(":checked")){ +_6b4(_6b3); +}else{ +_6b5(_6b3); +} +e.stopPropagation(); +}else{ +var cell=$(e.target).closest(".datagrid-cell"); +if(cell.length){ +var p1=cell.offset().left+5; +var p2=cell.offset().left+cell._outerWidth()-5; +if(e.pageXp1){ +_6b6(_6b3,cell.parent().attr("field")); +} +} +} +}; +function _6b7(e){ +var _6b8=_6b1(e.target); +var opts=$(_6b8).datagrid("options"); +var cell=$(e.target).closest(".datagrid-cell"); +if(cell.length){ +var p1=cell.offset().left+5; +var p2=cell.offset().left+cell._outerWidth()-5; +var cond=opts.resizeHandle=="right"?(e.pageX>p2):(opts.resizeHandle=="left"?(e.pageXp2)); +if(cond){ +var _6b9=cell.parent().attr("field"); +var col=_6a3(_6b8,_6b9); +if(col.resizable==false){ +return; +} +$(_6b8).datagrid("autoSizeColumn",_6b9); +col.auto=false; +} +} +}; +function _6ba(e){ +var _6bb=_6b1(e.target); +var opts=$(_6bb).datagrid("options"); +var td=$(e.target).closest("td[field]"); +opts.onHeaderContextMenu.call(_6bb,e,td.attr("field")); +}; +function _6bc(_6bd){ return function(e){ -var tr=_5d3(e.target); +var tr=_6be(e.target); if(!tr){ return; } -var _5d4=_5d5(tr); -if($.data(_5d4,"datagrid").resizing){ +var _6bf=_6b1(tr); +if($.data(_6bf,"datagrid").resizing){ return; } -var _5d6=_5d7(tr); -if(_5d2){ -_5d8(_5d4,_5d6); +var _6c0=_6c1(tr); +if(_6bd){ +_6c2(_6bf,_6c0); }else{ -var opts=$.data(_5d4,"datagrid").options; -opts.finder.getTr(_5d4,_5d6).removeClass("datagrid-row-over"); +var opts=$.data(_6bf,"datagrid").options; +opts.finder.getTr(_6bf,_6c0).removeClass("datagrid-row-over"); } }; }; -function _5d9(e){ -var tr=_5d3(e.target); +function _6c3(e){ +var tr=_6be(e.target); if(!tr){ return; } -var _5da=_5d5(tr); -var opts=$.data(_5da,"datagrid").options; -var _5db=_5d7(tr); +var _6c4=_6b1(tr); +var opts=$.data(_6c4,"datagrid").options; +var _6c5=_6c1(tr); var tt=$(e.target); if(tt.parent().hasClass("datagrid-cell-check")){ if(opts.singleSelect&&opts.selectOnCheck){ tt._propAttr("checked",!tt.is(":checked")); -_5dc(_5da,_5db); +_6c6(_6c4,_6c5); }else{ if(tt.is(":checked")){ tt._propAttr("checked",false); -_5dc(_5da,_5db); +_6c6(_6c4,_6c5); }else{ tt._propAttr("checked",true); -_5dd(_5da,_5db); +_6c7(_6c4,_6c5); } } }else{ -var row=opts.finder.getRow(_5da,_5db); +var row=opts.finder.getRow(_6c4,_6c5); var td=tt.closest("td[field]",tr); if(td.length){ -var _5de=td.attr("field"); -opts.onClickCell.call(_5da,_5db,_5de,row[_5de]); +var _6c8=td.attr("field"); +opts.onClickCell.call(_6c4,_6c5,_6c8,row[_6c8]); } if(opts.singleSelect==true){ -_5df(_5da,_5db); +_6c9(_6c4,_6c5); }else{ if(opts.ctrlSelect){ -if(e.ctrlKey){ +if(e.metaKey||e.ctrlKey){ if(tr.hasClass("datagrid-row-selected")){ -_5e0(_5da,_5db); +_6ca(_6c4,_6c5); }else{ -_5df(_5da,_5db); +_6c9(_6c4,_6c5); } }else{ if(e.shiftKey){ -$(_5da).datagrid("clearSelections"); -var _5e1=Math.min(opts.lastSelectedIndex||0,_5db); -var _5e2=Math.max(opts.lastSelectedIndex||0,_5db); -for(var i=_5e1;i<=_5e2;i++){ -_5df(_5da,i); +$(_6c4).datagrid("clearSelections"); +var _6cb=Math.min(opts.lastSelectedIndex||0,_6c5); +var _6cc=Math.max(opts.lastSelectedIndex||0,_6c5); +for(var i=_6cb;i<=_6cc;i++){ +_6c9(_6c4,i); } }else{ -$(_5da).datagrid("clearSelections"); -_5df(_5da,_5db); -opts.lastSelectedIndex=_5db; +$(_6c4).datagrid("clearSelections"); +_6c9(_6c4,_6c5); +opts.lastSelectedIndex=_6c5; } } }else{ if(tr.hasClass("datagrid-row-selected")){ -_5e0(_5da,_5db); +_6ca(_6c4,_6c5); }else{ -_5df(_5da,_5db); +_6c9(_6c4,_6c5); } } } -opts.onClickRow.call(_5da,_5db,row); +opts.onClickRow.apply(_6c4,_649(_6c4,[_6c5,row])); } }; -function _5e3(e){ -var tr=_5d3(e.target); +function _6cd(e){ +var tr=_6be(e.target); if(!tr){ return; } -var _5e4=_5d5(tr); -var opts=$.data(_5e4,"datagrid").options; -var _5e5=_5d7(tr); -var row=opts.finder.getRow(_5e4,_5e5); +var _6ce=_6b1(tr); +var opts=$.data(_6ce,"datagrid").options; +var _6cf=_6c1(tr); +var row=opts.finder.getRow(_6ce,_6cf); var td=$(e.target).closest("td[field]",tr); if(td.length){ -var _5e6=td.attr("field"); -opts.onDblClickCell.call(_5e4,_5e5,_5e6,row[_5e6]); +var _6d0=td.attr("field"); +opts.onDblClickCell.call(_6ce,_6cf,_6d0,row[_6d0]); } -opts.onDblClickRow.call(_5e4,_5e5,row); +opts.onDblClickRow.apply(_6ce,_649(_6ce,[_6cf,row])); }; -function _5e7(e){ -var tr=_5d3(e.target); -if(!tr){ -return; +function _6d1(e){ +var tr=_6be(e.target); +if(tr){ +var _6d2=_6b1(tr); +var opts=$.data(_6d2,"datagrid").options; +var _6d3=_6c1(tr); +var row=opts.finder.getRow(_6d2,_6d3); +opts.onRowContextMenu.call(_6d2,e,_6d3,row); +}else{ +var body=_6be(e.target,".datagrid-body"); +if(body){ +var _6d2=_6b1(body); +var opts=$.data(_6d2,"datagrid").options; +opts.onRowContextMenu.call(_6d2,e,-1,null); +} } -var _5e8=_5d5(tr); -var opts=$.data(_5e8,"datagrid").options; -var _5e9=_5d7(tr); -var row=opts.finder.getRow(_5e8,_5e9); -opts.onRowContextMenu.call(_5e8,e,_5e9,row); }; -function _5d5(t){ +function _6b1(t){ return $(t).closest("div.datagrid-view").children(".datagrid-f")[0]; }; -function _5d3(t){ -var tr=$(t).closest("tr.datagrid-row"); +function _6be(t,_6d4){ +var tr=$(t).closest(_6d4||"tr.datagrid-row"); if(tr.length&&tr.parent().length){ return tr; }else{ return undefined; } }; -function _5d7(tr){ +function _6c1(tr){ if(tr.attr("datagrid-row-index")){ return parseInt(tr.attr("datagrid-row-index")); }else{ return tr.attr("node-id"); } }; -function _5ea(_5eb,_5ec){ -var _5ed=$.data(_5eb,"datagrid"); -var opts=_5ed.options; -_5ec=_5ec||{}; -var _5ee={sortName:opts.sortName,sortOrder:opts.sortOrder}; -if(typeof _5ec=="object"){ -$.extend(_5ee,_5ec); +function _6b6(_6d5,_6d6){ +var _6d7=$.data(_6d5,"datagrid"); +var opts=_6d7.options; +_6d6=_6d6||{}; +var _6d8={sortName:opts.sortName,sortOrder:opts.sortOrder}; +if(typeof _6d6=="object"){ +$.extend(_6d8,_6d6); } -var _5ef=[]; -var _5f0=[]; -if(_5ee.sortName){ -_5ef=_5ee.sortName.split(","); -_5f0=_5ee.sortOrder.split(","); +var _6d9=[]; +var _6da=[]; +if(_6d8.sortName){ +_6d9=_6d8.sortName.split(","); +_6da=_6d8.sortOrder.split(","); } -if(typeof _5ec=="string"){ -var _5f1=_5ec; -var col=_5c4(_5eb,_5f1); -if(!col.sortable||_5ed.resizing){ +if(typeof _6d6=="string"){ +var _6db=_6d6; +var col=_6a3(_6d5,_6db); +if(!col.sortable||_6d7.resizing){ return; } -var _5f2=col.order||"asc"; -var pos=_56a(_5ef,_5f1); +var _6dc=col.order||"asc"; +var pos=_646(_6d9,_6db); if(pos>=0){ -var _5f3=_5f0[pos]=="asc"?"desc":"asc"; -if(opts.multiSort&&_5f3==_5f2){ -_5ef.splice(pos,1); -_5f0.splice(pos,1); +var _6dd=_6da[pos]=="asc"?"desc":"asc"; +if(opts.multiSort&&_6dd==_6dc){ +_6d9.splice(pos,1); +_6da.splice(pos,1); }else{ -_5f0[pos]=_5f3; +_6da[pos]=_6dd; } }else{ if(opts.multiSort){ -_5ef.push(_5f1); -_5f0.push(_5f2); +_6d9.push(_6db); +_6da.push(_6dc); }else{ -_5ef=[_5f1]; -_5f0=[_5f2]; +_6d9=[_6db]; +_6da=[_6dc]; } } -_5ee.sortName=_5ef.join(","); -_5ee.sortOrder=_5f0.join(","); +_6d8.sortName=_6d9.join(","); +_6d8.sortOrder=_6da.join(","); } -if(opts.onBeforeSortColumn.call(_5eb,_5ee.sortName,_5ee.sortOrder)==false){ +if(opts.onBeforeSortColumn.call(_6d5,_6d8.sortName,_6d8.sortOrder)==false){ return; } -$.extend(opts,_5ee); -var dc=_5ed.dc; -var _5f4=dc.header1.add(dc.header2); -_5f4.find("div.datagrid-cell").removeClass("datagrid-sort-asc datagrid-sort-desc"); -for(var i=0;i<_5ef.length;i++){ -var col=_5c4(_5eb,_5ef[i]); -_5f4.find("div."+col.cellClass).addClass("datagrid-sort-"+_5f0[i]); +$.extend(opts,_6d8); +var dc=_6d7.dc; +var _6de=dc.header1.add(dc.header2); +_6de.find("div.datagrid-cell").removeClass("datagrid-sort-asc datagrid-sort-desc"); +for(var i=0;i<_6d9.length;i++){ +var col=_6a3(_6d5,_6d9[i]); +_6de.find("div."+col.cellClass).addClass("datagrid-sort-"+_6da[i]); } if(opts.remoteSort){ -_5f5(_5eb); +_6df(_6d5); +}else{ +_6e0(_6d5,$(_6d5).datagrid("getData")); +} +opts.onSortColumn.call(_6d5,opts.sortName,opts.sortOrder); +}; +function _6e1(_6e2,_6e3,_6e4){ +_6e5(true); +_6e5(false); +function _6e5(_6e6){ +var aa=_6e7(_6e2,_6e6); +if(aa.length){ +var _6e8=aa[aa.length-1]; +var _6e9=_646(_6e8,_6e3); +if(_6e9>=0){ +for(var _6ea=0;_6ea=_5fa.find("table").width()){ +_6f0(); +_6f1(); +_6f2(); +_6f0(true); +if(_6ef.width()>=_6ef.find("table").width()){ dc.body2.css("overflow-x","hidden"); } -function _5fc(){ +function _6f2(){ if(!opts.fitColumns){ return; } -if(!_5f9.leftWidth){ -_5f9.leftWidth=0; +if(!_6ee.leftWidth){ +_6ee.leftWidth=0; } -var _5fd=0; +var _6f3=0; var cc=[]; -var _5fe=_5c3(_5f8,false); -for(var i=0;i<_5fe.length;i++){ -var col=_5c4(_5f8,_5fe[i]); -if(_5ff(col)){ -_5fd+=col.width; +var _6f4=_6a2(_6ed,false); +for(var i=0;i<_6f4.length;i++){ +var col=_6a3(_6ed,_6f4[i]); +if(_6f5(col)){ +_6f3+=col.width; cc.push({field:col.field,col:col,addingWidth:0}); } } -if(!_5fd){ +if(!_6f3){ return; } -cc[cc.length-1].addingWidth-=_5f9.leftWidth; -var _600=_5fa.children("div.datagrid-header-inner").show(); -var _601=_5fa.width()-_5fa.find("table").width()-opts.scrollbarSize+_5f9.leftWidth; -var rate=_601/_5fd; +cc[cc.length-1].addingWidth-=_6ee.leftWidth; +var _6f6=_6ef.children("div.datagrid-header-inner").show(); +var _6f7=_6ef.width()-_6ef.find("table").width()-opts.scrollbarSize+_6ee.leftWidth; +var rate=_6f7/_6f3; if(!opts.showHeader){ -_600.hide(); +_6f6.hide(); } for(var i=0;i0){ @@ -8592,27 +9886,38 @@ c.col.boxWidth+=c.addingWidth; c.col.width+=c.addingWidth; } } -_5f9.leftWidth=_601; -_613(_5f8); +_6ee.leftWidth=_6f7; +$(_6ed).datagrid("fixColumnSize"); }; -function _5fb(){ -var _603=false; -var _604=_5c3(_5f8,true).concat(_5c3(_5f8,false)); -$.map(_604,function(_605){ -var col=_5c4(_5f8,_605); +function _6f1(){ +var _6f9=false; +var _6fa=_6a2(_6ed,true).concat(_6a2(_6ed,false)); +$.map(_6fa,function(_6fb){ +var col=_6a3(_6ed,_6fb); if(String(col.width||"").indexOf("%")>=0){ -var _606=$.parser.parseValue("width",col.width,dc.view,opts.scrollbarSize)-col.deltaWidth; -if(_606>0){ -col.boxWidth=_606; -_603=true; +var _6fc=$.parser.parseValue("width",col.width,dc.view,opts.scrollbarSize+(opts.rownumbers?opts.rownumberWidth:0))-col.deltaWidth; +if(_6fc>0){ +col.boxWidth=_6fc; +_6f9=true; +} } +}); +if(_6f9){ +$(_6ed).datagrid("fixColumnSize"); } +}; +function _6f0(fit){ +var _6fd=dc.header1.add(dc.header2).find(".datagrid-cell-group"); +if(_6fd.length){ +_6fd.each(function(){ +$(this)._outerWidth(fit?$(this).parent().width():10); }); -if(_603){ -_613(_5f8); +if(fit){ +_65f(_6ed); +} } }; -function _5ff(col){ +function _6f5(col){ if(String(col.width||"").indexOf("%")>=0){ return false; } @@ -8621,115 +9926,114 @@ return true; } }; }; -function _607(_608,_609){ -var _60a=$.data(_608,"datagrid"); -var opts=_60a.options; -var dc=_60a.dc; +function _6fe(_6ff,_700){ +var _701=$.data(_6ff,"datagrid"); +var opts=_701.options; +var dc=_701.dc; var tmp=$("
            ").appendTo("body"); -if(_609){ -_57d(_609); -if(opts.fitColumns){ -_582(_608); -_5f7(_608); -} -}else{ -var _60b=false; -var _60c=_5c3(_608,true).concat(_5c3(_608,false)); -for(var i=0;i<_60c.length;i++){ -var _609=_60c[i]; -var col=_5c4(_608,_609); +if(_700){ +_65a(_700); +$(_6ff).datagrid("fitColumns"); +}else{ +var _702=false; +var _703=_6a2(_6ff,true).concat(_6a2(_6ff,false)); +for(var i=0;i<_703.length;i++){ +var _700=_703[i]; +var col=_6a3(_6ff,_700); if(col.auto){ -_57d(_609); -_60b=true; +_65a(_700); +_702=true; } } -if(_60b&&opts.fitColumns){ -_582(_608); -_5f7(_608); +if(_702){ +$(_6ff).datagrid("fitColumns"); } } tmp.remove(); -function _57d(_60d){ -var _60e=dc.view.find("div.datagrid-header td[field=\""+_60d+"\"] div.datagrid-cell"); -_60e.css("width",""); -var col=$(_608).datagrid("getColumnOption",_60d); +function _65a(_704){ +var _705=dc.view.find("div.datagrid-header td[field=\""+_704+"\"] div.datagrid-cell"); +_705.css("width",""); +var col=$(_6ff).datagrid("getColumnOption",_704); col.width=undefined; col.boxWidth=undefined; col.auto=true; -$(_608).datagrid("fixColumnSize",_60d); -var _60f=Math.max(_610("header"),_610("allbody"),_610("allfooter"))+1; -_60e._outerWidth(_60f-1); -col.width=_60f; -col.boxWidth=parseInt(_60e[0].style.width); -col.deltaWidth=_60f-col.boxWidth; -_60e.css("width",""); -$(_608).datagrid("fixColumnSize",_60d); -opts.onResizeColumn.call(_608,_60d,col.width); -function _610(type){ -var _611=0; +$(_6ff).datagrid("fixColumnSize",_704); +var _706=Math.max(_707("header"),_707("allbody"),_707("allfooter"))+1; +_705._outerWidth(_706-1); +col.width=_706; +col.boxWidth=parseInt(_705[0].style.width); +col.deltaWidth=_706-col.boxWidth; +_705.css("width",""); +$(_6ff).datagrid("fixColumnSize",_704); +opts.onResizeColumn.call(_6ff,_704,col.width); +function _707(type){ +var _708=0; if(type=="header"){ -_611=_612(_60e); +_708=_709(_705); }else{ -opts.finder.getTr(_608,0,type).find("td[field=\""+_60d+"\"] div.datagrid-cell").each(function(){ -var w=_612($(this)); -if(_6111){ +var col=_6a3(_712,td.attr("field")); +var _714=col.boxWidth+col.deltaWidth-1; +for(var i=1;i<_713;i++){ td=td.next(); -col=_5c4(_61b,td.attr("field")); -_61d+=col.boxWidth+col.deltaWidth; +col=_6a3(_712,td.attr("field")); +_714+=col.boxWidth+col.deltaWidth; +} +$(this).children("div.datagrid-cell")._outerWidth(_714); } -$(this).children("div.datagrid-cell")._outerWidth(_61d); }); }; -function _619(_61e){ -var dc=$.data(_61e,"datagrid").dc; +function _710(_715){ +var dc=$.data(_715,"datagrid").dc; dc.view.find("div.datagrid-editable").each(function(){ var cell=$(this); -var _61f=cell.parent().attr("field"); -var col=$(_61e).datagrid("getColumnOption",_61f); +var _716=cell.parent().attr("field"); +var col=$(_715).datagrid("getColumnOption",_716); cell._outerWidth(col.boxWidth+col.deltaWidth-1); var ed=$.data(this,"datagrid.editor"); if(ed.actions.resize){ @@ -8737,14 +10041,14 @@ ed.actions.resize(ed.target,cell.width()); } }); }; -function _5c4(_620,_621){ -function find(_622){ -if(_622){ -for(var i=0;i<_622.length;i++){ -var cc=_622[i]; +function _6a3(_717,_718){ +function find(_719){ +if(_719){ +for(var i=0;i<_719.length;i++){ +var cc=_719[i]; for(var j=0;j=0){ -var _62b=col.field||""; +var _71d=_71e(); +for(var i=0;i<_71c.length;i++){ +aa[i]=new Array(_71d); +} +for(var _71f=0;_71f<_71c.length;_71f++){ +$.map(_71c[_71f],function(col){ +var _720=_721(aa[_71f]); +if(_720>=0){ +var _722=col.field||col.id||""; for(var c=0;c<(col.colspan||1);c++){ for(var r=0;r<(col.rowspan||1);r++){ -aa[_628+r][_629]=_62b; +aa[_71f+r][_720]=_722; } -_629++; +_720++; } } }); } -return aa[aa.length-1]; -function _627(){ -var _62c=0; -$.map(_625[0],function(col){ -_62c+=col.colspan||1; +return aa; +function _71e(){ +var _723=0; +$.map(_71c[0]||[],function(col){ +_723+=col.colspan||1; }); -return _62c; +return _723; }; -function _62a(a){ +function _721(a){ for(var i=0;ib?1:-1); }; -r=_631(r1[sn],r2[sn])*(so=="asc"?1:-1); +r=_72a(r1[sn],r2[sn])*(so=="asc"?1:-1); if(r!=0){ return r; } @@ -8832,61 +10140,61 @@ return r; }); } if(opts.view.onBeforeRender){ -opts.view.onBeforeRender.call(opts.view,_62d,data.rows); +opts.view.onBeforeRender.call(opts.view,_726,data.rows); } -opts.view.render.call(opts.view,_62d,dc.body2,false); -opts.view.render.call(opts.view,_62d,dc.body1,true); +opts.view.render.call(opts.view,_726,dc.body2,false); +opts.view.render.call(opts.view,_726,dc.body1,true); if(opts.showFooter){ -opts.view.renderFooter.call(opts.view,_62d,dc.footer2,false); -opts.view.renderFooter.call(opts.view,_62d,dc.footer1,true); +opts.view.renderFooter.call(opts.view,_726,dc.footer2,false); +opts.view.renderFooter.call(opts.view,_726,dc.footer1,true); } if(opts.view.onAfterRender){ -opts.view.onAfterRender.call(opts.view,_62d); +opts.view.onAfterRender.call(opts.view,_726); } -_62e.ss.clean(); -var _632=$(_62d).datagrid("getPager"); -if(_632.length){ -var _633=_632.pagination("options"); -if(_633.total!=data.total){ -_632.pagination("refresh",{total:data.total}); -if(opts.pageNumber!=_633.pageNumber&&_633.pageNumber>0){ -opts.pageNumber=_633.pageNumber; -_5f5(_62d); +_727.ss.clean(); +var _72b=$(_726).datagrid("getPager"); +if(_72b.length){ +var _72c=_72b.pagination("options"); +if(_72c.total!=data.total){ +_72b.pagination("refresh",{total:data.total}); +if(opts.pageNumber!=_72c.pageNumber&&_72c.pageNumber>0){ +opts.pageNumber=_72c.pageNumber; +_6df(_726); } } } -_593(_62d); +_670(_726); dc.body2.triggerHandler("scroll"); -$(_62d).datagrid("setSelectionState"); -$(_62d).datagrid("autoSizeColumn"); -opts.onLoadSuccess.call(_62d,data); -}; -function _634(_635){ -var _636=$.data(_635,"datagrid"); -var opts=_636.options; -var dc=_636.dc; +$(_726).datagrid("setSelectionState"); +$(_726).datagrid("autoSizeColumn"); +opts.onLoadSuccess.call(_726,data); +}; +function _72d(_72e){ +var _72f=$.data(_72e,"datagrid"); +var opts=_72f.options; +var dc=_72f.dc; dc.header1.add(dc.header2).find("input[type=checkbox]")._propAttr("checked",false); if(opts.idField){ -var _637=$.data(_635,"treegrid")?true:false; -var _638=opts.onSelect; -var _639=opts.onCheck; +var _730=$.data(_72e,"treegrid")?true:false; +var _731=opts.onSelect; +var _732=opts.onCheck; opts.onSelect=opts.onCheck=function(){ }; -var rows=opts.finder.getRows(_635); +var rows=opts.finder.getRows(_72e); for(var i=0;i_64a.height()-18){ -_64a.scrollTop(_64a.scrollTop()+top+tr._outerHeight()-_64a.height()+18); +if(top+tr._outerHeight()>_743.height()-_744){ +_743.scrollTop(_743.scrollTop()+top+tr._outerHeight()-_743.height()+_744); } } } }; -function _5d8(_64c,_64d){ -var _64e=$.data(_64c,"datagrid"); -var opts=_64e.options; -opts.finder.getTr(_64c,_64e.highlightIndex).removeClass("datagrid-row-over"); -opts.finder.getTr(_64c,_64d).addClass("datagrid-row-over"); -_64e.highlightIndex=_64d; +function _6c2(_746,_747){ +var _748=$.data(_746,"datagrid"); +var opts=_748.options; +opts.finder.getTr(_746,_748.highlightIndex).removeClass("datagrid-row-over"); +opts.finder.getTr(_746,_747).addClass("datagrid-row-over"); +_748.highlightIndex=_747; }; -function _5df(_64f,_650,_651){ -var _652=$.data(_64f,"datagrid"); -var opts=_652.options; -var row=opts.finder.getRow(_64f,_650); -if(opts.onBeforeSelect.call(_64f,_650,row)==false){ +function _6c9(_749,_74a,_74b,_74c){ +var _74d=$.data(_749,"datagrid"); +var opts=_74d.options; +var row=opts.finder.getRow(_749,_74a); +if(!row){ +return; +} +if(opts.onBeforeSelect.apply(_749,_649(_749,[_74a,row]))==false){ return; } if(opts.singleSelect){ -_653(_64f,true); -_652.selectedRows=[]; +_74e(_749,true); +_74d.selectedRows=[]; } -if(!_651&&opts.checkOnSelect){ -_5dc(_64f,_650,true); +if(!_74b&&opts.checkOnSelect){ +_6c6(_749,_74a,true); } if(opts.idField){ -_56d(_652.selectedRows,opts.idField,row); +_648(_74d.selectedRows,opts.idField,row); +} +opts.finder.getTr(_749,_74a).addClass("datagrid-row-selected"); +opts.onSelect.apply(_749,_649(_749,[_74a,row])); +if(!_74c&&opts.scrollOnSelect){ +_73e(_749,_74a); } -opts.finder.getTr(_64f,_650).addClass("datagrid-row-selected"); -opts.onSelect.call(_64f,_650,row); -_645(_64f,_650); }; -function _5e0(_654,_655,_656){ -var _657=$.data(_654,"datagrid"); -var dc=_657.dc; -var opts=_657.options; -var row=opts.finder.getRow(_654,_655); -if(opts.onBeforeUnselect.call(_654,_655,row)==false){ +function _6ca(_74f,_750,_751){ +var _752=$.data(_74f,"datagrid"); +var dc=_752.dc; +var opts=_752.options; +var row=opts.finder.getRow(_74f,_750); +if(!row){ +return; +} +if(opts.onBeforeUnselect.apply(_74f,_649(_74f,[_750,row]))==false){ return; } -if(!_656&&opts.checkOnSelect){ -_5dd(_654,_655,true); +if(!_751&&opts.checkOnSelect){ +_6c7(_74f,_750,true); } -opts.finder.getTr(_654,_655).removeClass("datagrid-row-selected"); +opts.finder.getTr(_74f,_750).removeClass("datagrid-row-selected"); if(opts.idField){ -_56b(_657.selectedRows,opts.idField,row[opts.idField]); +_647(_752.selectedRows,opts.idField,row[opts.idField]); } -opts.onUnselect.call(_654,_655,row); +opts.onUnselect.apply(_74f,_649(_74f,[_750,row])); }; -function _658(_659,_65a){ -var _65b=$.data(_659,"datagrid"); -var opts=_65b.options; -var rows=opts.finder.getRows(_659); -var _65c=$.data(_659,"datagrid").selectedRows; -if(!_65a&&opts.checkOnSelect){ -_65d(_659,true); +function _753(_754,_755){ +var _756=$.data(_754,"datagrid"); +var opts=_756.options; +var rows=opts.finder.getRows(_754); +var _757=$.data(_754,"datagrid").selectedRows; +if(!_755&&opts.checkOnSelect){ +_6b4(_754,true); } -opts.finder.getTr(_659,"","allbody").addClass("datagrid-row-selected"); +opts.finder.getTr(_754,"","allbody").addClass("datagrid-row-selected"); if(opts.idField){ -for(var _65e=0;_65e"); cell.children("table").bind("click dblclick contextmenu",function(e){ e.stopPropagation(); }); -$.data(cell[0],"datagrid.editor",{actions:_694,target:_694.init(cell.find("td"),_693),field:_691,type:_692,oldHtml:_695}); +$.data(cell[0],"datagrid.editor",{actions:_78d,target:_78d.init(cell.find("td"),$.extend({height:opts.editorHeight},_78c)),field:_78a,type:_78b,oldHtml:_78e}); } } }); -_593(_68f,_690,true); +_670(_788,_789,true); }; -function _686(_697,_698){ -var opts=$.data(_697,"datagrid").options; -var tr=opts.finder.getTr(_697,_698); +function _77f(_790,_791){ +var opts=$.data(_790,"datagrid").options; +var tr=opts.finder.getTr(_790,_791); tr.children("td").each(function(){ var cell=$(this).find("div.datagrid-editable"); if(cell.length){ @@ -9257,402 +10585,415 @@ cell.css("width",""); } }); }; -function _679(_699,_69a){ -var tr=$.data(_699,"datagrid").options.finder.getTr(_699,_69a); +function _772(_792,_793){ +var tr=$.data(_792,"datagrid").options.finder.getTr(_792,_793); if(!tr.hasClass("datagrid-row-editing")){ return true; } var vbox=tr.find(".validatebox-text"); vbox.validatebox("validate"); vbox.trigger("mouseleave"); -var _69b=tr.find(".validatebox-invalid"); -return _69b.length==0; -}; -function _69c(_69d,_69e){ -var _69f=$.data(_69d,"datagrid").insertedRows; -var _6a0=$.data(_69d,"datagrid").deletedRows; -var _6a1=$.data(_69d,"datagrid").updatedRows; -if(!_69e){ +var _794=tr.find(".validatebox-invalid"); +return _794.length==0; +}; +function _795(_796,_797){ +var _798=$.data(_796,"datagrid").insertedRows; +var _799=$.data(_796,"datagrid").deletedRows; +var _79a=$.data(_796,"datagrid").updatedRows; +if(!_797){ var rows=[]; -rows=rows.concat(_69f); -rows=rows.concat(_6a0); -rows=rows.concat(_6a1); +rows=rows.concat(_798); +rows=rows.concat(_799); +rows=rows.concat(_79a); return rows; }else{ -if(_69e=="inserted"){ -return _69f; +if(_797=="inserted"){ +return _798; }else{ -if(_69e=="deleted"){ -return _6a0; +if(_797=="deleted"){ +return _799; }else{ -if(_69e=="updated"){ -return _6a1; +if(_797=="updated"){ +return _79a; } } } } return []; }; -function _6a2(_6a3,_6a4){ -var _6a5=$.data(_6a3,"datagrid"); -var opts=_6a5.options; -var data=_6a5.data; -var _6a6=_6a5.insertedRows; -var _6a7=_6a5.deletedRows; -$(_6a3).datagrid("cancelEdit",_6a4); -var row=opts.finder.getRow(_6a3,_6a4); -if(_56a(_6a6,row)>=0){ -_56b(_6a6,row); -}else{ -_6a7.push(row); -} -_56b(_6a5.selectedRows,opts.idField,row[opts.idField]); -_56b(_6a5.checkedRows,opts.idField,row[opts.idField]); -opts.view.deleteRow.call(opts.view,_6a3,_6a4); +function _79b(_79c,_79d){ +var _79e=$.data(_79c,"datagrid"); +var opts=_79e.options; +var data=_79e.data; +var _79f=_79e.insertedRows; +var _7a0=_79e.deletedRows; +$(_79c).datagrid("cancelEdit",_79d); +var row=opts.finder.getRow(_79c,_79d); +if(_646(_79f,row)>=0){ +_647(_79f,row); +}else{ +_7a0.push(row); +} +_647(_79e.selectedRows,opts.idField,row[opts.idField]); +_647(_79e.checkedRows,opts.idField,row[opts.idField]); +opts.view.deleteRow.call(opts.view,_79c,_79d); if(opts.height=="auto"){ -_593(_6a3); -} -$(_6a3).datagrid("getPager").pagination("refresh",{total:data.total}); -}; -function _6a8(_6a9,_6aa){ -var data=$.data(_6a9,"datagrid").data; -var view=$.data(_6a9,"datagrid").options.view; -var _6ab=$.data(_6a9,"datagrid").insertedRows; -view.insertRow.call(view,_6a9,_6aa.index,_6aa.row); -_6ab.push(_6aa.row); -$(_6a9).datagrid("getPager").pagination("refresh",{total:data.total}); -}; -function _6ac(_6ad,row){ -var data=$.data(_6ad,"datagrid").data; -var view=$.data(_6ad,"datagrid").options.view; -var _6ae=$.data(_6ad,"datagrid").insertedRows; -view.insertRow.call(view,_6ad,null,row); -_6ae.push(row); -$(_6ad).datagrid("getPager").pagination("refresh",{total:data.total}); -}; -function _6af(_6b0){ -var _6b1=$.data(_6b0,"datagrid"); -var data=_6b1.data; +_670(_79c); +} +$(_79c).datagrid("getPager").pagination("refresh",{total:data.total}); +}; +function _7a1(_7a2,_7a3){ +var data=$.data(_7a2,"datagrid").data; +var view=$.data(_7a2,"datagrid").options.view; +var _7a4=$.data(_7a2,"datagrid").insertedRows; +view.insertRow.call(view,_7a2,_7a3.index,_7a3.row); +_7a4.push(_7a3.row); +$(_7a2).datagrid("getPager").pagination("refresh",{total:data.total}); +}; +function _7a5(_7a6,row){ +var data=$.data(_7a6,"datagrid").data; +var view=$.data(_7a6,"datagrid").options.view; +var _7a7=$.data(_7a6,"datagrid").insertedRows; +view.insertRow.call(view,_7a6,null,row); +_7a7.push(row); +$(_7a6).datagrid("getPager").pagination("refresh",{total:data.total}); +}; +function _7a8(_7a9,_7aa){ +var _7ab=$.data(_7a9,"datagrid"); +var opts=_7ab.options; +var row=opts.finder.getRow(_7a9,_7aa.index); +var _7ac=false; +_7aa.row=_7aa.row||{}; +for(var _7ad in _7aa.row){ +if(row[_7ad]!==_7aa.row[_7ad]){ +_7ac=true; +break; +} +} +if(_7ac){ +if(_646(_7ab.insertedRows,row)==-1){ +if(_646(_7ab.updatedRows,row)==-1){ +_7ab.updatedRows.push(row); +} +} +opts.view.updateRow.call(opts.view,_7a9,_7aa.index,_7aa.row); +} +}; +function _7ae(_7af){ +var _7b0=$.data(_7af,"datagrid"); +var data=_7b0.data; var rows=data.rows; -var _6b2=[]; +var _7b1=[]; for(var i=0;i=0){ -(_6bf=="s"?_5df:_5dc)(_6b6,_6c0,true); +var _7bf=_735(_7b5,ids[i]); +if(_7bf>=0){ +(_7be=="s"?_6c9:_6c6)(_7b5,_7bf,true); } } }; for(var i=0;i0){ -_5f6(this,data); -_6af(this); +$(this).datagrid("loadData",data); +}else{ +opts.view.setEmptyMsg(this); +$(this).datagrid("autoSizeColumn"); } } -_5f5(this); +_6df(this); }); }; -function _6d1(_6d2){ -var _6d3={}; -$.map(_6d2,function(name){ -_6d3[name]=_6d4(name); +function _7cf(_7d0){ +var _7d1={}; +$.map(_7d0,function(name){ +_7d1[name]=_7d2(name); }); -return _6d3; -function _6d4(name){ -function isA(_6d5){ -return $.data($(_6d5)[0],name)!=undefined; +return _7d1; +function _7d2(name){ +function isA(_7d3){ +return $.data($(_7d3)[0],name)!=undefined; }; -return {init:function(_6d6,_6d7){ -var _6d8=$("").appendTo(_6d6); -if(_6d8[name]&&name!="text"){ -return _6d8[name](_6d7); +return {init:function(_7d4,_7d5){ +var _7d6=$("").appendTo(_7d4); +if(_7d6[name]&&name!="text"){ +return _7d6[name](_7d5); }else{ -return _6d8; +return _7d6; } -},destroy:function(_6d9){ -if(isA(_6d9,name)){ -$(_6d9)[name]("destroy"); +},destroy:function(_7d7){ +if(isA(_7d7,name)){ +$(_7d7)[name]("destroy"); } -},getValue:function(_6da){ -if(isA(_6da,name)){ -var opts=$(_6da)[name]("options"); +},getValue:function(_7d8){ +if(isA(_7d8,name)){ +var opts=$(_7d8)[name]("options"); if(opts.multiple){ -return $(_6da)[name]("getValues").join(opts.separator); +return $(_7d8)[name]("getValues").join(opts.separator); }else{ -return $(_6da)[name]("getValue"); +return $(_7d8)[name]("getValue"); } }else{ -return $(_6da).val(); +return $(_7d8).val(); } -},setValue:function(_6db,_6dc){ -if(isA(_6db,name)){ -var opts=$(_6db)[name]("options"); +},setValue:function(_7d9,_7da){ +if(isA(_7d9,name)){ +var opts=$(_7d9)[name]("options"); if(opts.multiple){ -if(_6dc){ -$(_6db)[name]("setValues",_6dc.split(opts.separator)); +if(_7da){ +$(_7d9)[name]("setValues",_7da.split(opts.separator)); }else{ -$(_6db)[name]("clear"); +$(_7d9)[name]("clear"); } }else{ -$(_6db)[name]("setValue",_6dc); +$(_7d9)[name]("setValue",_7da); } }else{ -$(_6db).val(_6dc); +$(_7d9).val(_7da); } -},resize:function(_6dd,_6de){ -if(isA(_6dd,name)){ -$(_6dd)[name]("resize",_6de); +},resize:function(_7db,_7dc){ +if(isA(_7db,name)){ +$(_7db)[name]("resize",_7dc); }else{ -$(_6dd)._outerWidth(_6de)._outerHeight(22); +$(_7db)._size({width:_7dc,height:$.fn.datagrid.defaults.editorHeight}); } }}; }; }; -var _6df=$.extend({},_6d1(["text","textbox","numberbox","numberspinner","combobox","combotree","combogrid","datebox","datetimebox","timespinner","datetimespinner"]),{textarea:{init:function(_6e0,_6e1){ -var _6e2=$("").appendTo(_6e0); -return _6e2; -},getValue:function(_6e3){ -return $(_6e3).val(); -},setValue:function(_6e4,_6e5){ -$(_6e4).val(_6e5); -},resize:function(_6e6,_6e7){ -$(_6e6)._outerWidth(_6e7); -}},checkbox:{init:function(_6e8,_6e9){ -var _6ea=$("").appendTo(_6e8); -_6ea.val(_6e9.on); -_6ea.attr("offval",_6e9.off); -return _6ea; -},getValue:function(_6eb){ -if($(_6eb).is(":checked")){ -return $(_6eb).val(); -}else{ -return $(_6eb).attr("offval"); -} -},setValue:function(_6ec,_6ed){ -var _6ee=false; -if($(_6ec).val()==_6ed){ -_6ee=true; -} -$(_6ec)._propAttr("checked",_6ee); -}},validatebox:{init:function(_6ef,_6f0){ -var _6f1=$("").appendTo(_6ef); -_6f1.validatebox(_6f0); -return _6f1; -},destroy:function(_6f2){ -$(_6f2).validatebox("destroy"); -},getValue:function(_6f3){ -return $(_6f3).val(); -},setValue:function(_6f4,_6f5){ -$(_6f4).val(_6f5); -},resize:function(_6f6,_6f7){ -$(_6f6)._outerWidth(_6f7)._outerHeight(22); +var _7dd=$.extend({},_7cf(["text","textbox","passwordbox","filebox","numberbox","numberspinner","combobox","combotree","combogrid","combotreegrid","datebox","datetimebox","timespinner","datetimespinner"]),{textarea:{init:function(_7de,_7df){ +var _7e0=$("").appendTo(_7de); +_7e0.css("vertical-align","middle")._outerHeight(_7df.height); +return _7e0; +},getValue:function(_7e1){ +return $(_7e1).val(); +},setValue:function(_7e2,_7e3){ +$(_7e2).val(_7e3); +},resize:function(_7e4,_7e5){ +$(_7e4)._outerWidth(_7e5); +}},checkbox:{init:function(_7e6,_7e7){ +var _7e8=$("").appendTo(_7e6); +_7e8.val(_7e7.on); +_7e8.attr("offval",_7e7.off); +return _7e8; +},getValue:function(_7e9){ +if($(_7e9).is(":checked")){ +return $(_7e9).val(); +}else{ +return $(_7e9).attr("offval"); +} +},setValue:function(_7ea,_7eb){ +var _7ec=false; +if($(_7ea).val()==_7eb){ +_7ec=true; +} +$(_7ea)._propAttr("checked",_7ec); +}},validatebox:{init:function(_7ed,_7ee){ +var _7ef=$("").appendTo(_7ed); +_7ef.validatebox(_7ee); +return _7ef; +},destroy:function(_7f0){ +$(_7f0).validatebox("destroy"); +},getValue:function(_7f1){ +return $(_7f1).val(); +},setValue:function(_7f2,_7f3){ +$(_7f2).val(_7f3); +},resize:function(_7f4,_7f5){ +$(_7f4)._outerWidth(_7f5)._outerHeight($.fn.datagrid.defaults.editorHeight); }}}); $.fn.datagrid.methods={options:function(jq){ -var _6f8=$.data(jq[0],"datagrid").options; -var _6f9=$.data(jq[0],"datagrid").panel.panel("options"); -var opts=$.extend(_6f8,{width:_6f9.width,height:_6f9.height,closed:_6f9.closed,collapsed:_6f9.collapsed,minimized:_6f9.minimized,maximized:_6f9.maximized}); +var _7f6=$.data(jq[0],"datagrid").options; +var _7f7=$.data(jq[0],"datagrid").panel.panel("options"); +var opts=$.extend(_7f6,{width:_7f7.width,height:_7f7.height,closed:_7f7.closed,collapsed:_7f7.collapsed,minimized:_7f7.minimized,maximized:_7f7.maximized}); return opts; },setSelectionState:function(jq){ return jq.each(function(){ -_634(this); +_72d(this); }); },createStyleSheet:function(jq){ -return _56e(jq[0]); +return _64b(jq[0]); },getPanel:function(jq){ return $.data(jq[0],"datagrid").panel; },getPager:function(jq){ return $.data(jq[0],"datagrid").panel.children("div.datagrid-pager"); -},getColumnFields:function(jq,_6fa){ -return _5c3(jq[0],_6fa); -},getColumnOption:function(jq,_6fb){ -return _5c4(jq[0],_6fb); -},resize:function(jq,_6fc){ +},getColumnFields:function(jq,_7f8){ +return _6a2(jq[0],_7f8); +},getColumnOption:function(jq,_7f9){ +return _6a3(jq[0],_7f9); +},resize:function(jq,_7fa){ return jq.each(function(){ -_57d(this,_6fc); +_65a(this,_7fa); }); -},load:function(jq,_6fd){ +},load:function(jq,_7fb){ return jq.each(function(){ var opts=$(this).datagrid("options"); -if(typeof _6fd=="string"){ -opts.url=_6fd; -_6fd=null; +if(typeof _7fb=="string"){ +opts.url=_7fb; +_7fb=null; } opts.pageNumber=1; -var _6fe=$(this).datagrid("getPager"); -_6fe.pagination("refresh",{pageNumber:1}); -_5f5(this,_6fd); +var _7fc=$(this).datagrid("getPager"); +_7fc.pagination("refresh",{pageNumber:1}); +_6df(this,_7fb); }); -},reload:function(jq,_6ff){ +},reload:function(jq,_7fd){ return jq.each(function(){ var opts=$(this).datagrid("options"); -if(typeof _6ff=="string"){ -opts.url=_6ff; -_6ff=null; +if(typeof _7fd=="string"){ +opts.url=_7fd; +_7fd=null; } -_5f5(this,_6ff); +_6df(this,_7fd); }); -},reloadFooter:function(jq,_700){ +},reloadFooter:function(jq,_7fe){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; var dc=$.data(this,"datagrid").dc; -if(_700){ -$.data(this,"datagrid").footer=_700; +if(_7fe){ +$.data(this,"datagrid").footer=_7fe; } if(opts.showFooter){ opts.view.renderFooter.call(opts.view,this,dc.footer2,false); @@ -9668,10 +11009,10 @@ return jq.each(function(){ var opts=$.data(this,"datagrid").options; $(this).datagrid("getPager").pagination("loading"); if(opts.loadMsg){ -var _701=$(this).datagrid("getPanel"); -if(!_701.children("div.datagrid-mask").length){ -$("
            ").appendTo(_701); -var msg=$("
            ").html(opts.loadMsg).appendTo(_701); +var _7ff=$(this).datagrid("getPanel"); +if(!_7ff.children("div.datagrid-mask").length){ +$("
            ").appendTo(_7ff); +var msg=$("
            ").html(opts.loadMsg).appendTo(_7ff); msg._outerHeight(40); msg.css({marginLeft:(-msg.outerWidth()/2),lineHeight:(msg.height()+"px")}); } @@ -9680,34 +11021,34 @@ msg.css({marginLeft:(-msg.outerWidth()/2),lineHeight:(msg.height()+"px")}); },loaded:function(jq){ return jq.each(function(){ $(this).datagrid("getPager").pagination("loaded"); -var _702=$(this).datagrid("getPanel"); -_702.children("div.datagrid-mask-msg").remove(); -_702.children("div.datagrid-mask").remove(); +var _800=$(this).datagrid("getPanel"); +_800.children("div.datagrid-mask-msg").remove(); +_800.children("div.datagrid-mask").remove(); }); },fitColumns:function(jq){ return jq.each(function(){ -_5f7(this); +_6ec(this); }); -},fixColumnSize:function(jq,_703){ +},fixColumnSize:function(jq,_801){ return jq.each(function(){ -_613(this,_703); +_70a(this,_801); }); -},fixRowHeight:function(jq,_704){ +},fixRowHeight:function(jq,_802){ return jq.each(function(){ -_593(this,_704); +_670(this,_802); }); -},freezeRow:function(jq,_705){ +},freezeRow:function(jq,_803){ return jq.each(function(){ -_5a0(this,_705); +_67d(this,_803); }); -},autoSizeColumn:function(jq,_706){ +},autoSizeColumn:function(jq,_804){ return jq.each(function(){ -_607(this,_706); +_6fe(this,_804); }); },loadData:function(jq,data){ return jq.each(function(){ -_5f6(this,data); -_6af(this); +_6e0(this,data); +_7ae(this); }); },getData:function(jq){ return $.data(jq[0],"datagrid").data; @@ -9716,276 +11057,285 @@ return $.data(jq[0],"datagrid").data.rows; },getFooterRows:function(jq){ return $.data(jq[0],"datagrid").footer; },getRowIndex:function(jq,id){ -return _63c(jq[0],id); +return _735(jq[0],id); },getChecked:function(jq){ -return _642(jq[0]); +return _73b(jq[0]); },getSelected:function(jq){ -var rows=_63f(jq[0]); +var rows=_738(jq[0]); return rows.length>0?rows[0]:null; },getSelections:function(jq){ -return _63f(jq[0]); +return _738(jq[0]); },clearSelections:function(jq){ return jq.each(function(){ -var _707=$.data(this,"datagrid"); -var _708=_707.selectedRows; -var _709=_707.checkedRows; -_708.splice(0,_708.length); -_653(this); -if(_707.options.checkOnSelect){ -_709.splice(0,_709.length); +var _805=$.data(this,"datagrid"); +var _806=_805.selectedRows; +var _807=_805.checkedRows; +_806.splice(0,_806.length); +_74e(this); +if(_805.options.checkOnSelect){ +_807.splice(0,_807.length); } }); },clearChecked:function(jq){ return jq.each(function(){ -var _70a=$.data(this,"datagrid"); -var _70b=_70a.selectedRows; -var _70c=_70a.checkedRows; -_70c.splice(0,_70c.length); -_663(this); -if(_70a.options.selectOnCheck){ -_70b.splice(0,_70b.length); +var _808=$.data(this,"datagrid"); +var _809=_808.selectedRows; +var _80a=_808.checkedRows; +_80a.splice(0,_80a.length); +_6b5(this); +if(_808.options.selectOnCheck){ +_809.splice(0,_809.length); } }); -},scrollTo:function(jq,_70d){ +},scrollTo:function(jq,_80b){ return jq.each(function(){ -_645(this,_70d); +_73e(this,_80b); }); -},highlightRow:function(jq,_70e){ +},highlightRow:function(jq,_80c){ return jq.each(function(){ -_5d8(this,_70e); -_645(this,_70e); +_6c2(this,_80c); +_73e(this,_80c); }); },selectAll:function(jq){ return jq.each(function(){ -_658(this); +_753(this); }); },unselectAll:function(jq){ return jq.each(function(){ -_653(this); +_74e(this); }); -},selectRow:function(jq,_70f){ +},selectRow:function(jq,_80d){ return jq.each(function(){ -_5df(this,_70f); +_6c9(this,_80d); }); },selectRecord:function(jq,id){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; if(opts.idField){ -var _710=_63c(this,id); -if(_710>=0){ -$(this).datagrid("selectRow",_710); +var _80e=_735(this,id); +if(_80e>=0){ +$(this).datagrid("selectRow",_80e); } } }); -},unselectRow:function(jq,_711){ +},unselectRow:function(jq,_80f){ return jq.each(function(){ -_5e0(this,_711); +_6ca(this,_80f); }); -},checkRow:function(jq,_712){ +},checkRow:function(jq,_810){ return jq.each(function(){ -_5dc(this,_712); +_6c6(this,_810); }); -},uncheckRow:function(jq,_713){ +},uncheckRow:function(jq,_811){ return jq.each(function(){ -_5dd(this,_713); +_6c7(this,_811); }); },checkAll:function(jq){ return jq.each(function(){ -_65d(this); +_6b4(this); }); },uncheckAll:function(jq){ return jq.each(function(){ -_663(this); +_6b5(this); }); -},beginEdit:function(jq,_714){ +},beginEdit:function(jq,_812){ return jq.each(function(){ -_674(this,_714); +_76d(this,_812); }); -},endEdit:function(jq,_715){ +},endEdit:function(jq,_813){ return jq.each(function(){ -_67a(this,_715,false); +_773(this,_813,false); }); -},cancelEdit:function(jq,_716){ +},cancelEdit:function(jq,_814){ return jq.each(function(){ -_67a(this,_716,true); +_773(this,_814,true); }); -},getEditors:function(jq,_717){ -return _687(jq[0],_717); -},getEditor:function(jq,_718){ -return _68b(jq[0],_718); -},refreshRow:function(jq,_719){ +},getEditors:function(jq,_815){ +return _780(jq[0],_815); +},getEditor:function(jq,_816){ +return _784(jq[0],_816); +},refreshRow:function(jq,_817){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; -opts.view.refreshRow.call(opts.view,this,_719); +opts.view.refreshRow.call(opts.view,this,_817); }); -},validateRow:function(jq,_71a){ -return _679(jq[0],_71a); -},updateRow:function(jq,_71b){ +},validateRow:function(jq,_818){ +return _772(jq[0],_818); +},updateRow:function(jq,_819){ return jq.each(function(){ -var opts=$.data(this,"datagrid").options; -opts.view.updateRow.call(opts.view,this,_71b.index,_71b.row); +_7a8(this,_819); }); },appendRow:function(jq,row){ return jq.each(function(){ -_6ac(this,row); +_7a5(this,row); }); -},insertRow:function(jq,_71c){ +},insertRow:function(jq,_81a){ return jq.each(function(){ -_6a8(this,_71c); +_7a1(this,_81a); }); -},deleteRow:function(jq,_71d){ +},deleteRow:function(jq,_81b){ return jq.each(function(){ -_6a2(this,_71d); +_79b(this,_81b); }); -},getChanges:function(jq,_71e){ -return _69c(jq[0],_71e); +},getChanges:function(jq,_81c){ +return _795(jq[0],_81c); },acceptChanges:function(jq){ return jq.each(function(){ -_6b3(this); +_7b2(this); }); },rejectChanges:function(jq){ return jq.each(function(){ -_6b5(this); +_7b4(this); }); -},mergeCells:function(jq,_71f){ +},mergeCells:function(jq,_81d){ return jq.each(function(){ -_6c8(this,_71f); +_7c6(this,_81d); }); -},showColumn:function(jq,_720){ +},showColumn:function(jq,_81e){ return jq.each(function(){ -var _721=$(this).datagrid("getPanel"); -_721.find("td[field=\""+_720+"\"]").show(); -$(this).datagrid("getColumnOption",_720).hidden=false; +var col=$(this).datagrid("getColumnOption",_81e); +if(col.hidden){ +col.hidden=false; +$(this).datagrid("getPanel").find("td[field=\""+_81e+"\"]").show(); +_6e1(this,_81e,1); $(this).datagrid("fitColumns"); +} }); -},hideColumn:function(jq,_722){ +},hideColumn:function(jq,_81f){ return jq.each(function(){ -var _723=$(this).datagrid("getPanel"); -_723.find("td[field=\""+_722+"\"]").hide(); -$(this).datagrid("getColumnOption",_722).hidden=true; +var col=$(this).datagrid("getColumnOption",_81f); +if(!col.hidden){ +col.hidden=true; +$(this).datagrid("getPanel").find("td[field=\""+_81f+"\"]").hide(); +_6e1(this,_81f,-1); $(this).datagrid("fitColumns"); +} }); -},sort:function(jq,_724){ +},sort:function(jq,_820){ return jq.each(function(){ -_5ea(this,_724); +_6b6(this,_820); +}); +},gotoPage:function(jq,_821){ +return jq.each(function(){ +var _822=this; +var page,cb; +if(typeof _821=="object"){ +page=_821.page; +cb=_821.callback; +}else{ +page=_821; +} +$(_822).datagrid("options").pageNumber=page; +$(_822).datagrid("getPager").pagination("refresh",{pageNumber:page}); +_6df(_822,null,function(){ +if(cb){ +cb.call(_822,page); +} +}); }); }}; -$.fn.datagrid.parseOptions=function(_725){ -var t=$(_725); -return $.extend({},$.fn.panel.parseOptions(_725),$.parser.parseOptions(_725,["url","toolbar","idField","sortName","sortOrder","pagePosition","resizeHandle",{sharedStyleSheet:"boolean",fitColumns:"boolean",autoRowHeight:"boolean",striped:"boolean",nowrap:"boolean"},{rownumbers:"boolean",singleSelect:"boolean",ctrlSelect:"boolean",checkOnSelect:"boolean",selectOnCheck:"boolean"},{pagination:"boolean",pageSize:"number",pageNumber:"number"},{multiSort:"boolean",remoteSort:"boolean",showHeader:"boolean",showFooter:"boolean"},{scrollbarSize:"number"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined),loadMsg:(t.attr("loadMsg")!=undefined?t.attr("loadMsg"):undefined),rowStyler:(t.attr("rowStyler")?eval(t.attr("rowStyler")):undefined)}); +$.fn.datagrid.parseOptions=function(_823){ +var t=$(_823); +return $.extend({},$.fn.panel.parseOptions(_823),$.parser.parseOptions(_823,["url","toolbar","idField","sortName","sortOrder","pagePosition","resizeHandle",{sharedStyleSheet:"boolean",fitColumns:"boolean",autoRowHeight:"boolean",striped:"boolean",nowrap:"boolean"},{rownumbers:"boolean",singleSelect:"boolean",ctrlSelect:"boolean",checkOnSelect:"boolean",selectOnCheck:"boolean"},{pagination:"boolean",pageSize:"number",pageNumber:"number"},{multiSort:"boolean",remoteSort:"boolean",showHeader:"boolean",showFooter:"boolean"},{scrollbarSize:"number",scrollOnSelect:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined),loadMsg:(t.attr("loadMsg")!=undefined?t.attr("loadMsg"):undefined),rowStyler:(t.attr("rowStyler")?eval(t.attr("rowStyler")):undefined)}); }; -$.fn.datagrid.parseData=function(_726){ -var t=$(_726); +$.fn.datagrid.parseData=function(_824){ +var t=$(_824); var data={total:0,rows:[]}; -var _727=t.datagrid("getColumnFields",true).concat(t.datagrid("getColumnFields",false)); +var _825=t.datagrid("getColumnFields",true).concat(t.datagrid("getColumnFields",false)); t.find("tbody tr").each(function(){ data.total++; var row={}; $.extend(row,$.parser.parseOptions(this,["iconCls","state"])); -for(var i=0;i<_727.length;i++){ -row[_727[i]]=$(this).find("td:eq("+i+")").html(); +for(var i=0;i<_825.length;i++){ +row[_825[i]]=$(this).find("td:eq("+i+")").html(); } data.rows.push(row); }); return data; }; -var _728={render:function(_729,_72a,_72b){ -var _72c=$.data(_729,"datagrid"); -var opts=_72c.options; -var rows=_72c.data.rows; -var _72d=$(_729).datagrid("getColumnFields",_72b); -if(_72b){ +var _826={render:function(_827,_828,_829){ +var rows=$(_827).datagrid("getRows"); +$(_828).html(this.renderTable(_827,0,rows,_829)); +},renderFooter:function(_82a,_82b,_82c){ +var opts=$.data(_82a,"datagrid").options; +var rows=$.data(_82a,"datagrid").footer||[]; +var _82d=$(_82a).datagrid("getColumnFields",_82c); +var _82e=[""]; +for(var i=0;i"); +_82e.push(this.renderRow.call(this,_82a,_82d,_82c,i,rows[i])); +_82e.push(""); +} +_82e.push("
            "); +$(_82b).html(_82e.join("")); +},renderTable:function(_82f,_830,rows,_831){ +var _832=$.data(_82f,"datagrid"); +var opts=_832.options; +if(_831){ if(!(opts.rownumbers||(opts.frozenColumns&&opts.frozenColumns.length))){ -return; +return ""; } } -var _72e=[""]; -for(var i=0;i"); -_72e.push(this.renderRow.call(this,_729,_72d,_72b,i,rows[i])); -_72e.push(""); -} -_72e.push("
            "); -$(_72a).html(_72e.join("")); -},renderFooter:function(_733,_734,_735){ -var opts=$.data(_733,"datagrid").options; -var rows=$.data(_733,"datagrid").footer||[]; -var _736=$(_733).datagrid("getColumnFields",_735); -var _737=[""]; +var _833=$(_82f).datagrid("getColumnFields",_831); +var _834=["
            "]; for(var i=0;i"); -_737.push(this.renderRow.call(this,_733,_736,_735,i,rows[i])); -_737.push(""); -} -_737.push("
            "); -$(_734).html(_737.join("")); -},renderRow:function(_738,_739,_73a,_73b,_73c){ -var opts=$.data(_738,"datagrid").options; +var row=rows[i]; +var css=opts.rowStyler?opts.rowStyler.call(_82f,_830,row):""; +var cs=this.getStyleValue(css); +var cls="class=\"datagrid-row "+(_830%2&&opts.striped?"datagrid-row-alt ":" ")+cs.c+"\""; +var _835=cs.s?"style=\""+cs.s+"\"":""; +var _836=_832.rowIdPrefix+"-"+(_831?1:2)+"-"+_830; +_834.push(""); +_834.push(this.renderRow.call(this,_82f,_833,_831,_830,row)); +_834.push(""); +_830++; +} +_834.push(""); +return _834.join(""); +},renderRow:function(_837,_838,_839,_83a,_83b){ +var opts=$.data(_837,"datagrid").options; var cc=[]; -if(_73a&&opts.rownumbers){ -var _73d=_73b+1; +if(_839&&opts.rownumbers){ +var _83c=_83a+1; if(opts.pagination){ -_73d+=(opts.pageNumber-1)*opts.pageSize; +_83c+=(opts.pageNumber-1)*opts.pageSize; } -cc.push("
            "+_73d+"
            "); +cc.push("
            "+_83c+"
            "); } -for(var i=0;i<_739.length;i++){ -var _73e=_739[i]; -var col=$(_738).datagrid("getColumnOption",_73e); +for(var i=0;i<_838.length;i++){ +var _83d=_838[i]; +var col=$(_837).datagrid("getColumnOption",_83d); if(col){ -var _73f=_73c[_73e]; -var css=col.styler?(col.styler(_73f,_73c,_73b)||""):""; -var _740=""; -var _741=""; -if(typeof css=="string"){ -_741=css; -}else{ -if(css){ -_740=css["class"]||""; -_741=css["style"]||""; -} -} -var cls=_740?"class=\""+_740+"\"":""; -var _742=col.hidden?"style=\"display:none;"+_741+"\"":(_741?"style=\""+_741+"\"":""); -cc.push(""); -var _742=""; +var _83e=_83b[_83d]; +var css=col.styler?(col.styler.call(_837,_83e,_83b,_83a)||""):""; +var cs=this.getStyleValue(css); +var cls=cs.c?"class=\""+cs.c+"\"":""; +var _83f=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":""); +cc.push(""); +var _83f=""; if(!col.checkbox){ if(col.align){ -_742+="text-align:"+col.align+";"; +_83f+="text-align:"+col.align+";"; } if(!opts.nowrap){ -_742+="white-space:normal;height:auto;"; +_83f+="white-space:normal;height:auto;"; }else{ if(opts.autoRowHeight){ -_742+="height:auto;"; +_83f+="height:auto;"; } } } -cc.push("
            "); if(col.checkbox){ -cc.push(""); +cc.push(""); }else{ if(col.formatter){ -cc.push(col.formatter(_73f,_73c,_73b)); +cc.push(col.formatter(_83e,_83b,_83a)); }else{ -cc.push(_73f); +cc.push(_83e); } } cc.push("
            "); @@ -9993,189 +11343,228 @@ cc.push(""); } } return cc.join(""); -},refreshRow:function(_743,_744){ -this.updateRow.call(this,_743,_744,{}); -},updateRow:function(_745,_746,row){ -var opts=$.data(_745,"datagrid").options; -var rows=$(_745).datagrid("getRows"); -var _747=_748(_746); -$.extend(rows[_746],row); -var _749=_748(_746); -var _74a=_747.c; -var _74b=_749.s; -var _74c="datagrid-row "+(_746%2&&opts.striped?"datagrid-row-alt ":" ")+_749.c; -function _748(_74d){ -var css=opts.rowStyler?opts.rowStyler.call(_745,_74d,rows[_74d]):""; -var _74e=""; -var _74f=""; +},getStyleValue:function(css){ +var _840=""; +var _841=""; if(typeof css=="string"){ -_74f=css; +_841=css; }else{ if(css){ -_74e=css["class"]||""; -_74f=css["style"]||""; -} +_840=css["class"]||""; +_841=css["style"]||""; +} +} +return {c:_840,s:_841}; +},refreshRow:function(_842,_843){ +this.updateRow.call(this,_842,_843,{}); +},updateRow:function(_844,_845,row){ +var opts=$.data(_844,"datagrid").options; +var _846=opts.finder.getRow(_844,_845); +$.extend(_846,row); +var cs=_847.call(this,_845); +var _848=cs.s; +var cls="datagrid-row "+(_845%2&&opts.striped?"datagrid-row-alt ":" ")+cs.c; +function _847(_849){ +var css=opts.rowStyler?opts.rowStyler.call(_844,_849,_846):""; +return this.getStyleValue(css); +}; +function _84a(_84b){ +var tr=opts.finder.getTr(_844,_845,"body",(_84b?1:2)); +if(!tr.length){ +return; } -return {c:_74e,s:_74f}; -}; -function _750(_751){ -var _752=$(_745).datagrid("getColumnFields",_751); -var tr=opts.finder.getTr(_745,_746,"body",(_751?1:2)); -var _753=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); -tr.html(this.renderRow.call(this,_745,_752,_751,_746,rows[_746])); -tr.attr("style",_74b).removeClass(_74a).addClass(_74c); -if(_753){ +var _84c=$(_844).datagrid("getColumnFields",_84b); +var _84d=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); +tr.html(this.renderRow.call(this,_844,_84c,_84b,_845,_846)); +var _84e=(tr.hasClass("datagrid-row-checked")?" datagrid-row-checked":"")+(tr.hasClass("datagrid-row-selected")?" datagrid-row-selected":""); +tr.attr("style",_848).attr("class",cls+_84e); +if(_84d){ tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true); } }; -_750.call(this,true); -_750.call(this,false); -$(_745).datagrid("fixRowHeight",_746); -},insertRow:function(_754,_755,row){ -var _756=$.data(_754,"datagrid"); -var opts=_756.options; -var dc=_756.dc; -var data=_756.data; -if(_755==undefined||_755==null){ -_755=data.rows.length; -} -if(_755>data.rows.length){ -_755=data.rows.length; -} -function _757(_758){ -var _759=_758?1:2; -for(var i=data.rows.length-1;i>=_755;i--){ -var tr=opts.finder.getTr(_754,i,"body",_759); +_84a.call(this,true); +_84a.call(this,false); +$(_844).datagrid("fixRowHeight",_845); +},insertRow:function(_84f,_850,row){ +var _851=$.data(_84f,"datagrid"); +var opts=_851.options; +var dc=_851.dc; +var data=_851.data; +if(_850==undefined||_850==null){ +_850=data.rows.length; +} +if(_850>data.rows.length){ +_850=data.rows.length; +} +function _852(_853){ +var _854=_853?1:2; +for(var i=data.rows.length-1;i>=_850;i--){ +var tr=opts.finder.getTr(_84f,i,"body",_854); tr.attr("datagrid-row-index",i+1); -tr.attr("id",_756.rowIdPrefix+"-"+_759+"-"+(i+1)); -if(_758&&opts.rownumbers){ -var _75a=i+2; +tr.attr("id",_851.rowIdPrefix+"-"+_854+"-"+(i+1)); +if(_853&&opts.rownumbers){ +var _855=i+2; if(opts.pagination){ -_75a+=(opts.pageNumber-1)*opts.pageSize; +_855+=(opts.pageNumber-1)*opts.pageSize; } -tr.find("div.datagrid-cell-rownumber").html(_75a); +tr.find("div.datagrid-cell-rownumber").html(_855); } if(opts.striped){ tr.removeClass("datagrid-row-alt").addClass((i+1)%2?"datagrid-row-alt":""); } } }; -function _75b(_75c){ -var _75d=_75c?1:2; -var _75e=$(_754).datagrid("getColumnFields",_75c); -var _75f=_756.rowIdPrefix+"-"+_75d+"-"+_755; -var tr=""; -if(_755>=data.rows.length){ +function _856(_857){ +var _858=_857?1:2; +var _859=$(_84f).datagrid("getColumnFields",_857); +var _85a=_851.rowIdPrefix+"-"+_858+"-"+_850; +var tr=""; +if(_850>=data.rows.length){ if(data.rows.length){ -opts.finder.getTr(_754,"","last",_75d).after(tr); +opts.finder.getTr(_84f,"","last",_858).after(tr); }else{ -var cc=_75c?dc.body1:dc.body2; -cc.html(""+tr+"
            "); +var cc=_857?dc.body1:dc.body2; +cc.html(""+tr+"
            "); } }else{ -opts.finder.getTr(_754,_755+1,"body",_75d).before(tr); +opts.finder.getTr(_84f,_850+1,"body",_858).before(tr); } }; -_757.call(this,true); -_757.call(this,false); -_75b.call(this,true); -_75b.call(this,false); +_852.call(this,true); +_852.call(this,false); +_856.call(this,true); +_856.call(this,false); data.total+=1; -data.rows.splice(_755,0,row); -this.refreshRow.call(this,_754,_755); -},deleteRow:function(_760,_761){ -var _762=$.data(_760,"datagrid"); -var opts=_762.options; -var data=_762.data; -function _763(_764){ -var _765=_764?1:2; -for(var i=_761+1;i
            ").appendTo(_867.dc.view); +d.html(opts.emptyMsg).css("top",h+"px"); +} +} +},renderEmptyRow:function(_869){ +var cols=$.map($(_869).datagrid("getColumnFields"),function(_86a){ +return $(_869).datagrid("getColumnOption",_86a); +}); +$.map(cols,function(col){ +col.formatter1=col.formatter; +col.styler1=col.styler; +col.formatter=col.styler=undefined; +}); +var _86b=$.data(_869,"datagrid").dc.body2; +_86b.html(this.renderTable(_869,0,[{}],false)); +_86b.find("tbody *").css({height:1,borderColor:"transparent",background:"transparent"}); +var tr=_86b.find(".datagrid-row"); +tr.removeClass("datagrid-row").removeAttr("datagrid-row-index"); +tr.find(".datagrid-cell,.datagrid-cell-check").empty(); +$.map(cols,function(col){ +col.formatter=col.formatter1; +col.styler=col.styler1; +col.formatter1=col.styler1=undefined; +}); }}; -$.fn.datagrid.defaults=$.extend({},$.fn.panel.defaults,{sharedStyleSheet:false,frozenColumns:undefined,columns:undefined,fitColumns:false,resizeHandle:"right",autoRowHeight:true,toolbar:null,striped:false,method:"post",nowrap:true,idField:null,url:null,data:null,loadMsg:"Processing, please wait ...",rownumbers:false,singleSelect:false,ctrlSelect:false,selectOnCheck:true,checkOnSelect:true,pagination:false,pagePosition:"bottom",pageNumber:1,pageSize:10,pageList:[10,20,30,40,50],queryParams:{},sortName:null,sortOrder:"asc",multiSort:false,remoteSort:true,showHeader:true,showFooter:false,scrollbarSize:18,rowEvents:{mouseover:_5d1(true),mouseout:_5d1(false),click:_5d9,dblclick:_5e3,contextmenu:_5e7},rowStyler:function(_76a,_76b){ -},loader:function(_76c,_76d,_76e){ +$.fn.datagrid.defaults=$.extend({},$.fn.panel.defaults,{sharedStyleSheet:false,frozenColumns:undefined,columns:undefined,fitColumns:false,resizeHandle:"right",autoRowHeight:true,toolbar:null,striped:false,method:"post",nowrap:true,idField:null,url:null,data:null,loadMsg:"Processing, please wait ...",emptyMsg:"",rownumbers:false,singleSelect:false,ctrlSelect:false,selectOnCheck:true,checkOnSelect:true,pagination:false,pagePosition:"bottom",pageNumber:1,pageSize:10,pageList:[10,20,30,40,50],queryParams:{},sortName:null,sortOrder:"asc",multiSort:false,remoteSort:true,showHeader:true,showFooter:false,scrollOnSelect:true,scrollbarSize:18,rownumberWidth:30,editorHeight:24,headerEvents:{mouseover:_6ae(true),mouseout:_6ae(false),click:_6b2,dblclick:_6b7,contextmenu:_6ba},rowEvents:{mouseover:_6bc(true),mouseout:_6bc(false),click:_6c3,dblclick:_6cd,contextmenu:_6d1},rowStyler:function(_86c,_86d){ +},loader:function(_86e,_86f,_870){ var opts=$(this).datagrid("options"); if(!opts.url){ return false; } -$.ajax({type:opts.method,url:opts.url,data:_76c,dataType:"json",success:function(data){ -_76d(data); +$.ajax({type:opts.method,url:opts.url,data:_86e,dataType:"json",success:function(data){ +_86f(data); },error:function(){ -_76e.apply(this,arguments); +_870.apply(this,arguments); }}); },loadFilter:function(data){ -if(typeof data.length=="number"&&typeof data.splice=="function"){ -return {total:data.length,rows:data}; -}else{ return data; -} -},editors:_6df,finder:{getTr:function(_76f,_770,type,_771){ +},editors:_7dd,finder:{getTr:function(_871,_872,type,_873){ type=type||"body"; -_771=_771||0; -var _772=$.data(_76f,"datagrid"); -var dc=_772.dc; -var opts=_772.options; -if(_771==0){ -var tr1=opts.finder.getTr(_76f,_770,type,1); -var tr2=opts.finder.getTr(_76f,_770,type,2); +_873=_873||0; +var _874=$.data(_871,"datagrid"); +var dc=_874.dc; +var opts=_874.options; +if(_873==0){ +var tr1=opts.finder.getTr(_871,_872,type,1); +var tr2=opts.finder.getTr(_871,_872,type,2); return tr1.add(tr2); }else{ if(type=="body"){ -var tr=$("#"+_772.rowIdPrefix+"-"+_771+"-"+_770); +var tr=$("#"+_874.rowIdPrefix+"-"+_873+"-"+_872); if(!tr.length){ -tr=(_771==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index="+_770+"]"); +tr=(_873==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index="+_872+"]"); } return tr; }else{ if(type=="footer"){ -return (_771==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index="+_770+"]"); +return (_873==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index="+_872+"]"); }else{ if(type=="selected"){ -return (_771==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-selected"); +return (_873==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-selected"); }else{ if(type=="highlight"){ -return (_771==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-over"); +return (_873==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-over"); }else{ if(type=="checked"){ -return (_771==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-checked"); +return (_873==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-checked"); }else{ if(type=="editing"){ -return (_771==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-editing"); +return (_873==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-editing"); }else{ if(type=="last"){ -return (_771==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]:last"); +return (_873==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]:last"); }else{ if(type=="allbody"){ -return (_771==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]"); +return (_873==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]"); }else{ if(type=="allfooter"){ -return (_771==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index]"); +return (_873==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index]"); } } } @@ -10186,469 +11575,434 @@ return (_771==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index] } } } -},getRow:function(_773,p){ -var _774=(typeof p=="object")?p.attr("datagrid-row-index"):p; -return $.data(_773,"datagrid").data.rows[parseInt(_774)]; -},getRows:function(_775){ -return $(_775).datagrid("getRows"); -}},view:_728,onBeforeLoad:function(_776){ +},getRow:function(_875,p){ +var _876=(typeof p=="object")?p.attr("datagrid-row-index"):p; +return $.data(_875,"datagrid").data.rows[parseInt(_876)]; +},getRows:function(_877){ +return $(_877).datagrid("getRows"); +}},view:_826,onBeforeLoad:function(_878){ },onLoadSuccess:function(){ },onLoadError:function(){ -},onClickRow:function(_777,_778){ -},onDblClickRow:function(_779,_77a){ -},onClickCell:function(_77b,_77c,_77d){ -},onDblClickCell:function(_77e,_77f,_780){ -},onBeforeSortColumn:function(sort,_781){ -},onSortColumn:function(sort,_782){ -},onResizeColumn:function(_783,_784){ -},onBeforeSelect:function(_785,_786){ -},onSelect:function(_787,_788){ -},onBeforeUnselect:function(_789,_78a){ -},onUnselect:function(_78b,_78c){ +},onClickRow:function(_879,_87a){ +},onDblClickRow:function(_87b,_87c){ +},onClickCell:function(_87d,_87e,_87f){ +},onDblClickCell:function(_880,_881,_882){ +},onBeforeSortColumn:function(sort,_883){ +},onSortColumn:function(sort,_884){ +},onResizeColumn:function(_885,_886){ +},onBeforeSelect:function(_887,_888){ +},onSelect:function(_889,_88a){ +},onBeforeUnselect:function(_88b,_88c){ +},onUnselect:function(_88d,_88e){ },onSelectAll:function(rows){ },onUnselectAll:function(rows){ -},onBeforeCheck:function(_78d,_78e){ -},onCheck:function(_78f,_790){ -},onBeforeUncheck:function(_791,_792){ -},onUncheck:function(_793,_794){ +},onBeforeCheck:function(_88f,_890){ +},onCheck:function(_891,_892){ +},onBeforeUncheck:function(_893,_894){ +},onUncheck:function(_895,_896){ },onCheckAll:function(rows){ },onUncheckAll:function(rows){ -},onBeforeEdit:function(_795,_796){ -},onBeginEdit:function(_797,_798){ -},onEndEdit:function(_799,_79a,_79b){ -},onAfterEdit:function(_79c,_79d,_79e){ -},onCancelEdit:function(_79f,_7a0){ -},onHeaderContextMenu:function(e,_7a1){ -},onRowContextMenu:function(e,_7a2,_7a3){ +},onBeforeEdit:function(_897,_898){ +},onBeginEdit:function(_899,_89a){ +},onEndEdit:function(_89b,_89c,_89d){ +},onAfterEdit:function(_89e,_89f,_8a0){ +},onCancelEdit:function(_8a1,_8a2){ +},onHeaderContextMenu:function(e,_8a3){ +},onRowContextMenu:function(e,_8a4,_8a5){ }}); })(jQuery); (function($){ -var _7a4; +var _8a6; $(document).unbind(".propertygrid").bind("mousedown.propertygrid",function(e){ var p=$(e.target).closest("div.datagrid-view,div.combo-panel"); if(p.length){ return; } -_7a5(_7a4); -_7a4=undefined; +_8a7(_8a6); +_8a6=undefined; }); -function _7a6(_7a7){ -var _7a8=$.data(_7a7,"propertygrid"); -var opts=$.data(_7a7,"propertygrid").options; -$(_7a7).datagrid($.extend({},opts,{cls:"propertygrid",view:(opts.showGroup?opts.groupView:opts.view),onBeforeEdit:function(_7a9,row){ -if(opts.onBeforeEdit.call(_7a7,_7a9,row)==false){ +function _8a8(_8a9){ +var _8aa=$.data(_8a9,"propertygrid"); +var opts=$.data(_8a9,"propertygrid").options; +$(_8a9).datagrid($.extend({},opts,{cls:"propertygrid",view:(opts.showGroup?opts.groupView:opts.view),onBeforeEdit:function(_8ab,row){ +if(opts.onBeforeEdit.call(_8a9,_8ab,row)==false){ return false; } var dg=$(this); -var row=dg.datagrid("getRows")[_7a9]; +var row=dg.datagrid("getRows")[_8ab]; var col=dg.datagrid("getColumnOption","value"); col.editor=row.editor; -},onClickCell:function(_7aa,_7ab,_7ac){ -if(_7a4!=this){ -_7a5(_7a4); -_7a4=this; -} -if(opts.editIndex!=_7aa){ -_7a5(_7a4); -$(this).datagrid("beginEdit",_7aa); -var ed=$(this).datagrid("getEditor",{index:_7aa,field:_7ab}); +},onClickCell:function(_8ac,_8ad,_8ae){ +if(_8a6!=this){ +_8a7(_8a6); +_8a6=this; +} +if(opts.editIndex!=_8ac){ +_8a7(_8a6); +$(this).datagrid("beginEdit",_8ac); +var ed=$(this).datagrid("getEditor",{index:_8ac,field:_8ad}); if(!ed){ -ed=$(this).datagrid("getEditor",{index:_7aa,field:"value"}); +ed=$(this).datagrid("getEditor",{index:_8ac,field:"value"}); } if(ed){ var t=$(ed.target); -var _7ad=t.data("textbox")?t.textbox("textbox"):t; -_7ad.focus(); -opts.editIndex=_7aa; +var _8af=t.data("textbox")?t.textbox("textbox"):t; +_8af.focus(); +opts.editIndex=_8ac; } } -opts.onClickCell.call(_7a7,_7aa,_7ab,_7ac); +opts.onClickCell.call(_8a9,_8ac,_8ad,_8ae); },loadFilter:function(data){ -_7a5(this); +_8a7(this); return opts.loadFilter.call(this,data); }})); }; -function _7a5(_7ae){ -var t=$(_7ae); +function _8a7(_8b0){ +var t=$(_8b0); if(!t.length){ return; } -var opts=$.data(_7ae,"propertygrid").options; -opts.finder.getTr(_7ae,null,"editing").each(function(){ -var _7af=parseInt($(this).attr("datagrid-row-index")); -if(t.datagrid("validateRow",_7af)){ -t.datagrid("endEdit",_7af); +var opts=$.data(_8b0,"propertygrid").options; +opts.finder.getTr(_8b0,null,"editing").each(function(){ +var _8b1=parseInt($(this).attr("datagrid-row-index")); +if(t.datagrid("validateRow",_8b1)){ +t.datagrid("endEdit",_8b1); }else{ -t.datagrid("cancelEdit",_7af); +t.datagrid("cancelEdit",_8b1); } }); +opts.editIndex=undefined; }; -$.fn.propertygrid=function(_7b0,_7b1){ -if(typeof _7b0=="string"){ -var _7b2=$.fn.propertygrid.methods[_7b0]; -if(_7b2){ -return _7b2(this,_7b1); +$.fn.propertygrid=function(_8b2,_8b3){ +if(typeof _8b2=="string"){ +var _8b4=$.fn.propertygrid.methods[_8b2]; +if(_8b4){ +return _8b4(this,_8b3); }else{ -return this.datagrid(_7b0,_7b1); +return this.datagrid(_8b2,_8b3); } } -_7b0=_7b0||{}; +_8b2=_8b2||{}; return this.each(function(){ -var _7b3=$.data(this,"propertygrid"); -if(_7b3){ -$.extend(_7b3.options,_7b0); +var _8b5=$.data(this,"propertygrid"); +if(_8b5){ +$.extend(_8b5.options,_8b2); }else{ -var opts=$.extend({},$.fn.propertygrid.defaults,$.fn.propertygrid.parseOptions(this),_7b0); +var opts=$.extend({},$.fn.propertygrid.defaults,$.fn.propertygrid.parseOptions(this),_8b2); opts.frozenColumns=$.extend(true,[],opts.frozenColumns); opts.columns=$.extend(true,[],opts.columns); $.data(this,"propertygrid",{options:opts}); } -_7a6(this); +_8a8(this); }); }; $.fn.propertygrid.methods={options:function(jq){ return $.data(jq[0],"propertygrid").options; }}; -$.fn.propertygrid.parseOptions=function(_7b4){ -return $.extend({},$.fn.datagrid.parseOptions(_7b4),$.parser.parseOptions(_7b4,[{showGroup:"boolean"}])); -}; -var _7b5=$.extend({},$.fn.datagrid.defaults.view,{render:function(_7b6,_7b7,_7b8){ -var _7b9=[]; -var _7ba=this.groups; -for(var i=0;i<_7ba.length;i++){ -_7b9.push(this.renderGroup.call(this,_7b6,i,_7ba[i],_7b8)); -} -$(_7b7).html(_7b9.join("")); -},renderGroup:function(_7bb,_7bc,_7bd,_7be){ -var _7bf=$.data(_7bb,"datagrid"); -var opts=_7bf.options; -var _7c0=$(_7bb).datagrid("getColumnFields",_7be); -var _7c1=[]; -_7c1.push("
            "); -_7c1.push(""); -_7c1.push(""); -if((_7be&&(opts.rownumbers||opts.frozenColumns.length))||(!_7be&&!(opts.rownumbers||opts.frozenColumns.length))){ -_7c1.push(""); -} -_7c1.push(""); -_7c1.push(""); -_7c1.push("
             "); -if(!_7be){ -_7c1.push(""); -_7c1.push(opts.groupFormatter.call(_7bb,_7bd.value,_7bd.rows)); -_7c1.push(""); -} -_7c1.push("
            "); -_7c1.push("
            "); -_7c1.push(""); -var _7c2=_7bd.startIndex; -for(var j=0;j<_7bd.rows.length;j++){ -var css=opts.rowStyler?opts.rowStyler.call(_7bb,_7c2,_7bd.rows[j]):""; -var _7c3=""; -var _7c4=""; +$.fn.propertygrid.parseOptions=function(_8b6){ +return $.extend({},$.fn.datagrid.parseOptions(_8b6),$.parser.parseOptions(_8b6,[{showGroup:"boolean"}])); +}; +var _8b7=$.extend({},$.fn.datagrid.defaults.view,{render:function(_8b8,_8b9,_8ba){ +var _8bb=[]; +var _8bc=this.groups; +for(var i=0;i<_8bc.length;i++){ +_8bb.push(this.renderGroup.call(this,_8b8,i,_8bc[i],_8ba)); +} +$(_8b9).html(_8bb.join("")); +},renderGroup:function(_8bd,_8be,_8bf,_8c0){ +var _8c1=$.data(_8bd,"datagrid"); +var opts=_8c1.options; +var _8c2=$(_8bd).datagrid("getColumnFields",_8c0); +var _8c3=[]; +_8c3.push("
            "); +if((_8c0&&(opts.rownumbers||opts.frozenColumns.length))||(!_8c0&&!(opts.rownumbers||opts.frozenColumns.length))){ +_8c3.push(""); +_8c3.push(" "); +_8c3.push(""); +} +if(!_8c0){ +_8c3.push(""); +_8c3.push(opts.groupFormatter.call(_8bd,_8bf.value,_8bf.rows)); +_8c3.push(""); +} +_8c3.push("
            "); +_8c3.push("
            "); +var _8c4=_8bf.startIndex; +for(var j=0;j<_8bf.rows.length;j++){ +var css=opts.rowStyler?opts.rowStyler.call(_8bd,_8c4,_8bf.rows[j]):""; +var _8c5=""; +var _8c6=""; if(typeof css=="string"){ -_7c4=css; +_8c6=css; }else{ if(css){ -_7c3=css["class"]||""; -_7c4=css["style"]||""; -} -} -var cls="class=\"datagrid-row "+(_7c2%2&&opts.striped?"datagrid-row-alt ":" ")+_7c3+"\""; -var _7c5=_7c4?"style=\""+_7c4+"\"":""; -var _7c6=_7bf.rowIdPrefix+"-"+(_7be?1:2)+"-"+_7c2; -_7c1.push(""); -_7c1.push(this.renderRow.call(this,_7bb,_7c0,_7be,_7c2,_7bd.rows[j])); -_7c1.push(""); -_7c2++; -} -_7c1.push("
            "); -return _7c1.join(""); -},bindEvents:function(_7c7){ -var _7c8=$.data(_7c7,"datagrid"); -var dc=_7c8.dc; +_8c5=css["class"]||""; +_8c6=css["style"]||""; +} +} +var cls="class=\"datagrid-row "+(_8c4%2&&opts.striped?"datagrid-row-alt ":" ")+_8c5+"\""; +var _8c7=_8c6?"style=\""+_8c6+"\"":""; +var _8c8=_8c1.rowIdPrefix+"-"+(_8c0?1:2)+"-"+_8c4; +_8c3.push(""); +_8c3.push(this.renderRow.call(this,_8bd,_8c2,_8c0,_8c4,_8bf.rows[j])); +_8c3.push(""); +_8c4++; +} +_8c3.push(""); +return _8c3.join(""); +},bindEvents:function(_8c9){ +var _8ca=$.data(_8c9,"datagrid"); +var dc=_8ca.dc; var body=dc.body1.add(dc.body2); -var _7c9=($.data(body[0],"events")||$._data(body[0],"events")).click[0].handler; +var _8cb=($.data(body[0],"events")||$._data(body[0],"events")).click[0].handler; body.unbind("click").bind("click",function(e){ var tt=$(e.target); -var _7ca=tt.closest("span.datagrid-row-expander"); -if(_7ca.length){ -var _7cb=_7ca.closest("div.datagrid-group").attr("group-index"); -if(_7ca.hasClass("datagrid-row-collapse")){ -$(_7c7).datagrid("collapseGroup",_7cb); +var _8cc=tt.closest("span.datagrid-row-expander"); +if(_8cc.length){ +var _8cd=_8cc.closest("div.datagrid-group").attr("group-index"); +if(_8cc.hasClass("datagrid-row-collapse")){ +$(_8c9).datagrid("collapseGroup",_8cd); }else{ -$(_7c7).datagrid("expandGroup",_7cb); +$(_8c9).datagrid("expandGroup",_8cd); } }else{ -_7c9(e); +_8cb(e); } e.stopPropagation(); }); -},onBeforeRender:function(_7cc,rows){ -var _7cd=$.data(_7cc,"datagrid"); -var opts=_7cd.options; -_7ce(); -var _7cf=[]; +},onBeforeRender:function(_8ce,rows){ +var _8cf=$.data(_8ce,"datagrid"); +var opts=_8cf.options; +_8d0(); +var _8d1=[]; for(var i=0;i"+".datagrid-group{height:25px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;}"+""); +$("head").append(""); } }; }}); -$.extend($.fn.datagrid.methods,{expandGroup:function(jq,_7d6){ +$.extend($.fn.datagrid.methods,{groups:function(jq){ +return jq.datagrid("options").view.groups; +},expandGroup:function(jq,_8d8){ return jq.each(function(){ var view=$.data(this,"datagrid").dc.view; -var _7d7=view.find(_7d6!=undefined?"div.datagrid-group[group-index=\""+_7d6+"\"]":"div.datagrid-group"); -var _7d8=_7d7.find("span.datagrid-row-expander"); -if(_7d8.hasClass("datagrid-row-expand")){ -_7d8.removeClass("datagrid-row-expand").addClass("datagrid-row-collapse"); -_7d7.next("table").show(); +var _8d9=view.find(_8d8!=undefined?"div.datagrid-group[group-index=\""+_8d8+"\"]":"div.datagrid-group"); +var _8da=_8d9.find("span.datagrid-row-expander"); +if(_8da.hasClass("datagrid-row-expand")){ +_8da.removeClass("datagrid-row-expand").addClass("datagrid-row-collapse"); +_8d9.next("table").show(); } $(this).datagrid("fixRowHeight"); }); -},collapseGroup:function(jq,_7d9){ +},collapseGroup:function(jq,_8db){ return jq.each(function(){ var view=$.data(this,"datagrid").dc.view; -var _7da=view.find(_7d9!=undefined?"div.datagrid-group[group-index=\""+_7d9+"\"]":"div.datagrid-group"); -var _7db=_7da.find("span.datagrid-row-expander"); -if(_7db.hasClass("datagrid-row-collapse")){ -_7db.removeClass("datagrid-row-collapse").addClass("datagrid-row-expand"); -_7da.next("table").hide(); +var _8dc=view.find(_8db!=undefined?"div.datagrid-group[group-index=\""+_8db+"\"]":"div.datagrid-group"); +var _8dd=_8dc.find("span.datagrid-row-expander"); +if(_8dd.hasClass("datagrid-row-collapse")){ +_8dd.removeClass("datagrid-row-collapse").addClass("datagrid-row-expand"); +_8dc.next("table").hide(); } $(this).datagrid("fixRowHeight"); }); }}); -$.extend(_7b5,{refreshGroupTitle:function(_7dc,_7dd){ -var _7de=$.data(_7dc,"datagrid"); -var opts=_7de.options; -var dc=_7de.dc; -var _7df=this.groups[_7dd]; -var span=dc.body2.children("div.datagrid-group[group-index="+_7dd+"]").find("span.datagrid-group-title"); -span.html(opts.groupFormatter.call(_7dc,_7df.value,_7df.rows)); -},insertRow:function(_7e0,_7e1,row){ -var _7e2=$.data(_7e0,"datagrid"); -var opts=_7e2.options; -var dc=_7e2.dc; -var _7e3=null; -var _7e4; +$.extend(_8b7,{refreshGroupTitle:function(_8de,_8df){ +var _8e0=$.data(_8de,"datagrid"); +var opts=_8e0.options; +var dc=_8e0.dc; +var _8e1=this.groups[_8df]; +var span=dc.body2.children("div.datagrid-group[group-index="+_8df+"]").find("span.datagrid-group-title"); +span.html(opts.groupFormatter.call(_8de,_8e1.value,_8e1.rows)); +},insertRow:function(_8e2,_8e3,row){ +var _8e4=$.data(_8e2,"datagrid"); +var opts=_8e4.options; +var dc=_8e4.dc; +var _8e5=null; +var _8e6; +if(!_8e4.data.rows.length){ +$(_8e2).datagrid("loadData",[row]); +return; +} for(var i=0;i_7e3.startIndex+_7e3.rows.length){ -_7e1=_7e3.startIndex+_7e3.rows.length; -} -} -$.fn.datagrid.defaults.view.insertRow.call(this,_7e0,_7e1,row); -if(_7e1>=_7e3.startIndex+_7e3.rows.length){ -_7e5(_7e1,true); -_7e5(_7e1,false); -} -_7e3.rows.splice(_7e1-_7e3.startIndex,0,row); -}else{ -_7e3={value:row[opts.groupField],rows:[row],startIndex:_7e2.data.rows.length}; -_7e4=this.groups.length; -dc.body1.append(this.renderGroup.call(this,_7e0,_7e4,_7e3,true)); -dc.body2.append(this.renderGroup.call(this,_7e0,_7e4,_7e3,false)); -this.groups.push(_7e3); -_7e2.data.rows.push(row); -} -this.refreshGroupTitle(_7e0,_7e4); -function _7e5(_7e6,_7e7){ -var _7e8=_7e7?1:2; -var _7e9=opts.finder.getTr(_7e0,_7e6-1,"body",_7e8); -var tr=opts.finder.getTr(_7e0,_7e6,"body",_7e8); -tr.insertAfter(_7e9); -}; -},updateRow:function(_7ea,_7eb,row){ -var opts=$.data(_7ea,"datagrid").options; -$.fn.datagrid.defaults.view.updateRow.call(this,_7ea,_7eb,row); -var tb=opts.finder.getTr(_7ea,_7eb,"body",2).closest("table.datagrid-btable"); -var _7ec=parseInt(tb.prev().attr("group-index")); -this.refreshGroupTitle(_7ea,_7ec); -},deleteRow:function(_7ed,_7ee){ -var _7ef=$.data(_7ed,"datagrid"); -var opts=_7ef.options; -var dc=_7ef.dc; +if(_8e5){ +if(_8e3==undefined||_8e3==null){ +_8e3=_8e4.data.rows.length; +} +if(_8e3<_8e5.startIndex){ +_8e3=_8e5.startIndex; +}else{ +if(_8e3>_8e5.startIndex+_8e5.rows.length){ +_8e3=_8e5.startIndex+_8e5.rows.length; +} +} +$.fn.datagrid.defaults.view.insertRow.call(this,_8e2,_8e3,row); +if(_8e3>=_8e5.startIndex+_8e5.rows.length){ +_8e7(_8e3,true); +_8e7(_8e3,false); +} +_8e5.rows.splice(_8e3-_8e5.startIndex,0,row); +}else{ +_8e5={value:row[opts.groupField],rows:[row],startIndex:_8e4.data.rows.length}; +_8e6=this.groups.length; +dc.body1.append(this.renderGroup.call(this,_8e2,_8e6,_8e5,true)); +dc.body2.append(this.renderGroup.call(this,_8e2,_8e6,_8e5,false)); +this.groups.push(_8e5); +_8e4.data.rows.push(row); +} +this.refreshGroupTitle(_8e2,_8e6); +function _8e7(_8e8,_8e9){ +var _8ea=_8e9?1:2; +var _8eb=opts.finder.getTr(_8e2,_8e8-1,"body",_8ea); +var tr=opts.finder.getTr(_8e2,_8e8,"body",_8ea); +tr.insertAfter(_8eb); +}; +},updateRow:function(_8ec,_8ed,row){ +var opts=$.data(_8ec,"datagrid").options; +$.fn.datagrid.defaults.view.updateRow.call(this,_8ec,_8ed,row); +var tb=opts.finder.getTr(_8ec,_8ed,"body",2).closest("table.datagrid-btable"); +var _8ee=parseInt(tb.prev().attr("group-index")); +this.refreshGroupTitle(_8ec,_8ee); +},deleteRow:function(_8ef,_8f0){ +var _8f1=$.data(_8ef,"datagrid"); +var opts=_8f1.options; +var dc=_8f1.dc; var body=dc.body1.add(dc.body2); -var tb=opts.finder.getTr(_7ed,_7ee,"body",2).closest("table.datagrid-btable"); -var _7f0=parseInt(tb.prev().attr("group-index")); -$.fn.datagrid.defaults.view.deleteRow.call(this,_7ed,_7ee); -var _7f1=this.groups[_7f0]; -if(_7f1.rows.length>1){ -_7f1.rows.splice(_7ee-_7f1.startIndex,1); -this.refreshGroupTitle(_7ed,_7f0); -}else{ -body.children("div.datagrid-group[group-index="+_7f0+"]").remove(); -for(var i=_7f0+1;i1){ +_8f3.rows.splice(_8f0-_8f3.startIndex,1); +this.refreshGroupTitle(_8ef,_8f2); +}else{ +body.children("div.datagrid-group[group-index="+_8f2+"]").remove(); +for(var i=_8f2+1;i"+""+"
            "+""+"").insertAfter(tr); -}; -}; -function _828(_829,_82a,data,_82b){ -var _82c=$.data(_829,"treegrid"); -var opts=_82c.options; -var dc=_82c.dc; -data=opts.loadFilter.call(_829,data,_82a); -var node=find(_829,_82a); +function _929(row){ +var len=0; +var c0=0; +var c1=0; +$.easyui.forEach(row.children||[],false,function(r){ +if(r.checkState){ +len++; +if(r.checkState=="checked"){ +c1++; +}else{ +if(r.checkState=="unchecked"){ +c0++; +} +} +} +}); +if(len==0){ +return undefined; +} +var flag=0; +if(c0==len){ +flag=0; +}else{ +if(c1==len){ +flag=1; +}else{ +flag=2; +} +} +return flag; +}; +function _92a(_92b,_92c){ +var opts=$.data(_92b,"treegrid").options; +if(!opts.checkbox){ +return; +} +var row=find(_92b,_92c); +var tr=opts.finder.getTr(_92b,_92c); +var ck=tr.find(".tree-checkbox"); +if(opts.view.hasCheckbox(_92b,row)){ +if(!ck.length){ +row.checkState=row.checkState||"unchecked"; +$("").insertBefore(tr.find(".tree-title")); +} +if(row.checkState=="checked"){ +_917(_92b,_92c,true,true); +}else{ +if(row.checkState=="unchecked"){ +_917(_92b,_92c,false,true); +}else{ +var flag=_929(row); +if(flag===0){ +_917(_92b,_92c,false,true); +}else{ +if(flag===1){ +_917(_92b,_92c,true,true); +} +} +} +} +}else{ +ck.remove(); +row.checkState=undefined; +row.checked=undefined; +_920(_92b,row); +} +}; +function _92d(_92e,_92f){ +var opts=$.data(_92e,"treegrid").options; +var tr1=opts.finder.getTr(_92e,_92f,"body",1); +var tr2=opts.finder.getTr(_92e,_92f,"body",2); +var _930=$(_92e).datagrid("getColumnFields",true).length+(opts.rownumbers?1:0); +var _931=$(_92e).datagrid("getColumnFields",false).length; +_932(tr1,_930); +_932(tr2,_931); +function _932(tr,_933){ +$(""+""+"
            "+""+"").insertAfter(tr); +}; +}; +function _934(_935,_936,data,_937,_938){ +var _939=$.data(_935,"treegrid"); +var opts=_939.options; +var dc=_939.dc; +data=opts.loadFilter.call(_935,data,_936); +var node=find(_935,_936); if(node){ -var _82d=opts.finder.getTr(_829,_82a,"body",1); -var _82e=opts.finder.getTr(_829,_82a,"body",2); -var cc1=_82d.next("tr.treegrid-tr-tree").children("td").children("div"); -var cc2=_82e.next("tr.treegrid-tr-tree").children("td").children("div"); -if(!_82b){ +var _93a=opts.finder.getTr(_935,_936,"body",1); +var _93b=opts.finder.getTr(_935,_936,"body",2); +var cc1=_93a.next("tr.treegrid-tr-tree").children("td").children("div"); +var cc2=_93b.next("tr.treegrid-tr-tree").children("td").children("div"); +if(!_937){ node.children=[]; } }else{ var cc1=dc.body1; var cc2=dc.body2; -if(!_82b){ -_82c.data=[]; +if(!_937){ +_939.data=[]; } } -if(!_82b){ +if(!_937){ cc1.empty(); cc2.empty(); } if(opts.view.onBeforeRender){ -opts.view.onBeforeRender.call(opts.view,_829,_82a,data); +opts.view.onBeforeRender.call(opts.view,_935,_936,data); } -opts.view.render.call(opts.view,_829,cc1,true); -opts.view.render.call(opts.view,_829,cc2,false); +opts.view.render.call(opts.view,_935,cc1,true); +opts.view.render.call(opts.view,_935,cc2,false); if(opts.showFooter){ -opts.view.renderFooter.call(opts.view,_829,dc.footer1,true); -opts.view.renderFooter.call(opts.view,_829,dc.footer2,false); +opts.view.renderFooter.call(opts.view,_935,dc.footer1,true); +opts.view.renderFooter.call(opts.view,_935,dc.footer2,false); } if(opts.view.onAfterRender){ -opts.view.onAfterRender.call(opts.view,_829); +opts.view.onAfterRender.call(opts.view,_935); +} +if(!_936&&opts.pagination){ +var _93c=$.data(_935,"treegrid").total; +var _93d=$(_935).datagrid("getPager"); +if(_93d.pagination("options").total!=_93c){ +_93d.pagination({total:_93c}); } -if(!_82a&&opts.pagination){ -var _82f=$.data(_829,"treegrid").total; -var _830=$(_829).datagrid("getPager"); -if(_830.pagination("options").total!=_82f){ -_830.pagination({total:_82f}); } +_906(_935); +_90e(_935); +$(_935).treegrid("showLines"); +$(_935).treegrid("setSelectionState"); +$(_935).treegrid("autoSizeColumn"); +if(!_938){ +opts.onLoadSuccess.call(_935,node,data); } -_812(_829); -_81a(_829); -$(_829).treegrid("showLines"); -$(_829).treegrid("setSelectionState"); -$(_829).treegrid("autoSizeColumn"); -opts.onLoadSuccess.call(_829,node,data); }; -function _811(_831,_832,_833,_834,_835){ -var opts=$.data(_831,"treegrid").options; -var body=$(_831).datagrid("getPanel").find("div.datagrid-body"); -if(_833){ -opts.queryParams=_833; +function _905(_93e,_93f,_940,_941,_942){ +var opts=$.data(_93e,"treegrid").options; +var body=$(_93e).datagrid("getPanel").find("div.datagrid-body"); +if(_93f==undefined&&opts.queryParams){ +opts.queryParams.id=undefined; } -var _836=$.extend({},opts.queryParams); +if(_940){ +opts.queryParams=_940; +} +var _943=$.extend({},opts.queryParams); if(opts.pagination){ -$.extend(_836,{page:opts.pageNumber,rows:opts.pageSize}); +$.extend(_943,{page:opts.pageNumber,rows:opts.pageSize}); } if(opts.sortName){ -$.extend(_836,{sort:opts.sortName,order:opts.sortOrder}); +$.extend(_943,{sort:opts.sortName,order:opts.sortOrder}); } -var row=find(_831,_832); -if(opts.onBeforeLoad.call(_831,row,_836)==false){ +var row=find(_93e,_93f); +if(opts.onBeforeLoad.call(_93e,row,_943)==false){ return; } -var _837=body.find("tr[node-id=\""+_832+"\"] span.tree-folder"); -_837.addClass("tree-loading"); -$(_831).treegrid("loading"); -var _838=opts.loader.call(_831,_836,function(data){ -_837.removeClass("tree-loading"); -$(_831).treegrid("loaded"); -_828(_831,_832,data,_834); -if(_835){ -_835(); +var _944=body.find("tr[node-id=\""+_93f+"\"] span.tree-folder"); +_944.addClass("tree-loading"); +$(_93e).treegrid("loading"); +var _945=opts.loader.call(_93e,_943,function(data){ +_944.removeClass("tree-loading"); +$(_93e).treegrid("loaded"); +_934(_93e,_93f,data,_941); +if(_942){ +_942(); } },function(){ -_837.removeClass("tree-loading"); -$(_831).treegrid("loaded"); -opts.onLoadError.apply(_831,arguments); -if(_835){ -_835(); +_944.removeClass("tree-loading"); +$(_93e).treegrid("loaded"); +opts.onLoadError.apply(_93e,arguments); +if(_942){ +_942(); } }); -if(_838==false){ -_837.removeClass("tree-loading"); -$(_831).treegrid("loaded"); +if(_945==false){ +_944.removeClass("tree-loading"); +$(_93e).treegrid("loaded"); } }; -function _839(_83a){ -var rows=_83b(_83a); -if(rows.length){ -return rows[0]; -}else{ -return null; -} +function _946(_947){ +var _948=_949(_947); +return _948.length?_948[0]:null; }; -function _83b(_83c){ -return $.data(_83c,"treegrid").data; +function _949(_94a){ +return $.data(_94a,"treegrid").data; }; -function _83d(_83e,_83f){ -var row=find(_83e,_83f); +function _928(_94b,_94c){ +var row=find(_94b,_94c); if(row._parentId){ -return find(_83e,row._parentId); +return find(_94b,row._parentId); }else{ return null; } }; -function _816(_840,_841){ -var opts=$.data(_840,"treegrid").options; -var body=$(_840).datagrid("getPanel").find("div.datagrid-view2 div.datagrid-body"); -var _842=[]; -if(_841){ -_843(_841); -}else{ -var _844=_83b(_840); -for(var i=0;i<_844.length;i++){ -_842.push(_844[i]); -_843(_844[i][opts.idField]); +function _90a(_94d,_94e){ +var data=$.data(_94d,"treegrid").data; +if(_94e){ +var _94f=find(_94d,_94e); +data=_94f?(_94f.children||[]):[]; } -} -function _843(_845){ -var _846=find(_840,_845); -if(_846&&_846.children){ -for(var i=0,len=_846.children.length;i").insertBefore(_866); +var _972=cell.children("span.tree-icon"); +if(_972.hasClass("tree-file")){ +_972.removeClass("tree-file").addClass("tree-folder tree-folder-open"); +var hit=$("").insertBefore(_972); if(hit.prev().length){ hit.prev().remove(); } } } -_828(_864,_865.parent,_865.data,true); +_934(_96f,_970.parent,_970.data,_971.data.length>0,true); }; -function _867(_868,_869){ -var ref=_869.before||_869.after; -var opts=$.data(_868,"treegrid").options; -var _86a=_83d(_868,ref); -_863(_868,{parent:(_86a?_86a[opts.idField]:null),data:[_869.data]}); -var _86b=_86a?_86a.children:$(_868).treegrid("getRoots"); -for(var i=0;i<_86b.length;i++){ -if(_86b[i][opts.idField]==ref){ -var _86c=_86b[_86b.length-1]; -_86b.splice(_869.before?i:(i+1),0,_86c); -_86b.splice(_86b.length-1,1); +function _973(_974,_975){ +var ref=_975.before||_975.after; +var opts=$.data(_974,"treegrid").options; +var _976=_928(_974,ref); +_96e(_974,{parent:(_976?_976[opts.idField]:null),data:[_975.data]}); +var _977=_976?_976.children:$(_974).treegrid("getRoots"); +for(var i=0;i<_977.length;i++){ +if(_977[i][opts.idField]==ref){ +var _978=_977[_977.length-1]; +_977.splice(_975.before?i:(i+1),0,_978); +_977.splice(_977.length-1,1); break; } } -_86d(true); -_86d(false); -_81a(_868); -$(_868).treegrid("showLines"); -function _86d(_86e){ -var _86f=_86e?1:2; -var tr=opts.finder.getTr(_868,_869.data[opts.idField],"body",_86f); -var _870=tr.closest("table.datagrid-btable"); +_979(true); +_979(false); +_90e(_974); +$(_974).treegrid("showLines"); +function _979(_97a){ +var _97b=_97a?1:2; +var tr=opts.finder.getTr(_974,_975.data[opts.idField],"body",_97b); +var _97c=tr.closest("table.datagrid-btable"); tr=tr.parent().children(); -var dest=opts.finder.getTr(_868,ref,"body",_86f); -if(_869.before){ +var dest=opts.finder.getTr(_974,ref,"body",_97b); +if(_975.before){ tr.insertBefore(dest); }else{ var sub=dest.next("tr.treegrid-tr-tree"); tr.insertAfter(sub.length?sub:dest); } -_870.remove(); +_97c.remove(); }; }; -function _871(_872,_873){ -var _874=$.data(_872,"treegrid"); -$(_872).datagrid("deleteRow",_873); -_81a(_872); -_874.total-=1; -$(_872).datagrid("getPager").pagination("refresh",{total:_874.total}); -$(_872).treegrid("showLines"); +function _97d(_97e,_97f){ +var _980=$.data(_97e,"treegrid"); +var opts=_980.options; +var prow=_928(_97e,_97f); +$(_97e).datagrid("deleteRow",_97f); +$.easyui.removeArrayItem(_980.checkedRows,opts.idField,_97f); +_90e(_97e); +if(prow){ +_92a(_97e,prow[opts.idField]); +} +_980.total-=1; +$(_97e).datagrid("getPager").pagination("refresh",{total:_980.total}); +$(_97e).treegrid("showLines"); }; -function _875(_876){ -var t=$(_876); +function _981(_982){ +var t=$(_982); var opts=t.treegrid("options"); if(opts.lines){ t.treegrid("getPanel").addClass("tree-lines"); @@ -11048,125 +12574,125 @@ return; } t.treegrid("getPanel").find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); t.treegrid("getPanel").find("div.datagrid-cell").removeClass("tree-node-last tree-root-first tree-root-one"); -var _877=t.treegrid("getRoots"); -if(_877.length>1){ -_878(_877[0]).addClass("tree-root-first"); +var _983=t.treegrid("getRoots"); +if(_983.length>1){ +_984(_983[0]).addClass("tree-root-first"); }else{ -if(_877.length==1){ -_878(_877[0]).addClass("tree-root-one"); +if(_983.length==1){ +_984(_983[0]).addClass("tree-root-one"); } } -_879(_877); -_87a(_877); -function _879(_87b){ -$.map(_87b,function(node){ +_985(_983); +_986(_983); +function _985(_987){ +$.map(_987,function(node){ if(node.children&&node.children.length){ -_879(node.children); +_985(node.children); }else{ -var cell=_878(node); +var cell=_984(node); cell.find(".tree-icon").prev().addClass("tree-join"); } }); -if(_87b.length){ -var cell=_878(_87b[_87b.length-1]); +if(_987.length){ +var cell=_984(_987[_987.length-1]); cell.addClass("tree-node-last"); cell.find(".tree-join").removeClass("tree-join").addClass("tree-joinbottom"); } }; -function _87a(_87c){ -$.map(_87c,function(node){ +function _986(_988){ +$.map(_988,function(node){ if(node.children&&node.children.length){ -_87a(node.children); +_986(node.children); } }); -for(var i=0;i<_87c.length-1;i++){ -var node=_87c[i]; -var _87d=t.treegrid("getLevel",node[opts.idField]); -var tr=opts.finder.getTr(_876,node[opts.idField]); +for(var i=0;i<_988.length-1;i++){ +var node=_988[i]; +var _989=t.treegrid("getLevel",node[opts.idField]); +var tr=opts.finder.getTr(_982,node[opts.idField]); var cc=tr.next().find("tr.datagrid-row td[field=\""+opts.treeField+"\"] div.datagrid-cell"); -cc.find("span:eq("+(_87d-1)+")").addClass("tree-line"); +cc.find("span:eq("+(_989-1)+")").addClass("tree-line"); } }; -function _878(node){ -var tr=opts.finder.getTr(_876,node[opts.idField]); +function _984(node){ +var tr=opts.finder.getTr(_982,node[opts.idField]); var cell=tr.find("td[field=\""+opts.treeField+"\"] div.datagrid-cell"); return cell; }; }; -$.fn.treegrid=function(_87e,_87f){ -if(typeof _87e=="string"){ -var _880=$.fn.treegrid.methods[_87e]; -if(_880){ -return _880(this,_87f); +$.fn.treegrid=function(_98a,_98b){ +if(typeof _98a=="string"){ +var _98c=$.fn.treegrid.methods[_98a]; +if(_98c){ +return _98c(this,_98b); }else{ -return this.datagrid(_87e,_87f); +return this.datagrid(_98a,_98b); } } -_87e=_87e||{}; +_98a=_98a||{}; return this.each(function(){ -var _881=$.data(this,"treegrid"); -if(_881){ -$.extend(_881.options,_87e); +var _98d=$.data(this,"treegrid"); +if(_98d){ +$.extend(_98d.options,_98a); }else{ -_881=$.data(this,"treegrid",{options:$.extend({},$.fn.treegrid.defaults,$.fn.treegrid.parseOptions(this),_87e),data:[]}); +_98d=$.data(this,"treegrid",{options:$.extend({},$.fn.treegrid.defaults,$.fn.treegrid.parseOptions(this),_98a),data:[],checkedRows:[],tmpIds:[]}); } -_7f3(this); -if(_881.options.data){ -$(this).treegrid("loadData",_881.options.data); +_8f5(this); +if(_98d.options.data){ +$(this).treegrid("loadData",_98d.options.data); } -_811(this); +_905(this); }); }; $.fn.treegrid.methods={options:function(jq){ return $.data(jq[0],"treegrid").options; -},resize:function(jq,_882){ +},resize:function(jq,_98e){ return jq.each(function(){ -$(this).datagrid("resize",_882); +$(this).datagrid("resize",_98e); }); -},fixRowHeight:function(jq,_883){ +},fixRowHeight:function(jq,_98f){ return jq.each(function(){ -_812(this,_883); +_906(this,_98f); }); },loadData:function(jq,data){ return jq.each(function(){ -_828(this,data.parent,data); +_934(this,data.parent,data); }); -},load:function(jq,_884){ +},load:function(jq,_990){ return jq.each(function(){ $(this).treegrid("options").pageNumber=1; $(this).treegrid("getPager").pagination({pageNumber:1}); -$(this).treegrid("reload",_884); +$(this).treegrid("reload",_990); }); },reload:function(jq,id){ return jq.each(function(){ var opts=$(this).treegrid("options"); -var _885={}; +var _991={}; if(typeof id=="object"){ -_885=id; +_991=id; }else{ -_885=$.extend({},opts.queryParams); -_885.id=id; +_991=$.extend({},opts.queryParams); +_991.id=id; } -if(_885.id){ -var node=$(this).treegrid("find",_885.id); +if(_991.id){ +var node=$(this).treegrid("find",_991.id); if(node.children){ node.children.splice(0,node.children.length); } -opts.queryParams=_885; -var tr=opts.finder.getTr(this,_885.id); +opts.queryParams=_991; +var tr=opts.finder.getTr(this,_991.id); tr.next("tr.treegrid-tr-tree").remove(); tr.find("span.tree-hit").removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); -_850(this,_885.id); +_95b(this,_991.id); }else{ -_811(this,null,_885); +_905(this,null,_991); } }); -},reloadFooter:function(jq,_886){ +},reloadFooter:function(jq,_992){ return jq.each(function(){ var opts=$.data(this,"treegrid").options; var dc=$.data(this,"datagrid").dc; -if(_886){ -$.data(this,"treegrid").footer=_886; +if(_992){ +$.data(this,"treegrid").footer=_992; } if(opts.showFooter){ opts.view.renderFooter.call(opts.view,this,dc.footer1,true); @@ -11182,15 +12708,15 @@ return $.data(jq[0],"treegrid").data; },getFooterRows:function(jq){ return $.data(jq[0],"treegrid").footer; },getRoot:function(jq){ -return _839(jq[0]); +return _946(jq[0]); },getRoots:function(jq){ -return _83b(jq[0]); +return _949(jq[0]); },getParent:function(jq,id){ -return _83d(jq[0],id); +return _928(jq[0],id); },getChildren:function(jq,id){ -return _816(jq[0],id); +return _90a(jq[0],id); },getLevel:function(jq,id){ -return _848(jq[0],id); +return _951(jq[0],id); },find:function(jq,id){ return find(jq[0],id); },isLeaf:function(jq,id){ @@ -11208,39 +12734,39 @@ $(this).datagrid("unselectRow",id); }); },collapse:function(jq,id){ return jq.each(function(){ -_84d(this,id); +_958(this,id); }); },expand:function(jq,id){ return jq.each(function(){ -_850(this,id); +_95b(this,id); }); },toggle:function(jq,id){ return jq.each(function(){ -_820(this,id); +_916(this,id); }); },collapseAll:function(jq,id){ return jq.each(function(){ -_858(this,id); +_963(this,id); }); },expandAll:function(jq,id){ return jq.each(function(){ -_85c(this,id); +_967(this,id); }); },expandTo:function(jq,id){ return jq.each(function(){ -_860(this,id); +_96b(this,id); }); -},append:function(jq,_887){ +},append:function(jq,_993){ return jq.each(function(){ -_863(this,_887); +_96e(this,_993); }); -},insert:function(jq,_888){ +},insert:function(jq,_994){ return jq.each(function(){ -_867(this,_888); +_973(this,_994); }); },remove:function(jq,id){ return jq.each(function(){ -_871(this,id); +_97d(this,id); }); },pop:function(jq,id){ var row=jq.treegrid("find",id); @@ -11251,10 +12777,16 @@ return jq.each(function(){ var opts=$.data(this,"treegrid").options; opts.view.refreshRow.call(opts.view,this,id); }); -},update:function(jq,_889){ +},update:function(jq,_995){ return jq.each(function(){ var opts=$.data(this,"treegrid").options; -opts.view.updateRow.call(opts.view,this,_889.id,_889.row); +var row=_995.row; +opts.view.updateRow.call(opts.view,this,_995.id,row); +if(row.checked!=undefined){ +row=find(this,_995.id); +$.extend(row,{checkState:row.checked?"checked":(row.checked===false?"unchecked":undefined)}); +_92a(this,_995.id); +} }); },beginEdit:function(jq,id){ return jq.each(function(){ @@ -11271,115 +12803,133 @@ $(this).datagrid("cancelEdit",id); }); },showLines:function(jq){ return jq.each(function(){ -_875(this); +_981(this); +}); +},setSelectionState:function(jq){ +return jq.each(function(){ +$(this).datagrid("setSelectionState"); +var _996=$(this).data("treegrid"); +for(var i=0;i<_996.tmpIds.length;i++){ +_917(this,_996.tmpIds[i],true,true); +} +_996.tmpIds=[]; +}); +},getCheckedNodes:function(jq,_997){ +_997=_997||"checked"; +var rows=[]; +$.easyui.forEach(jq.data("treegrid").checkedRows,false,function(row){ +if(row.checkState==_997){ +rows.push(row); +} +}); +return rows; +},checkNode:function(jq,id){ +return jq.each(function(){ +_917(this,id,true); +}); +},uncheckNode:function(jq,id){ +return jq.each(function(){ +_917(this,id,false); +}); +},clearChecked:function(jq){ +return jq.each(function(){ +var _998=this; +var opts=$(_998).treegrid("options"); +$(_998).datagrid("clearChecked"); +$.map($(_998).treegrid("getCheckedNodes"),function(row){ +_917(_998,row[opts.idField],false,true); +}); }); }}; -$.fn.treegrid.parseOptions=function(_88a){ -return $.extend({},$.fn.datagrid.parseOptions(_88a),$.parser.parseOptions(_88a,["treeField",{animate:"boolean"}])); -}; -var _88b=$.extend({},$.fn.datagrid.defaults.view,{render:function(_88c,_88d,_88e){ -var opts=$.data(_88c,"treegrid").options; -var _88f=$(_88c).datagrid("getColumnFields",_88e); -var _890=$.data(_88c,"datagrid").rowIdPrefix; -if(_88e){ +$.fn.treegrid.parseOptions=function(_999){ +return $.extend({},$.fn.datagrid.parseOptions(_999),$.parser.parseOptions(_999,["treeField",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean"}])); +}; +var _99a=$.extend({},$.fn.datagrid.defaults.view,{render:function(_99b,_99c,_99d){ +var opts=$.data(_99b,"treegrid").options; +var _99e=$(_99b).datagrid("getColumnFields",_99d); +var _99f=$.data(_99b,"datagrid").rowIdPrefix; +if(_99d){ if(!(opts.rownumbers||(opts.frozenColumns&&opts.frozenColumns.length))){ return; } } var view=this; if(this.treeNodes&&this.treeNodes.length){ -var _891=_892(_88e,this.treeLevel,this.treeNodes); -$(_88d).append(_891.join("")); -} -function _892(_893,_894,_895){ -var _896=$(_88c).treegrid("getParent",_895[0][opts.idField]); -var _897=(_896?_896.children.length:$(_88c).treegrid("getRoots").length)-_895.length; -var _898=[""]; -for(var i=0;i<_895.length;i++){ -var row=_895[i]; +var _9a0=_9a1.call(this,_99d,this.treeLevel,this.treeNodes); +$(_99c).append(_9a0.join("")); +} +function _9a1(_9a2,_9a3,_9a4){ +var _9a5=$(_99b).treegrid("getParent",_9a4[0][opts.idField]); +var _9a6=(_9a5?_9a5.children.length:$(_99b).treegrid("getRoots").length)-_9a4.length; +var _9a7=["
            "]; +for(var i=0;i<_9a4.length;i++){ +var row=_9a4[i]; if(row.state!="open"&&row.state!="closed"){ row.state="open"; } -var css=opts.rowStyler?opts.rowStyler.call(_88c,row):""; -var _899=""; -var _89a=""; -if(typeof css=="string"){ -_89a=css; -}else{ -if(css){ -_899=css["class"]||""; -_89a=css["style"]||""; -} -} -var cls="class=\"datagrid-row "+(_897++%2&&opts.striped?"datagrid-row-alt ":" ")+_899+"\""; -var _89b=_89a?"style=\""+_89a+"\"":""; -var _89c=_890+"-"+(_893?1:2)+"-"+row[opts.idField]; -_898.push(""); -_898=_898.concat(view.renderRow.call(view,_88c,_88f,_893,_894,row)); -_898.push(""); +var css=opts.rowStyler?opts.rowStyler.call(_99b,row):""; +var cs=this.getStyleValue(css); +var cls="class=\"datagrid-row "+(_9a6++%2&&opts.striped?"datagrid-row-alt ":" ")+cs.c+"\""; +var _9a8=cs.s?"style=\""+cs.s+"\"":""; +var _9a9=_99f+"-"+(_9a2?1:2)+"-"+row[opts.idField]; +_9a7.push(""); +_9a7=_9a7.concat(view.renderRow.call(view,_99b,_99e,_9a2,_9a3,row)); +_9a7.push(""); if(row.children&&row.children.length){ -var tt=_892(_893,_894+1,row.children); +var tt=_9a1.call(this,_9a2,_9a3+1,row.children); var v=row.state=="closed"?"none":"block"; -_898.push(""); +_9a7.push(""); } } -_898.push("
            "); -_898=_898.concat(tt); -_898.push("
            "); +_9a7=_9a7.concat(tt); +_9a7.push("
            "); -return _898; +_9a7.push(""); +return _9a7; }; -},renderFooter:function(_89d,_89e,_89f){ -var opts=$.data(_89d,"treegrid").options; -var rows=$.data(_89d,"treegrid").footer||[]; -var _8a0=$(_89d).datagrid("getColumnFields",_89f); -var _8a1=[""]; +},renderFooter:function(_9aa,_9ab,_9ac){ +var opts=$.data(_9aa,"treegrid").options; +var rows=$.data(_9aa,"treegrid").footer||[]; +var _9ad=$(_9aa).datagrid("getColumnFields",_9ac); +var _9ae=["
            "]; for(var i=0;i"); -_8a1.push(this.renderRow.call(this,_89d,_8a0,_89f,0,row)); -_8a1.push(""); -} -_8a1.push("
            "); -$(_89e).html(_8a1.join("")); -},renderRow:function(_8a2,_8a3,_8a4,_8a5,row){ -var opts=$.data(_8a2,"treegrid").options; +_9ae.push(""); +_9ae.push(this.renderRow.call(this,_9aa,_9ad,_9ac,0,row)); +_9ae.push(""); +} +_9ae.push(""); +$(_9ab).html(_9ae.join("")); +},renderRow:function(_9af,_9b0,_9b1,_9b2,row){ +var _9b3=$.data(_9af,"treegrid"); +var opts=_9b3.options; var cc=[]; -if(_8a4&&opts.rownumbers){ +if(_9b1&&opts.rownumbers){ cc.push("
            0
            "); } -for(var i=0;i<_8a3.length;i++){ -var _8a6=_8a3[i]; -var col=$(_8a2).datagrid("getColumnOption",_8a6); +for(var i=0;i<_9b0.length;i++){ +var _9b4=_9b0[i]; +var col=$(_9af).datagrid("getColumnOption",_9b4); if(col){ -var css=col.styler?(col.styler(row[_8a6],row)||""):""; -var _8a7=""; -var _8a8=""; -if(typeof css=="string"){ -_8a8=css; -}else{ -if(cc){ -_8a7=css["class"]||""; -_8a8=css["style"]||""; -} -} -var cls=_8a7?"class=\""+_8a7+"\"":""; -var _8a9=col.hidden?"style=\"display:none;"+_8a8+"\"":(_8a8?"style=\""+_8a8+"\"":""); -cc.push(""); -var _8a9=""; +var css=col.styler?(col.styler(row[_9b4],row)||""):""; +var cs=this.getStyleValue(css); +var cls=cs.c?"class=\""+cs.c+"\"":""; +var _9b5=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":""); +cc.push(""); +var _9b5=""; if(!col.checkbox){ if(col.align){ -_8a9+="text-align:"+col.align+";"; +_9b5+="text-align:"+col.align+";"; } if(!opts.nowrap){ -_8a9+="white-space:normal;height:auto;"; +_9b5+="white-space:normal;height:auto;"; }else{ if(opts.autoRowHeight){ -_8a9+="height:auto;"; +_9b5+="height:auto;"; } } } -cc.push("
            "); +cc.push(" name=\""+_9b4+"\" value=\""+(row[_9b4]!=undefined?row[_9b4]:"")+"\">"); }else{ var val=null; if(col.formatter){ -val=col.formatter(row[_8a6],row); +val=col.formatter(row[_9b4],row); }else{ -val=row[_8a6]; +val=row[_9b4]; } -if(_8a6==opts.treeField){ -for(var j=0;j<_8a5;j++){ +if(_9b4==opts.treeField){ +for(var j=0;j<_9b2;j++){ cc.push(""); } if(row.state=="closed"){ @@ -11416,6 +12966,32 @@ cc.push(""); cc.push(""); } } +if(this.hasCheckbox(_9af,row)){ +var flag=0; +var crow=$.easyui.getArrayItem(_9b3.checkedRows,opts.idField,row[opts.idField]); +if(crow){ +flag=crow.checkState=="checked"?1:2; +row.checkState=crow.checkState; +row.checked=crow.checked; +$.easyui.addArrayItem(_9b3.checkedRows,opts.idField,row); +}else{ +var prow=$.easyui.getArrayItem(_9b3.checkedRows,opts.idField,row._parentId); +if(prow&&prow.checkState=="checked"&&opts.cascadeCheck){ +flag=1; +row.checked=true; +$.easyui.addArrayItem(_9b3.checkedRows,opts.idField,row); +}else{ +if(row.checked){ +$.easyui.addArrayItem(_9b3.tmpIds,row[opts.idField]); +} +} +row.checkState=flag?"checked":"unchecked"; +} +cc.push(""); +}else{ +row.checkState=undefined; +row.checked=undefined; +} cc.push(""+val+""); }else{ cc.push(val); @@ -11426,44 +13002,64 @@ cc.push(""); } } return cc.join(""); -},refreshRow:function(_8aa,id){ -this.updateRow.call(this,_8aa,id,{}); -},updateRow:function(_8ab,id,row){ -var opts=$.data(_8ab,"treegrid").options; -var _8ac=$(_8ab).treegrid("find",id); -$.extend(_8ac,row); -var _8ad=$(_8ab).treegrid("getLevel",id)-1; -var _8ae=opts.rowStyler?opts.rowStyler.call(_8ab,_8ac):""; -var _8af=$.data(_8ab,"datagrid").rowIdPrefix; -var _8b0=_8ac[opts.idField]; -function _8b1(_8b2){ -var _8b3=$(_8ab).treegrid("getColumnFields",_8b2); -var tr=opts.finder.getTr(_8ab,id,"body",(_8b2?1:2)); -var _8b4=tr.find("div.datagrid-cell-rownumber").html(); -var _8b5=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); -tr.html(this.renderRow(_8ab,_8b3,_8b2,_8ad,_8ac)); -tr.attr("style",_8ae||""); -tr.find("div.datagrid-cell-rownumber").html(_8b4); -if(_8b5){ +},hasCheckbox:function(_9b6,row){ +var opts=$.data(_9b6,"treegrid").options; +if(opts.checkbox){ +if($.isFunction(opts.checkbox)){ +if(opts.checkbox.call(_9b6,row)){ +return true; +}else{ +return false; +} +}else{ +if(opts.onlyLeafCheck){ +if(row.state=="open"&&!(row.children&&row.children.length)){ +return true; +} +}else{ +return true; +} +} +} +return false; +},refreshRow:function(_9b7,id){ +this.updateRow.call(this,_9b7,id,{}); +},updateRow:function(_9b8,id,row){ +var opts=$.data(_9b8,"treegrid").options; +var _9b9=$(_9b8).treegrid("find",id); +$.extend(_9b9,row); +var _9ba=$(_9b8).treegrid("getLevel",id)-1; +var _9bb=opts.rowStyler?opts.rowStyler.call(_9b8,_9b9):""; +var _9bc=$.data(_9b8,"datagrid").rowIdPrefix; +var _9bd=_9b9[opts.idField]; +function _9be(_9bf){ +var _9c0=$(_9b8).treegrid("getColumnFields",_9bf); +var tr=opts.finder.getTr(_9b8,id,"body",(_9bf?1:2)); +var _9c1=tr.find("div.datagrid-cell-rownumber").html(); +var _9c2=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); +tr.html(this.renderRow(_9b8,_9c0,_9bf,_9ba,_9b9)); +tr.attr("style",_9bb||""); +tr.find("div.datagrid-cell-rownumber").html(_9c1); +if(_9c2){ tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true); } -if(_8b0!=id){ -tr.attr("id",_8af+"-"+(_8b2?1:2)+"-"+_8b0); -tr.attr("node-id",_8b0); +if(_9bd!=id){ +tr.attr("id",_9bc+"-"+(_9bf?1:2)+"-"+_9bd); +tr.attr("node-id",_9bd); } }; -_8b1.call(this,true); -_8b1.call(this,false); -$(_8ab).treegrid("fixRowHeight",id); -},deleteRow:function(_8b6,id){ -var opts=$.data(_8b6,"treegrid").options; -var tr=opts.finder.getTr(_8b6,id); +_9be.call(this,true); +_9be.call(this,false); +$(_9b8).treegrid("fixRowHeight",id); +},deleteRow:function(_9c3,id){ +var opts=$.data(_9c3,"treegrid").options; +var tr=opts.finder.getTr(_9c3,id); tr.next("tr.treegrid-tr-tree").remove(); tr.remove(); -var _8b7=del(id); -if(_8b7){ -if(_8b7.children.length==0){ -tr=opts.finder.getTr(_8b6,_8b7[opts.idField]); +var _9c4=del(id); +if(_9c4){ +if(_9c4.children.length==0){ +tr=opts.finder.getTr(_9c3,_9c4[opts.idField]); tr.next("tr.treegrid-tr-tree").remove(); var cell=tr.children("td[field=\""+opts.treeField+"\"]").children("div.datagrid-cell"); cell.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); @@ -11471,13 +13067,14 @@ cell.find(".tree-hit").remove(); $("").prependTo(cell); } } +this.setEmptyMsg(_9c3); function del(id){ var cc; -var _8b8=$(_8b6).treegrid("getParent",id); -if(_8b8){ -cc=_8b8.children; +var _9c5=$(_9c3).treegrid("getParent",id); +if(_9c5){ +cc=_9c5.children; }else{ -cc=$(_8b6).treegrid("getData"); +cc=$(_9c3).treegrid("getData"); } for(var i=0;ib?1:-1); }; -r=_8c3(r1[sn],r2[sn])*(so=="asc"?1:-1); +r=_9d0(r1[sn],r2[sn])*(so=="asc"?1:-1); if(r!=0){ return r; } @@ -11555,106 +13152,92 @@ return r; return r; }); for(var i=0;i"); +if(!_9f3){ +_9f6.push(""); +_9f6.push(opts.groupFormatter.call(_9f0,_9f2.value,_9f2.rows)); +_9f6.push(""); +} +_9f6.push("
            "); +_9f6.push(this.renderTable(_9f0,_9f2.startIndex,_9f2.rows,_9f3)); +return _9f6.join(""); +},groupRows:function(_9f7,rows){ +var _9f8=$.data(_9f7,"datagrid"); +var opts=_9f8.options; +var _9f9=[]; +for(var i=0;idiv.combo-p>div.combo-panel:visible").panel("close"); }); }); -function _8d5(_8d6){ -var _8d7=$.data(_8d6,"combo"); -var opts=_8d7.options; -if(!_8d7.panel){ -_8d7.panel=$("
            ").appendTo("body"); -_8d7.panel.panel({minWidth:opts.panelMinWidth,maxWidth:opts.panelMaxWidth,minHeight:opts.panelMinHeight,maxHeight:opts.panelMaxHeight,doSize:false,closed:true,cls:"combo-p",style:{position:"absolute",zIndex:10},onOpen:function(){ -var _8d8=$(this).panel("options").comboTarget; -var _8d9=$.data(_8d8,"combo"); -if(_8d9){ -_8d9.options.onShowPanel.call(_8d8); +function _a09(_a0a){ +var _a0b=$.data(_a0a,"combo"); +var opts=_a0b.options; +if(!_a0b.panel){ +_a0b.panel=$("
            ").appendTo("body"); +_a0b.panel.panel({minWidth:opts.panelMinWidth,maxWidth:opts.panelMaxWidth,minHeight:opts.panelMinHeight,maxHeight:opts.panelMaxHeight,doSize:false,closed:true,cls:"combo-p",style:{position:"absolute",zIndex:10},onOpen:function(){ +var _a0c=$(this).panel("options").comboTarget; +var _a0d=$.data(_a0c,"combo"); +if(_a0d){ +_a0d.options.onShowPanel.call(_a0c); } },onBeforeClose:function(){ -_8d4(this); +_a08($(this).parent()); },onClose:function(){ -var _8da=$(this).panel("options").comboTarget; -var _8db=$.data(_8da,"combo"); -if(_8db){ -_8db.options.onHidePanel.call(_8da); +var _a0e=$(this).panel("options").comboTarget; +var _a0f=$(_a0e).data("combo"); +if(_a0f){ +_a0f.options.onHidePanel.call(_a0e); } }}); } -var _8dc=$.extend(true,[],opts.icons); +var _a10=$.extend(true,[],opts.icons); if(opts.hasDownArrow){ -_8dc.push({iconCls:"combo-arrow",handler:function(e){ -_8e0(e.data.target); +_a10.push({iconCls:"combo-arrow",handler:function(e){ +_a14(e.data.target); }}); } -$(_8d6).addClass("combo-f").textbox($.extend({},opts,{icons:_8dc,onChange:function(){ +$(_a0a).addClass("combo-f").textbox($.extend({},opts,{icons:_a10,onChange:function(){ }})); -$(_8d6).attr("comboName",$(_8d6).attr("textboxName")); -_8d7.combo=$(_8d6).next(); -_8d7.combo.addClass("combo"); -}; -function _8dd(_8de){ -var _8df=$.data(_8de,"combo"); -var opts=_8df.options; -var p=_8df.panel; +$(_a0a).attr("comboName",$(_a0a).attr("textboxName")); +_a0b.combo=$(_a0a).next(); +_a0b.combo.addClass("combo"); +}; +function _a11(_a12){ +var _a13=$.data(_a12,"combo"); +var opts=_a13.options; +var p=_a13.panel; if(p.is(":visible")){ p.panel("close"); } if(!opts.cloned){ p.panel("destroy"); } -$(_8de).textbox("destroy"); +$(_a12).textbox("destroy"); }; -function _8e0(_8e1){ -var _8e2=$.data(_8e1,"combo").panel; -if(_8e2.is(":visible")){ -_8e3(_8e1); +function _a14(_a15){ +var _a16=$.data(_a15,"combo").panel; +if(_a16.is(":visible")){ +var _a17=_a16.combo("combo"); +_a18(_a17); +if(_a17!=_a15){ +$(_a15).combo("showPanel"); +} }else{ -var p=$(_8e1).closest("div.combo-panel"); -$("div.combo-panel:visible").not(_8e2).not(p).panel("close"); -$(_8e1).combo("showPanel"); +var p=$(_a15).closest("div.combo-p").children(".combo-panel"); +$("div.combo-panel:visible").not(_a16).not(p).panel("close"); +$(_a15).combo("showPanel"); } -$(_8e1).combo("textbox").focus(); +$(_a15).combo("textbox").focus(); }; -function _8d4(_8e4){ -$(_8e4).find(".combo-f").each(function(){ +function _a08(_a19){ +$(_a19).find(".combo-f").each(function(){ var p=$(this).combo("panel"); if(p.is(":visible")){ p.panel("close"); } }); }; -function _8e5(e){ -var _8e6=e.data.target; -var _8e7=$.data(_8e6,"combo"); -var opts=_8e7.options; -var _8e8=_8e7.panel; +function _a1a(e){ +var _a1b=e.data.target; +var _a1c=$.data(_a1b,"combo"); +var opts=_a1c.options; if(!opts.editable){ -_8e0(_8e6); +_a14(_a1b); }else{ -var p=$(_8e6).closest("div.combo-panel"); -$("div.combo-panel:visible").not(_8e8).not(p).panel("close"); +var p=$(_a1b).closest("div.combo-p").children(".combo-panel"); +$("div.combo-panel:visible").not(p).each(function(){ +var _a1d=$(this).combo("combo"); +if(_a1d!=_a1b){ +_a18(_a1d); +} +}); } }; -function _8e9(e){ -var _8ea=e.data.target; -var t=$(_8ea); -var _8eb=t.data("combo"); +function _a1e(e){ +var _a1f=e.data.target; +var t=$(_a1f); +var _a20=t.data("combo"); var opts=t.combo("options"); +_a20.panel.panel("options").comboTarget=_a1f; switch(e.keyCode){ case 38: -opts.keyHandler.up.call(_8ea,e); +opts.keyHandler.up.call(_a1f,e); break; case 40: -opts.keyHandler.down.call(_8ea,e); +opts.keyHandler.down.call(_a1f,e); break; case 37: -opts.keyHandler.left.call(_8ea,e); +opts.keyHandler.left.call(_a1f,e); break; case 39: -opts.keyHandler.right.call(_8ea,e); +opts.keyHandler.right.call(_a1f,e); break; case 13: e.preventDefault(); -opts.keyHandler.enter.call(_8ea,e); +opts.keyHandler.enter.call(_a1f,e); return false; case 9: case 27: -_8e3(_8ea); +_a18(_a1f); break; default: if(opts.editable){ -if(_8eb.timer){ -clearTimeout(_8eb.timer); +if(_a20.timer){ +clearTimeout(_a20.timer); } -_8eb.timer=setTimeout(function(){ +_a20.timer=setTimeout(function(){ var q=t.combo("getText"); -if(_8eb.previousText!=q){ -_8eb.previousText=q; +if(_a20.previousText!=q){ +_a20.previousText=q; t.combo("showPanel"); -opts.keyHandler.query.call(_8ea,q,e); +opts.keyHandler.query.call(_a1f,q,e); t.combo("validate"); } },opts.delay); } } }; -function _8ec(_8ed){ -var _8ee=$.data(_8ed,"combo"); -var _8ef=_8ee.combo; -var _8f0=_8ee.panel; -var opts=$(_8ed).combo("options"); -var _8f1=_8f0.panel("options"); -_8f1.comboTarget=_8ed; -if(_8f1.closed){ -_8f0.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:$.fn.window.defaults.zIndex++),left:-999999}); -_8f0.panel("resize",{width:(opts.panelWidth?opts.panelWidth:_8ef._outerWidth()),height:opts.panelHeight}); -_8f0.panel("panel").hide(); -_8f0.panel("open"); +function _a21(_a22){ +var _a23=$.data(_a22,"combo"); +var _a24=_a23.combo; +var _a25=_a23.panel; +var opts=$(_a22).combo("options"); +var _a26=_a25.panel("options"); +_a26.comboTarget=_a22; +if(_a26.closed){ +_a25.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999}); +_a25.panel("resize",{width:(opts.panelWidth?opts.panelWidth:_a24._outerWidth()),height:opts.panelHeight}); +_a25.panel("panel").hide(); +_a25.panel("open"); } (function(){ -if(_8f0.is(":visible")){ -_8f0.panel("move",{left:_8f2(),top:_8f3()}); +if(_a26.comboTarget==_a22&&_a25.is(":visible")){ +_a25.panel("move",{left:_a27(),top:_a28()}); setTimeout(arguments.callee,200); } })(); -function _8f2(){ -var left=_8ef.offset().left; +function _a27(){ +var left=_a24.offset().left; if(opts.panelAlign=="right"){ -left+=_8ef._outerWidth()-_8f0._outerWidth(); +left+=_a24._outerWidth()-_a25._outerWidth(); } -if(left+_8f0._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){ -left=$(window)._outerWidth()+$(document).scrollLeft()-_8f0._outerWidth(); +if(left+_a25._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){ +left=$(window)._outerWidth()+$(document).scrollLeft()-_a25._outerWidth(); } if(left<0){ left=0; } return left; }; -function _8f3(){ -var top=_8ef.offset().top+_8ef._outerHeight(); -if(top+_8f0._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ -top=_8ef.offset().top-_8f0._outerHeight(); +function _a28(){ +var top=_a24.offset().top+_a24._outerHeight(); +if(top+_a25._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ +top=_a24.offset().top-_a25._outerHeight(); } if(top<$(document).scrollTop()){ -top=_8ef.offset().top+_8ef._outerHeight(); +top=_a24.offset().top+_a24._outerHeight(); } return top; }; }; -function _8e3(_8f4){ -var _8f5=$.data(_8f4,"combo").panel; -_8f5.panel("close"); -}; -function _8f6(_8f7){ -var _8f8=$.data(_8f7,"combo"); -var opts=_8f8.options; -var _8f9=_8f8.combo; -$(_8f7).textbox("clear"); -if(opts.multiple){ -_8f9.find(".textbox-value").remove(); -}else{ -_8f9.find(".textbox-value").val(""); -} +function _a18(_a29){ +var _a2a=$.data(_a29,"combo").panel; +_a2a.panel("close"); }; -function _8fa(_8fb,text){ -var _8fc=$.data(_8fb,"combo"); -var _8fd=$(_8fb).textbox("getText"); -if(_8fd!=text){ -$(_8fb).textbox("setText",text); -_8fc.previousText=text; +function _a2b(_a2c,text){ +var _a2d=$.data(_a2c,"combo"); +var _a2e=$(_a2c).textbox("getText"); +if(_a2e!=text){ +$(_a2c).textbox("setText",text); } +_a2d.previousText=text; }; -function _8fe(_8ff){ -var _900=[]; -var _901=$.data(_8ff,"combo").combo; -_901.find(".textbox-value").each(function(){ -_900.push($(this).val()); +function _a2f(_a30){ +var _a31=$.data(_a30,"combo"); +var opts=_a31.options; +var _a32=$(_a30).next(); +var _a33=[]; +_a32.find(".textbox-value").each(function(){ +_a33.push($(this).val()); }); -return _900; +if(opts.multivalue){ +return _a33; +}else{ +return _a33.length?_a33[0].split(opts.separator):_a33; +} }; -function _902(_903,_904){ -var _905=$.data(_903,"combo"); -var opts=_905.options; -var _906=_905.combo; -if(!$.isArray(_904)){ -_904=_904.split(opts.separator); +function _a34(_a35,_a36){ +var _a37=$.data(_a35,"combo"); +var _a38=_a37.combo; +var opts=$(_a35).combo("options"); +if(!$.isArray(_a36)){ +_a36=_a36.split(opts.separator); } -var _907=_8fe(_903); -_906.find(".textbox-value").remove(); -var name=$(_903).attr("textboxName")||""; -for(var i=0;i<_904.length;i++){ -var _908=$("").appendTo(_906); -_908.attr("name",name); -if(opts.disabled){ -_908.attr("disabled","disabled"); +var _a39=_a2f(_a35); +_a38.find(".textbox-value").remove(); +if(_a36.length){ +if(opts.multivalue){ +for(var i=0;i<_a36.length;i++){ +_a3a(_a36[i]); } -_908.val(_904[i]); +}else{ +_a3a(_a36.join(opts.separator)); +} +} +function _a3a(_a3b){ +var name=$(_a35).attr("textboxName")||""; +var _a3c=$("").appendTo(_a38); +_a3c.attr("name",name); +if(opts.disabled){ +_a3c.attr("disabled","disabled"); } -var _909=(function(){ -if(_907.length!=_904.length){ +_a3c.val(_a3b); +}; +var _a3d=(function(){ +if(_a39.length!=_a36.length){ return true; } -var a1=$.extend(true,[],_907); -var a2=$.extend(true,[],_904); -a1.sort(); -a2.sort(); -for(var i=0;i_924.height()){ -var h=_924.scrollTop()+item.position().top+item.outerHeight()-_924.height(); -_924.scrollTop(h); +if(item.position().top+item.outerHeight()>_a57.height()){ +var h=_a57.scrollTop()+item.position().top+item.outerHeight()-_a57.height(); +_a57.scrollTop(h); } } } +_a57.triggerHandler("scroll"); }; -function nav(_925,dir){ -var opts=$.data(_925,"combobox").options; -var _926=$(_925).combobox("panel"); -var item=_926.children("div.combobox-item-hover"); +function nav(_a58,dir){ +var opts=$.data(_a58,"combobox").options; +var _a59=$(_a58).combobox("panel"); +var item=_a59.children("div.combobox-item-hover"); if(!item.length){ -item=_926.children("div.combobox-item-selected"); +item=_a59.children("div.combobox-item-selected"); } item.removeClass("combobox-item-hover"); -var _927="div.combobox-item:visible:not(.combobox-item-disabled):first"; -var _928="div.combobox-item:visible:not(.combobox-item-disabled):last"; +var _a5a="div.combobox-item:visible:not(.combobox-item-disabled):first"; +var _a5b="div.combobox-item:visible:not(.combobox-item-disabled):last"; if(!item.length){ -item=_926.children(dir=="next"?_927:_928); +item=_a59.children(dir=="next"?_a5a:_a5b); }else{ if(dir=="next"){ -item=item.nextAll(_927); +item=item.nextAll(_a5a); if(!item.length){ -item=_926.children(_927); +item=_a59.children(_a5a); } }else{ -item=item.prevAll(_927); +item=item.prevAll(_a5a); if(!item.length){ -item=_926.children(_928); +item=_a59.children(_a5b); } } } if(item.length){ item.addClass("combobox-item-hover"); -var row=opts.finder.getRow(_925,item); +var row=opts.finder.getRow(_a58,item); if(row){ -_921(_925,row[opts.valueField]); +$(_a58).combobox("scrollTo",row[opts.valueField]); if(opts.selectOnNavigation){ -_929(_925,row[opts.valueField]); +_a5c(_a58,row[opts.valueField]); } } } }; -function _929(_92a,_92b){ -var opts=$.data(_92a,"combobox").options; -var _92c=$(_92a).combo("getValues"); -if($.inArray(_92b+"",_92c)==-1){ +function _a5c(_a5d,_a5e,_a5f){ +var opts=$.data(_a5d,"combobox").options; +var _a60=$(_a5d).combo("getValues"); +if($.inArray(_a5e+"",_a60)==-1){ if(opts.multiple){ -_92c.push(_92b); +_a60.push(_a5e); }else{ -_92c=[_92b]; +_a60=[_a5e]; } -_92d(_92a,_92c); -opts.onSelect.call(_92a,opts.finder.getRow(_92a,_92b)); +_a61(_a5d,_a60,_a5f); } }; -function _92e(_92f,_930){ -var opts=$.data(_92f,"combobox").options; -var _931=$(_92f).combo("getValues"); -var _932=$.inArray(_930+"",_931); -if(_932>=0){ -_931.splice(_932,1); -_92d(_92f,_931); -opts.onUnselect.call(_92f,opts.finder.getRow(_92f,_930)); +function _a62(_a63,_a64){ +var opts=$.data(_a63,"combobox").options; +var _a65=$(_a63).combo("getValues"); +var _a66=$.inArray(_a64+"",_a65); +if(_a66>=0){ +_a65.splice(_a66,1); +_a61(_a63,_a65); } }; -function _92d(_933,_934,_935){ -var opts=$.data(_933,"combobox").options; -var _936=$(_933).combo("panel"); -if(!$.isArray(_934)){ -_934=_934.split(opts.separator); +function _a61(_a67,_a68,_a69){ +var opts=$.data(_a67,"combobox").options; +var _a6a=$(_a67).combo("panel"); +if(!$.isArray(_a68)){ +_a68=_a68.split(opts.separator); +} +if(!opts.multiple){ +_a68=_a68.length?[_a68[0]]:[""]; +} +var _a6b=$(_a67).combo("getValues"); +if(_a6a.is(":visible")){ +_a6a.find(".combobox-item-selected").each(function(){ +var row=opts.finder.getRow(_a67,$(this)); +if(row){ +if($.easyui.indexOfArray(_a6b,row[opts.valueField])==-1){ +$(this).removeClass("combobox-item-selected"); +} +} +}); } -_936.find("div.combobox-item-selected").removeClass("combobox-item-selected"); +$.map(_a6b,function(v){ +if($.easyui.indexOfArray(_a68,v)==-1){ +var el=opts.finder.getEl(_a67,v); +if(el.hasClass("combobox-item-selected")){ +el.removeClass("combobox-item-selected"); +opts.onUnselect.call(_a67,opts.finder.getRow(_a67,v)); +} +} +}); +var _a6c=null; var vv=[],ss=[]; -for(var i=0;i<_934.length;i++){ -var v=_934[i]; +for(var i=0;i<_a68.length;i++){ +var v=_a68[i]; var s=v; -opts.finder.getEl(_933,v).addClass("combobox-item-selected"); -var row=opts.finder.getRow(_933,v); +var row=opts.finder.getRow(_a67,v); if(row){ s=row[opts.textField]; +_a6c=row; +var el=opts.finder.getEl(_a67,v); +if(!el.hasClass("combobox-item-selected")){ +el.addClass("combobox-item-selected"); +opts.onSelect.call(_a67,row); +} } vv.push(v); ss.push(s); } -$(_933).combo("setValues",vv); -if(!_935){ -$(_933).combo("setText",ss.join(opts.separator)); -} -}; -function _937(_938,data,_939){ -var _93a=$.data(_938,"combobox"); -var opts=_93a.options; -_93a.data=opts.loadFilter.call(_938,data); -_93a.groups=[]; -data=_93a.data; -var _93b=$(_938).combobox("getValues"); -var dd=[]; -var _93c=undefined; -for(var i=0;i"); -dd.push(opts.groupFormatter?opts.groupFormatter.call(_938,g):g); -dd.push("
            "); +if(!_a69){ +$(_a67).combo("setText",ss.join(opts.separator)); } -}else{ -_93c=undefined; +if(opts.showItemIcon){ +var tb=$(_a67).combobox("textbox"); +tb.removeClass("textbox-bgicon "+opts.textboxIconCls); +if(_a6c&&_a6c.iconCls){ +tb.addClass("textbox-bgicon "+_a6c.iconCls); +opts.textboxIconCls=_a6c.iconCls; } -var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":""); -dd.push("
            "); -dd.push(opts.formatter?opts.formatter.call(_938,row):s); -dd.push("
            "); -if(row["selected"]&&$.inArray(v,_93b)==-1){ -_93b.push(v); } +$(_a67).combo("setValues",vv); +_a6a.triggerHandler("scroll"); +}; +function _a6d(_a6e,data,_a6f){ +var _a70=$.data(_a6e,"combobox"); +var opts=_a70.options; +_a70.data=opts.loadFilter.call(_a6e,data); +opts.view.render.call(opts.view,_a6e,$(_a6e).combo("panel"),_a70.data); +var vv=$(_a6e).combobox("getValues"); +$.easyui.forEach(_a70.data,false,function(row){ +if(row["selected"]){ +$.easyui.addArrayItem(vv,row[opts.valueField]+""); } -$(_938).combo("panel").html(dd.join("")); +}); if(opts.multiple){ -_92d(_938,_93b,_939); +_a61(_a6e,vv,_a6f); }else{ -_92d(_938,_93b.length?[_93b[_93b.length-1]]:[],_939); +_a61(_a6e,vv.length?[vv[vv.length-1]]:[],_a6f); } -opts.onLoadSuccess.call(_938,data); +opts.onLoadSuccess.call(_a6e,data); }; -function _93d(_93e,url,_93f,_940){ -var opts=$.data(_93e,"combobox").options; +function _a71(_a72,url,_a73,_a74){ +var opts=$.data(_a72,"combobox").options; if(url){ opts.url=url; } -_93f=_93f||{}; -if(opts.onBeforeLoad.call(_93e,_93f)==false){ +_a73=$.extend({},opts.queryParams,_a73||{}); +if(opts.onBeforeLoad.call(_a72,_a73)==false){ return; } -opts.loader.call(_93e,_93f,function(data){ -_937(_93e,data,_940); +opts.loader.call(_a72,_a73,function(data){ +_a6d(_a72,data,_a74); },function(){ opts.onLoadError.apply(this,arguments); }); }; -function _941(_942,q){ -var _943=$.data(_942,"combobox"); -var opts=_943.options; -if(opts.multiple&&!q){ -_92d(_942,[],true); -}else{ -_92d(_942,[q],true); -} +function _a75(_a76,q){ +var _a77=$.data(_a76,"combobox"); +var opts=_a77.options; +var _a78=$(); +var qq=opts.multiple?q.split(opts.separator):[q]; if(opts.mode=="remote"){ -_93d(_942,null,{q:q},true); +_a79(qq); +_a71(_a76,null,{q:q},true); }else{ -var _944=$(_942).combo("panel"); -_944.find("div.combobox-item-selected,div.combobox-item-hover").removeClass("combobox-item-selected combobox-item-hover"); -_944.find("div.combobox-item,div.combobox-group").hide(); -var data=_943.data; +var _a7a=$(_a76).combo("panel"); +_a7a.find(".combobox-item-hover").removeClass("combobox-item-hover"); +_a7a.find(".combobox-item,.combobox-group").hide(); +var data=_a77.data; var vv=[]; -var qq=opts.multiple?q.split(opts.separator):[q]; $.map(qq,function(q){ q=$.trim(q); -var _945=undefined; +var _a7b=q; +var _a7c=undefined; +_a78=$(); for(var i=0;i=0){ +if(_a50(_a7e,v)>=0){ vv.push(v); } }); @@ -12281,98 +14028,141 @@ if(!opts.multiple){ t.combobox("hidePanel"); } }; -function _94a(_94b){ -var _94c=$.data(_94b,"combobox"); -var opts=_94c.options; -_91c++; -_94c.itemIdPrefix="_easyui_combobox_i"+_91c; -_94c.groupIdPrefix="_easyui_combobox_g"+_91c; -$(_94b).addClass("combobox-f"); -$(_94b).combo($.extend({},opts,{onShowPanel:function(){ -$(_94b).combo("panel").find("div.combobox-item,div.combobox-group").show(); -_921(_94b,$(_94b).combobox("getValue")); -opts.onShowPanel.call(_94b); +function _a81(_a82){ +var _a83=$.data(_a82,"combobox"); +var opts=_a83.options; +$(_a82).addClass("combobox-f"); +$(_a82).combo($.extend({},opts,{onShowPanel:function(){ +$(this).combo("panel").find("div.combobox-item:hidden,div.combobox-group:hidden").show(); +_a61(this,$(this).combobox("getValues"),true); +$(this).combobox("scrollTo",$(this).combobox("getValue")); +opts.onShowPanel.call(this); }})); -$(_94b).combo("panel").unbind().bind("mouseover",function(e){ +var p=$(_a82).combo("panel"); +p.unbind(".combobox"); +for(var _a84 in opts.panelEvents){ +p.bind(_a84+".combobox",{target:_a82},opts.panelEvents[_a84]); +} +}; +function _a85(e){ $(this).children("div.combobox-item-hover").removeClass("combobox-item-hover"); var item=$(e.target).closest("div.combobox-item"); if(!item.hasClass("combobox-item-disabled")){ item.addClass("combobox-item-hover"); } e.stopPropagation(); -}).bind("mouseout",function(e){ +}; +function _a86(e){ $(e.target).closest("div.combobox-item").removeClass("combobox-item-hover"); e.stopPropagation(); -}).bind("click",function(e){ +}; +function _a87(e){ +var _a88=$(this).panel("options").comboTarget; +if(!_a88){ +return; +} +var opts=$(_a88).combobox("options"); var item=$(e.target).closest("div.combobox-item"); if(!item.length||item.hasClass("combobox-item-disabled")){ return; } -var row=opts.finder.getRow(_94b,item); +var row=opts.finder.getRow(_a88,item); if(!row){ return; } -var _94d=row[opts.valueField]; +if(opts.blurTimer){ +clearTimeout(opts.blurTimer); +opts.blurTimer=null; +} +opts.onClick.call(_a88,row); +var _a89=row[opts.valueField]; if(opts.multiple){ if(item.hasClass("combobox-item-selected")){ -_92e(_94b,_94d); +_a62(_a88,_a89); }else{ -_929(_94b,_94d); +_a5c(_a88,_a89); } }else{ -_929(_94b,_94d); -$(_94b).combo("hidePanel"); +$(_a88).combobox("setValue",_a89).combobox("hidePanel"); } e.stopPropagation(); +}; +function _a8a(e){ +var _a8b=$(this).panel("options").comboTarget; +if(!_a8b){ +return; +} +var opts=$(_a8b).combobox("options"); +if(opts.groupPosition=="sticky"){ +var _a8c=$(this).children(".combobox-stick"); +if(!_a8c.length){ +_a8c=$("
            ").appendTo(this); +} +_a8c.hide(); +var _a8d=$(_a8b).data("combobox"); +$(this).children(".combobox-group:visible").each(function(){ +var g=$(this); +var _a8e=opts.finder.getGroup(_a8b,g); +var _a8f=_a8d.data[_a8e.startIndex+_a8e.count-1]; +var last=opts.finder.getEl(_a8b,_a8f[opts.valueField]); +if(g.position().top<0&&last.position().top>0){ +_a8c.show().html(g.html()); +return false; +} }); +} }; -$.fn.combobox=function(_94e,_94f){ -if(typeof _94e=="string"){ -var _950=$.fn.combobox.methods[_94e]; -if(_950){ -return _950(this,_94f); +$.fn.combobox=function(_a90,_a91){ +if(typeof _a90=="string"){ +var _a92=$.fn.combobox.methods[_a90]; +if(_a92){ +return _a92(this,_a91); }else{ -return this.combo(_94e,_94f); +return this.combo(_a90,_a91); } } -_94e=_94e||{}; +_a90=_a90||{}; return this.each(function(){ -var _951=$.data(this,"combobox"); -if(_951){ -$.extend(_951.options,_94e); -_94a(this); +var _a93=$.data(this,"combobox"); +if(_a93){ +$.extend(_a93.options,_a90); +}else{ +_a93=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_a90),data:[]}); +} +_a81(this); +if(_a93.options.data){ +_a6d(this,_a93.options.data); }else{ -_951=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_94e),data:[]}); -_94a(this); var data=$.fn.combobox.parseData(this); if(data.length){ -_937(this,data); -} +_a6d(this,data); } -if(_951.options.data){ -_937(this,_951.options.data); } -_93d(this); +_a71(this); }); }; $.fn.combobox.methods={options:function(jq){ -var _952=jq.combo("options"); -return $.extend($.data(jq[0],"combobox").options,{width:_952.width,height:_952.height,originalValue:_952.originalValue,disabled:_952.disabled,readonly:_952.readonly}); +var _a94=jq.combo("options"); +return $.extend($.data(jq[0],"combobox").options,{width:_a94.width,height:_a94.height,originalValue:_a94.originalValue,disabled:_a94.disabled,readonly:_a94.readonly}); +},cloneFrom:function(jq,from){ +return jq.each(function(){ +$(this).combo("cloneFrom",from); +$.data(this,"combobox",$(from).data("combobox")); +$(this).addClass("combobox-f").attr("comboboxName",$(this).attr("textboxName")); +}); },getData:function(jq){ return $.data(jq[0],"combobox").data; -},setValues:function(jq,_953){ +},setValues:function(jq,_a95){ return jq.each(function(){ -_92d(this,_953); +_a61(this,_a95); }); -},setValue:function(jq,_954){ +},setValue:function(jq,_a96){ return jq.each(function(){ -_92d(this,[_954]); +_a61(this,$.isArray(_a96)?_a96:[_a96]); }); },clear:function(jq){ return jq.each(function(){ -$(this).combo("clear"); -var _955=$(this).combo("panel"); -_955.find("div.combobox-item-selected").removeClass("combobox-item-selected"); +_a61(this,[]); }); },reset:function(jq){ return jq.each(function(){ @@ -12385,56 +14175,106 @@ $(this).combobox("setValue",opts.originalValue); }); },loadData:function(jq,data){ return jq.each(function(){ -_937(this,data); +_a6d(this,data); }); },reload:function(jq,url){ return jq.each(function(){ -_93d(this,url); +if(typeof url=="string"){ +_a71(this,url); +}else{ +if(url){ +var opts=$(this).combobox("options"); +opts.queryParams=url; +} +_a71(this); +} +}); +},select:function(jq,_a97){ +return jq.each(function(){ +_a5c(this,_a97); }); -},select:function(jq,_956){ +},unselect:function(jq,_a98){ return jq.each(function(){ -_929(this,_956); +_a62(this,_a98); }); -},unselect:function(jq,_957){ +},scrollTo:function(jq,_a99){ return jq.each(function(){ -_92e(this,_957); +_a54(this,_a99); }); }}; -$.fn.combobox.parseOptions=function(_958){ -var t=$(_958); -return $.extend({},$.fn.combo.parseOptions(_958),$.parser.parseOptions(_958,["valueField","textField","groupField","mode","method","url"])); +$.fn.combobox.parseOptions=function(_a9a){ +var t=$(_a9a); +return $.extend({},$.fn.combo.parseOptions(_a9a),$.parser.parseOptions(_a9a,["valueField","textField","groupField","groupPosition","mode","method","url",{showItemIcon:"boolean",limitToList:"boolean"}])); }; -$.fn.combobox.parseData=function(_959){ +$.fn.combobox.parseData=function(_a9b){ var data=[]; -var opts=$(_959).combobox("options"); -$(_959).children().each(function(){ +var opts=$(_a9b).combobox("options"); +$(_a9b).children().each(function(){ if(this.tagName.toLowerCase()=="optgroup"){ -var _95a=$(this).attr("label"); +var _a9c=$(this).attr("label"); $(this).children().each(function(){ -_95b(this,_95a); +_a9d(this,_a9c); }); }else{ -_95b(this); +_a9d(this); } }); return data; -function _95b(el,_95c){ +function _a9d(el,_a9e){ var t=$(el); var row={}; row[opts.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text(); row[opts.textField]=t.text(); row["selected"]=t.is(":selected"); row["disabled"]=t.is(":disabled"); -if(_95c){ +if(_a9e){ opts.groupField=opts.groupField||"group"; -row[opts.groupField]=_95c; +row[opts.groupField]=_a9e; } data.push(row); }; }; -$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupField:null,groupFormatter:function(_95d){ -return _95d; -},mode:"local",method:"post",url:null,data:null,keyHandler:{up:function(e){ +var _a9f=0; +var _aa0={render:function(_aa1,_aa2,data){ +var _aa3=$.data(_aa1,"combobox"); +var opts=_aa3.options; +_a9f++; +_aa3.itemIdPrefix="_easyui_combobox_i"+_a9f; +_aa3.groupIdPrefix="_easyui_combobox_g"+_a9f; +_aa3.groups=[]; +var dd=[]; +var _aa4=undefined; +for(var i=0;i"); +dd.push(opts.groupFormatter?opts.groupFormatter.call(_aa1,g):g); +dd.push("
            "); +}else{ +_aa3.groups[_aa3.groups.length-1].count++; +} +}else{ +_aa4=undefined; +} +var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":""); +dd.push("
            "); +if(opts.showItemIcon&&row.iconCls){ +dd.push(""); +} +dd.push(opts.formatter?opts.formatter.call(_aa1,row):s); +dd.push("
            "); +} +$(_aa2).html(dd.join("")); +}}; +$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupPosition:"static",groupField:null,groupFormatter:function(_aa5){ +return _aa5; +},mode:"local",method:"post",url:null,data:null,queryParams:{},showItemIcon:false,limitToList:false,view:_aa0,keyHandler:{up:function(e){ nav(this,"prev"); e.preventDefault(); },down:function(e){ @@ -12443,154 +14283,234 @@ e.preventDefault(); },left:function(e){ },right:function(e){ },enter:function(e){ -_946(this); +_a7d(this); },query:function(q,e){ -_941(this,q); -}},filter:function(q,row){ +_a75(this,q); +}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _aa6=e.data.target; +var opts=$(_aa6).combobox("options"); +if(opts.reversed||opts.limitToList){ +if(opts.blurTimer){ +clearTimeout(opts.blurTimer); +} +opts.blurTimer=setTimeout(function(){ +var _aa7=$(_aa6).parent().length; +if(_aa7){ +if(opts.reversed){ +$(_aa6).combobox("setValues",$(_aa6).combobox("getValues")); +}else{ +if(opts.limitToList){ +_a7d(_aa6); +} +} +opts.blurTimer=null; +} +},50); +} +}}),panelEvents:{mouseover:_a85,mouseout:_a86,click:_a87,scroll:_a8a},filter:function(q,row){ var opts=$(this).combobox("options"); -return row[opts.textField].toLowerCase().indexOf(q.toLowerCase())==0; +return row[opts.textField].toLowerCase().indexOf(q.toLowerCase())>=0; },formatter:function(row){ var opts=$(this).combobox("options"); return row[opts.textField]; -},loader:function(_95e,_95f,_960){ +},loader:function(_aa8,_aa9,_aaa){ var opts=$(this).combobox("options"); if(!opts.url){ return false; } -$.ajax({type:opts.method,url:opts.url,data:_95e,dataType:"json",success:function(data){ -_95f(data); +$.ajax({type:opts.method,url:opts.url,data:_aa8,dataType:"json",success:function(data){ +_aa9(data); },error:function(){ -_960.apply(this,arguments); +_aaa.apply(this,arguments); }}); },loadFilter:function(data){ return data; -},finder:{getEl:function(_961,_962){ -var _963=_91d(_961,_962); -var id=$.data(_961,"combobox").itemIdPrefix+"_"+_963; +},finder:{getEl:function(_aab,_aac){ +var _aad=_a50(_aab,_aac); +var id=$.data(_aab,"combobox").itemIdPrefix+"_"+_aad; return $("#"+id); -},getRow:function(_964,p){ -var _965=$.data(_964,"combobox"); -var _966=(p instanceof jQuery)?p.attr("id").substr(_965.itemIdPrefix.length+1):_91d(_964,p); -return _965.data[parseInt(_966)]; -}},onBeforeLoad:function(_967){ -},onLoadSuccess:function(){ +},getGroupEl:function(_aae,_aaf){ +var _ab0=$.data(_aae,"combobox"); +var _ab1=$.easyui.indexOfArray(_ab0.groups,"value",_aaf); +var id=_ab0.groupIdPrefix+"_"+_ab1; +return $("#"+id); +},getGroup:function(_ab2,p){ +var _ab3=$.data(_ab2,"combobox"); +var _ab4=p.attr("id").substr(_ab3.groupIdPrefix.length+1); +return _ab3.groups[parseInt(_ab4)]; +},getRow:function(_ab5,p){ +var _ab6=$.data(_ab5,"combobox"); +var _ab7=(p instanceof $)?p.attr("id").substr(_ab6.itemIdPrefix.length+1):_a50(_ab5,p); +return _ab6.data[parseInt(_ab7)]; +}},onBeforeLoad:function(_ab8){ +},onLoadSuccess:function(data){ },onLoadError:function(){ -},onSelect:function(_968){ -},onUnselect:function(_969){ +},onSelect:function(_ab9){ +},onUnselect:function(_aba){ +},onClick:function(_abb){ }}); })(jQuery); (function($){ -function _96a(_96b){ -var _96c=$.data(_96b,"combotree"); -var opts=_96c.options; -var tree=_96c.tree; -$(_96b).addClass("combotree-f"); -$(_96b).combo(opts); -var _96d=$(_96b).combo("panel"); +function _abc(_abd){ +var _abe=$.data(_abd,"combotree"); +var opts=_abe.options; +var tree=_abe.tree; +$(_abd).addClass("combotree-f"); +$(_abd).combo($.extend({},opts,{onShowPanel:function(){ +if(opts.editable){ +tree.tree("doFilter",""); +} +opts.onShowPanel.call(this); +}})); +var _abf=$(_abd).combo("panel"); if(!tree){ -tree=$("
              ").appendTo(_96d); -$.data(_96b,"combotree").tree=tree; +tree=$("
                ").appendTo(_abf); +_abe.tree=tree; } tree.tree($.extend({},opts,{checkbox:opts.multiple,onLoadSuccess:function(node,data){ -var _96e=$(_96b).combotree("getValues"); +var _ac0=$(_abd).combotree("getValues"); if(opts.multiple){ -var _96f=tree.tree("getChecked"); -for(var i=0;i<_96f.length;i++){ -var id=_96f[i].id; -(function(){ -for(var i=0;i<_96e.length;i++){ -if(id==_96e[i]){ -return; -} -} -_96e.push(id); -})(); -} +$.map(tree.tree("getChecked"),function(node){ +$.easyui.addArrayItem(_ac0,node.id); +}); } -$(_96b).combotree("setValues",_96e); +_ac5(_abd,_ac0,_abe.remainText); opts.onLoadSuccess.call(this,node,data); },onClick:function(node){ if(opts.multiple){ $(this).tree(node.checked?"uncheck":"check",node.target); }else{ -$(_96b).combo("hidePanel"); +$(_abd).combo("hidePanel"); } -_971(_96b); +_abe.remainText=false; +_ac2(_abd); opts.onClick.call(this,node); -},onCheck:function(node,_970){ -_971(_96b); -opts.onCheck.call(this,node,_970); +},onCheck:function(node,_ac1){ +_abe.remainText=false; +_ac2(_abd); +opts.onCheck.call(this,node,_ac1); }})); }; -function _971(_972){ -var _973=$.data(_972,"combotree"); -var opts=_973.options; -var tree=_973.tree; -var vv=[],ss=[]; +function _ac2(_ac3){ +var _ac4=$.data(_ac3,"combotree"); +var opts=_ac4.options; +var tree=_ac4.tree; +var vv=[]; if(opts.multiple){ -var _974=tree.tree("getChecked"); -for(var i=0;i<_974.length;i++){ -vv.push(_974[i].id); -ss.push(_974[i].text); -} +vv=$.map(tree.tree("getChecked"),function(node){ +return node.id; +}); }else{ var node=tree.tree("getSelected"); if(node){ vv.push(node.id); -ss.push(node.text); } } -$(_972).combo("setValues",vv).combo("setText",ss.join(opts.separator)); +vv=vv.concat(opts.unselectedValues); +_ac5(_ac3,vv,_ac4.remainText); }; -function _975(_976,_977){ -var _978=$.data(_976,"combotree"); -var opts=_978.options; -var tree=_978.tree; -var _979=tree.tree("options"); -var _97a=_979.onCheck; -var _97b=_979.onSelect; -_979.onCheck=_979.onSelect=function(){ +function _ac5(_ac6,_ac7,_ac8){ +var _ac9=$.data(_ac6,"combotree"); +var opts=_ac9.options; +var tree=_ac9.tree; +var _aca=tree.tree("options"); +var _acb=_aca.onBeforeCheck; +var _acc=_aca.onCheck; +var _acd=_aca.onSelect; +_aca.onBeforeCheck=_aca.onCheck=_aca.onSelect=function(){ }; -tree.find("span.tree-checkbox").addClass("tree-checkbox0").removeClass("tree-checkbox1 tree-checkbox2"); -if(!$.isArray(_977)){ -_977=_977.split(opts.separator); +if(!$.isArray(_ac7)){ +_ac7=_ac7.split(opts.separator); } -for(var i=0;i<_977.length;i++){ -var node=tree.tree("find",_977[i]); +if(!opts.multiple){ +_ac7=_ac7.length?[_ac7[0]]:[""]; +} +var vv=$.map(_ac7,function(_ace){ +return String(_ace); +}); +tree.find("div.tree-node-selected").removeClass("tree-node-selected"); +$.map(tree.tree("getChecked"),function(node){ +if($.inArray(String(node.id),vv)==-1){ +tree.tree("uncheck",node.target); +} +}); +var ss=[]; +opts.unselectedValues=[]; +$.map(vv,function(v){ +var node=tree.tree("find",v); if(node){ -tree.tree("check",node.target); -tree.tree("select",node.target); +tree.tree("check",node.target).tree("select",node.target); +ss.push(_acf(node)); +}else{ +ss.push(_ad0(v,opts.mappingRows)||v); +opts.unselectedValues.push(v); +} +}); +if(opts.multiple){ +$.map(tree.tree("getChecked"),function(node){ +var id=String(node.id); +if($.inArray(id,vv)==-1){ +vv.push(id); +ss.push(_acf(node)); +} +}); +} +_aca.onBeforeCheck=_acb; +_aca.onCheck=_acc; +_aca.onSelect=_acd; +if(!_ac8){ +var s=ss.join(opts.separator); +if($(_ac6).combo("getText")!=s){ +$(_ac6).combo("setText",s); } } -_979.onCheck=_97a; -_979.onSelect=_97b; -_971(_976); +$(_ac6).combo("setValues",vv); +function _ad0(_ad1,a){ +var item=$.easyui.getArrayItem(a,"id",_ad1); +return item?_acf(item):undefined; +}; +function _acf(node){ +return node[opts.textField||""]||node.text; +}; }; -$.fn.combotree=function(_97c,_97d){ -if(typeof _97c=="string"){ -var _97e=$.fn.combotree.methods[_97c]; -if(_97e){ -return _97e(this,_97d); +function _ad2(_ad3,q){ +var _ad4=$.data(_ad3,"combotree"); +var opts=_ad4.options; +var tree=_ad4.tree; +_ad4.remainText=true; +tree.tree("doFilter",opts.multiple?q.split(opts.separator):q); +}; +function _ad5(_ad6){ +var _ad7=$.data(_ad6,"combotree"); +_ad7.remainText=false; +$(_ad6).combotree("setValues",$(_ad6).combotree("getValues")); +$(_ad6).combotree("hidePanel"); +}; +$.fn.combotree=function(_ad8,_ad9){ +if(typeof _ad8=="string"){ +var _ada=$.fn.combotree.methods[_ad8]; +if(_ada){ +return _ada(this,_ad9); }else{ -return this.combo(_97c,_97d); +return this.combo(_ad8,_ad9); } } -_97c=_97c||{}; +_ad8=_ad8||{}; return this.each(function(){ -var _97f=$.data(this,"combotree"); -if(_97f){ -$.extend(_97f.options,_97c); +var _adb=$.data(this,"combotree"); +if(_adb){ +$.extend(_adb.options,_ad8); }else{ -$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_97c)}); +$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_ad8)}); } -_96a(this); +_abc(this); }); }; $.fn.combotree.methods={options:function(jq){ -var _980=jq.combo("options"); -return $.extend($.data(jq[0],"combotree").options,{width:_980.width,height:_980.height,originalValue:_980.originalValue,disabled:_980.disabled,readonly:_980.readonly}); -},clone:function(jq,_981){ -var t=jq.combo("clone",_981); +var _adc=jq.combo("options"); +return $.extend($.data(jq[0],"combotree").options,{width:_adc.width,height:_adc.height,originalValue:_adc.originalValue,disabled:_adc.disabled,readonly:_adc.readonly}); +},clone:function(jq,_add){ +var t=jq.combo("clone",_add); t.data("combotree",{options:$.extend(true,{},jq.combotree("options")),tree:jq.combotree("tree")}); return t; },tree:function(jq){ @@ -12611,23 +14531,28 @@ opts.url=url; } tree.tree({url:opts.url}); }); -},setValues:function(jq,_982){ +},setValues:function(jq,_ade){ return jq.each(function(){ -_975(this,_982); +var opts=$(this).combotree("options"); +if($.isArray(_ade)){ +_ade=$.map(_ade,function(_adf){ +if(_adf&&typeof _adf=="object"){ +$.easyui.addArrayItem(opts.mappingRows,"id",_adf); +return _adf.id; +}else{ +return _adf; +} }); -},setValue:function(jq,_983){ +} +_ac5(this,_ade); +}); +},setValue:function(jq,_ae0){ return jq.each(function(){ -_975(this,[_983]); +$(this).combotree("setValues",$.isArray(_ae0)?_ae0:[_ae0]); }); },clear:function(jq){ return jq.each(function(){ -var tree=$.data(this,"combotree").tree; -tree.find("div.tree-node-selected").removeClass("tree-node-selected"); -var cc=tree.tree("getChecked"); -for(var i=0;i").appendTo(_98b); -_987.grid=grid; -} -grid.datagrid($.extend({},opts,{border:false,singleSelect:(!opts.multiple),onLoadSuccess:function(data){ -var _98c=$(_986).combo("getValues"); -var _98d=opts.onSelect; -opts.onSelect=function(){ -}; -_997(_986,_98c,_987.remainText); -opts.onSelect=_98d; -opts.onLoadSuccess.apply(_986,arguments); -},onClickRow:_98e,onSelect:function(_98f,row){ -_990(); -opts.onSelect.call(this,_98f,row); -},onUnselect:function(_991,row){ -_990(); -opts.onUnselect.call(this,_991,row); -},onSelectAll:function(rows){ -_990(); -opts.onSelectAll.call(this,rows); -},onUnselectAll:function(rows){ -if(opts.multiple){ -_990(); -} -opts.onUnselectAll.call(this,rows); -}})); -function _98e(_992,row){ -_987.remainText=false; -_990(); +grid=$("
                ").appendTo(_ae8); +_ae4.grid=grid; +} +grid.datagrid($.extend({},opts,{border:false,singleSelect:(!opts.multiple),onLoadSuccess:_ae9,onClickRow:_aea,onSelect:_aeb("onSelect"),onUnselect:_aeb("onUnselect"),onSelectAll:_aeb("onSelectAll"),onUnselectAll:_aeb("onUnselectAll")})); +function _aec(dg){ +return $(dg).closest(".combo-panel").panel("options").comboTarget||_ae3; +}; +function _ae9(data){ +var _aed=_aec(this); +var _aee=$(_aed).data("combogrid"); +var opts=_aee.options; +var _aef=$(_aed).combo("getValues"); +_af9(_aed,_aef,_aee.remainText); +opts.onLoadSuccess.call(this,data); +}; +function _aea(_af0,row){ +var _af1=_aec(this); +var _af2=$(_af1).data("combogrid"); +var opts=_af2.options; +_af2.remainText=false; +_af3.call(this); if(!opts.multiple){ -$(_986).combo("hidePanel"); +$(_af1).combo("hidePanel"); } -opts.onClickRow.call(this,_992,row); +opts.onClickRow.call(this,_af0,row); }; -function _990(){ -var rows=grid.datagrid("getSelections"); -var vv=[],ss=[]; -for(var i=0;i=_995){ -_996=0; +if(_afd>=_afc){ +_afd=0; } } -grid.datagrid("highlightRow",_996); +grid.datagrid("highlightRow",_afd); if(opts.selectOnNavigation){ -_994.remainText=false; -grid.datagrid("selectRow",_996); +_afb.remainText=false; +grid.datagrid("selectRow",_afd); } }; -function _997(_998,_999,_99a){ -var _99b=$.data(_998,"combogrid"); -var opts=_99b.options; -var grid=_99b.grid; -var rows=grid.datagrid("getRows"); -var ss=[]; -var _99c=$(_998).combo("getValues"); -var _99d=$(_998).combo("options"); -var _99e=_99d.onChange; -_99d.onChange=function(){ +function _af9(_afe,_aff,_b00){ +var _b01=$.data(_afe,"combogrid"); +var opts=_b01.options; +var grid=_b01.grid; +var _b02=$(_afe).combo("getValues"); +var _b03=$(_afe).combo("options"); +var _b04=_b03.onChange; +_b03.onChange=function(){ }; -grid.datagrid("clearSelections"); -if(!$.isArray(_999)){ -_999=_999.split(opts.separator); +var _b05=grid.datagrid("options"); +var _b06=_b05.onSelect; +var _b07=_b05.onUnselectAll; +_b05.onSelect=_b05.onUnselectAll=function(){ +}; +if(!$.isArray(_aff)){ +_aff=_aff.split(opts.separator); } -for(var i=0;i<_999.length;i++){ -var _99f=grid.datagrid("getRowIndex",_999[i]); -if(_99f>=0){ -grid.datagrid("selectRow",_99f); -ss.push(rows[_99f][opts.textField]); -}else{ -ss.push(_999[i]); +if(!opts.multiple){ +_aff=_aff.length?[_aff[0]]:[""]; } +var vv=$.map(_aff,function(_b08){ +return String(_b08); +}); +vv=$.grep(vv,function(v,_b09){ +return _b09===$.inArray(v,vv); +}); +var _b0a=$.grep(grid.datagrid("getSelections"),function(row,_b0b){ +return $.inArray(String(row[opts.idField]),vv)>=0; +}); +grid.datagrid("clearSelections"); +grid.data("datagrid").selectedRows=_b0a; +var ss=[]; +opts.unselectedValues=[]; +$.map(vv,function(v){ +var _b0c=grid.datagrid("getRowIndex",v); +if(_b0c>=0){ +grid.datagrid("selectRow",_b0c); +}else{ +opts.unselectedValues.push(v); } -$(_998).combo("setValues",_99c); -_99d.onChange=_99e; -$(_998).combo("setValues",_999); -if(!_99a){ +ss.push(_b0d(v,grid.datagrid("getRows"))||_b0d(v,_b0a)||_b0d(v,opts.mappingRows)||v); +}); +$(_afe).combo("setValues",_b02); +_b03.onChange=_b04; +_b05.onSelect=_b06; +_b05.onUnselectAll=_b07; +if(!_b00){ var s=ss.join(opts.separator); -if($(_998).combo("getText")!=s){ -$(_998).combo("setText",s); +if($(_afe).combo("getText")!=s){ +$(_afe).combo("setText",s); } } +$(_afe).combo("setValues",_aff); +function _b0d(_b0e,a){ +var item=$.easyui.getArrayItem(a,opts.idField,_b0e); +return item?item[opts.textField]:undefined; }; -function _9a0(_9a1,q){ -var _9a2=$.data(_9a1,"combogrid"); -var opts=_9a2.options; -var grid=_9a2.grid; -_9a2.remainText=true; -if(opts.multiple&&!q){ -_997(_9a1,[],true); -}else{ -_997(_9a1,[q],true); -} +}; +function _b0f(_b10,q){ +var _b11=$.data(_b10,"combogrid"); +var opts=_b11.options; +var grid=_b11.grid; +_b11.remainText=true; +var qq=opts.multiple?q.split(opts.separator):[q]; +qq=$.grep(qq,function(q){ +return $.trim(q)!=""; +}); if(opts.mode=="remote"){ -grid.datagrid("clearSelections"); +_b12(qq); grid.datagrid("load",$.extend({},opts.queryParams,{q:q})); }else{ -if(!q){ -return; -} -grid.datagrid("clearSelections").datagrid("highlightRow",-1); +grid.datagrid("highlightRow",-1); var rows=grid.datagrid("getRows"); -var qq=opts.multiple?q.split(opts.separator):[q]; +var vv=[]; $.map(qq,function(q){ q=$.trim(q); -if(q){ -$.map(rows,function(row,i){ -if(q==row[opts.textField]){ -grid.datagrid("selectRow",i); +var _b13=q; +_b14(opts.mappingRows,q); +_b14(grid.datagrid("getSelections"),q); +var _b15=_b14(rows,q); +if(_b15>=0){ +if(opts.reversed){ +grid.datagrid("highlightRow",_b15); +} }else{ -if(opts.filter.call(_9a1,q,row)){ +$.map(rows,function(row,i){ +if(opts.filter.call(_b10,q,row)){ grid.datagrid("highlightRow",i); } -} }); } }); +_b12(vv); +} +function _b14(rows,q){ +for(var i=0;i=0){ +$.easyui.addArrayItem(vv,v); +} +}); +$(_b17).combogrid("setValues",vv); if(!opts.multiple){ -$(_9a4).combogrid("hidePanel"); +$(_b17).combogrid("hidePanel"); } }; -$.fn.combogrid=function(_9a7,_9a8){ -if(typeof _9a7=="string"){ -var _9a9=$.fn.combogrid.methods[_9a7]; -if(_9a9){ -return _9a9(this,_9a8); +$.fn.combogrid=function(_b1a,_b1b){ +if(typeof _b1a=="string"){ +var _b1c=$.fn.combogrid.methods[_b1a]; +if(_b1c){ +return _b1c(this,_b1b); }else{ -return this.combo(_9a7,_9a8); +return this.combo(_b1a,_b1b); } } -_9a7=_9a7||{}; +_b1a=_b1a||{}; return this.each(function(){ -var _9aa=$.data(this,"combogrid"); -if(_9aa){ -$.extend(_9aa.options,_9a7); +var _b1d=$.data(this,"combogrid"); +if(_b1d){ +$.extend(_b1d.options,_b1a); }else{ -_9aa=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_9a7)}); +_b1d=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_b1a)}); } -_985(this); +_ae2(this); }); }; $.fn.combogrid.methods={options:function(jq){ -var _9ab=jq.combo("options"); -return $.extend($.data(jq[0],"combogrid").options,{width:_9ab.width,height:_9ab.height,originalValue:_9ab.originalValue,disabled:_9ab.disabled,readonly:_9ab.readonly}); +var _b1e=jq.combo("options"); +return $.extend($.data(jq[0],"combogrid").options,{width:_b1e.width,height:_b1e.height,originalValue:_b1e.originalValue,disabled:_b1e.disabled,readonly:_b1e.readonly}); +},cloneFrom:function(jq,from){ +return jq.each(function(){ +$(this).combo("cloneFrom",from); +$.data(this,"combogrid",{options:$.extend(true,{cloned:true},$(from).combogrid("options")),combo:$(this).next(),panel:$(from).combo("panel"),grid:$(from).combogrid("grid")}); +}); },grid:function(jq){ return $.data(jq[0],"combogrid").grid; -},setValues:function(jq,_9ac){ +},setValues:function(jq,_b1f){ return jq.each(function(){ -_997(this,_9ac); +var opts=$(this).combogrid("options"); +if($.isArray(_b1f)){ +_b1f=$.map(_b1f,function(_b20){ +if(_b20&&typeof _b20=="object"){ +$.easyui.addArrayItem(opts.mappingRows,opts.idField,_b20); +return _b20[opts.idField]; +}else{ +return _b20; +} }); -},setValue:function(jq,_9ad){ +} +_af9(this,_b1f); +}); +},setValue:function(jq,_b21){ return jq.each(function(){ -_997(this,[_9ad]); +$(this).combogrid("setValues",$.isArray(_b21)?_b21:[_b21]); }); },clear:function(jq){ return jq.each(function(){ -$(this).combogrid("grid").datagrid("clearSelections"); -$(this).combo("clear"); +$(this).combogrid("setValues",[]); }); },reset:function(jq){ return jq.each(function(){ @@ -12886,11 +14886,11 @@ $(this).combogrid("setValue",opts.originalValue); } }); }}; -$.fn.combogrid.parseOptions=function(_9ae){ -var t=$(_9ae); -return $.extend({},$.fn.combo.parseOptions(_9ae),$.fn.datagrid.parseOptions(_9ae),$.parser.parseOptions(_9ae,["idField","textField","mode"])); +$.fn.combogrid.parseOptions=function(_b22){ +var t=$(_b22); +return $.extend({},$.fn.combo.parseOptions(_b22),$.fn.datagrid.parseOptions(_b22),$.parser.parseOptions(_b22,["idField","textField","mode"])); }; -$.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{height:22,loadMsg:null,idField:null,textField:null,mode:"local",keyHandler:{up:function(e){ +$.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{loadMsg:null,idField:null,textField:null,unselectedValues:[],mappingRows:[],mode:"local",keyHandler:{up:function(e){ nav(this,"prev"); e.preventDefault(); },down:function(e){ @@ -12899,34 +14899,508 @@ e.preventDefault(); },left:function(e){ },right:function(e){ },enter:function(e){ -_9a3(this); +_b16(this); },query:function(q,e){ -_9a0(this,q); -}},filter:function(q,row){ +_b0f(this,q); +}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _b23=e.data.target; +var opts=$(_b23).combogrid("options"); +if(opts.reversed){ +$(_b23).combogrid("setValues",$(_b23).combogrid("getValues")); +} +}}),filter:function(q,row){ var opts=$(this).combogrid("options"); -return row[opts.textField].toLowerCase().indexOf(q.toLowerCase())==0; +return (row[opts.textField]||"").toLowerCase().indexOf(q.toLowerCase())>=0; +}}); +})(jQuery); +(function($){ +function _b24(_b25){ +var _b26=$.data(_b25,"combotreegrid"); +var opts=_b26.options; +$(_b25).addClass("combotreegrid-f").combo($.extend({},opts,{onShowPanel:function(){ +var p=$(this).combotreegrid("panel"); +var _b27=p.outerHeight()-p.height(); +var _b28=p._size("minHeight"); +var _b29=p._size("maxHeight"); +var dg=$(this).combotreegrid("grid"); +dg.treegrid("resize",{width:"100%",height:(isNaN(parseInt(opts.panelHeight))?"auto":"100%"),minHeight:(_b28?_b28-_b27:""),maxHeight:(_b29?_b29-_b27:"")}); +var row=dg.treegrid("getSelected"); +if(row){ +dg.treegrid("scrollTo",row[opts.idField]); +} +opts.onShowPanel.call(this); +}})); +if(!_b26.grid){ +var _b2a=$(_b25).combo("panel"); +_b26.grid=$("
                ").appendTo(_b2a); +} +_b26.grid.treegrid($.extend({},opts,{border:false,checkbox:opts.multiple,onLoadSuccess:function(row,data){ +var _b2b=$(_b25).combotreegrid("getValues"); +if(opts.multiple){ +$.map($(this).treegrid("getCheckedNodes"),function(row){ +$.easyui.addArrayItem(_b2b,row[opts.idField]); +}); +} +_b30(_b25,_b2b); +opts.onLoadSuccess.call(this,row,data); +_b26.remainText=false; +},onClickRow:function(row){ +if(opts.multiple){ +$(this).treegrid(row.checked?"uncheckNode":"checkNode",row[opts.idField]); +$(this).treegrid("unselect",row[opts.idField]); +}else{ +$(_b25).combo("hidePanel"); +} +_b2d(_b25); +opts.onClickRow.call(this,row); +},onCheckNode:function(row,_b2c){ +_b2d(_b25); +opts.onCheckNode.call(this,row,_b2c); +}})); +}; +function _b2d(_b2e){ +var _b2f=$.data(_b2e,"combotreegrid"); +var opts=_b2f.options; +var grid=_b2f.grid; +var vv=[]; +if(opts.multiple){ +vv=$.map(grid.treegrid("getCheckedNodes"),function(row){ +return row[opts.idField]; +}); +}else{ +var row=grid.treegrid("getSelected"); +if(row){ +vv.push(row[opts.idField]); +} +} +vv=vv.concat(opts.unselectedValues); +_b30(_b2e,vv); +}; +function _b30(_b31,_b32){ +var _b33=$.data(_b31,"combotreegrid"); +var opts=_b33.options; +var grid=_b33.grid; +if(!$.isArray(_b32)){ +_b32=_b32.split(opts.separator); +} +if(!opts.multiple){ +_b32=_b32.length?[_b32[0]]:[""]; +} +var vv=$.map(_b32,function(_b34){ +return String(_b34); +}); +vv=$.grep(vv,function(v,_b35){ +return _b35===$.inArray(v,vv); +}); +var _b36=grid.treegrid("getSelected"); +if(_b36){ +grid.treegrid("unselect",_b36[opts.idField]); +} +$.map(grid.treegrid("getCheckedNodes"),function(row){ +if($.inArray(String(row[opts.idField]),vv)==-1){ +grid.treegrid("uncheckNode",row[opts.idField]); +} +}); +var ss=[]; +opts.unselectedValues=[]; +$.map(vv,function(v){ +var row=grid.treegrid("find",v); +if(row){ +if(opts.multiple){ +grid.treegrid("checkNode",v); +}else{ +grid.treegrid("select",v); +} +ss.push(_b37(row)); +}else{ +ss.push(_b38(v,opts.mappingRows)||v); +opts.unselectedValues.push(v); +} +}); +if(opts.multiple){ +$.map(grid.treegrid("getCheckedNodes"),function(row){ +var id=String(row[opts.idField]); +if($.inArray(id,vv)==-1){ +vv.push(id); +ss.push(_b37(row)); +} +}); +} +if(!_b33.remainText){ +var s=ss.join(opts.separator); +if($(_b31).combo("getText")!=s){ +$(_b31).combo("setText",s); +} +} +$(_b31).combo("setValues",vv); +function _b38(_b39,a){ +var item=$.easyui.getArrayItem(a,opts.idField,_b39); +return item?_b37(item):undefined; +}; +function _b37(row){ +return row[opts.textField||""]||row[opts.treeField]; +}; +}; +function _b3a(_b3b,q){ +var _b3c=$.data(_b3b,"combotreegrid"); +var opts=_b3c.options; +var grid=_b3c.grid; +_b3c.remainText=true; +grid.treegrid("clearSelections").treegrid("clearChecked").treegrid("highlightRow",-1); +if(opts.mode=="remote"){ +$(_b3b).combotreegrid("clear"); +grid.treegrid("load",$.extend({},opts.queryParams,{q:q})); +}else{ +if(q){ +var data=grid.treegrid("getData"); +var vv=[]; +var qq=opts.multiple?q.split(opts.separator):[q]; +$.map(qq,function(q){ +q=$.trim(q); +if(q){ +var v=undefined; +$.easyui.forEach(data,true,function(row){ +if(q.toLowerCase()==String(row[opts.treeField]).toLowerCase()){ +v=row[opts.idField]; +return false; +}else{ +if(opts.filter.call(_b3b,q,row)){ +grid.treegrid("expandTo",row[opts.idField]); +grid.treegrid("highlightRow",row[opts.idField]); +return false; +} +} +}); +if(v==undefined){ +$.easyui.forEach(opts.mappingRows,false,function(row){ +if(q.toLowerCase()==String(row[opts.treeField])){ +v=row[opts.idField]; +return false; +} +}); +} +if(v!=undefined){ +vv.push(v); +} +} +}); +_b30(_b3b,vv); +_b3c.remainText=false; +} +} +}; +function _b3d(_b3e){ +_b2d(_b3e); +}; +$.fn.combotreegrid=function(_b3f,_b40){ +if(typeof _b3f=="string"){ +var _b41=$.fn.combotreegrid.methods[_b3f]; +if(_b41){ +return _b41(this,_b40); +}else{ +return this.combo(_b3f,_b40); +} +} +_b3f=_b3f||{}; +return this.each(function(){ +var _b42=$.data(this,"combotreegrid"); +if(_b42){ +$.extend(_b42.options,_b3f); +}else{ +_b42=$.data(this,"combotreegrid",{options:$.extend({},$.fn.combotreegrid.defaults,$.fn.combotreegrid.parseOptions(this),_b3f)}); +} +_b24(this); +}); +}; +$.fn.combotreegrid.methods={options:function(jq){ +var _b43=jq.combo("options"); +return $.extend($.data(jq[0],"combotreegrid").options,{width:_b43.width,height:_b43.height,originalValue:_b43.originalValue,disabled:_b43.disabled,readonly:_b43.readonly}); +},grid:function(jq){ +return $.data(jq[0],"combotreegrid").grid; +},setValues:function(jq,_b44){ +return jq.each(function(){ +var opts=$(this).combotreegrid("options"); +if($.isArray(_b44)){ +_b44=$.map(_b44,function(_b45){ +if(_b45&&typeof _b45=="object"){ +$.easyui.addArrayItem(opts.mappingRows,opts.idField,_b45); +return _b45[opts.idField]; +}else{ +return _b45; +} +}); +} +_b30(this,_b44); +}); +},setValue:function(jq,_b46){ +return jq.each(function(){ +$(this).combotreegrid("setValues",$.isArray(_b46)?_b46:[_b46]); +}); +},clear:function(jq){ +return jq.each(function(){ +$(this).combotreegrid("setValues",[]); +}); +},reset:function(jq){ +return jq.each(function(){ +var opts=$(this).combotreegrid("options"); +if(opts.multiple){ +$(this).combotreegrid("setValues",opts.originalValue); +}else{ +$(this).combotreegrid("setValue",opts.originalValue); +} +}); +}}; +$.fn.combotreegrid.parseOptions=function(_b47){ +var t=$(_b47); +return $.extend({},$.fn.combo.parseOptions(_b47),$.fn.treegrid.parseOptions(_b47),$.parser.parseOptions(_b47,["mode",{limitToGrid:"boolean"}])); +}; +$.fn.combotreegrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.treegrid.defaults,{editable:false,singleSelect:true,limitToGrid:false,unselectedValues:[],mappingRows:[],mode:"local",textField:null,keyHandler:{up:function(e){ +},down:function(e){ +},left:function(e){ +},right:function(e){ +},enter:function(e){ +_b3d(this); +},query:function(q,e){ +_b3a(this,q); +}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _b48=e.data.target; +var opts=$(_b48).combotreegrid("options"); +if(opts.limitToGrid){ +_b3d(_b48); +} +}}),filter:function(q,row){ +var opts=$(this).combotreegrid("options"); +return (row[opts.treeField]||"").toLowerCase().indexOf(q.toLowerCase())>=0; }}); })(jQuery); (function($){ -function _9af(_9b0){ -var _9b1=$.data(_9b0,"datebox"); -var opts=_9b1.options; -$(_9b0).addClass("datebox-f").combo($.extend({},opts,{onShowPanel:function(){ -_9b2(this); -_9b3(this); -_9b4(this); -_9c2(this,$(this).datebox("getText"),true); +function _b49(_b4a){ +var _b4b=$.data(_b4a,"tagbox"); +var opts=_b4b.options; +$(_b4a).addClass("tagbox-f").combobox($.extend({},opts,{cls:"tagbox",reversed:true,onChange:function(_b4c,_b4d){ +_b4e(); +$(this).combobox("hidePanel"); +opts.onChange.call(_b4a,_b4c,_b4d); +},onResizing:function(_b4f,_b50){ +var _b51=$(this).combobox("textbox"); +var tb=$(this).data("textbox").textbox; +tb.css({height:"",paddingLeft:_b51.css("marginLeft"),paddingRight:_b51.css("marginRight")}); +_b51.css("margin",0); +tb._size({width:opts.width},$(this).parent()); +_b64(_b4a); +_b56(this); +opts.onResizing.call(_b4a,_b4f,_b50); +},onLoadSuccess:function(data){ +_b4e(); +opts.onLoadSuccess.call(_b4a,data); +}})); +_b4e(); +_b64(_b4a); +function _b4e(){ +$(_b4a).next().find(".tagbox-label").remove(); +var _b52=$(_b4a).tagbox("textbox"); +var ss=[]; +$.map($(_b4a).tagbox("getValues"),function(_b53,_b54){ +var row=opts.finder.getRow(_b4a,_b53); +var text=opts.tagFormatter.call(_b4a,_b53,row); +var cs={}; +var css=opts.tagStyler.call(_b4a,_b53,row)||""; +if(typeof css=="string"){ +cs={s:css}; +}else{ +cs={c:css["class"]||"",s:css["style"]||""}; +} +var _b55=$("").insertBefore(_b52).html(text); +_b55.attr("tagbox-index",_b54); +_b55.attr("style",cs.s).addClass(cs.c); +$("").appendTo(_b55); +}); +_b56(_b4a); +$(_b4a).combobox("setText",""); +}; +}; +function _b56(_b57,_b58){ +var span=$(_b57).next(); +var _b59=_b58?$(_b58):span.find(".tagbox-label"); +if(_b59.length){ +var _b5a=$(_b57).tagbox("textbox"); +var _b5b=$(_b59[0]); +var _b5c=_b5b.outerHeight(true)-_b5b.outerHeight(); +var _b5d=_b5a.outerHeight()-_b5c*2; +_b59.css({height:_b5d+"px",lineHeight:_b5d+"px"}); +var _b5e=span.find(".textbox-addon").css("height","100%"); +_b5e.find(".textbox-icon").css("height","100%"); +span.find(".textbox-button").linkbutton("resize",{height:"100%"}); +} +}; +function _b5f(_b60){ +var span=$(_b60).next(); +span.unbind(".tagbox").bind("click.tagbox",function(e){ +var opts=$(_b60).tagbox("options"); +if(opts.disabled||opts.readonly){ +return; +} +if($(e.target).hasClass("tagbox-remove")){ +var _b61=parseInt($(e.target).parent().attr("tagbox-index")); +var _b62=$(_b60).tagbox("getValues"); +if(opts.onBeforeRemoveTag.call(_b60,_b62[_b61])==false){ +return; +} +opts.onRemoveTag.call(_b60,_b62[_b61]); +_b62.splice(_b61,1); +$(_b60).tagbox("setValues",_b62); +}else{ +var _b63=$(e.target).closest(".tagbox-label"); +if(_b63.length){ +var _b61=parseInt(_b63.attr("tagbox-index")); +var _b62=$(_b60).tagbox("getValues"); +opts.onClickTag.call(_b60,_b62[_b61]); +} +} +$(this).find(".textbox-text").focus(); +}).bind("keyup.tagbox",function(e){ +_b64(_b60); +}).bind("mouseover.tagbox",function(e){ +if($(e.target).closest(".textbox-button,.textbox-addon,.tagbox-label").length){ +$(this).triggerHandler("mouseleave"); +}else{ +$(this).find(".textbox-text").triggerHandler("mouseenter"); +} +}).bind("mouseleave.tagbox",function(e){ +$(this).find(".textbox-text").triggerHandler("mouseleave"); +}); +}; +function _b64(_b65){ +var opts=$(_b65).tagbox("options"); +var _b66=$(_b65).tagbox("textbox"); +var span=$(_b65).next(); +var tmp=$("").appendTo("body"); +tmp.attr("style",_b66.attr("style")); +tmp.css({position:"absolute",top:-9999,left:-9999,width:"auto",fontFamily:_b66.css("fontFamily"),fontSize:_b66.css("fontSize"),fontWeight:_b66.css("fontWeight"),whiteSpace:"nowrap"}); +var _b67=_b68(_b66.val()); +var _b69=_b68(opts.prompt||""); +tmp.remove(); +var _b6a=Math.min(Math.max(_b67,_b69)+20,span.width()); +_b66._outerWidth(_b6a); +span.find(".textbox-button").linkbutton("resize",{height:"100%"}); +function _b68(val){ +var s=val.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">"); +tmp.html(s); +return tmp.outerWidth(); +}; +}; +function _b6b(_b6c){ +var t=$(_b6c); +var opts=t.tagbox("options"); +if(opts.limitToList){ +var _b6d=t.tagbox("panel"); +var item=_b6d.children("div.combobox-item-hover"); +if(item.length){ +item.removeClass("combobox-item-hover"); +var row=opts.finder.getRow(_b6c,item); +var _b6e=row[opts.valueField]; +$(_b6c).tagbox(item.hasClass("combobox-item-selected")?"unselect":"select",_b6e); +} +$(_b6c).tagbox("hidePanel"); +}else{ +var v=$.trim($(_b6c).tagbox("getText")); +if(v!==""){ +var _b6f=$(_b6c).tagbox("getValues"); +_b6f.push(v); +$(_b6c).tagbox("setValues",_b6f); +} +} +}; +function _b70(_b71,_b72){ +$(_b71).combobox("setText",""); +_b64(_b71); +$(_b71).combobox("setValues",_b72); +$(_b71).combobox("setText",""); +$(_b71).tagbox("validate"); +}; +$.fn.tagbox=function(_b73,_b74){ +if(typeof _b73=="string"){ +var _b75=$.fn.tagbox.methods[_b73]; +if(_b75){ +return _b75(this,_b74); +}else{ +return this.combobox(_b73,_b74); +} +} +_b73=_b73||{}; +return this.each(function(){ +var _b76=$.data(this,"tagbox"); +if(_b76){ +$.extend(_b76.options,_b73); +}else{ +$.data(this,"tagbox",{options:$.extend({},$.fn.tagbox.defaults,$.fn.tagbox.parseOptions(this),_b73)}); +} +_b49(this); +_b5f(this); +}); +}; +$.fn.tagbox.methods={options:function(jq){ +var _b77=jq.combobox("options"); +return $.extend($.data(jq[0],"tagbox").options,{width:_b77.width,height:_b77.height,originalValue:_b77.originalValue,disabled:_b77.disabled,readonly:_b77.readonly}); +},setValues:function(jq,_b78){ +return jq.each(function(){ +_b70(this,_b78); +}); +}}; +$.fn.tagbox.parseOptions=function(_b79){ +return $.extend({},$.fn.combobox.parseOptions(_b79),$.parser.parseOptions(_b79,[])); +}; +$.fn.tagbox.defaults=$.extend({},$.fn.combobox.defaults,{hasDownArrow:false,multiple:true,reversed:true,selectOnNavigation:false,tipOptions:$.extend({},$.fn.textbox.defaults.tipOptions,{showDelay:200}),val:function(_b7a){ +var vv=$(_b7a).parent().prev().tagbox("getValues"); +if($(_b7a).is(":focus")){ +vv.push($(_b7a).val()); +} +return vv.join(","); +},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _b7b=e.data.target; +var opts=$(_b7b).tagbox("options"); +if(opts.limitToList){ +_b6b(_b7b); +} +}}),keyHandler:$.extend({},$.fn.combobox.defaults.keyHandler,{enter:function(e){ +_b6b(this); +},query:function(q,e){ +var opts=$(this).tagbox("options"); +if(opts.limitToList){ +$.fn.combobox.defaults.keyHandler.query.call(this,q,e); +}else{ +$(this).combobox("hidePanel"); +} +}}),tagFormatter:function(_b7c,row){ +var opts=$(this).tagbox("options"); +return row?row[opts.textField]:_b7c; +},tagStyler:function(_b7d,row){ +return ""; +},onClickTag:function(_b7e){ +},onBeforeRemoveTag:function(_b7f){ +},onRemoveTag:function(_b80){ +}}); +})(jQuery); +(function($){ +function _b81(_b82){ +var _b83=$.data(_b82,"datebox"); +var opts=_b83.options; +$(_b82).addClass("datebox-f").combo($.extend({},opts,{onShowPanel:function(){ +_b84(this); +_b85(this); +_b86(this); +_b94(this,$(this).datebox("getText"),true); opts.onShowPanel.call(this); }})); -if(!_9b1.calendar){ -var _9b5=$(_9b0).combo("panel").css("overflow","hidden"); -_9b5.panel("options").onBeforeDestroy=function(){ +if(!_b83.calendar){ +var _b87=$(_b82).combo("panel").css("overflow","hidden"); +_b87.panel("options").onBeforeDestroy=function(){ var c=$(this).find(".calendar-shared"); if(c.length){ c.insertBefore(c[0].pholder); } }; -var cc=$("
                ").prependTo(_9b5); +var cc=$("
                ").prependTo(_b87); if(opts.sharedCalendar){ var c=$(opts.sharedCalendar); if(!c[0].pholder){ @@ -12936,111 +15410,110 @@ c.addClass("calendar-shared").appendTo(cc); if(!c.hasClass("calendar")){ c.calendar(); } -_9b1.calendar=c; +_b83.calendar=c; }else{ -_9b1.calendar=$("
                ").appendTo(cc).calendar(); +_b83.calendar=$("
                ").appendTo(cc).calendar(); } -$.extend(_9b1.calendar.calendar("options"),{fit:true,border:false,onSelect:function(date){ -var _9b6=this.target; -var opts=$(_9b6).datebox("options"); -_9c2(_9b6,opts.formatter.call(_9b6,date)); -$(_9b6).combo("hidePanel"); -opts.onSelect.call(_9b6,date); +$.extend(_b83.calendar.calendar("options"),{fit:true,border:false,onSelect:function(date){ +var _b88=this.target; +var opts=$(_b88).datebox("options"); +_b94(_b88,opts.formatter.call(_b88,date)); +$(_b88).combo("hidePanel"); +opts.onSelect.call(_b88,date); }}); } -$(_9b0).combo("textbox").parent().addClass("datebox"); -$(_9b0).datebox("initValue",opts.value); -function _9b2(_9b7){ -var opts=$(_9b7).datebox("options"); -var _9b8=$(_9b7).combo("panel"); -_9b8.unbind(".datebox").bind("click.datebox",function(e){ +$(_b82).combo("textbox").parent().addClass("datebox"); +$(_b82).datebox("initValue",opts.value); +function _b84(_b89){ +var opts=$(_b89).datebox("options"); +var _b8a=$(_b89).combo("panel"); +_b8a.unbind(".datebox").bind("click.datebox",function(e){ if($(e.target).hasClass("datebox-button-a")){ -var _9b9=parseInt($(e.target).attr("datebox-button-index")); -opts.buttons[_9b9].handler.call(e.target,_9b7); +var _b8b=parseInt($(e.target).attr("datebox-button-index")); +opts.buttons[_b8b].handler.call(e.target,_b89); } }); }; -function _9b3(_9ba){ -var _9bb=$(_9ba).combo("panel"); -if(_9bb.children("div.datebox-button").length){ +function _b85(_b8c){ +var _b8d=$(_b8c).combo("panel"); +if(_b8d.children("div.datebox-button").length){ return; } -var _9bc=$("
                ").appendTo(_9bb); -var tr=_9bc.find("tr"); +var _b8e=$("
                ").appendTo(_b8d); +var tr=_b8e.find("tr"); for(var i=0;i").appendTo(tr); var btn=opts.buttons[i]; -var t=$("").html($.isFunction(btn.text)?btn.text(_9ba):btn.text).appendTo(td); +var t=$("").html($.isFunction(btn.text)?btn.text(_b8c):btn.text).appendTo(td); t.attr("datebox-button-index",i); } tr.find("td").css("width",(100/opts.buttons.length)+"%"); }; -function _9b4(_9bd){ -var _9be=$(_9bd).combo("panel"); -var cc=_9be.children("div.datebox-calendar-inner"); -_9be.children()._outerWidth(_9be.width()); -_9b1.calendar.appendTo(cc); -_9b1.calendar[0].target=_9bd; +function _b86(_b8f){ +var _b90=$(_b8f).combo("panel"); +var cc=_b90.children("div.datebox-calendar-inner"); +_b90.children()._outerWidth(_b90.width()); +_b83.calendar.appendTo(cc); +_b83.calendar[0].target=_b8f; if(opts.panelHeight!="auto"){ -var _9bf=_9be.height(); -_9be.children().not(cc).each(function(){ -_9bf-=$(this).outerHeight(); +var _b91=_b90.height(); +_b90.children().not(cc).each(function(){ +_b91-=$(this).outerHeight(); }); -cc._outerHeight(_9bf); +cc._outerHeight(_b91); } -_9b1.calendar.calendar("resize"); +_b83.calendar.calendar("resize"); }; }; -function _9c0(_9c1,q){ -_9c2(_9c1,q,true); +function _b92(_b93,q){ +_b94(_b93,q,true); }; -function _9c3(_9c4){ -var _9c5=$.data(_9c4,"datebox"); -var opts=_9c5.options; -var _9c6=_9c5.calendar.calendar("options").current; -if(_9c6){ -_9c2(_9c4,opts.formatter.call(_9c4,_9c6)); -$(_9c4).combo("hidePanel"); +function _b95(_b96){ +var _b97=$.data(_b96,"datebox"); +var opts=_b97.options; +var _b98=_b97.calendar.calendar("options").current; +if(_b98){ +_b94(_b96,opts.formatter.call(_b96,_b98)); +$(_b96).combo("hidePanel"); } }; -function _9c2(_9c7,_9c8,_9c9){ -var _9ca=$.data(_9c7,"datebox"); -var opts=_9ca.options; -var _9cb=_9ca.calendar; -$(_9c7).combo("setValue",_9c8); -_9cb.calendar("moveTo",opts.parser.call(_9c7,_9c8)); -if(!_9c9){ -if(_9c8){ -_9c8=opts.formatter.call(_9c7,_9cb.calendar("options").current); -$(_9c7).combo("setValue",_9c8).combo("setText",_9c8); +function _b94(_b99,_b9a,_b9b){ +var _b9c=$.data(_b99,"datebox"); +var opts=_b9c.options; +var _b9d=_b9c.calendar; +_b9d.calendar("moveTo",opts.parser.call(_b99,_b9a)); +if(_b9b){ +$(_b99).combo("setValue",_b9a); }else{ -$(_9c7).combo("setText",_9c8); +if(_b9a){ +_b9a=opts.formatter.call(_b99,_b9d.calendar("options").current); } +$(_b99).combo("setText",_b9a).combo("setValue",_b9a); } }; -$.fn.datebox=function(_9cc,_9cd){ -if(typeof _9cc=="string"){ -var _9ce=$.fn.datebox.methods[_9cc]; -if(_9ce){ -return _9ce(this,_9cd); +$.fn.datebox=function(_b9e,_b9f){ +if(typeof _b9e=="string"){ +var _ba0=$.fn.datebox.methods[_b9e]; +if(_ba0){ +return _ba0(this,_b9f); }else{ -return this.combo(_9cc,_9cd); +return this.combo(_b9e,_b9f); } } -_9cc=_9cc||{}; +_b9e=_b9e||{}; return this.each(function(){ -var _9cf=$.data(this,"datebox"); -if(_9cf){ -$.extend(_9cf.options,_9cc); +var _ba1=$.data(this,"datebox"); +if(_ba1){ +$.extend(_ba1.options,_b9e); }else{ -$.data(this,"datebox",{options:$.extend({},$.fn.datebox.defaults,$.fn.datebox.parseOptions(this),_9cc)}); +$.data(this,"datebox",{options:$.extend({},$.fn.datebox.defaults,$.fn.datebox.parseOptions(this),_b9e)}); } -_9af(this); +_b81(this); }); }; $.fn.datebox.methods={options:function(jq){ -var _9d0=jq.combo("options"); -return $.extend($.data(jq[0],"datebox").options,{width:_9d0.width,height:_9d0.height,originalValue:_9d0.originalValue,disabled:_9d0.disabled,readonly:_9d0.readonly}); +var _ba2=jq.combo("options"); +return $.extend($.data(jq[0],"datebox").options,{width:_ba2.width,height:_ba2.height,originalValue:_ba2.originalValue,disabled:_ba2.disabled,readonly:_ba2.readonly}); },cloneFrom:function(jq,from){ return jq.each(function(){ $(this).combo("cloneFrom",from); @@ -13049,18 +15522,18 @@ $(this).addClass("datebox-f"); }); },calendar:function(jq){ return $.data(jq[0],"datebox").calendar; -},initValue:function(jq,_9d1){ +},initValue:function(jq,_ba3){ return jq.each(function(){ var opts=$(this).datebox("options"); -var _9d2=opts.value; -if(_9d2){ -_9d2=opts.formatter.call(this,opts.parser.call(this,_9d2)); +var _ba4=opts.value; +if(_ba4){ +_ba4=opts.formatter.call(this,opts.parser.call(this,_ba4)); } -$(this).combo("initValue",_9d2).combo("setText",_9d2); +$(this).combo("initValue",_ba4).combo("setText",_ba4); }); -},setValue:function(jq,_9d3){ +},setValue:function(jq,_ba5){ return jq.each(function(){ -_9c2(this,_9d3); +_b94(this,_ba5); }); },reset:function(jq){ return jq.each(function(){ @@ -13068,25 +15541,26 @@ var opts=$(this).datebox("options"); $(this).datebox("setValue",opts.originalValue); }); }}; -$.fn.datebox.parseOptions=function(_9d4){ -return $.extend({},$.fn.combo.parseOptions(_9d4),$.parser.parseOptions(_9d4,["sharedCalendar"])); +$.fn.datebox.parseOptions=function(_ba6){ +return $.extend({},$.fn.combo.parseOptions(_ba6),$.parser.parseOptions(_ba6,["sharedCalendar"])); }; $.fn.datebox.defaults=$.extend({},$.fn.combo.defaults,{panelWidth:180,panelHeight:"auto",sharedCalendar:null,keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ -_9c3(this); +_b95(this); },query:function(q,e){ -_9c0(this,q); -}},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_9d5){ -return $(_9d5).datebox("options").currentText; -},handler:function(_9d6){ -$(_9d6).datebox("calendar").calendar({year:new Date().getFullYear(),month:new Date().getMonth()+1,current:new Date()}); -_9c3(_9d6); -}},{text:function(_9d7){ -return $(_9d7).datebox("options").closeText; -},handler:function(_9d8){ +_b92(this,q); +}},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_ba7){ +return $(_ba7).datebox("options").currentText; +},handler:function(_ba8){ +var now=new Date(); +$(_ba8).datebox("calendar").calendar({year:now.getFullYear(),month:now.getMonth()+1,current:new Date(now.getFullYear(),now.getMonth(),now.getDate())}); +_b95(_ba8); +}},{text:function(_ba9){ +return $(_ba9).datebox("options").closeText; +},handler:function(_baa){ $(this).closest("div.combo-panel").panel("close"); }}],formatter:function(date){ var y=date.getFullYear(); @@ -13110,90 +15584,90 @@ return new Date(); }}); })(jQuery); (function($){ -function _9d9(_9da){ -var _9db=$.data(_9da,"datetimebox"); -var opts=_9db.options; -$(_9da).datebox($.extend({},opts,{onShowPanel:function(){ -var _9dc=$(this).datetimebox("getValue"); -_9e2(this,_9dc,true); +function _bab(_bac){ +var _bad=$.data(_bac,"datetimebox"); +var opts=_bad.options; +$(_bac).datebox($.extend({},opts,{onShowPanel:function(){ +var _bae=$(this).datetimebox("getValue"); +_bb4(this,_bae,true); opts.onShowPanel.call(this); },formatter:$.fn.datebox.defaults.formatter,parser:$.fn.datebox.defaults.parser})); -$(_9da).removeClass("datebox-f").addClass("datetimebox-f"); -$(_9da).datebox("calendar").calendar({onSelect:function(date){ +$(_bac).removeClass("datebox-f").addClass("datetimebox-f"); +$(_bac).datebox("calendar").calendar({onSelect:function(date){ opts.onSelect.call(this.target,date); }}); -if(!_9db.spinner){ -var _9dd=$(_9da).datebox("panel"); -var p=$("
                ").insertAfter(_9dd.children("div.datebox-calendar-inner")); -_9db.spinner=p.children("input"); +if(!_bad.spinner){ +var _baf=$(_bac).datebox("panel"); +var p=$("
                ").insertAfter(_baf.children("div.datebox-calendar-inner")); +_bad.spinner=p.children("input"); } -_9db.spinner.timespinner({width:opts.spinnerWidth,showSeconds:opts.showSeconds,separator:opts.timeSeparator}); -$(_9da).datetimebox("initValue",opts.value); +_bad.spinner.timespinner({width:opts.spinnerWidth,showSeconds:opts.showSeconds,separator:opts.timeSeparator}); +$(_bac).datetimebox("initValue",opts.value); }; -function _9de(_9df){ -var c=$(_9df).datetimebox("calendar"); -var t=$(_9df).datetimebox("spinner"); +function _bb0(_bb1){ +var c=$(_bb1).datetimebox("calendar"); +var t=$(_bb1).datetimebox("spinner"); var date=c.calendar("options").current; return new Date(date.getFullYear(),date.getMonth(),date.getDate(),t.timespinner("getHours"),t.timespinner("getMinutes"),t.timespinner("getSeconds")); }; -function _9e0(_9e1,q){ -_9e2(_9e1,q,true); +function _bb2(_bb3,q){ +_bb4(_bb3,q,true); }; -function _9e3(_9e4){ -var opts=$.data(_9e4,"datetimebox").options; -var date=_9de(_9e4); -_9e2(_9e4,opts.formatter.call(_9e4,date)); -$(_9e4).combo("hidePanel"); +function _bb5(_bb6){ +var opts=$.data(_bb6,"datetimebox").options; +var date=_bb0(_bb6); +_bb4(_bb6,opts.formatter.call(_bb6,date)); +$(_bb6).combo("hidePanel"); }; -function _9e2(_9e5,_9e6,_9e7){ -var opts=$.data(_9e5,"datetimebox").options; -$(_9e5).combo("setValue",_9e6); -if(!_9e7){ -if(_9e6){ -var date=opts.parser.call(_9e5,_9e6); -$(_9e5).combo("setValue",opts.formatter.call(_9e5,date)); -$(_9e5).combo("setText",opts.formatter.call(_9e5,date)); +function _bb4(_bb7,_bb8,_bb9){ +var opts=$.data(_bb7,"datetimebox").options; +$(_bb7).combo("setValue",_bb8); +if(!_bb9){ +if(_bb8){ +var date=opts.parser.call(_bb7,_bb8); +$(_bb7).combo("setText",opts.formatter.call(_bb7,date)); +$(_bb7).combo("setValue",opts.formatter.call(_bb7,date)); }else{ -$(_9e5).combo("setText",_9e6); +$(_bb7).combo("setText",_bb8); } } -var date=opts.parser.call(_9e5,_9e6); -$(_9e5).datetimebox("calendar").calendar("moveTo",date); -$(_9e5).datetimebox("spinner").timespinner("setValue",_9e8(date)); -function _9e8(date){ -function _9e9(_9ea){ -return (_9ea<10?"0":"")+_9ea; +var date=opts.parser.call(_bb7,_bb8); +$(_bb7).datetimebox("calendar").calendar("moveTo",date); +$(_bb7).datetimebox("spinner").timespinner("setValue",_bba(date)); +function _bba(date){ +function _bbb(_bbc){ +return (_bbc<10?"0":"")+_bbc; }; -var tt=[_9e9(date.getHours()),_9e9(date.getMinutes())]; +var tt=[_bbb(date.getHours()),_bbb(date.getMinutes())]; if(opts.showSeconds){ -tt.push(_9e9(date.getSeconds())); +tt.push(_bbb(date.getSeconds())); } -return tt.join($(_9e5).datetimebox("spinner").timespinner("options").separator); +return tt.join($(_bb7).datetimebox("spinner").timespinner("options").separator); }; }; -$.fn.datetimebox=function(_9eb,_9ec){ -if(typeof _9eb=="string"){ -var _9ed=$.fn.datetimebox.methods[_9eb]; -if(_9ed){ -return _9ed(this,_9ec); +$.fn.datetimebox=function(_bbd,_bbe){ +if(typeof _bbd=="string"){ +var _bbf=$.fn.datetimebox.methods[_bbd]; +if(_bbf){ +return _bbf(this,_bbe); }else{ -return this.datebox(_9eb,_9ec); +return this.datebox(_bbd,_bbe); } } -_9eb=_9eb||{}; +_bbd=_bbd||{}; return this.each(function(){ -var _9ee=$.data(this,"datetimebox"); -if(_9ee){ -$.extend(_9ee.options,_9eb); +var _bc0=$.data(this,"datetimebox"); +if(_bc0){ +$.extend(_bc0.options,_bbd); }else{ -$.data(this,"datetimebox",{options:$.extend({},$.fn.datetimebox.defaults,$.fn.datetimebox.parseOptions(this),_9eb)}); +$.data(this,"datetimebox",{options:$.extend({},$.fn.datetimebox.defaults,$.fn.datetimebox.parseOptions(this),_bbd)}); } -_9d9(this); +_bab(this); }); }; $.fn.datetimebox.methods={options:function(jq){ -var _9ef=jq.datebox("options"); -return $.extend($.data(jq[0],"datetimebox").options,{originalValue:_9ef.originalValue,disabled:_9ef.disabled,readonly:_9ef.readonly}); +var _bc1=jq.datebox("options"); +return $.extend($.data(jq[0],"datetimebox").options,{originalValue:_bc1.originalValue,disabled:_bc1.disabled,readonly:_bc1.readonly}); },cloneFrom:function(jq,from){ return jq.each(function(){ $(this).datebox("cloneFrom",from); @@ -13202,18 +15676,18 @@ $(this).removeClass("datebox-f").addClass("datetimebox-f"); }); },spinner:function(jq){ return $.data(jq[0],"datetimebox").spinner; -},initValue:function(jq,_9f0){ +},initValue:function(jq,_bc2){ return jq.each(function(){ var opts=$(this).datetimebox("options"); -var _9f1=opts.value; -if(_9f1){ -_9f1=opts.formatter.call(this,opts.parser.call(this,_9f1)); +var _bc3=opts.value; +if(_bc3){ +_bc3=opts.formatter.call(this,opts.parser.call(this,_bc3)); } -$(this).combo("initValue",_9f1).combo("setText",_9f1); +$(this).combo("initValue",_bc3).combo("setText",_bc3); }); -},setValue:function(jq,_9f2){ +},setValue:function(jq,_bc4){ return jq.each(function(){ -_9e2(this,_9f2); +_bb4(this,_bc4); }); },reset:function(jq){ return jq.each(function(){ @@ -13221,43 +15695,43 @@ var opts=$(this).datetimebox("options"); $(this).datetimebox("setValue",opts.originalValue); }); }}; -$.fn.datetimebox.parseOptions=function(_9f3){ -var t=$(_9f3); -return $.extend({},$.fn.datebox.parseOptions(_9f3),$.parser.parseOptions(_9f3,["timeSeparator","spinnerWidth",{showSeconds:"boolean"}])); +$.fn.datetimebox.parseOptions=function(_bc5){ +var t=$(_bc5); +return $.extend({},$.fn.datebox.parseOptions(_bc5),$.parser.parseOptions(_bc5,["timeSeparator","spinnerWidth",{showSeconds:"boolean"}])); }; $.fn.datetimebox.defaults=$.extend({},$.fn.datebox.defaults,{spinnerWidth:"100%",showSeconds:true,timeSeparator:":",keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ -_9e3(this); +_bb5(this); },query:function(q,e){ -_9e0(this,q); -}},buttons:[{text:function(_9f4){ -return $(_9f4).datetimebox("options").currentText; -},handler:function(_9f5){ -var opts=$(_9f5).datetimebox("options"); -_9e2(_9f5,opts.formatter.call(_9f5,new Date())); -$(_9f5).datetimebox("hidePanel"); -}},{text:function(_9f6){ -return $(_9f6).datetimebox("options").okText; -},handler:function(_9f7){ -_9e3(_9f7); -}},{text:function(_9f8){ -return $(_9f8).datetimebox("options").closeText; -},handler:function(_9f9){ -$(_9f9).datetimebox("hidePanel"); +_bb2(this,q); +}},buttons:[{text:function(_bc6){ +return $(_bc6).datetimebox("options").currentText; +},handler:function(_bc7){ +var opts=$(_bc7).datetimebox("options"); +_bb4(_bc7,opts.formatter.call(_bc7,new Date())); +$(_bc7).datetimebox("hidePanel"); +}},{text:function(_bc8){ +return $(_bc8).datetimebox("options").okText; +},handler:function(_bc9){ +_bb5(_bc9); +}},{text:function(_bca){ +return $(_bca).datetimebox("options").closeText; +},handler:function(_bcb){ +$(_bcb).datetimebox("hidePanel"); }}],formatter:function(date){ var h=date.getHours(); var M=date.getMinutes(); var s=date.getSeconds(); -function _9fa(_9fb){ -return (_9fb<10?"0":"")+_9fb; +function _bcc(_bcd){ +return (_bcd<10?"0":"")+_bcd; }; -var _9fc=$(this).datetimebox("spinner").timespinner("options").separator; -var r=$.fn.datebox.defaults.formatter(date)+" "+_9fa(h)+_9fc+_9fa(M); +var _bce=$(this).datetimebox("spinner").timespinner("options").separator; +var r=$.fn.datebox.defaults.formatter(date)+" "+_bcc(h)+_bce+_bcc(M); if($(this).datetimebox("options").showSeconds){ -r+=_9fc+_9fa(s); +r+=_bce+_bcc(s); } return r; },parser:function(s){ @@ -13269,223 +15743,279 @@ var d=$.fn.datebox.defaults.parser(dt[0]); if(dt.length<2){ return d; } -var _9fd=$(this).datetimebox("spinner").timespinner("options").separator; -var tt=dt[1].split(_9fd); +var _bcf=$(this).datetimebox("spinner").timespinner("options").separator; +var tt=dt[1].split(_bcf); var hour=parseInt(tt[0],10)||0; -var _9fe=parseInt(tt[1],10)||0; -var _9ff=parseInt(tt[2],10)||0; -return new Date(d.getFullYear(),d.getMonth(),d.getDate(),hour,_9fe,_9ff); +var _bd0=parseInt(tt[1],10)||0; +var _bd1=parseInt(tt[2],10)||0; +return new Date(d.getFullYear(),d.getMonth(),d.getDate(),hour,_bd0,_bd1); }}); })(jQuery); (function($){ -function init(_a00){ -var _a01=$("
                "+"
                "+""+""+"
                "+"
                "+"
                "+"
                "+""+"
                ").insertAfter(_a00); -var t=$(_a00); +function init(_bd2){ +var _bd3=$("
                "+"
                "+""+""+"
                "+"
                "+"
                "+"
                "+""+"
                ").insertAfter(_bd2); +var t=$(_bd2); t.addClass("slider-f").hide(); var name=t.attr("name"); if(name){ -_a01.find("input.slider-value").attr("name",name); +_bd3.find("input.slider-value").attr("name",name); t.removeAttr("name").attr("sliderName",name); } -_a01.bind("_resize",function(e,_a02){ -if($(this).hasClass("easyui-fluid")||_a02){ -_a03(_a00); +_bd3.bind("_resize",function(e,_bd4){ +if($(this).hasClass("easyui-fluid")||_bd4){ +_bd5(_bd2); } return false; }); -return _a01; +return _bd3; }; -function _a03(_a04,_a05){ -var _a06=$.data(_a04,"slider"); -var opts=_a06.options; -var _a07=_a06.slider; -if(_a05){ -if(_a05.width){ -opts.width=_a05.width; +function _bd5(_bd6,_bd7){ +var _bd8=$.data(_bd6,"slider"); +var opts=_bd8.options; +var _bd9=_bd8.slider; +if(_bd7){ +if(_bd7.width){ +opts.width=_bd7.width; } -if(_a05.height){ -opts.height=_a05.height; +if(_bd7.height){ +opts.height=_bd7.height; } } -_a07._size(opts); +_bd9._size(opts); if(opts.mode=="h"){ -_a07.css("height",""); -_a07.children("div").css("height",""); +_bd9.css("height",""); +_bd9.children("div").css("height",""); }else{ -_a07.css("width",""); -_a07.children("div").css("width",""); -_a07.children("div.slider-rule,div.slider-rulelabel,div.slider-inner")._outerHeight(_a07._outerHeight()); +_bd9.css("width",""); +_bd9.children("div").css("width",""); +_bd9.children("div.slider-rule,div.slider-rulelabel,div.slider-inner")._outerHeight(_bd9._outerHeight()); } -_a08(_a04); +_bda(_bd6); }; -function _a09(_a0a){ -var _a0b=$.data(_a0a,"slider"); -var opts=_a0b.options; -var _a0c=_a0b.slider; +function _bdb(_bdc){ +var _bdd=$.data(_bdc,"slider"); +var opts=_bdd.options; +var _bde=_bdd.slider; var aa=opts.mode=="h"?opts.rule:opts.rule.slice(0).reverse(); if(opts.reversed){ aa=aa.slice(0).reverse(); } -_a0d(aa); -function _a0d(aa){ -var rule=_a0c.find("div.slider-rule"); -var _a0e=_a0c.find("div.slider-rulelabel"); +_bdf(aa); +function _bdf(aa){ +var rule=_bde.find("div.slider-rule"); +var _be0=_bde.find("div.slider-rulelabel"); rule.empty(); -_a0e.empty(); +_be0.empty(); for(var i=0;i").appendTo(rule); -span.css((opts.mode=="h"?"left":"top"),_a0f); +span.css((opts.mode=="h"?"left":"top"),_be1); if(aa[i]!="|"){ -span=$("").appendTo(_a0e); +span=$("").appendTo(_be0); span.html(aa[i]); if(opts.mode=="h"){ -span.css({left:_a0f,marginLeft:-Math.round(span.outerWidth()/2)}); +span.css({left:_be1,marginLeft:-Math.round(span.outerWidth()/2)}); }else{ -span.css({top:_a0f,marginTop:-Math.round(span.outerHeight()/2)}); +span.css({top:_be1,marginTop:-Math.round(span.outerHeight()/2)}); } } } }; }; -function _a10(_a11){ -var _a12=$.data(_a11,"slider"); -var opts=_a12.options; -var _a13=_a12.slider; -_a13.removeClass("slider-h slider-v slider-disabled"); -_a13.addClass(opts.mode=="h"?"slider-h":"slider-v"); -_a13.addClass(opts.disabled?"slider-disabled":""); -_a13.find("a.slider-handle").draggable({axis:opts.mode,cursor:"pointer",disabled:opts.disabled,onDrag:function(e){ +function _be2(_be3){ +var _be4=$.data(_be3,"slider"); +var opts=_be4.options; +var _be5=_be4.slider; +_be5.removeClass("slider-h slider-v slider-disabled"); +_be5.addClass(opts.mode=="h"?"slider-h":"slider-v"); +_be5.addClass(opts.disabled?"slider-disabled":""); +var _be6=_be5.find(".slider-inner"); +_be6.html(""+""); +if(opts.range){ +_be6.append(""+""); +} +_be5.find("a.slider-handle").draggable({axis:opts.mode,cursor:"pointer",disabled:opts.disabled,onDrag:function(e){ var left=e.data.left; -var _a14=_a13.width(); +var _be7=_be5.width(); if(opts.mode!="h"){ left=e.data.top; -_a14=_a13.height(); +_be7=_be5.height(); } -if(left<0||left>_a14){ +if(left<0||left>_be7){ return false; }else{ -var _a15=_a27(_a11,left); -_a16(_a15); +_be8(left,this); return false; } -},onBeforeDrag:function(){ -_a12.isDragging=true; },onStartDrag:function(){ -opts.onSlideStart.call(_a11,opts.value); +_be4.isDragging=true; +opts.onSlideStart.call(_be3,opts.value); },onStopDrag:function(e){ -var _a17=_a27(_a11,(opts.mode=="h"?e.data.left:e.data.top)); -_a16(_a17); -opts.onSlideEnd.call(_a11,opts.value); -opts.onComplete.call(_a11,opts.value); -_a12.isDragging=false; +_be8(opts.mode=="h"?e.data.left:e.data.top,this); +opts.onSlideEnd.call(_be3,opts.value); +opts.onComplete.call(_be3,opts.value); +_be4.isDragging=false; }}); -_a13.find("div.slider-inner").unbind(".slider").bind("mousedown.slider",function(e){ -if(_a12.isDragging||opts.disabled){ +_be5.find("div.slider-inner").unbind(".slider").bind("mousedown.slider",function(e){ +if(_be4.isDragging||opts.disabled){ return; } var pos=$(this).offset(); -var _a18=_a27(_a11,(opts.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top))); -_a16(_a18); -opts.onComplete.call(_a11,opts.value); +_be8(opts.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top)); +opts.onComplete.call(_be3,opts.value); }); -function _a16(_a19){ -var s=Math.abs(_a19%opts.step); +function _be8(pos,_be9){ +var _bea=_beb(_be3,pos); +var s=Math.abs(_bea%opts.step); if(s0; +if(_bea<=v2&&_bec){ +v1=_bea; }else{ -_a19=_a19-s+opts.step; +if(_bea>=v1&&(!_bec)){ +v2=_bea; +} +} +}else{ +if(_beav2){ +v2=_bea; +}else{ +_beaopts.max){ -_a1c=opts.max; +if(_bf4>opts.max){ +_bf4=opts.max; } -opts.value=_a1c; -$(_a1b).val(_a1c); -_a1e.find("input.slider-value").val(_a1c); -var pos=_a20(_a1b,_a1c); -var tip=_a1e.find(".slider-tip"); +var _bf5=$("").appendTo(_bf1); +_bf5.attr("name",name); +_bf5.val(_bf4); +_bf3.push(_bf4); +var _bf6=_bf1.find(".slider-handle:eq("+i+")"); +var tip=_bf6.next(); +var pos=_bf7(_bee,_bf4); if(opts.showTip){ tip.show(); -tip.html(opts.tipFormatter.call(_a1b,opts.value)); +tip.html(opts.tipFormatter.call(_bee,_bf4)); }else{ tip.hide(); } if(opts.mode=="h"){ -var _a21="left:"+pos+"px;"; -_a1e.find(".slider-handle").attr("style",_a21); -tip.attr("style",_a21+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px"); +var _bf8="left:"+pos+"px;"; +_bf6.attr("style",_bf8); +tip.attr("style",_bf8+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px"); }else{ -var _a21="top:"+pos+"px;"; -_a1e.find(".slider-handle").attr("style",_a21); -tip.attr("style",_a21+"margin-left:"+(-Math.round(tip.outerWidth()))+"px"); +var _bf8="top:"+pos+"px;"; +_bf6.attr("style",_bf8); +tip.attr("style",_bf8+"margin-left:"+(-Math.round(tip.outerWidth()))+"px"); } -if(_a1f!=_a1c){ -opts.onChange.call(_a1b,_a1c,_a1f); +} +opts.value=opts.range?_bf3:_bf3[0]; +$(_bee).val(opts.range?_bf3.join(opts.separator):_bf3[0]); +if(_bf2.join(",")!=_bf3.join(",")){ +opts.onChange.call(_bee,opts.value,(opts.range?_bf2:_bf2[0])); } }; -function _a08(_a22){ -var opts=$.data(_a22,"slider").options; +function _bda(_bf9){ +var opts=$.data(_bf9,"slider").options; var fn=opts.onChange; opts.onChange=function(){ }; -_a1a(_a22,opts.value); +_bed(_bf9,opts.value); opts.onChange=fn; }; -function _a20(_a23,_a24){ -var _a25=$.data(_a23,"slider"); -var opts=_a25.options; -var _a26=_a25.slider; -var size=opts.mode=="h"?_a26.width():_a26.height(); -var pos=opts.converter.toPosition.call(_a23,_a24,size); +function _bf7(_bfa,_bfb){ +var _bfc=$.data(_bfa,"slider"); +var opts=_bfc.options; +var _bfd=_bfc.slider; +var size=opts.mode=="h"?_bfd.width():_bfd.height(); +var pos=opts.converter.toPosition.call(_bfa,_bfb,size); if(opts.mode=="v"){ -pos=_a26.height()-pos; +pos=_bfd.height()-pos; } if(opts.reversed){ pos=size-pos; } return pos.toFixed(0); }; -function _a27(_a28,pos){ -var _a29=$.data(_a28,"slider"); -var opts=_a29.options; -var _a2a=_a29.slider; -var size=opts.mode=="h"?_a2a.width():_a2a.height(); -var _a2b=opts.converter.toValue.call(_a28,opts.mode=="h"?(opts.reversed?(size-pos):pos):(size-pos),size); -return _a2b.toFixed(0); +function _beb(_bfe,pos){ +var _bff=$.data(_bfe,"slider"); +var opts=_bff.options; +var _c00=_bff.slider; +var size=opts.mode=="h"?_c00.width():_c00.height(); +var pos=opts.mode=="h"?(opts.reversed?(size-pos):pos):(opts.reversed?pos:(size-pos)); +var _c01=opts.converter.toValue.call(_bfe,pos,size); +return _c01.toFixed(0); }; -$.fn.slider=function(_a2c,_a2d){ -if(typeof _a2c=="string"){ -return $.fn.slider.methods[_a2c](this,_a2d); +$.fn.slider=function(_c02,_c03){ +if(typeof _c02=="string"){ +return $.fn.slider.methods[_c02](this,_c03); } -_a2c=_a2c||{}; +_c02=_c02||{}; return this.each(function(){ -var _a2e=$.data(this,"slider"); -if(_a2e){ -$.extend(_a2e.options,_a2c); +var _c04=$.data(this,"slider"); +if(_c04){ +$.extend(_c04.options,_c02); }else{ -_a2e=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_a2c),slider:init(this)}); +_c04=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_c02),slider:init(this)}); $(this).removeAttr("disabled"); } -var opts=_a2e.options; +var opts=_c04.options; opts.min=parseFloat(opts.min); opts.max=parseFloat(opts.max); +if(opts.range){ +if(!$.isArray(opts.value)){ +opts.value=$.map(String(opts.value).split(opts.separator),function(v){ +return parseFloat(v); +}); +} +if(opts.value.length<2){ +opts.value.push(opts.max); +} +}else{ opts.value=parseFloat(opts.value); +} opts.step=parseFloat(opts.step); opts.originalValue=opts.value; -_a10(this); -_a09(this); -_a03(this); +_be2(this); +_bdb(this); +_bd5(this); }); }; $.fn.slider.methods={options:function(jq){ @@ -13495,53 +16025,59 @@ return jq.each(function(){ $.data(this,"slider").slider.remove(); $(this).remove(); }); -},resize:function(jq,_a2f){ +},resize:function(jq,_c05){ return jq.each(function(){ -_a03(this,_a2f); +_bd5(this,_c05); }); },getValue:function(jq){ return jq.slider("options").value; -},setValue:function(jq,_a30){ +},getValues:function(jq){ +return jq.slider("options").value; +},setValue:function(jq,_c06){ +return jq.each(function(){ +_bed(this,[_c06]); +}); +},setValues:function(jq,_c07){ return jq.each(function(){ -_a1a(this,_a30); +_bed(this,_c07); }); },clear:function(jq){ return jq.each(function(){ var opts=$(this).slider("options"); -_a1a(this,opts.min); +_bed(this,opts.range?[opts.min,opts.max]:[opts.min]); }); },reset:function(jq){ return jq.each(function(){ var opts=$(this).slider("options"); -_a1a(this,opts.originalValue); +$(this).slider(opts.range?"setValues":"setValue",opts.originalValue); }); },enable:function(jq){ return jq.each(function(){ $.data(this,"slider").options.disabled=false; -_a10(this); +_be2(this); }); },disable:function(jq){ return jq.each(function(){ $.data(this,"slider").options.disabled=true; -_a10(this); +_be2(this); }); }}; -$.fn.slider.parseOptions=function(_a31){ -var t=$(_a31); -return $.extend({},$.parser.parseOptions(_a31,["width","height","mode",{reversed:"boolean",showTip:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)}); +$.fn.slider.parseOptions=function(_c08){ +var t=$(_c08); +return $.extend({},$.parser.parseOptions(_c08,["width","height","mode",{reversed:"boolean",showTip:"boolean",range:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)}); }; -$.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,value:0,min:0,max:100,step:1,rule:[],tipFormatter:function(_a32){ -return _a32; -},converter:{toPosition:function(_a33,size){ +$.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,range:false,value:0,separator:",",min:0,max:100,step:1,rule:[],tipFormatter:function(_c09){ +return _c09; +},converter:{toPosition:function(_c0a,size){ var opts=$(this).slider("options"); -return (_a33-opts.min)/(opts.max-opts.min)*size; +return (_c0a-opts.min)/(opts.max-opts.min)*size; },toValue:function(pos,size){ var opts=$(this).slider("options"); return opts.min+(opts.max-opts.min)*(pos/size); -}},onChange:function(_a34,_a35){ -},onSlideStart:function(_a36){ -},onSlideEnd:function(_a37){ -},onComplete:function(_a38){ +}},onChange:function(_c0b,_c0c){ +},onSlideStart:function(_c0d){ +},onSlideEnd:function(_c0e){ +},onComplete:function(_c0f){ }}; })(jQuery); diff --git a/assets/js/easy-ui/jquery.easyui.mobile.js b/assets/js/easy-ui/jquery.easyui.mobile.js new file mode 100644 index 0000000000..31f97024f8 --- /dev/null +++ b/assets/js/easy-ui/jquery.easyui.mobile.js @@ -0,0 +1,141 @@ +/** + * jQuery EasyUI 1.5.2 + * + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. + * + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com + * + */ +(function($){ +$.fn.navpanel=function(_1,_2){ +if(typeof _1=="string"){ +var _3=$.fn.navpanel.methods[_1]; +return _3?_3(this,_2):this.panel(_1,_2); +}else{ +_1=_1||{}; +return this.each(function(){ +var _4=$.data(this,"navpanel"); +if(_4){ +$.extend(_4.options,_1); +}else{ +_4=$.data(this,"navpanel",{options:$.extend({},$.fn.navpanel.defaults,$.fn.navpanel.parseOptions(this),_1)}); +} +$(this).panel(_4.options); +}); +} +}; +$.fn.navpanel.methods={options:function(jq){ +return $.data(jq[0],"navpanel").options; +}}; +$.fn.navpanel.parseOptions=function(_5){ +return $.extend({},$.fn.panel.parseOptions(_5),$.parser.parseOptions(_5,[])); +}; +$.fn.navpanel.defaults=$.extend({},$.fn.panel.defaults,{fit:true,border:false,cls:"navpanel"}); +$.parser.plugins.push("navpanel"); +})(jQuery); +(function($){ +$(function(){ +$.mobile.init(); +}); +$.mobile={defaults:{animation:"slide",direction:"left",reverseDirections:{up:"down",down:"up",left:"right",right:"left"}},panels:[],init:function(_6){ +$.mobile.panels=[]; +var _7=$(_6||"body").children(".navpanel:visible"); +if(_7.length){ +_7.not(":first").children(".panel-body").navpanel("close"); +var p=_7.eq(0).children(".panel-body"); +$.mobile.panels.push({panel:p,animation:$.mobile.defaults.animation,direction:$.mobile.defaults.direction}); +} +$(document).unbind(".mobile").bind("click.mobile",function(e){ +var a=$(e.target).closest("a"); +if(a.length){ +var _8=$.parser.parseOptions(a[0],["animation","direction",{back:"boolean"}]); +if(_8.back){ +$.mobile.back(); +e.preventDefault(); +}else{ +var _9=$.trim(a.attr("href")); +if(/^#/.test(_9)){ +var to=$(_9); +if(to.length&&to.hasClass("panel-body")){ +$.mobile.go(to,_8.animation,_8.direction); +e.preventDefault(); +} +} +} +} +}); +$(window).unbind(".mobile").bind("hashchange.mobile",function(){ +var _a=$.mobile.panels.length; +if(_a>1){ +var _b=location.hash; +var p=$.mobile.panels[_a-2]; +if(!_b||_b=="#&"+p.panel.attr("id")){ +$.mobile._back(); +} +} +}); +},nav:function(_c,to,_d,_e){ +if(window.WebKitAnimationEvent){ +_d=_d!=undefined?_d:$.mobile.defaults.animation; +_e=_e!=undefined?_e:$.mobile.defaults.direction; +var _f="m-"+_d+(_e?"-"+_e:""); +var p1=$(_c).panel("open").panel("resize").panel("panel"); +var p2=$(to).panel("open").panel("resize").panel("panel"); +p1.add(p2).bind("webkitAnimationEnd",function(){ +$(this).unbind("webkitAnimationEnd"); +var p=$(this).children(".panel-body"); +if($(this).hasClass("m-in")){ +p.panel("open").panel("resize"); +}else{ +p.panel("close"); +} +$(this).removeClass(_f+" m-in m-out"); +}); +p2.addClass(_f+" m-in"); +p1.addClass(_f+" m-out"); +}else{ +$(to).panel("open").panel("resize"); +$(_c).panel("close"); +} +},_go:function(_10,_11,_12){ +_11=_11!=undefined?_11:$.mobile.defaults.animation; +_12=_12!=undefined?_12:$.mobile.defaults.direction; +var _13=$.mobile.panels[$.mobile.panels.length-1].panel; +var to=$(_10); +if(_13[0]!=to[0]){ +$.mobile.nav(_13,to,_11,_12); +$.mobile.panels.push({panel:to,animation:_11,direction:_12}); +} +},_back:function(){ +if($.mobile.panels.length<2){ +return; +} +var p1=$.mobile.panels.pop(); +var p2=$.mobile.panels[$.mobile.panels.length-1]; +var _14=p1.animation; +var _15=$.mobile.defaults.reverseDirections[p1.direction]||""; +$.mobile.nav(p1.panel,p2.panel,_14,_15); +},go:function(_16,_17,_18){ +_17=_17!=undefined?_17:$.mobile.defaults.animation; +_18=_18!=undefined?_18:$.mobile.defaults.direction; +location.hash="#&"+$(_16).attr("id"); +$.mobile._go(_16,_17,_18); +},back:function(){ +history.go(-1); +}}; +$.map(["validatebox","textbox","passwordbox","filebox","searchbox","combo","combobox","combogrid","combotree","combotreegrid","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){ +if($.fn[_19]){ +$.extend($.fn[_19].defaults,{iconWidth:28,tipPosition:"bottom"}); +} +}); +$.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){ +if($.fn[_1a]){ +$.extend($.fn[_1a].defaults,{iconWidth:56,spinAlign:"horizontal"}); +} +}); +if($.fn.menu){ +$.extend($.fn.menu.defaults,{itemHeight:30,noline:true}); +} +})(jQuery); + diff --git a/assets/js/easy-ui/plugins/datagrid-bufferview.js b/assets/js/easy-ui/plugins/datagrid-bufferview.js new file mode 100644 index 0000000000..4cc249e7bb --- /dev/null +++ b/assets/js/easy-ui/plugins/datagrid-bufferview.js @@ -0,0 +1,182 @@ +var bufferview = {}; +(function($){ + $.extend($.fn.datagrid.defaults, { + rowHeight: 25, + onBeforeFetch: function(page){}, + onFetch: function(page, rows){} + }); + + bufferview = $.extend({}, $.fn.datagrid.defaults.view, { + render: function(target, container, frozen){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var rows = this.rows || []; + if (!rows.length) { + return; + } + var fields = $(target).datagrid('getColumnFields', frozen); + + if (frozen){ + if (!(opts.rownumbers || (opts.frozenColumns && opts.frozenColumns.length))){ + return; + } + } + + var index = parseInt(opts.finder.getTr(target,'','last',(frozen?1:2)).attr('datagrid-row-index'))+1 || 0; + var table = ['']; + for(var i=0; i'); + table.push(this.renderRow.call(this, target, fields, frozen, index, rows[i])); + table.push(''); + index++; + } + table.push('
                '); + + $(container).append(table.join('')); + }, + + onBeforeRender: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var view = this; + this.renderedCount = 0; + this.rows = []; + + dc.body1.add(dc.body2).empty(); + init(); + + function init(){ + // erase the onLoadSuccess event, make sure it can't be triggered + state.onLoadSuccess = opts.onLoadSuccess; + opts.onLoadSuccess = function(){}; + setTimeout(function(){ + dc.body2.unbind('.datagrid').bind('scroll.datagrid', function(e){ + if (state.onLoadSuccess){ + opts.onLoadSuccess = state.onLoadSuccess; // restore the onLoadSuccess event + state.onLoadSuccess = undefined; + } + if (view.scrollTimer){ + clearTimeout(view.scrollTimer); + } + view.scrollTimer = setTimeout(function(){ + scrolling.call(view); + }, 50); + }); + dc.body2.triggerHandler('scroll.datagrid'); + }, 0); + } + + function scrolling(){ + if (getDataHeight() < dc.body2.height() && view.renderedCount < state.data.total){ + this.getRows.call(this, target, function(rows){ + this.rows = rows; + this.populate.call(this, target); + dc.body2.triggerHandler('scroll.datagrid'); + }); + } else if (dc.body2.scrollTop() >= getDataHeight() - dc.body2.height()){ + this.getRows.call(this, target, function(rows){ + this.rows = rows; + this.populate.call(this, target); + }); + } + } + + function getDataHeight(){ + // var h = 0; + // dc.body2.children('table.datagrid-btable').each(function(){ + // h += $(this).outerHeight(); + // }); + // if (!h){ + // h = view.renderedCount * opts.rowHeight; + // } + // return h; + return view.renderedCount * opts.rowHeight; + } + }, + + getRows: function(target, callback){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var page = Math.floor(this.renderedCount/opts.pageSize) + 1; + + if (this.renderedCount >= state.data.total){return;} + if (opts.onBeforeFetch.call(target, page) == false){return} + + // var rows = state.data.rows.slice(this.renderedCount, this.renderedCount+opts.pageSize); + var index = (page-1)*opts.pageSize; + var rows = state.data.rows.slice(index, index+opts.pageSize); + if (rows.length){ + opts.onFetch.call(target, page, rows); + callback.call(this, rows); + } else { + var param = $.extend({}, opts.queryParams, { + page: Math.floor(this.renderedCount/opts.pageSize)+1, + rows: opts.pageSize + }); + if (opts.sortName){ + $.extend(param, { + sort: opts.sortName, + order: opts.sortOrder + }); + } + if (opts.onBeforeLoad.call(target, param) == false){return;} + + $(target).datagrid('loading'); + var result = opts.loader.call(target, param, function(data){ + $(target).datagrid('loaded'); + var data = opts.loadFilter.call(target, data); + opts.onFetch.call(target, page, data.rows); + if (data.rows && data.rows.length){ + state.data.rows = state.data.rows.concat(data.rows); + callback.call(opts.view, data.rows); + } else { + opts.onLoadSuccess.call(target, data); + } + }, function(){ + $(target).datagrid('loaded'); + opts.onLoadError.apply(target, arguments); + }); + if (result == false){ + $(target).datagrid('loaded'); + if (!state.data.rows.length){ + opts.onFetch.call(target, page, state.data.rows); + opts.onLoadSuccess.call(target, state.data); + } + } + } + }, + + populate: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + if (this.rows.length){ + this.renderedCount += this.rows.length; + this.render.call(this, target, dc.body2, false); + this.render.call(this, target, dc.body1, true); + opts.onLoadSuccess.call(target, { + total: state.data.total, + rows: this.rows + }); + // for(var i=this.renderedCount-this.rows.length; i'); + for(var i=0; i'); + table.push(this.renderRow.call(this, target, fields, frozen, i, rows[i])); + table.push(''); + + table.push(''); + if (frozen){ + table.push(''); + } else { + table.push(''); + } + + table.push('
                '); + if (frozen){ + table.push(' '); + } else { + table.push(opts.detailFormatter.call(target, i, rows[i])); + } + table.push('
                '); + + table.push(''); + table.push(''); + + } + table.push(''); + + $(container).html(table.join('')); + }, + + renderRow: function(target, fields, frozen, rowIndex, rowData){ + var opts = $.data(target, 'datagrid').options; + + var cc = []; + if (frozen && opts.rownumbers){ + var rownumber = rowIndex + 1; + if (opts.pagination){ + rownumber += (opts.pageNumber-1)*opts.pageSize; + } + cc.push('
                '+rownumber+'
                '); + } + for(var i=0; i'); + + if (col.checkbox){ + style = ''; + } else if (col.expander){ + style = "text-align:center;height:16px;"; + } else { + style = styleValue; + if (col.align){style += ';text-align:' + col.align + ';'} + if (!opts.nowrap){ + style += ';white-space:normal;height:auto;'; + } else if (opts.autoRowHeight){ + style += ';height:auto;'; + } + } + + cc.push('
                '); + + if (col.checkbox){ + cc.push(''); + } else if (col.expander) { + //cc.push('
                '); + cc.push(''); + //cc.push('
                '); + } else if (col.formatter){ + cc.push(col.formatter(value, rowData, rowIndex)); + } else { + cc.push(value); + } + + cc.push('
                '); + cc.push(''); + } + } + return cc.join(''); + }, + + insertRow: function(target, index, row){ + var opts = $.data(target, 'datagrid').options; + var dc = $.data(target, 'datagrid').dc; + var panel = $(target).datagrid('getPanel'); + var view1 = dc.view1; + var view2 = dc.view2; + + var isAppend = false; + var rowLength = $(target).datagrid('getRows').length; + if (rowLength == 0){ + $(target).datagrid('loadData',{total:1,rows:[row]}); + return; + } + + if (index == undefined || index == null || index >= rowLength) { + index = rowLength; + isAppend = true; + this.canUpdateDetail = false; + } + + $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); + + _insert(true); + _insert(false); + + this.canUpdateDetail = true; + + function _insert(frozen){ + var tr = opts.finder.getTr(target, index, 'body', frozen?1:2); + if (isAppend){ + var detail = tr.next(); + var newDetail = tr.next().clone(); + tr.insertAfter(detail); + } else { + var newDetail = tr.next().next().clone(); + } + newDetail.insertAfter(tr); + newDetail.hide(); + if (!frozen){ + newDetail.find('div.datagrid-row-detail').html(opts.detailFormatter.call(target, index, row)); + } + } + }, + + deleteRow: function(target, index){ + var opts = $.data(target, 'datagrid').options; + var dc = $.data(target, 'datagrid').dc; + var tr = opts.finder.getTr(target, index); + tr.next().remove(); + $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); + dc.body2.triggerHandler('scroll'); + }, + + updateRow: function(target, rowIndex, row){ + var dc = $.data(target, 'datagrid').dc; + var opts = $.data(target, 'datagrid').options; + var cls = $(target).datagrid('getExpander', rowIndex).attr('class'); + $.fn.datagrid.defaults.view.updateRow.call(this, target, rowIndex, row); + $(target).datagrid('getExpander', rowIndex).attr('class',cls); + + // update the detail content + if (opts.autoUpdateDetail && this.canUpdateDetail){ + var row = $(target).datagrid('getRows')[rowIndex]; + var detail = $(target).datagrid('getRowDetail', rowIndex); + detail.html(opts.detailFormatter.call(target, rowIndex, row)); + } + }, + + bindEvents: function(target){ + var state = $.data(target, 'datagrid'); + + if (state.ss.bindDetailEvents){return;} + state.ss.bindDetailEvents = true; + + var dc = state.dc; + var opts = state.options; + var body = dc.body1.add(dc.body2); + var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; + body.unbind('click').bind('click', function(e){ + var tt = $(e.target); + var tr = tt.closest('tr.datagrid-row'); + if (!tr.length){return} + if (tt.hasClass('datagrid-row-expander')){ + var rowIndex = parseInt(tr.attr('datagrid-row-index')); + if (tt.hasClass('datagrid-row-expand')){ + $(target).datagrid('expandRow', rowIndex); + } else { + $(target).datagrid('collapseRow', rowIndex); + } + $(target).datagrid('fixRowHeight'); + + } else { + clickHandler(e); + } + e.stopPropagation(); + }); + }, + + onBeforeRender: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var t = $(target); + var hasExpander = false; + var fields = t.datagrid('getColumnFields',true).concat(t.datagrid('getColumnFields')); + for(var i=0; i
                '); + if ($('tr',t).length == 0){ + td.wrap('').parent().appendTo($('tbody',t)); + } else if (opts.rownumbers){ + td.insertAfter(t.find('td:has(div.datagrid-header-rownumber)')); + } else { + td.prependTo(t.find('tr:first')); + } + } + + // if (!state.bindDetailEvents){ + // state.bindDetailEvents = true; + // var that = this; + // setTimeout(function(){ + // that.bindEvents(target); + // },0); + // } + }, + + onAfterRender: function(target){ + var that = this; + var state = $.data(target, 'datagrid'); + var dc = state.dc; + var opts = state.options; + var panel = $(target).datagrid('getPanel'); + + $.fn.datagrid.defaults.view.onAfterRender.call(this, target); + + if (!state.onResizeColumn){ + state.onResizeColumn = opts.onResizeColumn; + opts.onResizeColumn = function(field, width){ + if (!opts.fitColumns){ + resizeDetails(); + } + var rowCount = $(target).datagrid('getRows').length; + for(var i=0; itable.datagrid-btable>tbody>tr>td>div.datagrid-row-detail:visible')._outerWidth(ww); + // details.find('.easyui-fluid').trigger('_resize'); + // fr.show(); + // } + function resizeDetails(){ + var details = dc.body2.find('>table.datagrid-btable>tbody>tr>td>div.datagrid-row-detail:visible'); + if (details.length){ + var ww = 0; + dc.header2.find('.datagrid-header-check:visible,.datagrid-cell:visible').each(function(){ + ww += $(this).outerWidth(true) + 1; + }); + if (ww != details.outerWidth(true)){ + details._outerWidth(ww); + details.find('.easyui-fluid').trigger('_resize'); + } + } + } + + + this.canUpdateDetail = true; // define if to update the detail content when 'updateRow' method is called; + + var footer = dc.footer1.add(dc.footer2); + footer.find('span.datagrid-row-expander').css('visibility', 'hidden'); + $(target).datagrid('resize'); + + this.bindEvents(target); + var detail = dc.body1.add(dc.body2).find('div.datagrid-row-detail'); + detail.unbind().bind('mouseover mouseout click dblclick contextmenu scroll', function(e){ + e.stopPropagation(); + }); + } + }); + + $.extend($.fn.datagrid.methods, { + fixDetailRowHeight: function(jq, index){ + return jq.each(function(){ + var opts = $.data(this, 'datagrid').options; + if (!(opts.rownumbers || (opts.frozenColumns && opts.frozenColumns.length))){ + return; + } + var dc = $.data(this, 'datagrid').dc; + var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); + var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); + // fix the detail row height + if (tr2.is(':visible')){ + tr1.css('height', ''); + tr2.css('height', ''); + var height = Math.max(tr1.height(), tr2.height()); + tr1.css('height', height); + tr2.css('height', height); + } + dc.body2.triggerHandler('scroll'); + }); + }, + getExpander: function(jq, index){ // get row expander object + var opts = $.data(jq[0], 'datagrid').options; + return opts.finder.getTr(jq[0], index).find('span.datagrid-row-expander'); + }, + // get row detail container + getRowDetail: function(jq, index){ + var opts = $.data(jq[0], 'datagrid').options; + var tr = opts.finder.getTr(jq[0], index, 'body', 2); + // return tr.next().find('div.datagrid-row-detail'); + return tr.next().find('>td>div.datagrid-row-detail'); + }, + expandRow: function(jq, index){ + return jq.each(function(){ + var opts = $(this).datagrid('options'); + var dc = $.data(this, 'datagrid').dc; + var expander = $(this).datagrid('getExpander', index); + if (expander.hasClass('datagrid-row-expand')){ + expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); + var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); + var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); + tr1.show(); + tr2.show(); + $(this).datagrid('fixDetailRowHeight', index); + if (opts.onExpandRow){ + var row = $(this).datagrid('getRows')[index]; + opts.onExpandRow.call(this, index, row); + } + } + }); + }, + collapseRow: function(jq, index){ + return jq.each(function(){ + var opts = $(this).datagrid('options'); + var dc = $.data(this, 'datagrid').dc; + var expander = $(this).datagrid('getExpander', index); + if (expander.hasClass('datagrid-row-collapse')){ + expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); + var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); + var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); + tr1.hide(); + tr2.hide(); + dc.body2.triggerHandler('scroll'); + if (opts.onCollapseRow){ + var row = $(this).datagrid('getRows')[index]; + opts.onCollapseRow.call(this, index, row); + } + } + }); + } + }); + + $.extend($.fn.datagrid.methods, { + subgrid: function(jq, conf){ + return jq.each(function(){ + createGrid(this, conf); + + function createGrid(target, conf, prow){ + var queryParams = $.extend({}, conf.options.queryParams||{}); + // queryParams[conf.options.foreignField] = prow ? prow[conf.options.foreignField] : undefined; + if (prow){ + var fk = conf.options.foreignField; + if ($.isFunction(fk)){ + $.extend(queryParams, fk.call(conf, prow)); + } else { + queryParams[fk] = prow[fk]; + } + } + + var plugin = conf.options.edatagrid ? 'edatagrid' : 'datagrid'; + + $(target)[plugin]($.extend({}, conf.options, { + subgrid: conf.subgrid, + view: (conf.subgrid ? detailview : undefined), + queryParams: queryParams, + detailFormatter: function(index, row){ + return '
                '; + }, + onExpandRow: function(index, row){ + var opts = $(this).datagrid('options'); + var rd = $(this).datagrid('getRowDetail', index); + var dg = getSubGrid(rd); + if (!dg.data('datagrid')){ + createGrid(dg[0], opts.subgrid, row); + } + rd.find('.easyui-fluid').trigger('_resize'); + setHeight(this, index); + if (conf.options.onExpandRow){ + conf.options.onExpandRow.call(this, index, row); + } + }, + onCollapseRow: function(index, row){ + setHeight(this, index); + if (conf.options.onCollapseRow){ + conf.options.onCollapseRow.call(this, index, row); + } + }, + onResize: function(){ + var dg = $(this).children('div.datagrid-view').children('table') + setParentHeight(this); + }, + onResizeColumn: function(field, width){ + setParentHeight(this); + if (conf.options.onResizeColumn){ + conf.options.onResizeColumn.call(this, field, width); + } + }, + onLoadSuccess: function(data){ + setParentHeight(this); + if (conf.options.onLoadSuccess){ + conf.options.onLoadSuccess.call(this, data); + } + } + })); + } + function getSubGrid(rowDetail){ + var div = $(rowDetail).children('div'); + if (div.children('div.datagrid').length){ + return div.find('>div.datagrid>div.panel-body>div.datagrid-view>table.datagrid-subgrid'); + } else { + return div.find('>table.datagrid-subgrid'); + } + } + function setParentHeight(target){ + var tr = $(target).closest('div.datagrid-row-detail').closest('tr').prev(); + if (tr.length){ + var index = parseInt(tr.attr('datagrid-row-index')); + var dg = tr.closest('div.datagrid-view').children('table'); + setHeight(dg[0], index); + } + } + function setHeight(target, index){ + $(target).datagrid('fixDetailRowHeight', index); + $(target).datagrid('fixRowHeight', index); + var tr = $(target).closest('div.datagrid-row-detail').closest('tr').prev(); + if (tr.length){ + var index = parseInt(tr.attr('datagrid-row-index')); + var dg = tr.closest('div.datagrid-view').children('table'); + setHeight(dg[0], index); + } + } + }); + }, + getSelfGrid: function(jq){ + var grid = jq.closest('.datagrid'); + if (grid.length){ + return grid.find('>.datagrid-wrap>.datagrid-view>.datagrid-f'); + } else { + return null; + } + }, + getParentGrid: function(jq){ + var detail = jq.closest('div.datagrid-row-detail'); + if (detail.length){ + return detail.closest('.datagrid-view').children('.datagrid-f'); + } else { + return null; + } + }, + getParentRowIndex: function(jq){ + var detail = jq.closest('div.datagrid-row-detail'); + if (detail.length){ + var tr = detail.closest('tr').prev(); + return parseInt(tr.attr('datagrid-row-index')); + } else { + return -1; + } + } + }); +})(jQuery); \ No newline at end of file diff --git a/assets/js/easy-ui/plugins/datagrid-groupview.js b/assets/js/easy-ui/plugins/datagrid-groupview.js new file mode 100644 index 0000000000..02f1af2f68 --- /dev/null +++ b/assets/js/easy-ui/plugins/datagrid-groupview.js @@ -0,0 +1,382 @@ +var groupview = {}; +(function($){ + $.extend($.fn.datagrid.defaults, { + groupHeight: 25, + expanderWidth: 30, + groupStyler: function(value,rows){return ''} + }); + + groupview = $.extend({}, $.fn.datagrid.defaults.view, { + render: function(target, container, frozen){ + var table = []; + var groups = this.groups; + for(var i=0; i'); + if ((frozen && (opts.rownumbers || opts.frozenColumns.length)) || + (!frozen && !(opts.rownumbers || opts.frozenColumns.length))){ + table.push(''); + table.push(' '); + table.push(''); + } + if ((frozen && hasFrozen) || (!frozen)){ + table.push(''); + table.push(opts.groupFormatter.call(target, group.value, group.rows)); + table.push(''); + } + table.push('
                '); + + table.push(''); + var index = group.startIndex; + for(var j=0; j'); + table.push(this.renderRow.call(this, target, fields, frozen, index, group.rows[j])); + table.push(''); + index++; + } + table.push('
                '); + return table.join(''); + + function parseCss(css, cls){ + var classValue = ''; + var styleValue = ''; + if (typeof css == 'string'){ + styleValue = css; + } else if (css){ + classValue = css['class'] || ''; + styleValue = css['style'] || ''; + } + return 'class="' + cls + (classValue ? ' '+classValue : '') + '" ' + + 'style="' + styleValue + '"'; + } + }, + + bindEvents: function(target){ + var state = $.data(target, 'datagrid'); + var dc = state.dc; + var body = dc.body1.add(dc.body2); + var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; + body.unbind('click').bind('click', function(e){ + var tt = $(e.target); + var expander = tt.closest('span.datagrid-row-expander'); + if (expander.length){ + var gindex = expander.closest('div.datagrid-group').attr('group-index'); + if (expander.hasClass('datagrid-row-collapse')){ + $(target).datagrid('collapseGroup', gindex); + } else { + $(target).datagrid('expandGroup', gindex); + } + } else { + clickHandler(e); + } + e.stopPropagation(); + }); + }, + + onBeforeRender: function(target, rows){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + + initCss(); + + var groups = []; + for(var i=0; i' + + '.datagrid-group{height:'+opts.groupHeight+'px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;white-space:nowrap;word-break:normal;}' + + '.datagrid-group-title,.datagrid-group-expander{display:inline-block;vertical-align:bottom;height:100%;line-height:'+opts.groupHeight+'px;padding:0 4px;}' + + '.datagrid-group-title{position:relative;}' + + '.datagrid-group-expander{width:'+opts.expanderWidth+'px;text-align:center;padding:0}' + + '.datagrid-row-expander{margin:'+Math.floor((opts.groupHeight-16)/2)+'px 0;display:inline-block;width:16px;height:16px;cursor:pointer}' + + '' + ); + } + } + }, + onAfterRender: function(target){ + $.fn.datagrid.defaults.view.onAfterRender.call(this, target); + + var view = this; + var state = $.data(target, 'datagrid'); + var opts = state.options; + if (!state.onResizeColumn){ + state.onResizeColumn = opts.onResizeColumn; + } + if (!state.onResize){ + state.onResize = opts.onResize; + } + opts.onResizeColumn = function(field, width){ + view.resizeGroup(target); + state.onResizeColumn.call(target, field, width); + } + opts.onResize = function(width, height){ + view.resizeGroup(target); + state.onResize.call($(target).datagrid('getPanel')[0], width, height); + } + view.resizeGroup(target); + } + }); + + $.extend($.fn.datagrid.methods, { + groups:function(jq){ + return jq.datagrid('options').view.groups; + }, + expandGroup:function(jq, groupIndex){ + return jq.each(function(){ + var view = $.data(this, 'datagrid').dc.view; + var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); + var expander = group.find('span.datagrid-row-expander'); + if (expander.hasClass('datagrid-row-expand')){ + expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); + group.next('table').show(); + } + $(this).datagrid('fixRowHeight'); + }); + }, + collapseGroup:function(jq, groupIndex){ + return jq.each(function(){ + var view = $.data(this, 'datagrid').dc.view; + var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); + var expander = group.find('span.datagrid-row-expander'); + if (expander.hasClass('datagrid-row-collapse')){ + expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); + group.next('table').hide(); + } + $(this).datagrid('fixRowHeight'); + }); + }, + scrollToGroup: function(jq, groupIndex){ + return jq.each(function(){ + var state = $.data(this, 'datagrid'); + var dc = state.dc; + var grow = dc.body2.children('div.datagrid-group[group-index="'+groupIndex+'"]'); + if (grow.length){ + var groupHeight = grow.outerHeight(); + var headerHeight = dc.view2.children('div.datagrid-header')._outerHeight(); + var frozenHeight = dc.body2.outerHeight(true) - dc.body2.outerHeight(); + var top = grow.position().top - headerHeight - frozenHeight; + if (top < 0){ + dc.body2.scrollTop(dc.body2.scrollTop() + top); + } else if (top + groupHeight > dc.body2.height() - 18){ + dc.body2.scrollTop(dc.body2.scrollTop() + top + groupHeight - dc.body2.height() + 18); + } + } + }); + } + }); + + $.extend(groupview, { + refreshGroupTitle: function(target, groupIndex){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var group = this.groups[groupIndex]; + var span = dc.body1.add(dc.body2).children('div.datagrid-group[group-index=' + groupIndex + ']').find('span.datagrid-group-title'); + span.html(opts.groupFormatter.call(target, group.value, group.rows)); + }, + resizeGroup: function(target, groupIndex){ + var state = $.data(target, 'datagrid'); + var dc = state.dc; + var ht = dc.header2.find('table'); + var fr = ht.find('tr.datagrid-filter-row').hide(); + var ww = ht.width(); + if (groupIndex == undefined){ + var groupHeader = dc.body2.children('div.datagrid-group'); + } else { + var groupHeader = dc.body2.children('div.datagrid-group[group-index=' + groupIndex + ']'); + } + groupHeader._outerWidth(ww); + var opts = state.options; + if (opts.frozenColumns && opts.frozenColumns.length){ + var width = dc.view1.width() - opts.expanderWidth; + var isRtl = dc.view1.css('direction').toLowerCase()=='rtl'; + groupHeader.find('.datagrid-group-title').css(isRtl?'right':'left', -width+'px'); + } + if (fr.length){ + if (opts.showFilterBar){ + fr.show(); + } + } + // fr.show(); + }, + + insertRow: function(target, index, row){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var group = null; + var groupIndex; + + if (!state.data.rows.length){ + $(target).datagrid('loadData', [row]); + return; + } + + for(var i=0; i group.startIndex + group.rows.length){ + index = group.startIndex + group.rows.length; + } + $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); + + if (index >= group.startIndex + group.rows.length){ + _moveTr(index, true); + _moveTr(index, false); + } + group.rows.splice(index - group.startIndex, 0, row); + } else { + group = { + value: row[opts.groupField], + rows: [row], + startIndex: state.data.rows.length + } + groupIndex = this.groups.length; + dc.body1.append(this.renderGroup.call(this, target, groupIndex, group, true)); + dc.body2.append(this.renderGroup.call(this, target, groupIndex, group, false)); + this.groups.push(group); + state.data.rows.push(row); + } + + this.setGroupIndex(target); + this.refreshGroupTitle(target, groupIndex); + this.resizeGroup(target); + + function _moveTr(index,frozen){ + var serno = frozen?1:2; + var prevTr = opts.finder.getTr(target, index-1, 'body', serno); + var tr = opts.finder.getTr(target, index, 'body', serno); + tr.insertAfter(prevTr); + } + }, + + updateRow: function(target, index, row){ + var opts = $.data(target, 'datagrid').options; + $.fn.datagrid.defaults.view.updateRow.call(this, target, index, row); + var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); + var groupIndex = parseInt(tb.prev().attr('group-index')); + this.refreshGroupTitle(target, groupIndex); + }, + + deleteRow: function(target, index){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var body = dc.body1.add(dc.body2); + + var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); + var groupIndex = parseInt(tb.prev().attr('group-index')); + + $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); + + var group = this.groups[groupIndex]; + if (group.rows.length > 1){ + group.rows.splice(index-group.startIndex, 1); + this.refreshGroupTitle(target, groupIndex); + } else { + body.children('div.datagrid-group[group-index='+groupIndex+']').remove(); + for(var i=groupIndex+1; i
                ', + '']; + for(var i=0; i'); + table.push(this.renderRow.call(this, target, fields, frozen, index, rows[i])); + table.push(''); + + // render the detail row + if (opts.detailFormatter){ + table.push(''); + if (frozen){ + table.push(''); + table.push(''); + } + + index++; + } + table.push('
                '); + } else { + table.push(''); + } + table.push('
                '); + if (frozen){ + table.push(' '); + } else { + table.push(opts.detailFormatter.call(target, index, rows[i])); + } + table.push('
                '); + table.push('
                '); + table.push('
                '); + + $(container).html(table.join('')); + }, + + renderRow: function(target, fields, frozen, rowIndex, rowData){ + var opts = $.data(target, 'datagrid').options; + + var cc = []; + if (frozen && opts.rownumbers){ + var rownumber = rowIndex + 1; + // if (opts.pagination){ + // rownumber += (opts.pageNumber-1)*opts.pageSize; + // } + cc.push('
                '+rownumber+'
                '); + } + for(var i=0; i'); + + if (col.checkbox){ + style = ''; + } else if (col.expander){ + style = "text-align:center;height:16px;"; + } else { + style = styleValue; + if (col.align){style += ';text-align:' + col.align + ';'} + if (!opts.nowrap){ + style += ';white-space:normal;height:auto;'; + } else if (opts.autoRowHeight){ + style += ';height:auto;'; + } + } + + cc.push('
                '); + + if (col.checkbox){ + cc.push(''); + } else if (col.expander) { + //cc.push('
                '); + cc.push(''); + //cc.push('
                '); + } else if (col.formatter){ + cc.push(col.formatter(value, rowData, rowIndex)); + } else { + cc.push(value); + } + + cc.push('
                '); + cc.push(''); + } + } + return cc.join(''); + }, + + bindEvents: function(target){ + var state = $.data(target, 'datagrid'); + var dc = state.dc; + var opts = state.options; + var body = dc.body1.add(dc.body2); + var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; + body.unbind('click').bind('click', function(e){ + var tt = $(e.target); + var tr = tt.closest('tr.datagrid-row'); + if (!tr.length){return} + if (tt.hasClass('datagrid-row-expander')){ + var rowIndex = parseInt(tr.attr('datagrid-row-index')); + if (tt.hasClass('datagrid-row-expand')){ + $(target).datagrid('expandRow', rowIndex); + } else { + $(target).datagrid('collapseRow', rowIndex); + } + $(target).datagrid('fixRowHeight'); + + } else { + clickHandler(e); + } + e.stopPropagation(); + }); + }, + + onBeforeRender: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var view = this; + + opts._emptyMsg = opts.emptyMsg; // store the emptyMsg value + opts.emptyMsg = ''; // erase it to prevent from displaying it + state.data.firstRows = state.data.rows; + state.data.rows = []; + + dc.body1.add(dc.body2).empty(); + this.rows = []; // the rows to be rendered + this.r1 = this.r2 = []; // the first part and last part of rows + + init(); + createHeaderExpander(); + + function init(){ + var pager = $(target).datagrid('getPager'); + pager.each(function(){ + $(this).pagination('options').onSelectPage = function(pageNum, pageSize){ + opts.pageNumber = pageNum || 1; + opts.pageSize = pageSize; + pager.pagination('refresh',{ + pageNumber:pageNum, + pageSize:pageSize + }); + $(target).datagrid('gotoPage', opts.pageNumber); + }; + }); + // erase the onLoadSuccess event, make sure it can't be triggered + state.onLoadSuccess = opts.onLoadSuccess; + opts.onLoadSuccess = function(){}; + if (!opts.remoteSort){ + var onBeforeSortColumn = opts.onBeforeSortColumn; + opts.onBeforeSortColumn = function(name, order){ + var result = onBeforeSortColumn.call(this, name, order); + if (result == false){ + return false; + } + state.data.rows = state.data.firstRows; + } + } + dc.body2.unbind('.datagrid'); + setTimeout(function(){ + dc.body2.unbind('.datagrid').bind('scroll.datagrid', function(e){ + if (state.onLoadSuccess){ + opts.onLoadSuccess = state.onLoadSuccess; // restore the onLoadSuccess event + state.onLoadSuccess = undefined; + } + if (view.scrollTimer){ + clearTimeout(view.scrollTimer); + } + view.scrollTimer = setTimeout(function(){ + view.scrolling.call(view, target); + }, 50); + }); + dc.body2.triggerHandler('scroll.datagrid'); + }, 0); + } + function createHeaderExpander(){ + if (!opts.detailFormatter){return} + + var t = $(target); + var hasExpander = false; + var fields = t.datagrid('getColumnFields',true).concat(t.datagrid('getColumnFields')); + for(var i=0; i
                '); + if ($('tr',t).length == 0){ + td.wrap('').parent().appendTo($('tbody',t)); + } else if (opts.rownumbers){ + td.insertAfter(t.find('td:has(div.datagrid-header-rownumber)')); + } else { + td.prependTo(t.find('tr:first')); + } + } + + setTimeout(function(){ + view.bindEvents(target); + },0); + } + }, + + onAfterRender: function(target){ + $.fn.datagrid.defaults.view.onAfterRender.call(this, target); + var dc = $.data(target, 'datagrid').dc; + var footer = dc.footer1.add(dc.footer2); + footer.find('span.datagrid-row-expander').css('visibility', 'hidden'); + }, + + scrolling: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + if (!opts.finder.getRows(target).length){ + this.reload.call(this, target); + } else { + if (!dc.body2.is(':visible')){return} + var headerHeight = dc.view2.children('div.datagrid-header').outerHeight(); + + var topDiv = dc.body2.children('div.datagrid-btable-top'); + var bottomDiv = dc.body2.children('div.datagrid-btable-bottom'); + if (!topDiv.length || !bottomDiv.length){return;} + var top = topDiv.position().top + topDiv._outerHeight() - headerHeight; + var bottom = bottomDiv.position().top - headerHeight; + top = Math.floor(top); + bottom = Math.floor(bottom); + + if (top > dc.body2.height() || bottom < 0){ + this.reload.call(this, target); + } else if (top > 0){ + var page = Math.floor(this.index/opts.pageSize); + this.getRows.call(this, target, page, function(rows){ + this.page = page; + this.r2 = this.r1; + this.r1 = rows; + this.index = (page-1)*opts.pageSize; + this.rows = this.r1.concat(this.r2); + this.populate.call(this, target); + }); + } else if (bottom < dc.body2.height()){ + if (state.data.rows.length+this.index >= state.data.total){ + return; + } + var page = Math.floor(this.index/opts.pageSize)+2; + if (this.r2.length){ + page++; + } + this.getRows.call(this, target, page, function(rows){ + this.page = page; + if (!this.r2.length){ + this.r2 = rows; + } else { + this.r1 = this.r2; + this.r2 = rows; + this.index += opts.pageSize; + } + this.rows = this.r1.concat(this.r2); + this.populate.call(this, target); + }); + } + } + }, + reload: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var top = $(dc.body2).scrollTop() + opts.deltaTopHeight; + var index = Math.floor(top/opts.rowHeight); + var page = Math.floor(index/opts.pageSize) + 1; + + this.getRows.call(this, target, page, function(rows){ + this.page = page; + this.index = (page-1)*opts.pageSize; + this.rows = rows; + this.r1 = rows; + this.r2 = []; + this.populate.call(this, target); + dc.body2.triggerHandler('scroll.datagrid'); + }); + }, + + getRows: function(target, page, callback){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var index = (page-1)*opts.pageSize; + + // if possible display the empty message + opts.emptyMsg = opts._emptyMsg; + if (this.setEmptyMsg){ + this.setEmptyMsg(target); + } + + if (index < 0){return} + if (opts.onBeforeFetch.call(target, page) == false){return;} + + var rows = state.data.firstRows.slice(index, index+opts.pageSize); + if (rows.length && (rows.length==opts.pageSize || index+rows.length==state.data.total)){ + opts.onFetch.call(target, page, rows); + callback.call(this, rows); + } else { + var param = $.extend({}, opts.queryParams, { + page: page, + rows: opts.pageSize + }); + if (opts.sortName){ + $.extend(param, { + sort: opts.sortName, + order: opts.sortOrder + }); + } + if (opts.onBeforeLoad.call(target, param) == false) return; + + $(target).datagrid('loading'); + var result = opts.loader.call(target, param, function(data){ + $(target).datagrid('loaded'); + var data = opts.loadFilter.call(target, data); + opts.onFetch.call(target, page, data.rows); + if (data.rows && data.rows.length){ + callback.call(opts.view, data.rows); + } else { + opts.onLoadSuccess.call(target, data); + } + }, function(){ + $(target).datagrid('loaded'); + opts.onLoadError.apply(target, arguments); + }); + if (result == false){ + $(target).datagrid('loaded'); + if (!state.data.firstRows.length){ + opts.onFetch.call(target, page, state.data.firstRows); + opts.onLoadSuccess.call(target, state.data); + } + } + } + }, + + populate: function(target){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var rowHeight = opts.rowHeight; + var maxHeight = opts.maxDivHeight; + + if (this.rows.length){ + opts.view.render.call(opts.view, target, dc.body2, false); + opts.view.render.call(opts.view, target, dc.body1, true); + + var body = dc.body1.add(dc.body2); + var topDiv = body.children('div.datagrid-btable-top'); + var bottomDiv = body.children('div.datagrid-btable-bottom'); + var topHeight = this.index * rowHeight; + var bottomHeight = state.data.total*rowHeight - this.rows.length*rowHeight - topHeight; + fillHeight(topDiv, topHeight); + fillHeight(bottomDiv, bottomHeight); + + state.data.rows = this.rows; + + var spos = dc.body2.scrollTop() + opts.deltaTopHeight; + if (topHeight > opts.maxVisibleHeight){ + opts.deltaTopHeight = topHeight - opts.maxVisibleHeight; + fillHeight(topDiv, topHeight - opts.deltaTopHeight); + } else { + opts.deltaTopHeight = 0; + } + if (bottomHeight > opts.maxVisibleHeight){ + fillHeight(bottomDiv, opts.maxVisibleHeight); + } else if (bottomHeight == 0){ + var lastCount = state.data.total % opts.pageSize; + if (lastCount){ + fillHeight(bottomDiv, dc.body2.height() - lastCount * rowHeight); + } + } + + $(target).datagrid('setSelectionState'); + dc.body2.scrollTop(spos - opts.deltaTopHeight); + + opts.pageNumber = this.page; + var pager = $(target).datagrid('getPager'); + if (pager.length){ + var popts = pager.pagination('options'); + var displayMsg = popts.displayMsg; + var msg = displayMsg.replace(/{from}/, this.index+1); + msg = msg.replace(/{to}/, this.index+this.rows.length); + pager.pagination('refresh', { + pageNumber: this.page, + displayMsg: msg + }); + popts.displayMsg = displayMsg; + } + if (this.setEmptyMsg){ + this.setEmptyMsg(target); + } + + opts.onLoadSuccess.call(target, { + total: state.data.total, + rows: this.rows + }); + } + function fillHeight(div, height){ + var count = Math.floor(height/maxHeight); + var leftHeight = height - maxHeight*count; + if (height < 0){ + leftHeight = 0; + } + var cc = []; + for(var i=0; i'); + } + cc.push('
                '); + $(div).html(cc.join('')); + } + }, + + updateRow: function(target, rowIndex, row){ + var opts = $.data(target, 'datagrid').options; + var rows = $(target).datagrid('getRows'); + var rowData = opts.finder.getRow(target, rowIndex); + var oldStyle = _getRowStyle(rowIndex); + $.extend(rowData, row); + var newStyle = _getRowStyle(rowIndex); + var oldClassValue = oldStyle.c; + var styleValue = newStyle.s; + var classValue = 'datagrid-row ' + (rowIndex % 2 && opts.striped ? 'datagrid-row-alt ' : ' ') + newStyle.c; + + function _getRowStyle(rowIndex){ + var css = opts.rowStyler ? opts.rowStyler.call(target, rowIndex, rowData) : ''; + var classValue = ''; + var styleValue = ''; + if (typeof css == 'string'){ + styleValue = css; + } else if (css){ + classValue = css['class'] || ''; + styleValue = css['style'] || ''; + } + return {c:classValue, s:styleValue}; + } + function _update(frozen){ + var fields = $(target).datagrid('getColumnFields', frozen); + var tr = opts.finder.getTr(target, rowIndex, 'body', (frozen?1:2)); + var checked = tr.find('div.datagrid-cell-check input[type=checkbox]').is(':checked'); + tr.html(this.renderRow.call(this, target, fields, frozen, rowIndex, rowData)); + tr.attr('style', styleValue).removeClass(oldClassValue).addClass(classValue); + if (checked){ + tr.find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true); + } + } + + _update.call(this, true); + _update.call(this, false); + $(target).datagrid('fixRowHeight', rowIndex); + }, + + // insertRow: function(target, index, row){ + // var state = $.data(target, 'datagrid'); + // var data = state.data; + + // if (index == undefined || index == null) index = data.rows.length; + // if (index > data.rows.length) index = data.rows.length; + // $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); + // if (data.firstRows && index <= data.firstRows.length){ + // data.firstRows.splice(index, 0, row); + // } + // }, + insertRow: function(target, index, row){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var data = state.data; + + var total = $(target).datagrid('getData').total; + if (index == null){index = total;} + if (index > total){index = total;} + if (data.firstRows && index <= data.firstRows.length){ + data.firstRows.splice(index, 0, row); + } + data.total++; + + var rows = this.r1.concat(this.r2); + if (index < this.index){ + this.reload.call(this, target); + } else if (index <= this.index+rows.length){ + rows.splice(index - this.index, 0, row); + this.r1 = rows.splice(0, opts.pageSize); + if (this.r2.length){ + this.r2 = rows.splice(0, opts.pageSize); + } + this.rows = this.r1.concat(this.r2); + this.populate.call(this, target); + state.dc.body2.triggerHandler('scroll.datagrid'); + } + }, + + // deleteRow: function(target, index){ + // var data = $(target).datagrid('getData'); + // $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); + // if (data.firstRows){ + // data.firstRows.splice(index, 1); + // } + // }, + deleteRow: function(target, index){ + var state = $.data(target, 'datagrid'); + var data = state.data; + var opts = state.options; + data.total--; + if (data.firstRows){ + if (index < data.firstRows.length){ + data.firstRows.splice(index, 1); + this.reload.call(this, target); + return; + } + } + + var rows = this.r1.concat(this.r2); + if (index < this.index){ + this.reload.call(this, target); + } else if (index < this.index+rows.length){ + rows.splice(index - this.index, 1); + this.r1 = rows.splice(0, opts.pageSize); + if (this.r1.length < opts.pageSize){ + this.reload.call(this, target); + } else { + this.r2 = []; + this.rows = this.r1.concat(this.r2); + this.populate.call(this, target); + state.dc.body2.triggerHandler('scroll.datagrid'); + } + } + } + }); + + $.fn.datagrid.methods.baseUpdateRow = $.fn.datagrid.methods.updateRow; + $.fn.datagrid.methods.baseGetRowIndex = $.fn.datagrid.methods.getRowIndex; + $.fn.datagrid.methods.baseScrollTo = $.fn.datagrid.methods.scrollTo; + $.fn.datagrid.methods.baseGotoPage = $.fn.datagrid.methods.gotoPage; + $.extend($.fn.datagrid.methods, { + updateRow: function(jq, param){ + return jq.each(function(){ + var opts = $(this).datagrid('options'); + var row = opts.finder.getRow(this, param.index); + if (row){ + $(this).datagrid('baseUpdateRow', param); + } else { + var firstRows = $(this).datagrid('getData').firstRows||[]; + if (param.index < firstRows.length){ + $.extend(firstRows[param.index], param.row); + } + } + }); + }, + getRowIndex: function(jq, row){ + var opts = jq.datagrid('options'); + if (opts.view.type == 'scrollview'){ + var data = jq.datagrid('getData'); + if (typeof row == 'object'){ + var index = $.easyui.indexOfArray(data.firstRows, row); + } else { + var index = $.easyui.indexOfArray(data.firstRows, opts.idField, row); + } + if (index >= 0){ + return index; + } else { + index = jq.datagrid('baseGetRowIndex', row); + return (index == -1) ? -1 : index+opts.view.index; + } + } else { + return jq.datagrid('baseGetRowIndex', row); + } + }, + getRow: function(jq, index){ + return jq.datagrid('options').finder.getRow(jq[0], index); + }, + gotoPage: function(jq, param){ + return jq.each(function(){ + var target = this; + var opts = $(target).datagrid('options'); + if (opts.view.type == 'scrollview'){ + var page, callback; + if (typeof param == 'object'){ + page = param.page; + callback = param.callback; + } else { + page = param; + } + opts.view.getRows.call(opts.view, target, page, function(rows){ + this.page = page; + this.index = (page-1)*opts.pageSize; + this.rows = rows; + this.r1 = rows; + this.r2 = []; + this.populate.call(this, target); + $(target).data('datagrid').dc.body2.scrollTop(this.index * opts.rowHeight - opts.deltaTopHeight); + if (callback){ + callback.call(target, page); + } + }); + } else { + $(target).datagrid('baseGotoPage', param); + } + }); + }, + scrollTo: function(jq, param){ + return jq.each(function(){ + var target = this; + var opts = $(target).datagrid('options'); + var index, callback; + if (typeof param == 'object'){ + index = param.index; + callback = param.callback; + } else { + index = param; + } + var view = opts.view; + if (view.type == 'scrollview'){ + if (index >= view.index && index < view.index+view.rows.length){ + $(target).datagrid('baseScrollTo', index); + if (callback){ + callback.call(target, index); + } + } else if (index >= 0){ + var page = Math.floor(index/opts.pageSize) + 1; + $(target).datagrid('gotoPage', { + page: page, + callback: function(){ + setTimeout(function(){ + $(target).datagrid('baseScrollTo', index); + if (callback){ + callback.call(target, index); + } + }, 0); + } + }); + } + } else { + $(target).datagrid('baseScrollTo', index); + if (callback){ + callback.call(target, index); + } + } + }); + } + }); + + $.extend($.fn.datagrid.methods, { + fixDetailRowHeight: function(jq, index){ + return jq.each(function(){ + var opts = $.data(this, 'datagrid').options; + var dc = $.data(this, 'datagrid').dc; + var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); + var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); + // fix the detail row height + if (tr2.is(':visible')){ + tr1.css('height', ''); + tr2.css('height', ''); + var height = Math.max(tr1.height(), tr2.height()); + tr1.css('height', height); + tr2.css('height', height); + } + dc.body2.triggerHandler('scroll'); + }); + }, + getExpander: function(jq, index){ // get row expander object + var opts = $.data(jq[0], 'datagrid').options; + return opts.finder.getTr(jq[0], index).find('span.datagrid-row-expander'); + }, + // get row detail container + getRowDetail: function(jq, index){ + var opts = $.data(jq[0], 'datagrid').options; + var tr = opts.finder.getTr(jq[0], index, 'body', 2); + return tr.next().find('div.datagrid-row-detail'); + }, + expandRow: function(jq, index){ + return jq.each(function(){ + var opts = $(this).datagrid('options'); + var dc = $.data(this, 'datagrid').dc; + var expander = $(this).datagrid('getExpander', index); + if (expander.hasClass('datagrid-row-expand')){ + expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); + var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); + var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); + tr1.show(); + tr2.show(); + $(this).datagrid('fixDetailRowHeight', index); + if (opts.onExpandRow){ + var row = $(this).datagrid('getRows')[index]; + opts.onExpandRow.call(this, index, row); + } + } + }); + }, + collapseRow: function(jq, index){ + return jq.each(function(){ + var opts = $(this).datagrid('options'); + var dc = $.data(this, 'datagrid').dc; + var expander = $(this).datagrid('getExpander', index); + if (expander.hasClass('datagrid-row-collapse')){ + expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); + var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); + var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); + tr1.hide(); + tr2.hide(); + dc.body2.triggerHandler('scroll'); + if (opts.onCollapseRow){ + var row = $(this).datagrid('getRows')[index]; + opts.onCollapseRow.call(this, index, row); + } + } + }); + } + }); +}(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.accordion.js b/assets/js/easy-ui/plugins/jquery.accordion.js old mode 100755 new mode 100644 index 53664c8acc..9513fef9d0 --- a/assets/js/easy-ui/plugins/jquery.accordion.js +++ b/assets/js/easy-ui/plugins/jquery.accordion.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -13,302 +13,338 @@ var _4=$.data(_2,"accordion"); var _5=_4.options; var _6=_4.panels; var cc=$(_2); +var _7=(_5.halign=="left"||_5.halign=="right"); +cc.children(".panel-last").removeClass("panel-last"); +cc.children(".panel:last").addClass("panel-last"); if(_3){ $.extend(_5,{width:_3.width,height:_3.height}); } cc._size(_5); -var _7=0; -var _8="auto"; -var _9=cc.find(">div.panel>div.accordion-header"); -if(_9.length){ -_7=$(_9[0]).css("height","")._outerHeight(); +var _8=0; +var _9="auto"; +var _a=cc.find(">.panel>.accordion-header"); +if(_a.length){ +if(_7){ +$(_6[0]).panel("resize",{width:cc.width(),height:cc.height()}); +_8=$(_a[0])._outerWidth(); +}else{ +_8=$(_a[0]).css("height","")._outerHeight(); +} } if(!isNaN(parseInt(_5.height))){ -_8=cc.height()-_7*_9.length; +if(_7){ +_9=cc.width()-_8*_a.length; +}else{ +_9=cc.height()-_8*_a.length; } -_a(true,_8-_a(false)+1); -function _a(_b,_c){ -var _d=0; +} +_b(true,_9-_b(false)); +function _b(_c,_d){ +var _e=0; for(var i=0;i<_6.length;i++){ var p=_6[i]; -var h=p.panel("header")._outerHeight(_7); -if(p.panel("options").collapsible==_b){ -var _e=isNaN(_c)?undefined:(_c+_7*h.length); -p.panel("resize",{width:cc.width(),height:(_b?_e:undefined)}); -_d+=p.panel("panel").outerHeight()-_7*h.length; +if(_7){ +var h=p.panel("header")._outerWidth(_8); +}else{ +var h=p.panel("header")._outerHeight(_8); } +if(p.panel("options").collapsible==_c){ +var _f=isNaN(_d)?undefined:(_d+_8*h.length); +if(_7){ +p.panel("resize",{height:cc.height(),width:(_c?_f:undefined)}); +_e+=p.panel("panel")._outerWidth()-_8*h.length; +}else{ +p.panel("resize",{width:cc.width(),height:(_c?_f:undefined)}); +_e+=p.panel("panel").outerHeight()-_8*h.length; } -return _d; +} +} +return _e; }; }; -function _f(_10,_11,_12,all){ -var _13=$.data(_10,"accordion").panels; +function _10(_11,_12,_13,all){ +var _14=$.data(_11,"accordion").panels; var pp=[]; -for(var i=0;i<_13.length;i++){ -var p=_13[i]; -if(_11){ -if(p.panel("options")[_11]==_12){ +for(var i=0;i<_14.length;i++){ +var p=_14[i]; +if(_12){ +if(p.panel("options")[_12]==_13){ pp.push(p); } }else{ -if(p[0]==$(_12)[0]){ +if(p[0]==$(_13)[0]){ return i; } } } -if(_11){ +if(_12){ return all?pp:(pp.length?pp[0]:null); }else{ return -1; } }; -function _14(_15){ -return _f(_15,"collapsed",false,true); +function _15(_16){ +return _10(_16,"collapsed",false,true); }; -function _16(_17){ -var pp=_14(_17); +function _17(_18){ +var pp=_15(_18); return pp.length?pp[0]:null; }; -function _18(_19,_1a){ -return _f(_19,null,_1a); +function _19(_1a,_1b){ +return _10(_1a,null,_1b); }; -function _1b(_1c,_1d){ -var _1e=$.data(_1c,"accordion").panels; -if(typeof _1d=="number"){ -if(_1d<0||_1d>=_1e.length){ +function _1c(_1d,_1e){ +var _1f=$.data(_1d,"accordion").panels; +if(typeof _1e=="number"){ +if(_1e<0||_1e>=_1f.length){ return null; }else{ -return _1e[_1d]; +return _1f[_1e]; } } -return _f(_1c,"title",_1d); +return _10(_1d,"title",_1e); }; -function _1f(_20){ -var _21=$.data(_20,"accordion").options; -var cc=$(_20); -if(_21.border){ +function _20(_21){ +var _22=$.data(_21,"accordion").options; +var cc=$(_21); +if(_22.border){ cc.removeClass("accordion-noborder"); }else{ cc.addClass("accordion-noborder"); } }; -function _22(_23){ -var _24=$.data(_23,"accordion"); -var cc=$(_23); +function _23(_24){ +var _25=$.data(_24,"accordion"); +var cc=$(_24); cc.addClass("accordion"); -_24.panels=[]; +_25.panels=[]; cc.children("div").each(function(){ -var _25=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); +var _26=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); var pp=$(this); -_24.panels.push(pp); -_27(_23,pp,_25); +_25.panels.push(pp); +_28(_24,pp,_26); }); -cc.bind("_resize",function(e,_26){ -if($(this).hasClass("easyui-fluid")||_26){ -_1(_23); +cc.bind("_resize",function(e,_27){ +if($(this).hasClass("easyui-fluid")||_27){ +_1(_24); } return false; }); }; -function _27(_28,pp,_29){ -var _2a=$.data(_28,"accordion").options; -pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body"},_29,{onBeforeExpand:function(){ -if(_29.onBeforeExpand){ -if(_29.onBeforeExpand.call(this)==false){ +function _28(_29,pp,_2a){ +var _2b=$.data(_29,"accordion").options; +pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body",halign:_2b.halign},_2a,{onBeforeExpand:function(){ +if(_2a.onBeforeExpand){ +if(_2a.onBeforeExpand.call(this)==false){ return false; } } -if(!_2a.multiple){ -var all=$.grep(_14(_28),function(p){ +if(!_2b.multiple){ +var all=$.grep(_15(_29),function(p){ return p.panel("options").collapsible; }); for(var i=0;i.panel-last>.accordion-header").removeClass("accordion-header-border"); +if(_2a.onExpand){ +_2a.onExpand.call(this); } -_2a.onSelect.call(_28,$(this).panel("options").title,_18(_28,this)); +_2b.onSelect.call(_29,$(this).panel("options").title,_19(_29,this)); },onBeforeCollapse:function(){ -if(_29.onBeforeCollapse){ -if(_29.onBeforeCollapse.call(this)==false){ +if(_2a.onBeforeCollapse){ +if(_2a.onBeforeCollapse.call(this)==false){ return false; } } -var _2c=$(this).panel("header"); -_2c.removeClass("accordion-header-selected"); -_2c.find(".accordion-collapse").addClass("accordion-expand"); +$(_29).find(">.panel-last>.accordion-header").addClass("accordion-header-border"); +var _2d=$(this).panel("header"); +_2d.removeClass("accordion-header-selected"); +_2d.find(".accordion-collapse").addClass("accordion-expand"); },onCollapse:function(){ -if(_29.onCollapse){ -_29.onCollapse.call(this); +if(isNaN(parseInt(_2b.height))){ +$(_29).find(">.panel-last>.accordion-header").removeClass("accordion-header-border"); +} +if(_2a.onCollapse){ +_2a.onCollapse.call(this); } -_2a.onUnselect.call(_28,$(this).panel("options").title,_18(_28,this)); +_2b.onUnselect.call(_29,$(this).panel("options").title,_19(_29,this)); }})); -var _2d=pp.panel("header"); -var _2e=_2d.children("div.panel-tool"); -_2e.children("a.panel-tool-collapse").hide(); -var t=$("").addClass("accordion-collapse accordion-expand").appendTo(_2e); +var _2e=pp.panel("header"); +var _2f=_2e.children("div.panel-tool"); +_2f.children("a.panel-tool-collapse").hide(); +var t=$("").addClass("accordion-collapse accordion-expand").appendTo(_2f); t.bind("click",function(){ -var _2f=_18(_28,pp); -if(pp.panel("options").collapsed){ -_30(_28,_2f); -}else{ -_35(_28,_2f); -} +_30(pp); return false; }); pp.panel("options").collapsible?t.show():t.hide(); -_2d.click(function(){ -$(this).find("a.accordion-collapse:visible").triggerHandler("click"); +if(_2b.halign=="left"||_2b.halign=="right"){ +t.hide(); +} +_2e.click(function(){ +_30(pp); return false; }); +function _30(p){ +var _31=p.panel("options"); +if(_31.collapsible){ +var _32=_19(_29,p); +if(_31.collapsed){ +_33(_29,_32); +}else{ +_34(_29,_32); +} +} }; -function _30(_31,_32){ -var p=_1b(_31,_32); +}; +function _33(_35,_36){ +var p=_1c(_35,_36); if(!p){ return; } -_33(_31); -var _34=$.data(_31,"accordion").options; -p.panel("expand",_34.animate); +_37(_35); +var _38=$.data(_35,"accordion").options; +p.panel("expand",_38.animate); }; -function _35(_36,_37){ -var p=_1b(_36,_37); +function _34(_39,_3a){ +var p=_1c(_39,_3a); if(!p){ return; } -_33(_36); -var _38=$.data(_36,"accordion").options; -p.panel("collapse",_38.animate); +_37(_39); +var _3b=$.data(_39,"accordion").options; +p.panel("collapse",_3b.animate); }; -function _39(_3a){ -var _3b=$.data(_3a,"accordion").options; -var p=_f(_3a,"selected",true); +function _3c(_3d){ +var _3e=$.data(_3d,"accordion").options; +$(_3d).find(">.panel-last>.accordion-header").addClass("accordion-header-border"); +var p=_10(_3d,"selected",true); if(p){ -_3c(_18(_3a,p)); +_3f(_19(_3d,p)); }else{ -_3c(_3b.selected); +_3f(_3e.selected); } -function _3c(_3d){ -var _3e=_3b.animate; -_3b.animate=false; -_30(_3a,_3d); -_3b.animate=_3e; +function _3f(_40){ +var _41=_3e.animate; +_3e.animate=false; +_33(_3d,_40); +_3e.animate=_41; }; }; -function _33(_3f){ -var _40=$.data(_3f,"accordion").panels; -for(var i=0;i<_40.length;i++){ -_40[i].stop(true,true); +function _37(_42){ +var _43=$.data(_42,"accordion").panels; +for(var i=0;i<_43.length;i++){ +_43[i].stop(true,true); } }; -function add(_41,_42){ -var _43=$.data(_41,"accordion"); -var _44=_43.options; -var _45=_43.panels; -if(_42.selected==undefined){ -_42.selected=true; -} -_33(_41); -var pp=$("
                ").appendTo(_41); -_45.push(pp); -_27(_41,pp,_42); -_1(_41); -_44.onAdd.call(_41,_42.title,_45.length-1); -if(_42.selected){ -_30(_41,_45.length-1); +function add(_44,_45){ +var _46=$.data(_44,"accordion"); +var _47=_46.options; +var _48=_46.panels; +if(_45.selected==undefined){ +_45.selected=true; +} +_37(_44); +var pp=$("
                ").appendTo(_44); +_48.push(pp); +_28(_44,pp,_45); +_1(_44); +_47.onAdd.call(_44,_45.title,_48.length-1); +if(_45.selected){ +_33(_44,_48.length-1); } }; -function _46(_47,_48){ -var _49=$.data(_47,"accordion"); -var _4a=_49.options; -var _4b=_49.panels; -_33(_47); -var _4c=_1b(_47,_48); -var _4d=_4c.panel("options").title; -var _4e=_18(_47,_4c); -if(!_4c){ +function _49(_4a,_4b){ +var _4c=$.data(_4a,"accordion"); +var _4d=_4c.options; +var _4e=_4c.panels; +_37(_4a); +var _4f=_1c(_4a,_4b); +var _50=_4f.panel("options").title; +var _51=_19(_4a,_4f); +if(!_4f){ return; } -if(_4a.onBeforeRemove.call(_47,_4d,_4e)==false){ +if(_4d.onBeforeRemove.call(_4a,_50,_51)==false){ return; } -_4b.splice(_4e,1); -_4c.panel("destroy"); -if(_4b.length){ -_1(_47); -var _4f=_16(_47); -if(!_4f){ -_30(_47,0); +_4e.splice(_51,1); +_4f.panel("destroy"); +if(_4e.length){ +_1(_4a); +var _52=_17(_4a); +if(!_52){ +_33(_4a,0); } } -_4a.onRemove.call(_47,_4d,_4e); +_4d.onRemove.call(_4a,_50,_51); }; -$.fn.accordion=function(_50,_51){ -if(typeof _50=="string"){ -return $.fn.accordion.methods[_50](this,_51); +$.fn.accordion=function(_53,_54){ +if(typeof _53=="string"){ +return $.fn.accordion.methods[_53](this,_54); } -_50=_50||{}; +_53=_53||{}; return this.each(function(){ -var _52=$.data(this,"accordion"); -if(_52){ -$.extend(_52.options,_50); +var _55=$.data(this,"accordion"); +if(_55){ +$.extend(_55.options,_53); }else{ -$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_50),accordion:$(this).addClass("accordion"),panels:[]}); -_22(this); +$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_53),accordion:$(this).addClass("accordion"),panels:[]}); +_23(this); } -_1f(this); +_20(this); _1(this); -_39(this); +_3c(this); }); }; $.fn.accordion.methods={options:function(jq){ return $.data(jq[0],"accordion").options; },panels:function(jq){ return $.data(jq[0],"accordion").panels; -},resize:function(jq,_53){ +},resize:function(jq,_56){ return jq.each(function(){ -_1(this,_53); +_1(this,_56); }); },getSelections:function(jq){ -return _14(jq[0]); +return _15(jq[0]); },getSelected:function(jq){ -return _16(jq[0]); -},getPanel:function(jq,_54){ -return _1b(jq[0],_54); -},getPanelIndex:function(jq,_55){ -return _18(jq[0],_55); -},select:function(jq,_56){ +return _17(jq[0]); +},getPanel:function(jq,_57){ +return _1c(jq[0],_57); +},getPanelIndex:function(jq,_58){ +return _19(jq[0],_58); +},select:function(jq,_59){ return jq.each(function(){ -_30(this,_56); +_33(this,_59); }); -},unselect:function(jq,_57){ +},unselect:function(jq,_5a){ return jq.each(function(){ -_35(this,_57); +_34(this,_5a); }); -},add:function(jq,_58){ +},add:function(jq,_5b){ return jq.each(function(){ -add(this,_58); +add(this,_5b); }); -},remove:function(jq,_59){ +},remove:function(jq,_5c){ return jq.each(function(){ -_46(this,_59); +_49(this,_5c); }); }}; -$.fn.accordion.parseOptions=function(_5a){ -var t=$(_5a); -return $.extend({},$.parser.parseOptions(_5a,["width","height",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}])); +$.fn.accordion.parseOptions=function(_5d){ +var t=$(_5d); +return $.extend({},$.parser.parseOptions(_5d,["width","height","halign",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}])); }; -$.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,onSelect:function(_5b,_5c){ -},onUnselect:function(_5d,_5e){ -},onAdd:function(_5f,_60){ -},onBeforeRemove:function(_61,_62){ -},onRemove:function(_63,_64){ +$.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,halign:"top",onSelect:function(_5e,_5f){ +},onUnselect:function(_60,_61){ +},onAdd:function(_62,_63){ +},onBeforeRemove:function(_64,_65){ +},onRemove:function(_66,_67){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.calendar.js b/assets/js/easy-ui/plugins/jquery.calendar.js old mode 100755 new mode 100644 index b157edcbef..9ca3632ccb --- a/assets/js/easy-ui/plugins/jquery.calendar.js +++ b/assets/js/easy-ui/plugins/jquery.calendar.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -249,6 +249,9 @@ var _35=$(_2f).find("div.calendar-body"); _35.children("table").remove(); var _36=[""]; _36.push(""); +if(_30.showWeek){ +_36.push(""); +} for(var i=_30.firstDay;i<_30.weeks.length;i++){ _36.push(""); } @@ -269,20 +272,24 @@ cls="calendar-last"; } } _36.push(""); +if(_30.showWeek){ +var _39=_30.getWeekNumber(new Date(_38[0][0],parseInt(_38[0][1])-1,_38[0][2])); +_36.push(""); +} for(var j=0;j<_38.length;j++){ var day=_38[j]; var s=day[0]+","+day[1]+","+day[2]; -var _39=new Date(day[0],parseInt(day[1])-1,day[2]); -var d=_30.formatter.call(_2f,_39); -var css=_30.styler.call(_2f,_39); -var _3a=""; +var _3a=new Date(day[0],parseInt(day[1])-1,day[2]); +var d=_30.formatter.call(_2f,_3a); +var css=_30.styler.call(_2f,_3a); var _3b=""; +var _3c=""; if(typeof css=="string"){ -_3b=css; +_3c=css; }else{ if(css){ -_3a=css["class"]||""; -_3b=css["style"]||""; +_3b=css["class"]||""; +_3c=css["style"]||""; } } var cls="calendar-day"; @@ -309,11 +316,11 @@ if(j==_38.length-1){ cls+=" calendar-last"; } } -cls+=" "+_3a; -if(!_30.validator.call(_2f,_39)){ +cls+=" "+_3b; +if(!_30.validator.call(_2f,_3a)){ cls+=" calendar-disabled"; } -_36.push(""); +_36.push(""); } _36.push(""); } @@ -323,20 +330,20 @@ _35.append(_36.join("")); _35.children("table.calendar-dtable").prependTo(_35); _30.onNavigate.call(_2f,_30.year,_30.month); }; -$.fn.calendar=function(_3c,_3d){ -if(typeof _3c=="string"){ -return $.fn.calendar.methods[_3c](this,_3d); +$.fn.calendar=function(_3d,_3e){ +if(typeof _3d=="string"){ +return $.fn.calendar.methods[_3d](this,_3e); } -_3c=_3c||{}; +_3d=_3d||{}; return this.each(function(){ -var _3e=$.data(this,"calendar"); -if(_3e){ -$.extend(_3e.options,_3c); +var _3f=$.data(this,"calendar"); +if(_3f){ +$.extend(_3f.options,_3d); }else{ -_3e=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_3c)}); +_3f=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_3d)}); _6(this); } -if(_3e.options.border==false){ +if(_3f.options.border==false){ $(this).addClass("calendar-noborder"); } _1(this); @@ -347,38 +354,50 @@ $(this).find("div.calendar-menu").hide(); }; $.fn.calendar.methods={options:function(jq){ return $.data(jq[0],"calendar").options; -},resize:function(jq,_3f){ +},resize:function(jq,_40){ return jq.each(function(){ -_1(this,_3f); +_1(this,_40); }); -},moveTo:function(jq,_40){ +},moveTo:function(jq,_41){ return jq.each(function(){ -var _41=$(this).calendar("options"); -if(_41.validator.call(this,_40)){ -var _42=_41.current; -$(this).calendar({year:_40.getFullYear(),month:_40.getMonth()+1,current:_40}); -if(!_42||_42.getTime()!=_40.getTime()){ -_41.onChange.call(this,_41.current,_42); +if(!_41){ +var now=new Date(); +$(this).calendar({year:now.getFullYear(),month:now.getMonth()+1,current:_41}); +return; +} +var _42=$(this).calendar("options"); +if(_42.validator.call(this,_41)){ +var _43=_42.current; +$(this).calendar({year:_41.getFullYear(),month:_41.getMonth()+1,current:_41}); +if(!_43||_43.getTime()!=_41.getTime()){ +_42.onChange.call(this,_42.current,_43); } } }); }}; -$.fn.calendar.parseOptions=function(_43){ -var t=$(_43); -return $.extend({},$.parser.parseOptions(_43,[{firstDay:"number",fit:"boolean",border:"boolean"}])); +$.fn.calendar.parseOptions=function(_44){ +var t=$(_44); +return $.extend({},$.parser.parseOptions(_44,["weekNumberHeader",{firstDay:"number",fit:"boolean",border:"boolean",showWeek:"boolean"}])); }; -$.fn.calendar.defaults={width:180,height:180,fit:false,border:true,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){ +$.fn.calendar.defaults={width:180,height:180,fit:false,border:true,showWeek:false,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){ var d=new Date(); return new Date(d.getFullYear(),d.getMonth(),d.getDate()); -})(),formatter:function(_44){ -return _44.getDate(); -},styler:function(_45){ +})(),weekNumberHeader:"",getWeekNumber:function(_45){ +var _46=new Date(_45.getTime()); +_46.setDate(_46.getDate()+4-(_46.getDay()||7)); +var _47=_46.getTime(); +_46.setMonth(0); +_46.setDate(1); +return Math.floor(Math.round((_47-_46)/86400000)/7)+1; +},formatter:function(_48){ +return _48.getDate(); +},styler:function(_49){ return ""; -},validator:function(_46){ +},validator:function(_4a){ return true; -},onSelect:function(_47){ -},onChange:function(_48,_49){ -},onNavigate:function(_4a,_4b){ +},onSelect:function(_4b){ +},onChange:function(_4c,_4d){ +},onNavigate:function(_4e,_4f){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.combo.js b/assets/js/easy-ui/plugins/jquery.combo.js old mode 100755 new mode 100644 index b66b9fc2a6..a74c3d0231 --- a/assets/js/easy-ui/plugins/jquery.combo.js +++ b/assets/js/easy-ui/plugins/jquery.combo.js @@ -1,16 +1,16 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ $(function(){ $(document).unbind(".combo").bind("mousedown.combo mousewheel.combo",function(e){ -var p=$(e.target).closest("span.combo,div.combo-p"); +var p=$(e.target).closest("span.combo,div.combo-p,div.menu"); if(p.length){ _1(p); return; @@ -30,10 +30,10 @@ if(_7){ _7.options.onShowPanel.call(_6); } },onBeforeClose:function(){ -_1(this); +_1($(this).parent()); },onClose:function(){ var _8=$(this).panel("options").comboTarget; -var _9=$.data(_8,"combo"); +var _9=$(_8).data("combo"); if(_9){ _9.options.onHidePanel.call(_8); } @@ -66,198 +66,209 @@ $(_c).textbox("destroy"); function _f(_10){ var _11=$.data(_10,"combo").panel; if(_11.is(":visible")){ -_12(_10); +var _12=_11.combo("combo"); +_13(_12); +if(_12!=_10){ +$(_10).combo("showPanel"); +} }else{ -var p=$(_10).closest("div.combo-panel"); +var p=$(_10).closest("div.combo-p").children(".combo-panel"); $("div.combo-panel:visible").not(_11).not(p).panel("close"); $(_10).combo("showPanel"); } $(_10).combo("textbox").focus(); }; -function _1(_13){ -$(_13).find(".combo-f").each(function(){ +function _1(_14){ +$(_14).find(".combo-f").each(function(){ var p=$(this).combo("panel"); if(p.is(":visible")){ p.panel("close"); } }); }; -function _14(e){ -var _15=e.data.target; -var _16=$.data(_15,"combo"); -var _17=_16.options; -var _18=_16.panel; -if(!_17.editable){ -_f(_15); +function _15(e){ +var _16=e.data.target; +var _17=$.data(_16,"combo"); +var _18=_17.options; +if(!_18.editable){ +_f(_16); }else{ -var p=$(_15).closest("div.combo-panel"); -$("div.combo-panel:visible").not(_18).not(p).panel("close"); +var p=$(_16).closest("div.combo-p").children(".combo-panel"); +$("div.combo-panel:visible").not(p).each(function(){ +var _19=$(this).combo("combo"); +if(_19!=_16){ +_13(_19); +} +}); } }; -function _19(e){ -var _1a=e.data.target; -var t=$(_1a); -var _1b=t.data("combo"); -var _1c=t.combo("options"); +function _1a(e){ +var _1b=e.data.target; +var t=$(_1b); +var _1c=t.data("combo"); +var _1d=t.combo("options"); +_1c.panel.panel("options").comboTarget=_1b; switch(e.keyCode){ case 38: -_1c.keyHandler.up.call(_1a,e); +_1d.keyHandler.up.call(_1b,e); break; case 40: -_1c.keyHandler.down.call(_1a,e); +_1d.keyHandler.down.call(_1b,e); break; case 37: -_1c.keyHandler.left.call(_1a,e); +_1d.keyHandler.left.call(_1b,e); break; case 39: -_1c.keyHandler.right.call(_1a,e); +_1d.keyHandler.right.call(_1b,e); break; case 13: e.preventDefault(); -_1c.keyHandler.enter.call(_1a,e); +_1d.keyHandler.enter.call(_1b,e); return false; case 9: case 27: -_12(_1a); +_13(_1b); break; default: -if(_1c.editable){ -if(_1b.timer){ -clearTimeout(_1b.timer); +if(_1d.editable){ +if(_1c.timer){ +clearTimeout(_1c.timer); } -_1b.timer=setTimeout(function(){ +_1c.timer=setTimeout(function(){ var q=t.combo("getText"); -if(_1b.previousText!=q){ -_1b.previousText=q; +if(_1c.previousText!=q){ +_1c.previousText=q; t.combo("showPanel"); -_1c.keyHandler.query.call(_1a,q,e); +_1d.keyHandler.query.call(_1b,q,e); t.combo("validate"); } -},_1c.delay); +},_1d.delay); } } }; -function _1d(_1e){ -var _1f=$.data(_1e,"combo"); -var _20=_1f.combo; -var _21=_1f.panel; -var _22=$(_1e).combo("options"); -var _23=_21.panel("options"); -_23.comboTarget=_1e; -if(_23.closed){ -_21.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:$.fn.window.defaults.zIndex++),left:-999999}); -_21.panel("resize",{width:(_22.panelWidth?_22.panelWidth:_20._outerWidth()),height:_22.panelHeight}); -_21.panel("panel").hide(); -_21.panel("open"); +function _1e(_1f){ +var _20=$.data(_1f,"combo"); +var _21=_20.combo; +var _22=_20.panel; +var _23=$(_1f).combo("options"); +var _24=_22.panel("options"); +_24.comboTarget=_1f; +if(_24.closed){ +_22.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999}); +_22.panel("resize",{width:(_23.panelWidth?_23.panelWidth:_21._outerWidth()),height:_23.panelHeight}); +_22.panel("panel").hide(); +_22.panel("open"); } (function(){ -if(_21.is(":visible")){ -_21.panel("move",{left:_24(),top:_25()}); +if(_24.comboTarget==_1f&&_22.is(":visible")){ +_22.panel("move",{left:_25(),top:_26()}); setTimeout(arguments.callee,200); } })(); -function _24(){ -var _26=_20.offset().left; -if(_22.panelAlign=="right"){ -_26+=_20._outerWidth()-_21._outerWidth(); +function _25(){ +var _27=_21.offset().left; +if(_23.panelAlign=="right"){ +_27+=_21._outerWidth()-_22._outerWidth(); } -if(_26+_21._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){ -_26=$(window)._outerWidth()+$(document).scrollLeft()-_21._outerWidth(); +if(_27+_22._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){ +_27=$(window)._outerWidth()+$(document).scrollLeft()-_22._outerWidth(); } -if(_26<0){ -_26=0; +if(_27<0){ +_27=0; } -return _26; +return _27; }; -function _25(){ -var top=_20.offset().top+_20._outerHeight(); -if(top+_21._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ -top=_20.offset().top-_21._outerHeight(); +function _26(){ +var top=_21.offset().top+_21._outerHeight(); +if(top+_22._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ +top=_21.offset().top-_22._outerHeight(); } if(top<$(document).scrollTop()){ -top=_20.offset().top+_20._outerHeight(); +top=_21.offset().top+_21._outerHeight(); } return top; }; }; -function _12(_27){ -var _28=$.data(_27,"combo").panel; -_28.panel("close"); +function _13(_28){ +var _29=$.data(_28,"combo").panel; +_29.panel("close"); }; -function _29(_2a){ -var _2b=$.data(_2a,"combo"); -var _2c=_2b.options; -var _2d=_2b.combo; -$(_2a).textbox("clear"); -if(_2c.multiple){ -_2d.find(".textbox-value").remove(); -}else{ -_2d.find(".textbox-value").val(""); -} -}; -function _2e(_2f,_30){ -var _31=$.data(_2f,"combo"); -var _32=$(_2f).textbox("getText"); -if(_32!=_30){ -$(_2f).textbox("setText",_30); -_31.previousText=_30; +function _2a(_2b,_2c){ +var _2d=$.data(_2b,"combo"); +var _2e=$(_2b).textbox("getText"); +if(_2e!=_2c){ +$(_2b).textbox("setText",_2c); } +_2d.previousText=_2c; }; -function _33(_34){ -var _35=[]; -var _36=$.data(_34,"combo").combo; -_36.find(".textbox-value").each(function(){ -_35.push($(this).val()); +function _2f(_30){ +var _31=$.data(_30,"combo"); +var _32=_31.options; +var _33=$(_30).next(); +var _34=[]; +_33.find(".textbox-value").each(function(){ +_34.push($(this).val()); }); -return _35; +if(_32.multivalue){ +return _34; +}else{ +return _34.length?_34[0].split(_32.separator):_34; +} }; -function _37(_38,_39){ -var _3a=$.data(_38,"combo"); -var _3b=_3a.options; -var _3c=_3a.combo; -if(!$.isArray(_39)){ -_39=_39.split(_3b.separator); -} -var _3d=_33(_38); -_3c.find(".textbox-value").remove(); -var _3e=$(_38).attr("textboxName")||""; -for(var i=0;i<_39.length;i++){ -var _3f=$("").appendTo(_3c); +function _35(_36,_37){ +var _38=$.data(_36,"combo"); +var _39=_38.combo; +var _3a=$(_36).combo("options"); +if(!$.isArray(_37)){ +_37=_37.split(_3a.separator); +} +var _3b=_2f(_36); +_39.find(".textbox-value").remove(); +if(_37.length){ +if(_3a.multivalue){ +for(var i=0;i<_37.length;i++){ +_3c(_37[i]); +} +}else{ +_3c(_37.join(_3a.separator)); +} +} +function _3c(_3d){ +var _3e=$(_36).attr("textboxName")||""; +var _3f=$("").appendTo(_39); _3f.attr("name",_3e); -if(_3b.disabled){ +if(_3a.disabled){ _3f.attr("disabled","disabled"); } -_3f.val(_39[i]); -} +_3f.val(_3d); +}; var _40=(function(){ -if(_3d.length!=_39.length){ +if(_3b.length!=_37.length){ return true; } -var a1=$.extend(true,[],_3d); -var a2=$.extend(true,[],_39); -a1.sort(); -a2.sort(); -for(var i=0;i_c.height()){ -var h=_c.scrollTop()+_d.position().top+_d.outerHeight()-_c.height(); -_c.scrollTop(h); +if(_a.position().top+_a.outerHeight()>_9.height()){ +var h=_9.scrollTop()+_a.position().top+_a.outerHeight()-_9.height(); +_9.scrollTop(h); } } } +_9.triggerHandler("scroll"); }; -function _e(_f,dir){ -var _10=$.data(_f,"combobox").options; -var _11=$(_f).combobox("panel"); -var _12=_11.children("div.combobox-item-hover"); -if(!_12.length){ -_12=_11.children("div.combobox-item-selected"); -} -_12.removeClass("combobox-item-hover"); -var _13="div.combobox-item:visible:not(.combobox-item-disabled):first"; -var _14="div.combobox-item:visible:not(.combobox-item-disabled):last"; -if(!_12.length){ -_12=_11.children(dir=="next"?_13:_14); +function _b(_c,_d){ +var _e=$.data(_c,"combobox").options; +var _f=$(_c).combobox("panel"); +var _10=_f.children("div.combobox-item-hover"); +if(!_10.length){ +_10=_f.children("div.combobox-item-selected"); +} +_10.removeClass("combobox-item-hover"); +var _11="div.combobox-item:visible:not(.combobox-item-disabled):first"; +var _12="div.combobox-item:visible:not(.combobox-item-disabled):last"; +if(!_10.length){ +_10=_f.children(_d=="next"?_11:_12); }else{ -if(dir=="next"){ -_12=_12.nextAll(_13); -if(!_12.length){ -_12=_11.children(_13); +if(_d=="next"){ +_10=_10.nextAll(_11); +if(!_10.length){ +_10=_f.children(_11); } }else{ -_12=_12.prevAll(_13); -if(!_12.length){ -_12=_11.children(_14); +_10=_10.prevAll(_11); +if(!_10.length){ +_10=_f.children(_12); } } } -if(_12.length){ -_12.addClass("combobox-item-hover"); -var row=_10.finder.getRow(_f,_12); +if(_10.length){ +_10.addClass("combobox-item-hover"); +var row=_e.finder.getRow(_c,_10); if(row){ -_8(_f,row[_10.valueField]); -if(_10.selectOnNavigation){ -_15(_f,row[_10.valueField]); +$(_c).combobox("scrollTo",row[_e.valueField]); +if(_e.selectOnNavigation){ +_13(_c,row[_e.valueField]); } } } }; -function _15(_16,_17){ -var _18=$.data(_16,"combobox").options; -var _19=$(_16).combo("getValues"); -if($.inArray(_17+"",_19)==-1){ -if(_18.multiple){ -_19.push(_17); +function _13(_14,_15,_16){ +var _17=$.data(_14,"combobox").options; +var _18=$(_14).combo("getValues"); +if($.inArray(_15+"",_18)==-1){ +if(_17.multiple){ +_18.push(_15); }else{ -_19=[_17]; +_18=[_15]; } -_1a(_16,_19); -_18.onSelect.call(_16,_18.finder.getRow(_16,_17)); +_19(_14,_18,_16); } }; -function _1b(_1c,_1d){ -var _1e=$.data(_1c,"combobox").options; -var _1f=$(_1c).combo("getValues"); -var _20=$.inArray(_1d+"",_1f); -if(_20>=0){ -_1f.splice(_20,1); -_1a(_1c,_1f); -_1e.onUnselect.call(_1c,_1e.finder.getRow(_1c,_1d)); +function _1a(_1b,_1c){ +var _1d=$.data(_1b,"combobox").options; +var _1e=$(_1b).combo("getValues"); +var _1f=$.inArray(_1c+"",_1e); +if(_1f>=0){ +_1e.splice(_1f,1); +_19(_1b,_1e); } }; -function _1a(_21,_22,_23){ -var _24=$.data(_21,"combobox").options; -var _25=$(_21).combo("panel"); -if(!$.isArray(_22)){ -_22=_22.split(_24.separator); +function _19(_20,_21,_22){ +var _23=$.data(_20,"combobox").options; +var _24=$(_20).combo("panel"); +if(!$.isArray(_21)){ +_21=_21.split(_23.separator); +} +if(!_23.multiple){ +_21=_21.length?[_21[0]]:[""]; +} +var _25=$(_20).combo("getValues"); +if(_24.is(":visible")){ +_24.find(".combobox-item-selected").each(function(){ +var row=_23.finder.getRow(_20,$(this)); +if(row){ +if($.easyui.indexOfArray(_25,row[_23.valueField])==-1){ +$(this).removeClass("combobox-item-selected"); } -_25.find("div.combobox-item-selected").removeClass("combobox-item-selected"); +} +}); +} +$.map(_25,function(v){ +if($.easyui.indexOfArray(_21,v)==-1){ +var el=_23.finder.getEl(_20,v); +if(el.hasClass("combobox-item-selected")){ +el.removeClass("combobox-item-selected"); +_23.onUnselect.call(_20,_23.finder.getRow(_20,v)); +} +} +}); +var _26=null; var vv=[],ss=[]; -for(var i=0;i<_22.length;i++){ -var v=_22[i]; +for(var i=0;i<_21.length;i++){ +var v=_21[i]; var s=v; -_24.finder.getEl(_21,v).addClass("combobox-item-selected"); -var row=_24.finder.getRow(_21,v); +var row=_23.finder.getRow(_20,v); if(row){ -s=row[_24.textField]; +s=row[_23.textField]; +_26=row; +var el=_23.finder.getEl(_20,v); +if(!el.hasClass("combobox-item-selected")){ +el.addClass("combobox-item-selected"); +_23.onSelect.call(_20,row); +} } vv.push(v); ss.push(s); } -$(_21).combo("setValues",vv); -if(!_23){ -$(_21).combo("setText",ss.join(_24.separator)); +if(!_22){ +$(_20).combo("setText",ss.join(_23.separator)); } -}; -function _26(_27,_28,_29){ -var _2a=$.data(_27,"combobox"); -var _2b=_2a.options; -_2a.data=_2b.loadFilter.call(_27,_28); -_2a.groups=[]; -_28=_2a.data; -var _2c=$(_27).combobox("getValues"); -var dd=[]; -var _2d=undefined; -for(var i=0;i<_28.length;i++){ -var row=_28[i]; -var v=row[_2b.valueField]+""; -var s=row[_2b.textField]; -var g=row[_2b.groupField]; -if(g){ -if(_2d!=g){ -_2d=g; -_2a.groups.push(g); -dd.push("
                "); -dd.push(_2b.groupFormatter?_2b.groupFormatter.call(_27,g):g); -dd.push("
                "); +if(_23.showItemIcon){ +var tb=$(_20).combobox("textbox"); +tb.removeClass("textbox-bgicon "+_23.textboxIconCls); +if(_26&&_26.iconCls){ +tb.addClass("textbox-bgicon "+_26.iconCls); +_23.textboxIconCls=_26.iconCls; } -}else{ -_2d=undefined; -} -var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":""); -dd.push("
                "); -dd.push(_2b.formatter?_2b.formatter.call(_27,row):s); -dd.push("
                "); -if(row["selected"]&&$.inArray(v,_2c)==-1){ -_2c.push(v); } +$(_20).combo("setValues",vv); +_24.triggerHandler("scroll"); +}; +function _27(_28,_29,_2a){ +var _2b=$.data(_28,"combobox"); +var _2c=_2b.options; +_2b.data=_2c.loadFilter.call(_28,_29); +_2c.view.render.call(_2c.view,_28,$(_28).combo("panel"),_2b.data); +var vv=$(_28).combobox("getValues"); +$.easyui.forEach(_2b.data,false,function(row){ +if(row["selected"]){ +$.easyui.addArrayItem(vv,row[_2c.valueField]+""); } -$(_27).combo("panel").html(dd.join("")); -if(_2b.multiple){ -_1a(_27,_2c,_29); +}); +if(_2c.multiple){ +_19(_28,vv,_2a); }else{ -_1a(_27,_2c.length?[_2c[_2c.length-1]]:[],_29); +_19(_28,vv.length?[vv[vv.length-1]]:[],_2a); } -_2b.onLoadSuccess.call(_27,_28); +_2c.onLoadSuccess.call(_28,_29); }; -function _2e(_2f,url,_30,_31){ -var _32=$.data(_2f,"combobox").options; +function _2d(_2e,url,_2f,_30){ +var _31=$.data(_2e,"combobox").options; if(url){ -_32.url=url; +_31.url=url; } -_30=_30||{}; -if(_32.onBeforeLoad.call(_2f,_30)==false){ +_2f=$.extend({},_31.queryParams,_2f||{}); +if(_31.onBeforeLoad.call(_2e,_2f)==false){ return; } -_32.loader.call(_2f,_30,function(_33){ -_26(_2f,_33,_31); +_31.loader.call(_2e,_2f,function(_32){ +_27(_2e,_32,_30); },function(){ -_32.onLoadError.apply(this,arguments); +_31.onLoadError.apply(this,arguments); }); }; -function _34(_35,q){ -var _36=$.data(_35,"combobox"); -var _37=_36.options; -if(_37.multiple&&!q){ -_1a(_35,[],true); +function _33(_34,q){ +var _35=$.data(_34,"combobox"); +var _36=_35.options; +var _37=$(); +var qq=_36.multiple?q.split(_36.separator):[q]; +if(_36.mode=="remote"){ +_38(qq); +_2d(_34,null,{q:q},true); }else{ -_1a(_35,[q],true); -} -if(_37.mode=="remote"){ -_2e(_35,null,{q:q},true); -}else{ -var _38=$(_35).combo("panel"); -_38.find("div.combobox-item-selected,div.combobox-item-hover").removeClass("combobox-item-selected combobox-item-hover"); -_38.find("div.combobox-item,div.combobox-group").hide(); -var _39=_36.data; +var _39=$(_34).combo("panel"); +_39.find(".combobox-item-hover").removeClass("combobox-item-hover"); +_39.find(".combobox-item,.combobox-group").hide(); +var _3a=_35.data; var vv=[]; -var qq=_37.multiple?q.split(_37.separator):[q]; $.map(qq,function(q){ q=$.trim(q); -var _3a=undefined; -for(var i=0;i<_39.length;i++){ -var row=_39[i]; -if(_37.filter.call(_35,q,row)){ -var v=row[_37.valueField]; -var s=row[_37.textField]; -var g=row[_37.groupField]; -var _3b=_37.finder.getEl(_35,v).show(); +var _3b=q; +var _3c=undefined; +_37=$(); +for(var i=0;i<_3a.length;i++){ +var row=_3a[i]; +if(_36.filter.call(_34,q,row)){ +var v=row[_36.valueField]; +var s=row[_36.textField]; +var g=row[_36.groupField]; +var _3d=_36.finder.getEl(_34,v).show(); if(s.toLowerCase()==q.toLowerCase()){ -vv.push(v); -_3b.addClass("combobox-item-selected"); +_3b=v; +if(_36.reversed){ +_37=_3d; +}else{ +_13(_34,v,true); +} } -if(_37.groupField&&_3a!=g){ -$("#"+_36.groupIdPrefix+"_"+$.inArray(g,_36.groups)).show(); -_3a=g; +if(_36.groupField&&_3c!=g){ +_36.finder.getGroupEl(_34,g).show(); +_3c=g; } } } +vv.push(_3b); }); -_1a(_35,vv,true); +_38(vv); +} +function _38(vv){ +if(_36.reversed){ +_37.addClass("combobox-item-hover"); +}else{ +_19(_34,_36.multiple?(q?vv:[]):vv,true); } }; -function _3c(_3d){ -var t=$(_3d); -var _3e=t.combobox("options"); -var _3f=t.combobox("panel"); -var _40=_3f.children("div.combobox-item-hover"); -if(_40.length){ -var row=_3e.finder.getRow(_3d,_40); -var _41=row[_3e.valueField]; -if(_3e.multiple){ -if(_40.hasClass("combobox-item-selected")){ -t.combobox("unselect",_41); +}; +function _3e(_3f){ +var t=$(_3f); +var _40=t.combobox("options"); +var _41=t.combobox("panel"); +var _42=_41.children("div.combobox-item-hover"); +if(_42.length){ +_42.removeClass("combobox-item-hover"); +var row=_40.finder.getRow(_3f,_42); +var _43=row[_40.valueField]; +if(_40.multiple){ +if(_42.hasClass("combobox-item-selected")){ +t.combobox("unselect",_43); }else{ -t.combobox("select",_41); +t.combobox("select",_43); } }else{ -t.combobox("select",_41); +t.combobox("select",_43); } } var vv=[]; $.map(t.combobox("getValues"),function(v){ -if(_2(_3d,v)>=0){ +if(_1(_3f,v)>=0){ vv.push(v); } }); t.combobox("setValues",vv); -if(!_3e.multiple){ +if(!_40.multiple){ t.combobox("hidePanel"); } }; -function _42(_43){ -var _44=$.data(_43,"combobox"); -var _45=_44.options; -_1++; -_44.itemIdPrefix="_easyui_combobox_i"+_1; -_44.groupIdPrefix="_easyui_combobox_g"+_1; -$(_43).addClass("combobox-f"); -$(_43).combo($.extend({},_45,{onShowPanel:function(){ -$(_43).combo("panel").find("div.combobox-item,div.combobox-group").show(); -_8(_43,$(_43).combobox("getValue")); -_45.onShowPanel.call(_43); +function _44(_45){ +var _46=$.data(_45,"combobox"); +var _47=_46.options; +$(_45).addClass("combobox-f"); +$(_45).combo($.extend({},_47,{onShowPanel:function(){ +$(this).combo("panel").find("div.combobox-item:hidden,div.combobox-group:hidden").show(); +_19(this,$(this).combobox("getValues"),true); +$(this).combobox("scrollTo",$(this).combobox("getValue")); +_47.onShowPanel.call(this); }})); -$(_43).combo("panel").unbind().bind("mouseover",function(e){ +var p=$(_45).combo("panel"); +p.unbind(".combobox"); +for(var _48 in _47.panelEvents){ +p.bind(_48+".combobox",{target:_45},_47.panelEvents[_48]); +} +}; +function _49(e){ $(this).children("div.combobox-item-hover").removeClass("combobox-item-hover"); -var _46=$(e.target).closest("div.combobox-item"); -if(!_46.hasClass("combobox-item-disabled")){ -_46.addClass("combobox-item-hover"); +var _4a=$(e.target).closest("div.combobox-item"); +if(!_4a.hasClass("combobox-item-disabled")){ +_4a.addClass("combobox-item-hover"); } e.stopPropagation(); -}).bind("mouseout",function(e){ +}; +function _4b(e){ $(e.target).closest("div.combobox-item").removeClass("combobox-item-hover"); e.stopPropagation(); -}).bind("click",function(e){ -var _47=$(e.target).closest("div.combobox-item"); -if(!_47.length||_47.hasClass("combobox-item-disabled")){ +}; +function _4c(e){ +var _4d=$(this).panel("options").comboTarget; +if(!_4d){ +return; +} +var _4e=$(_4d).combobox("options"); +var _4f=$(e.target).closest("div.combobox-item"); +if(!_4f.length||_4f.hasClass("combobox-item-disabled")){ return; } -var row=_45.finder.getRow(_43,_47); +var row=_4e.finder.getRow(_4d,_4f); if(!row){ return; } -var _48=row[_45.valueField]; -if(_45.multiple){ -if(_47.hasClass("combobox-item-selected")){ -_1b(_43,_48); +if(_4e.blurTimer){ +clearTimeout(_4e.blurTimer); +_4e.blurTimer=null; +} +_4e.onClick.call(_4d,row); +var _50=row[_4e.valueField]; +if(_4e.multiple){ +if(_4f.hasClass("combobox-item-selected")){ +_1a(_4d,_50); }else{ -_15(_43,_48); +_13(_4d,_50); } }else{ -_15(_43,_48); -$(_43).combo("hidePanel"); +$(_4d).combobox("setValue",_50).combobox("hidePanel"); } e.stopPropagation(); +}; +function _51(e){ +var _52=$(this).panel("options").comboTarget; +if(!_52){ +return; +} +var _53=$(_52).combobox("options"); +if(_53.groupPosition=="sticky"){ +var _54=$(this).children(".combobox-stick"); +if(!_54.length){ +_54=$("
                ").appendTo(this); +} +_54.hide(); +var _55=$(_52).data("combobox"); +$(this).children(".combobox-group:visible").each(function(){ +var g=$(this); +var _56=_53.finder.getGroup(_52,g); +var _57=_55.data[_56.startIndex+_56.count-1]; +var _58=_53.finder.getEl(_52,_57[_53.valueField]); +if(g.position().top<0&&_58.position().top>0){ +_54.show().html(g.html()); +return false; +} }); +} }; -$.fn.combobox=function(_49,_4a){ -if(typeof _49=="string"){ -var _4b=$.fn.combobox.methods[_49]; -if(_4b){ -return _4b(this,_4a); +$.fn.combobox=function(_59,_5a){ +if(typeof _59=="string"){ +var _5b=$.fn.combobox.methods[_59]; +if(_5b){ +return _5b(this,_5a); }else{ -return this.combo(_49,_4a); +return this.combo(_59,_5a); } } -_49=_49||{}; +_59=_59||{}; return this.each(function(){ -var _4c=$.data(this,"combobox"); -if(_4c){ -$.extend(_4c.options,_49); -_42(this); +var _5c=$.data(this,"combobox"); +if(_5c){ +$.extend(_5c.options,_59); }else{ -_4c=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_49),data:[]}); -_42(this); -var _4d=$.fn.combobox.parseData(this); -if(_4d.length){ -_26(this,_4d); +_5c=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_59),data:[]}); } +_44(this); +if(_5c.options.data){ +_27(this,_5c.options.data); +}else{ +var _5d=$.fn.combobox.parseData(this); +if(_5d.length){ +_27(this,_5d); } -if(_4c.options.data){ -_26(this,_4c.options.data); } -_2e(this); +_2d(this); }); }; $.fn.combobox.methods={options:function(jq){ -var _4e=jq.combo("options"); -return $.extend($.data(jq[0],"combobox").options,{width:_4e.width,height:_4e.height,originalValue:_4e.originalValue,disabled:_4e.disabled,readonly:_4e.readonly}); +var _5e=jq.combo("options"); +return $.extend($.data(jq[0],"combobox").options,{width:_5e.width,height:_5e.height,originalValue:_5e.originalValue,disabled:_5e.disabled,readonly:_5e.readonly}); +},cloneFrom:function(jq,_5f){ +return jq.each(function(){ +$(this).combo("cloneFrom",_5f); +$.data(this,"combobox",$(_5f).data("combobox")); +$(this).addClass("combobox-f").attr("comboboxName",$(this).attr("textboxName")); +}); },getData:function(jq){ return $.data(jq[0],"combobox").data; -},setValues:function(jq,_4f){ +},setValues:function(jq,_60){ return jq.each(function(){ -_1a(this,_4f); +_19(this,_60); }); -},setValue:function(jq,_50){ +},setValue:function(jq,_61){ return jq.each(function(){ -_1a(this,[_50]); +_19(this,$.isArray(_61)?_61:[_61]); }); },clear:function(jq){ return jq.each(function(){ -$(this).combo("clear"); -var _51=$(this).combo("panel"); -_51.find("div.combobox-item-selected").removeClass("combobox-item-selected"); +_19(this,[]); }); },reset:function(jq){ return jq.each(function(){ -var _52=$(this).combobox("options"); -if(_52.multiple){ -$(this).combobox("setValues",_52.originalValue); +var _62=$(this).combobox("options"); +if(_62.multiple){ +$(this).combobox("setValues",_62.originalValue); }else{ -$(this).combobox("setValue",_52.originalValue); +$(this).combobox("setValue",_62.originalValue); } }); -},loadData:function(jq,_53){ +},loadData:function(jq,_63){ return jq.each(function(){ -_26(this,_53); +_27(this,_63); }); },reload:function(jq,url){ return jq.each(function(){ -_2e(this,url); +if(typeof url=="string"){ +_2d(this,url); +}else{ +if(url){ +var _64=$(this).combobox("options"); +_64.queryParams=url; +} +_2d(this); +} }); -},select:function(jq,_54){ +},select:function(jq,_65){ return jq.each(function(){ -_15(this,_54); +_13(this,_65); }); -},unselect:function(jq,_55){ +},unselect:function(jq,_66){ return jq.each(function(){ -_1b(this,_55); +_1a(this,_66); +}); +},scrollTo:function(jq,_67){ +return jq.each(function(){ +_5(this,_67); }); }}; -$.fn.combobox.parseOptions=function(_56){ -var t=$(_56); -return $.extend({},$.fn.combo.parseOptions(_56),$.parser.parseOptions(_56,["valueField","textField","groupField","mode","method","url"])); +$.fn.combobox.parseOptions=function(_68){ +var t=$(_68); +return $.extend({},$.fn.combo.parseOptions(_68),$.parser.parseOptions(_68,["valueField","textField","groupField","groupPosition","mode","method","url",{showItemIcon:"boolean",limitToList:"boolean"}])); }; -$.fn.combobox.parseData=function(_57){ -var _58=[]; -var _59=$(_57).combobox("options"); -$(_57).children().each(function(){ +$.fn.combobox.parseData=function(_69){ +var _6a=[]; +var _6b=$(_69).combobox("options"); +$(_69).children().each(function(){ if(this.tagName.toLowerCase()=="optgroup"){ -var _5a=$(this).attr("label"); +var _6c=$(this).attr("label"); $(this).children().each(function(){ -_5b(this,_5a); +_6d(this,_6c); }); }else{ -_5b(this); +_6d(this); } }); -return _58; -function _5b(el,_5c){ +return _6a; +function _6d(el,_6e){ var t=$(el); var row={}; -row[_59.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text(); -row[_59.textField]=t.text(); +row[_6b.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text(); +row[_6b.textField]=t.text(); row["selected"]=t.is(":selected"); row["disabled"]=t.is(":disabled"); -if(_5c){ -_59.groupField=_59.groupField||"group"; -row[_59.groupField]=_5c; +if(_6e){ +_6b.groupField=_6b.groupField||"group"; +row[_6b.groupField]=_6e; } -_58.push(row); +_6a.push(row); }; }; -$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupField:null,groupFormatter:function(_5d){ -return _5d; -},mode:"local",method:"post",url:null,data:null,keyHandler:{up:function(e){ -_e(this,"prev"); +var _6f=0; +var _70={render:function(_71,_72,_73){ +var _74=$.data(_71,"combobox"); +var _75=_74.options; +_6f++; +_74.itemIdPrefix="_easyui_combobox_i"+_6f; +_74.groupIdPrefix="_easyui_combobox_g"+_6f; +_74.groups=[]; +var dd=[]; +var _76=undefined; +for(var i=0;i<_73.length;i++){ +var row=_73[i]; +var v=row[_75.valueField]+""; +var s=row[_75.textField]; +var g=row[_75.groupField]; +if(g){ +if(_76!=g){ +_76=g; +_74.groups.push({value:g,startIndex:i,count:1}); +dd.push("
                "); +dd.push(_75.groupFormatter?_75.groupFormatter.call(_71,g):g); +dd.push("
                "); +}else{ +_74.groups[_74.groups.length-1].count++; +} +}else{ +_76=undefined; +} +var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":""); +dd.push("
                "); +if(_75.showItemIcon&&row.iconCls){ +dd.push(""); +} +dd.push(_75.formatter?_75.formatter.call(_71,row):s); +dd.push("
                "); +} +$(_72).html(dd.join("")); +}}; +$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupPosition:"static",groupField:null,groupFormatter:function(_77){ +return _77; +},mode:"local",method:"post",url:null,data:null,queryParams:{},showItemIcon:false,limitToList:false,view:_70,keyHandler:{up:function(e){ +_b(this,"prev"); e.preventDefault(); },down:function(e){ -_e(this,"next"); +_b(this,"next"); e.preventDefault(); },left:function(e){ },right:function(e){ },enter:function(e){ -_3c(this); +_3e(this); },query:function(q,e){ -_34(this,q); -}},filter:function(q,row){ -var _5e=$(this).combobox("options"); -return row[_5e.textField].toLowerCase().indexOf(q.toLowerCase())==0; +_33(this,q); +}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _78=e.data.target; +var _79=$(_78).combobox("options"); +if(_79.reversed||_79.limitToList){ +if(_79.blurTimer){ +clearTimeout(_79.blurTimer); +} +_79.blurTimer=setTimeout(function(){ +var _7a=$(_78).parent().length; +if(_7a){ +if(_79.reversed){ +$(_78).combobox("setValues",$(_78).combobox("getValues")); +}else{ +if(_79.limitToList){ +_3e(_78); +} +} +_79.blurTimer=null; +} +},50); +} +}}),panelEvents:{mouseover:_49,mouseout:_4b,click:_4c,scroll:_51},filter:function(q,row){ +var _7b=$(this).combobox("options"); +return row[_7b.textField].toLowerCase().indexOf(q.toLowerCase())>=0; },formatter:function(row){ -var _5f=$(this).combobox("options"); -return row[_5f.textField]; -},loader:function(_60,_61,_62){ -var _63=$(this).combobox("options"); -if(!_63.url){ +var _7c=$(this).combobox("options"); +return row[_7c.textField]; +},loader:function(_7d,_7e,_7f){ +var _80=$(this).combobox("options"); +if(!_80.url){ return false; } -$.ajax({type:_63.method,url:_63.url,data:_60,dataType:"json",success:function(_64){ -_61(_64); +$.ajax({type:_80.method,url:_80.url,data:_7d,dataType:"json",success:function(_81){ +_7e(_81); },error:function(){ -_62.apply(this,arguments); +_7f.apply(this,arguments); }}); -},loadFilter:function(_65){ -return _65; -},finder:{getEl:function(_66,_67){ -var _68=_2(_66,_67); -var id=$.data(_66,"combobox").itemIdPrefix+"_"+_68; +},loadFilter:function(_82){ +return _82; +},finder:{getEl:function(_83,_84){ +var _85=_1(_83,_84); +var id=$.data(_83,"combobox").itemIdPrefix+"_"+_85; +return $("#"+id); +},getGroupEl:function(_86,_87){ +var _88=$.data(_86,"combobox"); +var _89=$.easyui.indexOfArray(_88.groups,"value",_87); +var id=_88.groupIdPrefix+"_"+_89; return $("#"+id); -},getRow:function(_69,p){ -var _6a=$.data(_69,"combobox"); -var _6b=(p instanceof jQuery)?p.attr("id").substr(_6a.itemIdPrefix.length+1):_2(_69,p); -return _6a.data[parseInt(_6b)]; -}},onBeforeLoad:function(_6c){ -},onLoadSuccess:function(){ +},getGroup:function(_8a,p){ +var _8b=$.data(_8a,"combobox"); +var _8c=p.attr("id").substr(_8b.groupIdPrefix.length+1); +return _8b.groups[parseInt(_8c)]; +},getRow:function(_8d,p){ +var _8e=$.data(_8d,"combobox"); +var _8f=(p instanceof $)?p.attr("id").substr(_8e.itemIdPrefix.length+1):_1(_8d,p); +return _8e.data[parseInt(_8f)]; +}},onBeforeLoad:function(_90){ +},onLoadSuccess:function(_91){ },onLoadError:function(){ -},onSelect:function(_6d){ -},onUnselect:function(_6e){ +},onSelect:function(_92){ +},onUnselect:function(_93){ +},onClick:function(_94){ }}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.combogrid.js b/assets/js/easy-ui/plugins/jquery.combogrid.js old mode 100755 new mode 100644 index dc8f39e6f1..bd03ad4394 --- a/assets/js/easy-ui/plugins/jquery.combogrid.js +++ b/assets/js/easy-ui/plugins/jquery.combogrid.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -13,247 +13,314 @@ var _3=$.data(_2,"combogrid"); var _4=_3.options; var _5=_3.grid; $(_2).addClass("combogrid-f").combo($.extend({},_4,{onShowPanel:function(){ +_20(this,$(this).combogrid("getValues"),true); var p=$(this).combogrid("panel"); var _6=p.outerHeight()-p.height(); var _7=p._size("minHeight"); var _8=p._size("maxHeight"); -$(this).combogrid("grid").datagrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_7?_7-_6:""),maxHeight:(_8?_8-_6:"")}); +var dg=$(this).combogrid("grid"); +dg.datagrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_7?_7-_6:""),maxHeight:(_8?_8-_6:"")}); +var _9=dg.datagrid("getSelected"); +if(_9){ +dg.datagrid("scrollTo",dg.datagrid("getRowIndex",_9)); +} _4.onShowPanel.call(this); }})); -var _9=$(_2).combo("panel"); +var _a=$(_2).combo("panel"); if(!_5){ -_5=$("
                "+_30.weekNumberHeader+""+_30.weeks[i]+"
                "+_39+""+d+""+d+"
                ").appendTo(_9); +_5=$("
                ").appendTo(_a); _3.grid=_5; } -_5.datagrid($.extend({},_4,{border:false,singleSelect:(!_4.multiple),onLoadSuccess:function(_a){ -var _b=$(_2).combo("getValues"); -var _c=_4.onSelect; -_4.onSelect=function(){ +_5.datagrid($.extend({},_4,{border:false,singleSelect:(!_4.multiple),onLoadSuccess:_b,onClickRow:_c,onSelect:_d("onSelect"),onUnselect:_d("onUnselect"),onSelectAll:_d("onSelectAll"),onUnselectAll:_d("onUnselectAll")})); +function _e(dg){ +return $(dg).closest(".combo-panel").panel("options").comboTarget||_2; }; -_1c(_2,_b,_3.remainText); -_4.onSelect=_c; -_4.onLoadSuccess.apply(_2,arguments); -},onClickRow:_d,onSelect:function(_e,_f){ -_10(); -_4.onSelect.call(this,_e,_f); -},onUnselect:function(_11,row){ -_10(); -_4.onUnselect.call(this,_11,row); -},onSelectAll:function(_12){ -_10(); -_4.onSelectAll.call(this,_12); -},onUnselectAll:function(_13){ -if(_4.multiple){ -_10(); -} -_4.onUnselectAll.call(this,_13); -}})); -function _d(_14,row){ -_3.remainText=false; -_10(); -if(!_4.multiple){ -$(_2).combo("hidePanel"); +function _b(_f){ +var _10=_e(this); +var _11=$(_10).data("combogrid"); +var _12=_11.options; +var _13=$(_10).combo("getValues"); +_20(_10,_13,_11.remainText); +_12.onLoadSuccess.call(this,_f); +}; +function _c(_14,row){ +var _15=_e(this); +var _16=$(_15).data("combogrid"); +var _17=_16.options; +_16.remainText=false; +_18.call(this); +if(!_17.multiple){ +$(_15).combo("hidePanel"); } -_4.onClickRow.call(this,_14,row); +_17.onClickRow.call(this,_14,row); }; -function _10(){ -var _15=_5.datagrid("getSelections"); -var vv=[],ss=[]; -for(var i=0;i<_15.length;i++){ -vv.push(_15[i][_4.idField]); -ss.push(_15[i][_4.textField]); -} -if(!_4.multiple){ -$(_2).combo("setValues",(vv.length?vv:[""])); -}else{ -$(_2).combo("setValues",vv); +function _d(_19){ +return function(_1a,row){ +var _1b=_e(this); +var _1c=$(_1b).combogrid("options"); +if(_19=="onUnselectAll"){ +if(_1c.multiple){ +_18.call(this); } -if(!_3.remainText){ -$(_2).combo("setText",ss.join(_4.separator)); +}else{ +_18.call(this); } +_1c[_19].call(this,_1a,row); +}; +}; +function _18(){ +var dg=$(this); +var _1d=_e(dg); +var _1e=$(_1d).data("combogrid"); +var _1f=_1e.options; +var vv=$.map(dg.datagrid("getSelections"),function(row){ +return row[_1f.idField]; +}); +vv=vv.concat(_1f.unselectedValues); +_20(_1d,vv,_1e.remainText); }; }; -function nav(_16,dir){ -var _17=$.data(_16,"combogrid"); -var _18=_17.options; -var _19=_17.grid; -var _1a=_19.datagrid("getRows").length; -if(!_1a){ +function nav(_21,dir){ +var _22=$.data(_21,"combogrid"); +var _23=_22.options; +var _24=_22.grid; +var _25=_24.datagrid("getRows").length; +if(!_25){ return; } -var tr=_18.finder.getTr(_19[0],null,"highlight"); +var tr=_23.finder.getTr(_24[0],null,"highlight"); if(!tr.length){ -tr=_18.finder.getTr(_19[0],null,"selected"); +tr=_23.finder.getTr(_24[0],null,"selected"); } -var _1b; +var _26; if(!tr.length){ -_1b=(dir=="next"?0:_1a-1); +_26=(dir=="next"?0:_25-1); }else{ -var _1b=parseInt(tr.attr("datagrid-row-index")); -_1b+=(dir=="next"?1:-1); -if(_1b<0){ -_1b=_1a-1; +var _26=parseInt(tr.attr("datagrid-row-index")); +_26+=(dir=="next"?1:-1); +if(_26<0){ +_26=_25-1; } -if(_1b>=_1a){ -_1b=0; +if(_26>=_25){ +_26=0; } } -_19.datagrid("highlightRow",_1b); -if(_18.selectOnNavigation){ -_17.remainText=false; -_19.datagrid("selectRow",_1b); +_24.datagrid("highlightRow",_26); +if(_23.selectOnNavigation){ +_22.remainText=false; +_24.datagrid("selectRow",_26); } }; -function _1c(_1d,_1e,_1f){ -var _20=$.data(_1d,"combogrid"); -var _21=_20.options; -var _22=_20.grid; -var _23=_22.datagrid("getRows"); -var ss=[]; -var _24=$(_1d).combo("getValues"); -var _25=$(_1d).combo("options"); -var _26=_25.onChange; -_25.onChange=function(){ +function _20(_27,_28,_29){ +var _2a=$.data(_27,"combogrid"); +var _2b=_2a.options; +var _2c=_2a.grid; +var _2d=$(_27).combo("getValues"); +var _2e=$(_27).combo("options"); +var _2f=_2e.onChange; +_2e.onChange=function(){ }; -_22.datagrid("clearSelections"); -if(!$.isArray(_1e)){ -_1e=_1e.split(_21.separator); -} -for(var i=0;i<_1e.length;i++){ -var _27=_22.datagrid("getRowIndex",_1e[i]); -if(_27>=0){ -_22.datagrid("selectRow",_27); -ss.push(_23[_27][_21.textField]); -}else{ -ss.push(_1e[i]); +var _30=_2c.datagrid("options"); +var _31=_30.onSelect; +var _32=_30.onUnselectAll; +_30.onSelect=_30.onUnselectAll=function(){ +}; +if(!$.isArray(_28)){ +_28=_28.split(_2b.separator); } +if(!_2b.multiple){ +_28=_28.length?[_28[0]]:[""]; } -$(_1d).combo("setValues",_24); -_25.onChange=_26; -$(_1d).combo("setValues",_1e); -if(!_1f){ -var s=ss.join(_21.separator); -if($(_1d).combo("getText")!=s){ -$(_1d).combo("setText",s); +var vv=$.map(_28,function(_33){ +return String(_33); +}); +vv=$.grep(vv,function(v,_34){ +return _34===$.inArray(v,vv); +}); +var _35=$.grep(_2c.datagrid("getSelections"),function(row,_36){ +return $.inArray(String(row[_2b.idField]),vv)>=0; +}); +_2c.datagrid("clearSelections"); +_2c.data("datagrid").selectedRows=_35; +var ss=[]; +_2b.unselectedValues=[]; +$.map(vv,function(v){ +var _37=_2c.datagrid("getRowIndex",v); +if(_37>=0){ +_2c.datagrid("selectRow",_37); +}else{ +_2b.unselectedValues.push(v); } +ss.push(_38(v,_2c.datagrid("getRows"))||_38(v,_35)||_38(v,_2b.mappingRows)||v); +}); +$(_27).combo("setValues",_2d); +_2e.onChange=_2f; +_30.onSelect=_31; +_30.onUnselectAll=_32; +if(!_29){ +var s=ss.join(_2b.separator); +if($(_27).combo("getText")!=s){ +$(_27).combo("setText",s); } -}; -function _28(_29,q){ -var _2a=$.data(_29,"combogrid"); -var _2b=_2a.options; -var _2c=_2a.grid; -_2a.remainText=true; -if(_2b.multiple&&!q){ -_1c(_29,[],true); -}else{ -_1c(_29,[q],true); } -if(_2b.mode=="remote"){ -_2c.datagrid("clearSelections"); -_2c.datagrid("load",$.extend({},_2b.queryParams,{q:q})); +$(_27).combo("setValues",_28); +function _38(_39,a){ +var _3a=$.easyui.getArrayItem(a,_2b.idField,_39); +return _3a?_3a[_2b.textField]:undefined; +}; +}; +function _3b(_3c,q){ +var _3d=$.data(_3c,"combogrid"); +var _3e=_3d.options; +var _3f=_3d.grid; +_3d.remainText=true; +var qq=_3e.multiple?q.split(_3e.separator):[q]; +qq=$.grep(qq,function(q){ +return $.trim(q)!=""; +}); +if(_3e.mode=="remote"){ +_40(qq); +_3f.datagrid("load",$.extend({},_3e.queryParams,{q:q})); }else{ -if(!q){ -return; -} -_2c.datagrid("clearSelections").datagrid("highlightRow",-1); -var _2d=_2c.datagrid("getRows"); -var qq=_2b.multiple?q.split(_2b.separator):[q]; +_3f.datagrid("highlightRow",-1); +var _41=_3f.datagrid("getRows"); +var vv=[]; $.map(qq,function(q){ q=$.trim(q); -if(q){ -$.map(_2d,function(row,i){ -if(q==row[_2b.textField]){ -_2c.datagrid("selectRow",i); -}else{ -if(_2b.filter.call(_29,q,row)){ -_2c.datagrid("highlightRow",i); +var _42=q; +_43(_3e.mappingRows,q); +_43(_3f.datagrid("getSelections"),q); +var _44=_43(_41,q); +if(_44>=0){ +if(_3e.reversed){ +_3f.datagrid("highlightRow",_44); } +}else{ +$.map(_41,function(row,i){ +if(_3e.filter.call(_3c,q,row)){ +_3f.datagrid("highlightRow",i); } }); } }); +_40(vv); } +function _43(_45,q){ +for(var i=0;i<_45.length;i++){ +var row=_45[i]; +if((row[_3e.textField]||"").toLowerCase()==q.toLowerCase()){ +vv.push(row[_3e.idField]); +return i; +} +} +return -1; }; -function _2e(_2f){ -var _30=$.data(_2f,"combogrid"); -var _31=_30.options; -var _32=_30.grid; -var tr=_31.finder.getTr(_32[0],null,"highlight"); -_30.remainText=false; +function _40(vv){ +if(!_3e.reversed){ +_20(_3c,vv,true); +} +}; +}; +function _46(_47){ +var _48=$.data(_47,"combogrid"); +var _49=_48.options; +var _4a=_48.grid; +var tr=_49.finder.getTr(_4a[0],null,"highlight"); +_48.remainText=false; if(tr.length){ -var _33=parseInt(tr.attr("datagrid-row-index")); -if(_31.multiple){ +var _4b=parseInt(tr.attr("datagrid-row-index")); +if(_49.multiple){ if(tr.hasClass("datagrid-row-selected")){ -_32.datagrid("unselectRow",_33); +_4a.datagrid("unselectRow",_4b); }else{ -_32.datagrid("selectRow",_33); +_4a.datagrid("selectRow",_4b); } }else{ -_32.datagrid("selectRow",_33); +_4a.datagrid("selectRow",_4b); } } var vv=[]; -$.map(_32.datagrid("getSelections"),function(row){ -vv.push(row[_31.idField]); +$.map(_4a.datagrid("getSelections"),function(row){ +vv.push(row[_49.idField]); +}); +$.map(_49.unselectedValues,function(v){ +if($.easyui.indexOfArray(_49.mappingRows,_49.idField,v)>=0){ +$.easyui.addArrayItem(vv,v); +} }); -$(_2f).combogrid("setValues",vv); -if(!_31.multiple){ -$(_2f).combogrid("hidePanel"); +$(_47).combogrid("setValues",vv); +if(!_49.multiple){ +$(_47).combogrid("hidePanel"); } }; -$.fn.combogrid=function(_34,_35){ -if(typeof _34=="string"){ -var _36=$.fn.combogrid.methods[_34]; -if(_36){ -return _36(this,_35); +$.fn.combogrid=function(_4c,_4d){ +if(typeof _4c=="string"){ +var _4e=$.fn.combogrid.methods[_4c]; +if(_4e){ +return _4e(this,_4d); }else{ -return this.combo(_34,_35); +return this.combo(_4c,_4d); } } -_34=_34||{}; +_4c=_4c||{}; return this.each(function(){ -var _37=$.data(this,"combogrid"); -if(_37){ -$.extend(_37.options,_34); +var _4f=$.data(this,"combogrid"); +if(_4f){ +$.extend(_4f.options,_4c); }else{ -_37=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_34)}); +_4f=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_4c)}); } _1(this); }); }; $.fn.combogrid.methods={options:function(jq){ -var _38=jq.combo("options"); -return $.extend($.data(jq[0],"combogrid").options,{width:_38.width,height:_38.height,originalValue:_38.originalValue,disabled:_38.disabled,readonly:_38.readonly}); +var _50=jq.combo("options"); +return $.extend($.data(jq[0],"combogrid").options,{width:_50.width,height:_50.height,originalValue:_50.originalValue,disabled:_50.disabled,readonly:_50.readonly}); +},cloneFrom:function(jq,_51){ +return jq.each(function(){ +$(this).combo("cloneFrom",_51); +$.data(this,"combogrid",{options:$.extend(true,{cloned:true},$(_51).combogrid("options")),combo:$(this).next(),panel:$(_51).combo("panel"),grid:$(_51).combogrid("grid")}); +}); },grid:function(jq){ return $.data(jq[0],"combogrid").grid; -},setValues:function(jq,_39){ +},setValues:function(jq,_52){ return jq.each(function(){ -_1c(this,_39); +var _53=$(this).combogrid("options"); +if($.isArray(_52)){ +_52=$.map(_52,function(_54){ +if(_54&&typeof _54=="object"){ +$.easyui.addArrayItem(_53.mappingRows,_53.idField,_54); +return _54[_53.idField]; +}else{ +return _54; +} }); -},setValue:function(jq,_3a){ +} +_20(this,_52); +}); +},setValue:function(jq,_55){ return jq.each(function(){ -_1c(this,[_3a]); +$(this).combogrid("setValues",$.isArray(_55)?_55:[_55]); }); },clear:function(jq){ return jq.each(function(){ -$(this).combogrid("grid").datagrid("clearSelections"); -$(this).combo("clear"); +$(this).combogrid("setValues",[]); }); },reset:function(jq){ return jq.each(function(){ -var _3b=$(this).combogrid("options"); -if(_3b.multiple){ -$(this).combogrid("setValues",_3b.originalValue); +var _56=$(this).combogrid("options"); +if(_56.multiple){ +$(this).combogrid("setValues",_56.originalValue); }else{ -$(this).combogrid("setValue",_3b.originalValue); +$(this).combogrid("setValue",_56.originalValue); } }); }}; -$.fn.combogrid.parseOptions=function(_3c){ -var t=$(_3c); -return $.extend({},$.fn.combo.parseOptions(_3c),$.fn.datagrid.parseOptions(_3c),$.parser.parseOptions(_3c,["idField","textField","mode"])); +$.fn.combogrid.parseOptions=function(_57){ +var t=$(_57); +return $.extend({},$.fn.combo.parseOptions(_57),$.fn.datagrid.parseOptions(_57),$.parser.parseOptions(_57,["idField","textField","mode"])); }; -$.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{height:22,loadMsg:null,idField:null,textField:null,mode:"local",keyHandler:{up:function(e){ +$.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{loadMsg:null,idField:null,textField:null,unselectedValues:[],mappingRows:[],mode:"local",keyHandler:{up:function(e){ nav(this,"prev"); e.preventDefault(); },down:function(e){ @@ -262,12 +329,18 @@ e.preventDefault(); },left:function(e){ },right:function(e){ },enter:function(e){ -_2e(this); +_46(this); },query:function(q,e){ -_28(this,q); -}},filter:function(q,row){ -var _3d=$(this).combogrid("options"); -return row[_3d.textField].toLowerCase().indexOf(q.toLowerCase())==0; +_3b(this,q); +}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _58=e.data.target; +var _59=$(_58).combogrid("options"); +if(_59.reversed){ +$(_58).combogrid("setValues",$(_58).combogrid("getValues")); +} +}}),filter:function(q,row){ +var _5a=$(this).combogrid("options"); +return (row[_5a.textField]||"").toLowerCase().indexOf(q.toLowerCase())>=0; }}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.combotree.js b/assets/js/easy-ui/plugins/jquery.combotree.js old mode 100755 new mode 100644 index d08feb934a..990d856d8e --- a/assets/js/easy-ui/plugins/jquery.combotree.js +++ b/assets/js/easy-ui/plugins/jquery.combotree.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -13,29 +13,25 @@ var _3=$.data(_2,"combotree"); var _4=_3.options; var _5=_3.tree; $(_2).addClass("combotree-f"); -$(_2).combo(_4); +$(_2).combo($.extend({},_4,{onShowPanel:function(){ +if(_4.editable){ +_5.tree("doFilter",""); +} +_4.onShowPanel.call(this); +}})); var _6=$(_2).combo("panel"); if(!_5){ _5=$("
                  ").appendTo(_6); -$.data(_2,"combotree").tree=_5; +_3.tree=_5; } _5.tree($.extend({},_4,{checkbox:_4.multiple,onLoadSuccess:function(_7,_8){ var _9=$(_2).combotree("getValues"); if(_4.multiple){ -var _a=_5.tree("getChecked"); -for(var i=0;i<_a.length;i++){ -var id=_a[i].id; -(function(){ -for(var i=0;i<_9.length;i++){ -if(id==_9[i]){ -return; -} -} -_9.push(id); -})(); -} +$.map(_5.tree("getChecked"),function(_a){ +$.easyui.addArrayItem(_9,_a.id); +}); } -$(_2).combotree("setValues",_9); +_15(_2,_9,_3.remainText); _4.onLoadSuccess.call(this,_7,_8); },onClick:function(_b){ if(_4.multiple){ @@ -43,9 +39,11 @@ $(this).tree(_b.checked?"uncheck":"check",_b.target); }else{ $(_2).combo("hidePanel"); } +_3.remainText=false; _e(_2); _4.onClick.call(this,_b); },onCheck:function(_c,_d){ +_3.remainText=false; _e(_2); _4.onCheck.call(this,_c,_d); }})); @@ -54,122 +52,186 @@ function _e(_f){ var _10=$.data(_f,"combotree"); var _11=_10.options; var _12=_10.tree; -var vv=[],ss=[]; +var vv=[]; if(_11.multiple){ -var _13=_12.tree("getChecked"); -for(var i=0;i<_13.length;i++){ -vv.push(_13[i].id); -ss.push(_13[i].text); -} +vv=$.map(_12.tree("getChecked"),function(_13){ +return _13.id; +}); }else{ var _14=_12.tree("getSelected"); if(_14){ vv.push(_14.id); -ss.push(_14.text); } } -$(_f).combo("setValues",vv).combo("setText",ss.join(_11.separator)); +vv=vv.concat(_11.unselectedValues); +_15(_f,vv,_10.remainText); }; -function _15(_16,_17){ -var _18=$.data(_16,"combotree"); -var _19=_18.options; -var _1a=_18.tree; -var _1b=_1a.tree("options"); -var _1c=_1b.onCheck; -var _1d=_1b.onSelect; -_1b.onCheck=_1b.onSelect=function(){ +function _15(_16,_17,_18){ +var _19=$.data(_16,"combotree"); +var _1a=_19.options; +var _1b=_19.tree; +var _1c=_1b.tree("options"); +var _1d=_1c.onBeforeCheck; +var _1e=_1c.onCheck; +var _1f=_1c.onSelect; +_1c.onBeforeCheck=_1c.onCheck=_1c.onSelect=function(){ }; -_1a.find("span.tree-checkbox").addClass("tree-checkbox0").removeClass("tree-checkbox1 tree-checkbox2"); if(!$.isArray(_17)){ -_17=_17.split(_19.separator); +_17=_17.split(_1a.separator); } -for(var i=0;i<_17.length;i++){ -var _1e=_1a.tree("find",_17[i]); -if(_1e){ -_1a.tree("check",_1e.target); -_1a.tree("select",_1e.target); +if(!_1a.multiple){ +_17=_17.length?[_17[0]]:[""]; } +var vv=$.map(_17,function(_20){ +return String(_20); +}); +_1b.find("div.tree-node-selected").removeClass("tree-node-selected"); +$.map(_1b.tree("getChecked"),function(_21){ +if($.inArray(String(_21.id),vv)==-1){ +_1b.tree("uncheck",_21.target); +} +}); +var ss=[]; +_1a.unselectedValues=[]; +$.map(vv,function(v){ +var _22=_1b.tree("find",v); +if(_22){ +_1b.tree("check",_22.target).tree("select",_22.target); +ss.push(_23(_22)); +}else{ +ss.push(_24(v,_1a.mappingRows)||v); +_1a.unselectedValues.push(v); +} +}); +if(_1a.multiple){ +$.map(_1b.tree("getChecked"),function(_25){ +var id=String(_25.id); +if($.inArray(id,vv)==-1){ +vv.push(id); +ss.push(_23(_25)); } -_1b.onCheck=_1c; -_1b.onSelect=_1d; -_e(_16); +}); +} +_1c.onBeforeCheck=_1d; +_1c.onCheck=_1e; +_1c.onSelect=_1f; +if(!_18){ +var s=ss.join(_1a.separator); +if($(_16).combo("getText")!=s){ +$(_16).combo("setText",s); +} +} +$(_16).combo("setValues",vv); +function _24(_26,a){ +var _27=$.easyui.getArrayItem(a,"id",_26); +return _27?_23(_27):undefined; +}; +function _23(_28){ +return _28[_1a.textField||""]||_28.text; +}; +}; +function _29(_2a,q){ +var _2b=$.data(_2a,"combotree"); +var _2c=_2b.options; +var _2d=_2b.tree; +_2b.remainText=true; +_2d.tree("doFilter",_2c.multiple?q.split(_2c.separator):q); }; -$.fn.combotree=function(_1f,_20){ -if(typeof _1f=="string"){ -var _21=$.fn.combotree.methods[_1f]; -if(_21){ -return _21(this,_20); +function _2e(_2f){ +var _30=$.data(_2f,"combotree"); +_30.remainText=false; +$(_2f).combotree("setValues",$(_2f).combotree("getValues")); +$(_2f).combotree("hidePanel"); +}; +$.fn.combotree=function(_31,_32){ +if(typeof _31=="string"){ +var _33=$.fn.combotree.methods[_31]; +if(_33){ +return _33(this,_32); }else{ -return this.combo(_1f,_20); +return this.combo(_31,_32); } } -_1f=_1f||{}; +_31=_31||{}; return this.each(function(){ -var _22=$.data(this,"combotree"); -if(_22){ -$.extend(_22.options,_1f); +var _34=$.data(this,"combotree"); +if(_34){ +$.extend(_34.options,_31); }else{ -$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_1f)}); +$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_31)}); } _1(this); }); }; $.fn.combotree.methods={options:function(jq){ -var _23=jq.combo("options"); -return $.extend($.data(jq[0],"combotree").options,{width:_23.width,height:_23.height,originalValue:_23.originalValue,disabled:_23.disabled,readonly:_23.readonly}); -},clone:function(jq,_24){ -var t=jq.combo("clone",_24); +var _35=jq.combo("options"); +return $.extend($.data(jq[0],"combotree").options,{width:_35.width,height:_35.height,originalValue:_35.originalValue,disabled:_35.disabled,readonly:_35.readonly}); +},clone:function(jq,_36){ +var t=jq.combo("clone",_36); t.data("combotree",{options:$.extend(true,{},jq.combotree("options")),tree:jq.combotree("tree")}); return t; },tree:function(jq){ return $.data(jq[0],"combotree").tree; -},loadData:function(jq,_25){ +},loadData:function(jq,_37){ return jq.each(function(){ -var _26=$.data(this,"combotree").options; -_26.data=_25; -var _27=$.data(this,"combotree").tree; -_27.tree("loadData",_25); +var _38=$.data(this,"combotree").options; +_38.data=_37; +var _39=$.data(this,"combotree").tree; +_39.tree("loadData",_37); }); },reload:function(jq,url){ return jq.each(function(){ -var _28=$.data(this,"combotree").options; -var _29=$.data(this,"combotree").tree; +var _3a=$.data(this,"combotree").options; +var _3b=$.data(this,"combotree").tree; if(url){ -_28.url=url; +_3a.url=url; } -_29.tree({url:_28.url}); +_3b.tree({url:_3a.url}); }); -},setValues:function(jq,_2a){ +},setValues:function(jq,_3c){ return jq.each(function(){ -_15(this,_2a); +var _3d=$(this).combotree("options"); +if($.isArray(_3c)){ +_3c=$.map(_3c,function(_3e){ +if(_3e&&typeof _3e=="object"){ +$.easyui.addArrayItem(_3d.mappingRows,"id",_3e); +return _3e.id; +}else{ +return _3e; +} }); -},setValue:function(jq,_2b){ +} +_15(this,_3c); +}); +},setValue:function(jq,_3f){ return jq.each(function(){ -_15(this,[_2b]); +$(this).combotree("setValues",$.isArray(_3f)?_3f:[_3f]); }); },clear:function(jq){ return jq.each(function(){ -var _2c=$.data(this,"combotree").tree; -_2c.find("div.tree-node-selected").removeClass("tree-node-selected"); -var cc=_2c.tree("getChecked"); -for(var i=0;i").appendTo(_9); +} +_3.grid.treegrid($.extend({},_4,{border:false,checkbox:_4.multiple,onLoadSuccess:function(_a,_b){ +var _c=$(_2).combotreegrid("getValues"); +if(_4.multiple){ +$.map($(this).treegrid("getCheckedNodes"),function(_d){ +$.easyui.addArrayItem(_c,_d[_4.idField]); +}); +} +_16(_2,_c); +_4.onLoadSuccess.call(this,_a,_b); +_3.remainText=false; +},onClickRow:function(_e){ +if(_4.multiple){ +$(this).treegrid(_e.checked?"uncheckNode":"checkNode",_e[_4.idField]); +$(this).treegrid("unselect",_e[_4.idField]); +}else{ +$(_2).combo("hidePanel"); +} +_11(_2); +_4.onClickRow.call(this,_e); +},onCheckNode:function(_f,_10){ +_11(_2); +_4.onCheckNode.call(this,_f,_10); +}})); +}; +function _11(_12){ +var _13=$.data(_12,"combotreegrid"); +var _14=_13.options; +var _15=_13.grid; +var vv=[]; +if(_14.multiple){ +vv=$.map(_15.treegrid("getCheckedNodes"),function(row){ +return row[_14.idField]; +}); +}else{ +var row=_15.treegrid("getSelected"); +if(row){ +vv.push(row[_14.idField]); +} +} +vv=vv.concat(_14.unselectedValues); +_16(_12,vv); +}; +function _16(_17,_18){ +var _19=$.data(_17,"combotreegrid"); +var _1a=_19.options; +var _1b=_19.grid; +if(!$.isArray(_18)){ +_18=_18.split(_1a.separator); +} +if(!_1a.multiple){ +_18=_18.length?[_18[0]]:[""]; +} +var vv=$.map(_18,function(_1c){ +return String(_1c); +}); +vv=$.grep(vv,function(v,_1d){ +return _1d===$.inArray(v,vv); +}); +var _1e=_1b.treegrid("getSelected"); +if(_1e){ +_1b.treegrid("unselect",_1e[_1a.idField]); +} +$.map(_1b.treegrid("getCheckedNodes"),function(row){ +if($.inArray(String(row[_1a.idField]),vv)==-1){ +_1b.treegrid("uncheckNode",row[_1a.idField]); +} +}); +var ss=[]; +_1a.unselectedValues=[]; +$.map(vv,function(v){ +var row=_1b.treegrid("find",v); +if(row){ +if(_1a.multiple){ +_1b.treegrid("checkNode",v); +}else{ +_1b.treegrid("select",v); +} +ss.push(_1f(row)); +}else{ +ss.push(_20(v,_1a.mappingRows)||v); +_1a.unselectedValues.push(v); +} +}); +if(_1a.multiple){ +$.map(_1b.treegrid("getCheckedNodes"),function(row){ +var id=String(row[_1a.idField]); +if($.inArray(id,vv)==-1){ +vv.push(id); +ss.push(_1f(row)); +} +}); +} +if(!_19.remainText){ +var s=ss.join(_1a.separator); +if($(_17).combo("getText")!=s){ +$(_17).combo("setText",s); +} +} +$(_17).combo("setValues",vv); +function _20(_21,a){ +var _22=$.easyui.getArrayItem(a,_1a.idField,_21); +return _22?_1f(_22):undefined; +}; +function _1f(row){ +return row[_1a.textField||""]||row[_1a.treeField]; +}; +}; +function _23(_24,q){ +var _25=$.data(_24,"combotreegrid"); +var _26=_25.options; +var _27=_25.grid; +_25.remainText=true; +_27.treegrid("clearSelections").treegrid("clearChecked").treegrid("highlightRow",-1); +if(_26.mode=="remote"){ +$(_24).combotreegrid("clear"); +_27.treegrid("load",$.extend({},_26.queryParams,{q:q})); +}else{ +if(q){ +var _28=_27.treegrid("getData"); +var vv=[]; +var qq=_26.multiple?q.split(_26.separator):[q]; +$.map(qq,function(q){ +q=$.trim(q); +if(q){ +var v=undefined; +$.easyui.forEach(_28,true,function(row){ +if(q.toLowerCase()==String(row[_26.treeField]).toLowerCase()){ +v=row[_26.idField]; +return false; +}else{ +if(_26.filter.call(_24,q,row)){ +_27.treegrid("expandTo",row[_26.idField]); +_27.treegrid("highlightRow",row[_26.idField]); +return false; +} +} +}); +if(v==undefined){ +$.easyui.forEach(_26.mappingRows,false,function(row){ +if(q.toLowerCase()==String(row[_26.treeField])){ +v=row[_26.idField]; +return false; +} +}); +} +if(v!=undefined){ +vv.push(v); +} +} +}); +_16(_24,vv); +_25.remainText=false; +} +} +}; +function _29(_2a){ +_11(_2a); +}; +$.fn.combotreegrid=function(_2b,_2c){ +if(typeof _2b=="string"){ +var _2d=$.fn.combotreegrid.methods[_2b]; +if(_2d){ +return _2d(this,_2c); +}else{ +return this.combo(_2b,_2c); +} +} +_2b=_2b||{}; +return this.each(function(){ +var _2e=$.data(this,"combotreegrid"); +if(_2e){ +$.extend(_2e.options,_2b); +}else{ +_2e=$.data(this,"combotreegrid",{options:$.extend({},$.fn.combotreegrid.defaults,$.fn.combotreegrid.parseOptions(this),_2b)}); +} +_1(this); +}); +}; +$.fn.combotreegrid.methods={options:function(jq){ +var _2f=jq.combo("options"); +return $.extend($.data(jq[0],"combotreegrid").options,{width:_2f.width,height:_2f.height,originalValue:_2f.originalValue,disabled:_2f.disabled,readonly:_2f.readonly}); +},grid:function(jq){ +return $.data(jq[0],"combotreegrid").grid; +},setValues:function(jq,_30){ +return jq.each(function(){ +var _31=$(this).combotreegrid("options"); +if($.isArray(_30)){ +_30=$.map(_30,function(_32){ +if(_32&&typeof _32=="object"){ +$.easyui.addArrayItem(_31.mappingRows,_31.idField,_32); +return _32[_31.idField]; +}else{ +return _32; +} +}); +} +_16(this,_30); +}); +},setValue:function(jq,_33){ +return jq.each(function(){ +$(this).combotreegrid("setValues",$.isArray(_33)?_33:[_33]); +}); +},clear:function(jq){ +return jq.each(function(){ +$(this).combotreegrid("setValues",[]); +}); +},reset:function(jq){ +return jq.each(function(){ +var _34=$(this).combotreegrid("options"); +if(_34.multiple){ +$(this).combotreegrid("setValues",_34.originalValue); +}else{ +$(this).combotreegrid("setValue",_34.originalValue); +} +}); +}}; +$.fn.combotreegrid.parseOptions=function(_35){ +var t=$(_35); +return $.extend({},$.fn.combo.parseOptions(_35),$.fn.treegrid.parseOptions(_35),$.parser.parseOptions(_35,["mode",{limitToGrid:"boolean"}])); +}; +$.fn.combotreegrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.treegrid.defaults,{editable:false,singleSelect:true,limitToGrid:false,unselectedValues:[],mappingRows:[],mode:"local",textField:null,keyHandler:{up:function(e){ +},down:function(e){ +},left:function(e){ +},right:function(e){ +},enter:function(e){ +_29(this); +},query:function(q,e){ +_23(this,q); +}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _36=e.data.target; +var _37=$(_36).combotreegrid("options"); +if(_37.limitToGrid){ +_29(_36); +} +}}),filter:function(q,row){ +var _38=$(this).combotreegrid("options"); +return (row[_38.treeField]||"").toLowerCase().indexOf(q.toLowerCase())>=0; +}}); +})(jQuery); + diff --git a/assets/js/easy-ui/plugins/jquery.datagrid.js b/assets/js/easy-ui/plugins/jquery.datagrid.js old mode 100755 new mode 100644 index 7cd6a86bf0..618bb51205 --- a/assets/js/easy-ui/plugins/jquery.datagrid.js +++ b/assets/js/easy-ui/plugins/jquery.datagrid.js @@ -1,255 +1,235 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ var _1=0; function _2(a,o){ -for(var i=0,_3=a.length;i<_3;i++){ -if(a[i]==o){ -return i; -} -} -return -1; +return $.easyui.indexOfArray(a,o); }; -function _4(a,o,id){ -if(typeof o=="string"){ -for(var i=0,_5=a.length;i<_5;i++){ -if(a[i][o]==id){ -a.splice(i,1); -return; -} -} -}else{ -var _6=_2(a,o); -if(_6!=-1){ -a.splice(_6,1); -} -} +function _3(a,o,id){ +$.easyui.removeArrayItem(a,o,id); }; -function _7(a,o,r){ -for(var i=0,_8=a.length;i<_8;i++){ -if(a[i][o]==r[o]){ -return; -} -} -a.push(r); +function _4(a,o,r){ +$.easyui.addArrayItem(a,o,r); }; -function _9(_a){ -var _b=$.data(_a,"datagrid"); -var _c=_b.options; -var _d=_b.panel; -var dc=_b.dc; +function _5(_6,aa){ +return $.data(_6,"treegrid")?aa.slice(1):aa; +}; +function _7(_8){ +var _9=$.data(_8,"datagrid"); +var _a=_9.options; +var _b=_9.panel; +var dc=_9.dc; var ss=null; -if(_c.sharedStyleSheet){ -ss=typeof _c.sharedStyleSheet=="boolean"?"head":_c.sharedStyleSheet; +if(_a.sharedStyleSheet){ +ss=typeof _a.sharedStyleSheet=="boolean"?"head":_a.sharedStyleSheet; }else{ -ss=_d.closest("div.datagrid-view"); +ss=_b.closest("div.datagrid-view"); if(!ss.length){ ss=dc.view; } } var cc=$(ss); -var _e=$.data(cc[0],"ss"); -if(!_e){ -_e=$.data(cc[0],"ss",{cache:{},dirty:[]}); +var _c=$.data(cc[0],"ss"); +if(!_c){ +_c=$.data(cc[0],"ss",{cache:{},dirty:[]}); } -return {add:function(_f){ +return {add:function(_d){ var ss=[""); $(ss.join("\n")).appendTo(cc); cc.children("style[easyui]:not(:last)").remove(); -},getRule:function(_12){ -var _13=cc.children("style[easyui]:last")[0]; -var _14=_13.styleSheet?_13.styleSheet:(_13.sheet||document.styleSheets[document.styleSheets.length-1]); -var _15=_14.cssRules||_14.rules; -return _15[_12]; -},set:function(_16,_17){ -var _18=_e.cache[_16]; -if(_18){ -_18.width=_17; -var _19=this.getRule(_18.index); -if(_19){ -_19.style["width"]=_17; -} -} -},remove:function(_1a){ +},getRule:function(_10){ +var _11=cc.children("style[easyui]:last")[0]; +var _12=_11.styleSheet?_11.styleSheet:(_11.sheet||document.styleSheets[document.styleSheets.length-1]); +var _13=_12.cssRules||_12.rules; +return _13[_10]; +},set:function(_14,_15){ +var _16=_c.cache[_14]; +if(_16){ +_16.width=_15; +var _17=this.getRule(_16.index); +if(_17){ +_17.style["width"]=_15; +} +} +},remove:function(_18){ var tmp=[]; -for(var s in _e.cache){ -if(s.indexOf(_1a)==-1){ -tmp.push([s,_e.cache[s].width]); +for(var s in _c.cache){ +if(s.indexOf(_18)==-1){ +tmp.push([s,_c.cache[s].width]); } } -_e.cache={}; +_c.cache={}; this.add(tmp); -},dirty:function(_1b){ -if(_1b){ -_e.dirty.push(_1b); +},dirty:function(_19){ +if(_19){ +_c.dirty.push(_19); } },clean:function(){ -for(var i=0;i<_e.dirty.length;i++){ -this.remove(_e.dirty[i]); +for(var i=0;i<_c.dirty.length;i++){ +this.remove(_c.dirty[i]); } -_e.dirty=[]; +_c.dirty=[]; }}; }; -function _1c(_1d,_1e){ -var _1f=$.data(_1d,"datagrid"); -var _20=_1f.options; -var _21=_1f.panel; -if(_1e){ -$.extend(_20,_1e); -} -if(_20.fit==true){ -var p=_21.panel("panel").parent(); -_20.width=p.width(); -_20.height=p.height(); -} -_21.panel("resize",_20); -}; -function _22(_23){ -var _24=$.data(_23,"datagrid"); -var _25=_24.options; -var dc=_24.dc; -var _26=_24.panel; -var _27=_26.width(); -var _28=_26.height(); -var _29=dc.view; -var _2a=dc.view1; -var _2b=dc.view2; -var _2c=_2a.children("div.datagrid-header"); -var _2d=_2b.children("div.datagrid-header"); -var _2e=_2c.find("table"); -var _2f=_2d.find("table"); -_29.width(_27); -var _30=_2c.children("div.datagrid-header-inner").show(); -_2a.width(_30.find("table").width()); -if(!_25.showHeader){ -_30.hide(); -} -_2b.width(_27-_2a._outerWidth()); -_2a.children("div.datagrid-header,div.datagrid-body,div.datagrid-footer").width(_2a.width()); -_2b.children("div.datagrid-header,div.datagrid-body,div.datagrid-footer").width(_2b.width()); -var hh; -_2c.add(_2d).css("height",""); -_2e.add(_2f).css("height",""); -hh=Math.max(_2e.height(),_2f.height()); -_2e.add(_2f).height(hh); -_2c.add(_2d)._outerHeight(hh); +function _1a(_1b,_1c){ +var _1d=$.data(_1b,"datagrid"); +var _1e=_1d.options; +var _1f=_1d.panel; +if(_1c){ +$.extend(_1e,_1c); +} +if(_1e.fit==true){ +var p=_1f.panel("panel").parent(); +_1e.width=p.width(); +_1e.height=p.height(); +} +_1f.panel("resize",_1e); +}; +function _20(_21){ +var _22=$.data(_21,"datagrid"); +var _23=_22.options; +var dc=_22.dc; +var _24=_22.panel; +var _25=_24.width(); +var _26=_24.height(); +var _27=dc.view; +var _28=dc.view1; +var _29=dc.view2; +var _2a=_28.children("div.datagrid-header"); +var _2b=_29.children("div.datagrid-header"); +var _2c=_2a.find("table"); +var _2d=_2b.find("table"); +_27.width(_25); +var _2e=_2a.children("div.datagrid-header-inner").show(); +_28.width(_2e.find("table").width()); +if(!_23.showHeader){ +_2e.hide(); +} +_29.width(_25-_28._outerWidth()); +_28.children()._outerWidth(_28.width()); +_29.children()._outerWidth(_29.width()); +var all=_2a.add(_2b).add(_2c).add(_2d); +all.css("height",""); +var hh=Math.max(_2c.height(),_2d.height()); +all._outerHeight(hh); +_27.children(".datagrid-empty").css("top",hh+"px"); dc.body1.add(dc.body2).children("table.datagrid-btable-frozen").css({position:"absolute",top:dc.header2._outerHeight()}); -var _31=dc.body2.children("table.datagrid-btable-frozen")._outerHeight(); -var _32=_31+_2b.children("div.datagrid-header")._outerHeight()+_2b.children("div.datagrid-footer")._outerHeight()+_26.children("div.datagrid-toolbar")._outerHeight(); -_26.children("div.datagrid-pager").each(function(){ -_32+=$(this)._outerHeight(); -}); -var _33=_26.outerHeight()-_26.height(); -var _34=_26._size("minHeight")||""; -var _35=_26._size("maxHeight")||""; -_2a.add(_2b).children("div.datagrid-body").css({marginTop:_31,height:(isNaN(parseInt(_25.height))?"":(_28-_32)),minHeight:(_34?_34-_33-_32:""),maxHeight:(_35?_35-_33-_32:"")}); -_29.height(_2b.height()); -}; -function _36(_37,_38,_39){ -var _3a=$.data(_37,"datagrid").data.rows; -var _3b=$.data(_37,"datagrid").options; -var dc=$.data(_37,"datagrid").dc; -if(!dc.body1.is(":empty")&&(!_3b.nowrap||_3b.autoRowHeight||_39)){ -if(_38!=undefined){ -var tr1=_3b.finder.getTr(_37,_38,"body",1); -var tr2=_3b.finder.getTr(_37,_38,"body",2); -_3c(tr1,tr2); -}else{ -var tr1=_3b.finder.getTr(_37,0,"allbody",1); -var tr2=_3b.finder.getTr(_37,0,"allbody",2); -_3c(tr1,tr2); -if(_3b.showFooter){ -var tr1=_3b.finder.getTr(_37,0,"allfooter",1); -var tr2=_3b.finder.getTr(_37,0,"allfooter",2); -_3c(tr1,tr2); -} -} -} -_22(_37); -if(_3b.height=="auto"){ -var _3d=dc.body1.parent(); -var _3e=dc.body2; -var _3f=_40(_3e); -var _41=_3f.height; -if(_3f.width>_3e.width()){ -_41+=18; -} -_41-=parseInt(_3e.css("marginTop"))||0; -_3d.height(_41); -_3e.height(_41); +var _2f=dc.body2.children("table.datagrid-btable-frozen")._outerHeight(); +var _30=_2f+_2b._outerHeight()+_29.children(".datagrid-footer")._outerHeight(); +_24.children(":not(.datagrid-view,.datagrid-mask,.datagrid-mask-msg)").each(function(){ +_30+=$(this)._outerHeight(); +}); +var _31=_24.outerHeight()-_24.height(); +var _32=_24._size("minHeight")||""; +var _33=_24._size("maxHeight")||""; +_28.add(_29).children("div.datagrid-body").css({marginTop:_2f,height:(isNaN(parseInt(_23.height))?"":(_26-_30)),minHeight:(_32?_32-_31-_30:""),maxHeight:(_33?_33-_31-_30:"")}); +_27.height(_29.height()); +}; +function _34(_35,_36,_37){ +var _38=$.data(_35,"datagrid").data.rows; +var _39=$.data(_35,"datagrid").options; +var dc=$.data(_35,"datagrid").dc; +if(!dc.body1.is(":empty")&&(!_39.nowrap||_39.autoRowHeight||_37)){ +if(_36!=undefined){ +var tr1=_39.finder.getTr(_35,_36,"body",1); +var tr2=_39.finder.getTr(_35,_36,"body",2); +_3a(tr1,tr2); +}else{ +var tr1=_39.finder.getTr(_35,0,"allbody",1); +var tr2=_39.finder.getTr(_35,0,"allbody",2); +_3a(tr1,tr2); +if(_39.showFooter){ +var tr1=_39.finder.getTr(_35,0,"allfooter",1); +var tr2=_39.finder.getTr(_35,0,"allfooter",2); +_3a(tr1,tr2); +} +} +} +_20(_35); +if(_39.height=="auto"){ +var _3b=dc.body1.parent(); +var _3c=dc.body2; +var _3d=_3e(_3c); +var _3f=_3d.height; +if(_3d.width>_3c.width()){ +_3f+=18; +} +_3f-=parseInt(_3c.css("marginTop"))||0; +_3b.height(_3f); +_3c.height(_3f); dc.view.height(dc.view2.height()); } dc.body2.triggerHandler("scroll"); -function _3c(_42,_43){ -for(var i=0;i<_43.length;i++){ -var tr1=$(_42[i]); -var tr2=$(_43[i]); +function _3a(_40,_41){ +for(var i=0;i<_41.length;i++){ +var tr1=$(_40[i]); +var tr2=$(_41[i]); tr1.css("height",""); tr2.css("height",""); -var _44=Math.max(tr1.height(),tr2.height()); -tr1.css("height",_44); -tr2.css("height",_44); +var _42=Math.max(tr1.height(),tr2.height()); +tr1.css("height",_42); +tr2.css("height",_42); } }; -function _40(cc){ -var _45=0; -var _46=0; +function _3e(cc){ +var _43=0; +var _44=0; $(cc).children().each(function(){ var c=$(this); if(c.is(":visible")){ -_46+=c._outerHeight(); -if(_45"); } -_4c(true); -_4c(false); -_22(_48); -function _4c(_4d){ -var _4e=_4d?1:2; -var tr=_4b.finder.getTr(_48,_49,"body",_4e); -(_4d?dc.body1:dc.body2).children("table.datagrid-btable-frozen").append(tr); +_4a(true); +_4a(false); +_20(_46); +function _4a(_4b){ +var _4c=_4b?1:2; +var tr=_49.finder.getTr(_46,_47,"body",_4c); +(_4b?dc.body1:dc.body2).children("table.datagrid-btable-frozen").append(tr); }; }; -function _4f(_50,_51){ -function _52(){ -var _53=[]; -var _54=[]; -$(_50).children("thead").each(function(){ +function _4d(_4e,_4f){ +function _50(){ +var _51=[]; +var _52=[]; +$(_4e).children("thead").each(function(){ var opt=$.parser.parseOptions(this,[{frozen:"boolean"}]); $(this).find("tr").each(function(){ -var _55=[]; +var _53=[]; $(this).find("th").each(function(){ var th=$(this); -var col=$.extend({},$.parser.parseOptions(this,["field","align","halign","order","width",{sortable:"boolean",checkbox:"boolean",resizable:"boolean",fixed:"boolean"},{rowspan:"number",colspan:"number"}]),{title:(th.html()||undefined),hidden:(th.attr("hidden")?true:undefined),formatter:(th.attr("formatter")?eval(th.attr("formatter")):undefined),styler:(th.attr("styler")?eval(th.attr("styler")):undefined),sorter:(th.attr("sorter")?eval(th.attr("sorter")):undefined)}); +var col=$.extend({},$.parser.parseOptions(this,["id","field","align","halign","order","width",{sortable:"boolean",checkbox:"boolean",resizable:"boolean",fixed:"boolean"},{rowspan:"number",colspan:"number"}]),{title:(th.html()||undefined),hidden:(th.attr("hidden")?true:undefined),formatter:(th.attr("formatter")?eval(th.attr("formatter")):undefined),styler:(th.attr("styler")?eval(th.attr("styler")):undefined),sorter:(th.attr("sorter")?eval(th.attr("sorter")):undefined)}); if(col.width&&String(col.width).indexOf("%")==-1){ col.width=parseInt(col.width); } @@ -261,109 +241,114 @@ col.editor=eval("("+s+")"); col.editor=s; } } -_55.push(col); +_53.push(col); }); -opt.frozen?_53.push(_55):_54.push(_55); +opt.frozen?_51.push(_53):_52.push(_53); }); }); -return [_53,_54]; +return [_51,_52]; }; -var _56=$("
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+""+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+""+"
                  "+"
                  "+"
                  "+"
                  ").insertAfter(_50); -_56.panel({doSize:false,cls:"datagrid"}); -$(_50).addClass("datagrid-f").hide().appendTo(_56.children("div.datagrid-view")); -var cc=_52(); -var _57=_56.children("div.datagrid-view"); -var _58=_57.children("div.datagrid-view1"); -var _59=_57.children("div.datagrid-view2"); -return {panel:_56,frozenColumns:cc[0],columns:cc[1],dc:{view:_57,view1:_58,view2:_59,header1:_58.children("div.datagrid-header").children("div.datagrid-header-inner"),header2:_59.children("div.datagrid-header").children("div.datagrid-header-inner"),body1:_58.children("div.datagrid-body").children("div.datagrid-body-inner"),body2:_59.children("div.datagrid-body"),footer1:_58.children("div.datagrid-footer").children("div.datagrid-footer-inner"),footer2:_59.children("div.datagrid-footer").children("div.datagrid-footer-inner")}}; +var _54=$("
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+""+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+"
                  "+""+"
                  "+"
                  "+"
                  "+"
                  ").insertAfter(_4e); +_54.panel({doSize:false,cls:"datagrid"}); +$(_4e).addClass("datagrid-f").hide().appendTo(_54.children("div.datagrid-view")); +var cc=_50(); +var _55=_54.children("div.datagrid-view"); +var _56=_55.children("div.datagrid-view1"); +var _57=_55.children("div.datagrid-view2"); +return {panel:_54,frozenColumns:cc[0],columns:cc[1],dc:{view:_55,view1:_56,view2:_57,header1:_56.children("div.datagrid-header").children("div.datagrid-header-inner"),header2:_57.children("div.datagrid-header").children("div.datagrid-header-inner"),body1:_56.children("div.datagrid-body").children("div.datagrid-body-inner"),body2:_57.children("div.datagrid-body"),footer1:_56.children("div.datagrid-footer").children("div.datagrid-footer-inner"),footer2:_57.children("div.datagrid-footer").children("div.datagrid-footer-inner")}}; }; -function _5a(_5b){ -var _5c=$.data(_5b,"datagrid"); -var _5d=_5c.options; -var dc=_5c.dc; -var _5e=_5c.panel; -_5c.ss=$(_5b).datagrid("createStyleSheet"); -_5e.panel($.extend({},_5d,{id:null,doSize:false,onResize:function(_5f,_60){ -setTimeout(function(){ -if($.data(_5b,"datagrid")){ -_22(_5b); -_b0(_5b); -_5d.onResize.call(_5e,_5f,_60); +function _58(_59){ +var _5a=$.data(_59,"datagrid"); +var _5b=_5a.options; +var dc=_5a.dc; +var _5c=_5a.panel; +_5a.ss=$(_59).datagrid("createStyleSheet"); +_5c.panel($.extend({},_5b,{id:null,doSize:false,onResize:function(_5d,_5e){ +if($.data(_59,"datagrid")){ +_20(_59); +$(_59).datagrid("fitColumns"); +_5b.onResize.call(_5c,_5d,_5e); } -},0); },onExpand:function(){ -_36(_5b); -_5d.onExpand.call(_5e); +if($.data(_59,"datagrid")){ +$(_59).datagrid("fixRowHeight").datagrid("fitColumns"); +_5b.onExpand.call(_5c); +} }})); -_5c.rowIdPrefix="datagrid-row-r"+(++_1); -_5c.cellClassPrefix="datagrid-cell-c"+_1; -_61(dc.header1,_5d.frozenColumns,true); -_61(dc.header2,_5d.columns,false); -_62(); -dc.header1.add(dc.header2).css("display",_5d.showHeader?"block":"none"); -dc.footer1.add(dc.footer2).css("display",_5d.showFooter?"block":"none"); -if(_5d.toolbar){ -if($.isArray(_5d.toolbar)){ -$("div.datagrid-toolbar",_5e).remove(); -var tb=$("
                  ").prependTo(_5e); +_5a.rowIdPrefix="datagrid-row-r"+(++_1); +_5a.cellClassPrefix="datagrid-cell-c"+_1; +_5f(dc.header1,_5b.frozenColumns,true); +_5f(dc.header2,_5b.columns,false); +_60(); +dc.header1.add(dc.header2).css("display",_5b.showHeader?"block":"none"); +dc.footer1.add(dc.footer2).css("display",_5b.showFooter?"block":"none"); +if(_5b.toolbar){ +if($.isArray(_5b.toolbar)){ +$("div.datagrid-toolbar",_5c).remove(); +var tb=$("
                  ").prependTo(_5c); var tr=tb.find("tr"); -for(var i=0;i<_5d.toolbar.length;i++){ -var btn=_5d.toolbar[i]; +for(var i=0;i<_5b.toolbar.length;i++){ +var btn=_5b.toolbar[i]; if(btn=="-"){ $("
                  ").appendTo(tr); }else{ var td=$("").appendTo(tr); -var _63=$("").appendTo(td); -_63[0].onclick=eval(btn.handler||function(){ +var _61=$("").appendTo(td); +_61[0].onclick=eval(btn.handler||function(){ }); -_63.linkbutton($.extend({},btn,{plain:true})); +_61.linkbutton($.extend({},btn,{plain:true})); } } }else{ -$(_5d.toolbar).addClass("datagrid-toolbar").prependTo(_5e); -$(_5d.toolbar).show(); +$(_5b.toolbar).addClass("datagrid-toolbar").prependTo(_5c); +$(_5b.toolbar).show(); } }else{ -$("div.datagrid-toolbar",_5e).remove(); +$("div.datagrid-toolbar",_5c).remove(); } -$("div.datagrid-pager",_5e).remove(); -if(_5d.pagination){ -var _64=$("
                  "); -if(_5d.pagePosition=="bottom"){ -_64.appendTo(_5e); +$("div.datagrid-pager",_5c).remove(); +if(_5b.pagination){ +var _62=$("
                  "); +if(_5b.pagePosition=="bottom"){ +_62.appendTo(_5c); }else{ -if(_5d.pagePosition=="top"){ -_64.addClass("datagrid-pager-top").prependTo(_5e); +if(_5b.pagePosition=="top"){ +_62.addClass("datagrid-pager-top").prependTo(_5c); }else{ -var _65=$("
                  ").prependTo(_5e); -_64.appendTo(_5e); -_64=_64.add(_65); +var _63=$("
                  ").prependTo(_5c); +_62.appendTo(_5c); +_62=_62.add(_63); } } -_64.pagination({total:(_5d.pageNumber*_5d.pageSize),pageNumber:_5d.pageNumber,pageSize:_5d.pageSize,pageList:_5d.pageList,onSelectPage:function(_66,_67){ -_5d.pageNumber=_66||1; -_5d.pageSize=_67; -_64.pagination("refresh",{pageNumber:_66,pageSize:_67}); -_ae(_5b); +_62.pagination({total:0,pageNumber:_5b.pageNumber,pageSize:_5b.pageSize,pageList:_5b.pageList,onSelectPage:function(_64,_65){ +_5b.pageNumber=_64||1; +_5b.pageSize=_65; +_62.pagination("refresh",{pageNumber:_64,pageSize:_65}); +_bf(_59); }}); -_5d.pageSize=_64.pagination("options").pageSize; +_5b.pageSize=_62.pagination("options").pageSize; } -function _61(_68,_69,_6a){ -if(!_69){ +function _5f(_66,_67,_68){ +if(!_67){ return; } -$(_68).show(); -$(_68).empty(); +$(_66).show(); +$(_66).empty(); +var tmp=$("
                  ").appendTo("body"); +tmp._outerWidth(99); +var _69=100-parseInt(tmp[0].style.width); +tmp.remove(); +var _6a=[]; var _6b=[]; var _6c=[]; -if(_5d.sortName){ -_6b=_5d.sortName.split(","); -_6c=_5d.sortOrder.split(","); +if(_5b.sortName){ +_6a=_5b.sortName.split(","); +_6b=_5b.sortOrder.split(","); } -var t=$("
                  ").appendTo(_68); -for(var i=0;i<_69.length;i++){ +var t=$("
                  ").appendTo(_66); +for(var i=0;i<_67.length;i++){ var tr=$("").appendTo($("tbody",t)); -var _6d=_69[i]; +var _6d=_67[i]; for(var j=0;j<_6d.length;j++){ var col=_6d[j]; var _6e=""; @@ -372,6 +357,12 @@ _6e+="rowspan=\""+col.rowspan+"\" "; } if(col.colspan){ _6e+="colspan=\""+col.colspan+"\" "; +if(!col.id){ +col.id=["datagrid-td-group"+_1,i,j].join("-"); +} +} +if(col.id){ +_6e+="id=\""+col.id+"\""; } var td=$("").appendTo(tr); if(col.checkbox){ @@ -381,57 +372,62 @@ $("
                  ").html(""); -$("span",td).html(col.title); -$("span.datagrid-sort-icon",td).html(" "); +td.find("span:first").html(col.title); var _6f=td.find("div.datagrid-cell"); -var pos=_2(_6b,col.field); +var pos=_2(_6a,col.field); if(pos>=0){ -_6f.addClass("datagrid-sort-"+_6c[pos]); +_6f.addClass("datagrid-sort-"+_6b[pos]); +} +if(col.sortable){ +_6f.addClass("datagrid-sort"); } if(col.resizable==false){ _6f.attr("resizable","false"); } if(col.width){ -var _70=$.parser.parseValue("width",col.width,dc.view,_5d.scrollbarSize); -_6f._outerWidth(_70-1); -col.boxWidth=parseInt(_6f[0].style.width); -col.deltaWidth=_70-col.boxWidth; +var _70=$.parser.parseValue("width",col.width,dc.view,_5b.scrollbarSize+(_5b.rownumbers?_5b.rownumberWidth:0)); +col.deltaWidth=_69; +col.boxWidth=_70-_69; }else{ col.auto=true; } _6f.css("text-align",(col.halign||col.align||"")); -col.cellClass=_5c.cellClassPrefix+"-"+col.field.replace(/[\.|\s]/g,"-"); -_6f.addClass(col.cellClass).css("width",""); +col.cellClass=_5a.cellClassPrefix+"-"+col.field.replace(/[\.|\s]/g,"-"); +_6f.addClass(col.cellClass); }else{ $("
                  ").html(col.title).appendTo(td); } } if(col.hidden){ td.hide(); +_6c.push(col.field); } } } -if(_6a&&_5d.rownumbers){ -var td=$("
                  "); +if(_68&&_5b.rownumbers){ +var td=$("
                  "); if($("tr",t).length==0){ td.wrap("").parent().appendTo($("tbody",t)); }else{ td.prependTo($("tr:first",t)); } } +for(var i=0;i<_6c.length;i++){ +_c1(_59,_6c[i],-1); +} }; -function _62(){ -var _71=[]; -var _72=_73(_5b,true).concat(_73(_5b)); +function _60(){ +var _71=[[".datagrid-header-rownumber",(_5b.rownumberWidth-1)+"px"],[".datagrid-cell-rownumber",(_5b.rownumberWidth-1)+"px"]]; +var _72=_73(_59,true).concat(_73(_59)); for(var i=0;i<_72.length;i++){ -var col=_74(_5b,_72[i]); +var col=_74(_59,_72[i]); if(col&&!col.checkbox){ _71.push(["."+col.cellClass,col.boxWidth?col.boxWidth+"px":"auto"]); } } -_5c.ss.add(_71); -_5c.ss.dirty(_5c.cellSelectorPrefix); -_5c.cellSelectorPrefix="."+_5c.cellClassPrefix; +_5a.ss.add(_71); +_5a.ss.dirty(_5a.cellSelectorPrefix); +_5a.cellSelectorPrefix="."+_5a.cellClassPrefix; }; }; function _75(_76){ @@ -440,52 +436,14 @@ var _78=_77.panel; var _79=_77.options; var dc=_77.dc; var _7a=dc.header1.add(dc.header2); -_7a.find("input[type=checkbox]").unbind(".datagrid").bind("click.datagrid",function(e){ -if(_79.singleSelect&&_79.selectOnCheck){ -return false; -} -if($(this).is(":checked")){ -_123(_76); -}else{ -_129(_76); -} -e.stopPropagation(); -}); -var _7b=_7a.find("div.datagrid-cell"); -_7b.closest("td").unbind(".datagrid").bind("mouseenter.datagrid",function(){ -if(_77.resizing){ -return; -} -$(this).addClass("datagrid-header-over"); -}).bind("mouseleave.datagrid",function(){ -$(this).removeClass("datagrid-header-over"); -}).bind("contextmenu.datagrid",function(e){ -var _7c=$(this).attr("field"); -_79.onHeaderContextMenu.call(_76,e,_7c); -}); -_7b.unbind(".datagrid").bind("click.datagrid",function(e){ -var p1=$(this).offset().left+5; -var p2=$(this).offset().left+$(this)._outerWidth()-5; -if(e.pageXp1){ -_a2(_76,$(this).parent().attr("field")); -} -}).bind("dblclick.datagrid",function(e){ -var p1=$(this).offset().left+5; -var p2=$(this).offset().left+$(this)._outerWidth()-5; -var _7d=_79.resizeHandle=="right"?(e.pageX>p2):(_79.resizeHandle=="left"?(e.pageXp2)); -if(_7d){ -var _7e=$(this).parent().attr("field"); -var col=_74(_76,_7e); -if(col.resizable==false){ -return; -} -$(_76).datagrid("autoSizeColumn",_7e); -col.auto=false; -} -}); -var _7f=_79.resizeHandle=="right"?"e":(_79.resizeHandle=="left"?"w":"e,w"); -_7b.each(function(){ -$(this).resizable({handles:_7f,disabled:($(this).attr("resizable")?$(this).attr("resizable")=="false":false),minWidth:25,onStartResize:function(e){ +_7a.unbind(".datagrid"); +for(var _7b in _79.headerEvents){ +_7a.bind(_7b+".datagrid",_79.headerEvents[_7b]); +} +var _7c=_7a.find("div.datagrid-cell"); +var _7d=_79.resizeHandle=="right"?"e":(_79.resizeHandle=="left"?"w":"e,w"); +_7c.each(function(){ +$(this).resizable({handles:_7d,disabled:($(this).attr("resizable")?$(this).attr("resizable")=="false":false),minWidth:25,onStartResize:function(e){ _77.resizing=true; _7a.css("cursor",$("body").css("cursor")); if(!_77.proxy){ @@ -503,20 +461,20 @@ return false; },onStopResize:function(e){ _7a.css("cursor",""); $(this).css("height",""); -var _80=$(this).parent().attr("field"); -var col=_74(_76,_80); +var _7e=$(this).parent().attr("field"); +var col=_74(_76,_7e); col.width=$(this)._outerWidth(); col.boxWidth=col.width-col.deltaWidth; col.auto=undefined; $(this).css("width",""); -_d1(_76,_80); +$(_76).datagrid("fixColumnSize",_7e); _77.proxy.remove(); _77.proxy=null; if($(this).parents("div:first.datagrid-header").parent().hasClass("datagrid-view1")){ -_22(_76); +_20(_76); } -_b0(_76); -_79.onResizeColumn.call(_76,_80,col.width); +$(_76).datagrid("fitColumns"); +_79.onResizeColumn.call(_76,_7e,col.width); setTimeout(function(){ _77.resizing=false; },0); @@ -524,15 +482,19 @@ _77.resizing=false; }); var bb=dc.body1.add(dc.body2); bb.unbind(); -for(var _81 in _79.rowEvents){ -bb.bind(_81,_79.rowEvents[_81]); +for(var _7b in _79.rowEvents){ +bb.bind(_7b,_79.rowEvents[_7b]); } dc.body1.bind("mousewheel DOMMouseScroll",function(e){ +e.preventDefault(); var e1=e.originalEvent||window.event; -var _82=e1.wheelDelta||e1.detail*(-1); +var _7f=e1.wheelDelta||e1.detail*(-1); +if("deltaY" in e1){ +_7f=e1.deltaY*-1; +} var dg=$(e.target).closest("div.datagrid-view").children(".datagrid-f"); var dc=dg.data("datagrid").dc; -dc.body2.scrollTop(dc.body2.scrollTop()-_82); +dc.body2.scrollTop(dc.body2.scrollTop()-_7f); }); dc.body2.bind("scroll",function(){ var b1=dc.view1.children("div.datagrid-body"); @@ -540,249 +502,343 @@ b1.scrollTop($(this).scrollTop()); var c1=dc.body1.children(":first"); var c2=dc.body2.children(":first"); if(c1.length&&c2.length){ -var _83=c1.offset().top; -var _84=c2.offset().top; -if(_83!=_84){ -b1.scrollTop(b1.scrollTop()+_83-_84); +var _80=c1.offset().top; +var _81=c2.offset().top; +if(_80!=_81){ +b1.scrollTop(b1.scrollTop()+_80-_81); } } dc.view2.children("div.datagrid-header,div.datagrid-footer")._scrollLeft($(this)._scrollLeft()); dc.body2.children("table.datagrid-btable-frozen").css("left",-$(this)._scrollLeft()); }); }; -function _85(_86){ +function _82(_83){ return function(e){ -var tr=_87(e.target); +var td=$(e.target).closest("td[field]"); +if(td.length){ +var _84=_85(td); +if(!$(_84).data("datagrid").resizing&&_83){ +td.addClass("datagrid-header-over"); +}else{ +td.removeClass("datagrid-header-over"); +} +} +}; +}; +function _86(e){ +var _87=_85(e.target); +var _88=$(_87).datagrid("options"); +var ck=$(e.target).closest("input[type=checkbox]"); +if(ck.length){ +if(_88.singleSelect&&_88.selectOnCheck){ +return false; +} +if(ck.is(":checked")){ +_89(_87); +}else{ +_8a(_87); +} +e.stopPropagation(); +}else{ +var _8b=$(e.target).closest(".datagrid-cell"); +if(_8b.length){ +var p1=_8b.offset().left+5; +var p2=_8b.offset().left+_8b._outerWidth()-5; +if(e.pageXp1){ +_8c(_87,_8b.parent().attr("field")); +} +} +} +}; +function _8d(e){ +var _8e=_85(e.target); +var _8f=$(_8e).datagrid("options"); +var _90=$(e.target).closest(".datagrid-cell"); +if(_90.length){ +var p1=_90.offset().left+5; +var p2=_90.offset().left+_90._outerWidth()-5; +var _91=_8f.resizeHandle=="right"?(e.pageX>p2):(_8f.resizeHandle=="left"?(e.pageXp2)); +if(_91){ +var _92=_90.parent().attr("field"); +var col=_74(_8e,_92); +if(col.resizable==false){ +return; +} +$(_8e).datagrid("autoSizeColumn",_92); +col.auto=false; +} +} +}; +function _93(e){ +var _94=_85(e.target); +var _95=$(_94).datagrid("options"); +var td=$(e.target).closest("td[field]"); +_95.onHeaderContextMenu.call(_94,e,td.attr("field")); +}; +function _96(_97){ +return function(e){ +var tr=_98(e.target); if(!tr){ return; } -var _88=_89(tr); -if($.data(_88,"datagrid").resizing){ +var _99=_85(tr); +if($.data(_99,"datagrid").resizing){ return; } -var _8a=_8b(tr); -if(_86){ -_8c(_88,_8a); +var _9a=_9b(tr); +if(_97){ +_9c(_99,_9a); }else{ -var _8d=$.data(_88,"datagrid").options; -_8d.finder.getTr(_88,_8a).removeClass("datagrid-row-over"); +var _9d=$.data(_99,"datagrid").options; +_9d.finder.getTr(_99,_9a).removeClass("datagrid-row-over"); } }; }; -function _8e(e){ -var tr=_87(e.target); +function _9e(e){ +var tr=_98(e.target); if(!tr){ return; } -var _8f=_89(tr); -var _90=$.data(_8f,"datagrid").options; -var _91=_8b(tr); +var _9f=_85(tr); +var _a0=$.data(_9f,"datagrid").options; +var _a1=_9b(tr); var tt=$(e.target); if(tt.parent().hasClass("datagrid-cell-check")){ -if(_90.singleSelect&&_90.selectOnCheck){ +if(_a0.singleSelect&&_a0.selectOnCheck){ tt._propAttr("checked",!tt.is(":checked")); -_92(_8f,_91); +_a2(_9f,_a1); }else{ if(tt.is(":checked")){ tt._propAttr("checked",false); -_92(_8f,_91); +_a2(_9f,_a1); }else{ tt._propAttr("checked",true); -_93(_8f,_91); +_a3(_9f,_a1); } } }else{ -var row=_90.finder.getRow(_8f,_91); +var row=_a0.finder.getRow(_9f,_a1); var td=tt.closest("td[field]",tr); if(td.length){ -var _94=td.attr("field"); -_90.onClickCell.call(_8f,_91,_94,row[_94]); +var _a4=td.attr("field"); +_a0.onClickCell.call(_9f,_a1,_a4,row[_a4]); } -if(_90.singleSelect==true){ -_95(_8f,_91); +if(_a0.singleSelect==true){ +_a5(_9f,_a1); }else{ -if(_90.ctrlSelect){ -if(e.ctrlKey){ +if(_a0.ctrlSelect){ +if(e.metaKey||e.ctrlKey){ if(tr.hasClass("datagrid-row-selected")){ -_96(_8f,_91); +_a6(_9f,_a1); }else{ -_95(_8f,_91); +_a5(_9f,_a1); } }else{ if(e.shiftKey){ -$(_8f).datagrid("clearSelections"); -var _97=Math.min(_90.lastSelectedIndex||0,_91); -var _98=Math.max(_90.lastSelectedIndex||0,_91); -for(var i=_97;i<=_98;i++){ -_95(_8f,i); +$(_9f).datagrid("clearSelections"); +var _a7=Math.min(_a0.lastSelectedIndex||0,_a1); +var _a8=Math.max(_a0.lastSelectedIndex||0,_a1); +for(var i=_a7;i<=_a8;i++){ +_a5(_9f,i); } }else{ -$(_8f).datagrid("clearSelections"); -_95(_8f,_91); -_90.lastSelectedIndex=_91; +$(_9f).datagrid("clearSelections"); +_a5(_9f,_a1); +_a0.lastSelectedIndex=_a1; } } }else{ if(tr.hasClass("datagrid-row-selected")){ -_96(_8f,_91); +_a6(_9f,_a1); }else{ -_95(_8f,_91); +_a5(_9f,_a1); } } } -_90.onClickRow.call(_8f,_91,row); +_a0.onClickRow.apply(_9f,_5(_9f,[_a1,row])); } }; -function _99(e){ -var tr=_87(e.target); +function _a9(e){ +var tr=_98(e.target); if(!tr){ return; } -var _9a=_89(tr); -var _9b=$.data(_9a,"datagrid").options; -var _9c=_8b(tr); -var row=_9b.finder.getRow(_9a,_9c); +var _aa=_85(tr); +var _ab=$.data(_aa,"datagrid").options; +var _ac=_9b(tr); +var row=_ab.finder.getRow(_aa,_ac); var td=$(e.target).closest("td[field]",tr); if(td.length){ -var _9d=td.attr("field"); -_9b.onDblClickCell.call(_9a,_9c,_9d,row[_9d]); +var _ad=td.attr("field"); +_ab.onDblClickCell.call(_aa,_ac,_ad,row[_ad]); } -_9b.onDblClickRow.call(_9a,_9c,row); +_ab.onDblClickRow.apply(_aa,_5(_aa,[_ac,row])); }; -function _9e(e){ -var tr=_87(e.target); -if(!tr){ -return; +function _ae(e){ +var tr=_98(e.target); +if(tr){ +var _af=_85(tr); +var _b0=$.data(_af,"datagrid").options; +var _b1=_9b(tr); +var row=_b0.finder.getRow(_af,_b1); +_b0.onRowContextMenu.call(_af,e,_b1,row); +}else{ +var _b2=_98(e.target,".datagrid-body"); +if(_b2){ +var _af=_85(_b2); +var _b0=$.data(_af,"datagrid").options; +_b0.onRowContextMenu.call(_af,e,-1,null); +} } -var _9f=_89(tr); -var _a0=$.data(_9f,"datagrid").options; -var _a1=_8b(tr); -var row=_a0.finder.getRow(_9f,_a1); -_a0.onRowContextMenu.call(_9f,e,_a1,row); }; -function _89(t){ +function _85(t){ return $(t).closest("div.datagrid-view").children(".datagrid-f")[0]; }; -function _87(t){ -var tr=$(t).closest("tr.datagrid-row"); +function _98(t,_b3){ +var tr=$(t).closest(_b3||"tr.datagrid-row"); if(tr.length&&tr.parent().length){ return tr; }else{ return undefined; } }; -function _8b(tr){ +function _9b(tr){ if(tr.attr("datagrid-row-index")){ return parseInt(tr.attr("datagrid-row-index")); }else{ return tr.attr("node-id"); } }; -function _a2(_a3,_a4){ -var _a5=$.data(_a3,"datagrid"); -var _a6=_a5.options; -_a4=_a4||{}; -var _a7={sortName:_a6.sortName,sortOrder:_a6.sortOrder}; -if(typeof _a4=="object"){ -$.extend(_a7,_a4); -} -var _a8=[]; -var _a9=[]; -if(_a7.sortName){ -_a8=_a7.sortName.split(","); -_a9=_a7.sortOrder.split(","); -} -if(typeof _a4=="string"){ -var _aa=_a4; -var col=_74(_a3,_aa); -if(!col.sortable||_a5.resizing){ +function _8c(_b4,_b5){ +var _b6=$.data(_b4,"datagrid"); +var _b7=_b6.options; +_b5=_b5||{}; +var _b8={sortName:_b7.sortName,sortOrder:_b7.sortOrder}; +if(typeof _b5=="object"){ +$.extend(_b8,_b5); +} +var _b9=[]; +var _ba=[]; +if(_b8.sortName){ +_b9=_b8.sortName.split(","); +_ba=_b8.sortOrder.split(","); +} +if(typeof _b5=="string"){ +var _bb=_b5; +var col=_74(_b4,_bb); +if(!col.sortable||_b6.resizing){ return; } -var _ab=col.order||"asc"; -var pos=_2(_a8,_aa); +var _bc=col.order||"asc"; +var pos=_2(_b9,_bb); if(pos>=0){ -var _ac=_a9[pos]=="asc"?"desc":"asc"; -if(_a6.multiSort&&_ac==_ab){ -_a8.splice(pos,1); -_a9.splice(pos,1); +var _bd=_ba[pos]=="asc"?"desc":"asc"; +if(_b7.multiSort&&_bd==_bc){ +_b9.splice(pos,1); +_ba.splice(pos,1); }else{ -_a9[pos]=_ac; +_ba[pos]=_bd; } }else{ -if(_a6.multiSort){ -_a8.push(_aa); -_a9.push(_ab); +if(_b7.multiSort){ +_b9.push(_bb); +_ba.push(_bc); }else{ -_a8=[_aa]; -_a9=[_ab]; +_b9=[_bb]; +_ba=[_bc]; } } -_a7.sortName=_a8.join(","); -_a7.sortOrder=_a9.join(","); +_b8.sortName=_b9.join(","); +_b8.sortOrder=_ba.join(","); } -if(_a6.onBeforeSortColumn.call(_a3,_a7.sortName,_a7.sortOrder)==false){ +if(_b7.onBeforeSortColumn.call(_b4,_b8.sortName,_b8.sortOrder)==false){ return; } -$.extend(_a6,_a7); -var dc=_a5.dc; -var _ad=dc.header1.add(dc.header2); -_ad.find("div.datagrid-cell").removeClass("datagrid-sort-asc datagrid-sort-desc"); -for(var i=0;i<_a8.length;i++){ -var col=_74(_a3,_a8[i]); -_ad.find("div."+col.cellClass).addClass("datagrid-sort-"+_a9[i]); -} -if(_a6.remoteSort){ -_ae(_a3); +$.extend(_b7,_b8); +var dc=_b6.dc; +var _be=dc.header1.add(dc.header2); +_be.find("div.datagrid-cell").removeClass("datagrid-sort-asc datagrid-sort-desc"); +for(var i=0;i<_b9.length;i++){ +var col=_74(_b4,_b9[i]); +_be.find("div."+col.cellClass).addClass("datagrid-sort-"+_ba[i]); +} +if(_b7.remoteSort){ +_bf(_b4); +}else{ +_c0(_b4,$(_b4).datagrid("getData")); +} +_b7.onSortColumn.call(_b4,_b7.sortName,_b7.sortOrder); +}; +function _c1(_c2,_c3,_c4){ +_c5(true); +_c5(false); +function _c5(_c6){ +var aa=_c7(_c2,_c6); +if(aa.length){ +var _c8=aa[aa.length-1]; +var _c9=_2(_c8,_c3); +if(_c9>=0){ +for(var _ca=0;_ca=_b4.find("table").width()){ +_d1(); +_d2(); +_d3(); +_d1(true); +if(_d0.width()>=_d0.find("table").width()){ dc.body2.css("overflow-x","hidden"); } -function _b6(){ -if(!_b3.fitColumns){ +function _d3(){ +if(!_cf.fitColumns){ return; } -if(!_b2.leftWidth){ -_b2.leftWidth=0; +if(!_ce.leftWidth){ +_ce.leftWidth=0; } -var _b7=0; +var _d4=0; var cc=[]; -var _b8=_73(_b1,false); -for(var i=0;i<_b8.length;i++){ -var col=_74(_b1,_b8[i]); -if(_b9(col)){ -_b7+=col.width; +var _d5=_73(_cd,false); +for(var i=0;i<_d5.length;i++){ +var col=_74(_cd,_d5[i]); +if(_d6(col)){ +_d4+=col.width; cc.push({field:col.field,col:col,addingWidth:0}); } } -if(!_b7){ +if(!_d4){ return; } -cc[cc.length-1].addingWidth-=_b2.leftWidth; -var _ba=_b4.children("div.datagrid-header-inner").show(); -var _bb=_b4.width()-_b4.find("table").width()-_b3.scrollbarSize+_b2.leftWidth; -var _bc=_bb/_b7; -if(!_b3.showHeader){ -_ba.hide(); +cc[cc.length-1].addingWidth-=_ce.leftWidth; +var _d7=_d0.children("div.datagrid-header-inner").show(); +var _d8=_d0.width()-_d0.find("table").width()-_cf.scrollbarSize+_ce.leftWidth; +var _d9=_d8/_d4; +if(!_cf.showHeader){ +_d7.hide(); } for(var i=0;i0){ @@ -790,27 +846,38 @@ c.col.boxWidth+=c.addingWidth; c.col.width+=c.addingWidth; } } -_b2.leftWidth=_bb; -_d1(_b1); +_ce.leftWidth=_d8; +$(_cd).datagrid("fixColumnSize"); }; -function _b5(){ -var _be=false; -var _bf=_73(_b1,true).concat(_73(_b1,false)); -$.map(_bf,function(_c0){ -var col=_74(_b1,_c0); +function _d2(){ +var _db=false; +var _dc=_73(_cd,true).concat(_73(_cd,false)); +$.map(_dc,function(_dd){ +var col=_74(_cd,_dd); if(String(col.width||"").indexOf("%")>=0){ -var _c1=$.parser.parseValue("width",col.width,dc.view,_b3.scrollbarSize)-col.deltaWidth; -if(_c1>0){ -col.boxWidth=_c1; -_be=true; +var _de=$.parser.parseValue("width",col.width,dc.view,_cf.scrollbarSize+(_cf.rownumbers?_cf.rownumberWidth:0))-col.deltaWidth; +if(_de>0){ +col.boxWidth=_de; +_db=true; } } }); -if(_be){ -_d1(_b1); +if(_db){ +$(_cd).datagrid("fixColumnSize"); } }; -function _b9(col){ +function _d1(fit){ +var _df=dc.header1.add(dc.header2).find(".datagrid-cell-group"); +if(_df.length){ +_df.each(function(){ +$(this)._outerWidth(fit?$(this).parent().width():10); +}); +if(fit){ +_20(_cd); +} +} +}; +function _d6(col){ if(String(col.width||"").indexOf("%")>=0){ return false; } @@ -819,130 +886,129 @@ return true; } }; }; -function _c2(_c3,_c4){ -var _c5=$.data(_c3,"datagrid"); -var _c6=_c5.options; -var dc=_c5.dc; +function _e0(_e1,_e2){ +var _e3=$.data(_e1,"datagrid"); +var _e4=_e3.options; +var dc=_e3.dc; var tmp=$("
                  ").appendTo("body"); -if(_c4){ -_1c(_c4); -if(_c6.fitColumns){ -_22(_c3); -_b0(_c3); -} -}else{ -var _c7=false; -var _c8=_73(_c3,true).concat(_73(_c3,false)); -for(var i=0;i<_c8.length;i++){ -var _c4=_c8[i]; -var col=_74(_c3,_c4); +if(_e2){ +_1a(_e2); +$(_e1).datagrid("fitColumns"); +}else{ +var _e5=false; +var _e6=_73(_e1,true).concat(_73(_e1,false)); +for(var i=0;i<_e6.length;i++){ +var _e2=_e6[i]; +var col=_74(_e1,_e2); if(col.auto){ -_1c(_c4); -_c7=true; +_1a(_e2); +_e5=true; } } -if(_c7&&_c6.fitColumns){ -_22(_c3); -_b0(_c3); +if(_e5){ +$(_e1).datagrid("fitColumns"); } } tmp.remove(); -function _1c(_c9){ -var _ca=dc.view.find("div.datagrid-header td[field=\""+_c9+"\"] div.datagrid-cell"); -_ca.css("width",""); -var col=$(_c3).datagrid("getColumnOption",_c9); +function _1a(_e7){ +var _e8=dc.view.find("div.datagrid-header td[field=\""+_e7+"\"] div.datagrid-cell"); +_e8.css("width",""); +var col=$(_e1).datagrid("getColumnOption",_e7); col.width=undefined; col.boxWidth=undefined; col.auto=true; -$(_c3).datagrid("fixColumnSize",_c9); -var _cb=Math.max(_cc("header"),_cc("allbody"),_cc("allfooter"))+1; -_ca._outerWidth(_cb-1); -col.width=_cb; -col.boxWidth=parseInt(_ca[0].style.width); -col.deltaWidth=_cb-col.boxWidth; -_ca.css("width",""); -$(_c3).datagrid("fixColumnSize",_c9); -_c6.onResizeColumn.call(_c3,_c9,col.width); -function _cc(_cd){ -var _ce=0; -if(_cd=="header"){ -_ce=_cf(_ca); +$(_e1).datagrid("fixColumnSize",_e7); +var _e9=Math.max(_ea("header"),_ea("allbody"),_ea("allfooter"))+1; +_e8._outerWidth(_e9-1); +col.width=_e9; +col.boxWidth=parseInt(_e8[0].style.width); +col.deltaWidth=_e9-col.boxWidth; +_e8.css("width",""); +$(_e1).datagrid("fixColumnSize",_e7); +_e4.onResizeColumn.call(_e1,_e7,col.width); +function _ea(_eb){ +var _ec=0; +if(_eb=="header"){ +_ec=_ed(_e8); }else{ -_c6.finder.getTr(_c3,0,_cd).find("td[field=\""+_c9+"\"] div.datagrid-cell").each(function(){ -var w=_cf($(this)); -if(_ce1){ +var col=_74(_f8,td.attr("field")); +var _fa=col.boxWidth+col.deltaWidth-1; +for(var i=1;i<_f9;i++){ td=td.next(); -col=_74(_da,td.attr("field")); -_dc+=col.boxWidth+col.deltaWidth; +col=_74(_f8,td.attr("field")); +_fa+=col.boxWidth+col.deltaWidth; +} +$(this).children("div.datagrid-cell")._outerWidth(_fa); } -$(this).children("div.datagrid-cell")._outerWidth(_dc); }); }; -function _d8(_dd){ -var dc=$.data(_dd,"datagrid").dc; +function _f6(_fb){ +var dc=$.data(_fb,"datagrid").dc; dc.view.find("div.datagrid-editable").each(function(){ -var _de=$(this); -var _df=_de.parent().attr("field"); -var col=$(_dd).datagrid("getColumnOption",_df); -_de._outerWidth(col.boxWidth+col.deltaWidth-1); +var _fc=$(this); +var _fd=_fc.parent().attr("field"); +var col=$(_fb).datagrid("getColumnOption",_fd); +_fc._outerWidth(col.boxWidth+col.deltaWidth-1); var ed=$.data(this,"datagrid.editor"); if(ed.actions.resize){ -ed.actions.resize(ed.target,_de.width()); +ed.actions.resize(ed.target,_fc.width()); } }); }; -function _74(_e0,_e1){ -function _e2(_e3){ -if(_e3){ -for(var i=0;i<_e3.length;i++){ -var cc=_e3[i]; +function _74(_fe,_ff){ +function find(_100){ +if(_100){ +for(var i=0;i<_100.length;i++){ +var cc=_100[i]; for(var j=0;j=0){ -var _ee=col.field||""; +var _104=_105(); +for(var i=0;i<_103.length;i++){ +aa[i]=new Array(_104); +} +for(var _106=0;_106<_103.length;_106++){ +$.map(_103[_106],function(col){ +var _107=_108(aa[_106]); +if(_107>=0){ +var _109=col.field||col.id||""; for(var c=0;c<(col.colspan||1);c++){ for(var r=0;r<(col.rowspan||1);r++){ -aa[_eb+r][_ec]=_ee; +aa[_106+r][_107]=_109; } -_ec++; +_107++; } } }); } -return aa[aa.length-1]; -function _ea(){ -var _ef=0; -$.map(_e8[0],function(col){ -_ef+=col.colspan||1; +return aa; +function _105(){ +var _10a=0; +$.map(_103[0]||[],function(col){ +_10a+=col.colspan||1; }); -return _ef; +return _10a; }; -function _ed(a){ +function _108(a){ for(var i=0;ib?1:-1); }; -r=_f6(r1[sn],r2[sn])*(so=="asc"?1:-1); +r=_111(r1[sn],r2[sn])*(so=="asc"?1:-1); if(r!=0){ return r; } @@ -1029,64 +1099,64 @@ return r; return r; }); } -if(_f3.view.onBeforeRender){ -_f3.view.onBeforeRender.call(_f3.view,_f0,_f1.rows); +if(opts.view.onBeforeRender){ +opts.view.onBeforeRender.call(opts.view,_10d,data.rows); } -_f3.view.render.call(_f3.view,_f0,dc.body2,false); -_f3.view.render.call(_f3.view,_f0,dc.body1,true); -if(_f3.showFooter){ -_f3.view.renderFooter.call(_f3.view,_f0,dc.footer2,false); -_f3.view.renderFooter.call(_f3.view,_f0,dc.footer1,true); +opts.view.render.call(opts.view,_10d,dc.body2,false); +opts.view.render.call(opts.view,_10d,dc.body1,true); +if(opts.showFooter){ +opts.view.renderFooter.call(opts.view,_10d,dc.footer2,false); +opts.view.renderFooter.call(opts.view,_10d,dc.footer1,true); } -if(_f3.view.onAfterRender){ -_f3.view.onAfterRender.call(_f3.view,_f0); +if(opts.view.onAfterRender){ +opts.view.onAfterRender.call(opts.view,_10d); } -_f2.ss.clean(); -var _f7=$(_f0).datagrid("getPager"); -if(_f7.length){ -var _f8=_f7.pagination("options"); -if(_f8.total!=_f1.total){ -_f7.pagination("refresh",{total:_f1.total}); -if(_f3.pageNumber!=_f8.pageNumber&&_f8.pageNumber>0){ -_f3.pageNumber=_f8.pageNumber; -_ae(_f0); +_10e.ss.clean(); +var _112=$(_10d).datagrid("getPager"); +if(_112.length){ +var _113=_112.pagination("options"); +if(_113.total!=data.total){ +_112.pagination("refresh",{total:data.total}); +if(opts.pageNumber!=_113.pageNumber&&_113.pageNumber>0){ +opts.pageNumber=_113.pageNumber; +_bf(_10d); } } } -_36(_f0); +_34(_10d); dc.body2.triggerHandler("scroll"); -$(_f0).datagrid("setSelectionState"); -$(_f0).datagrid("autoSizeColumn"); -_f3.onLoadSuccess.call(_f0,_f1); -}; -function _f9(_fa){ -var _fb=$.data(_fa,"datagrid"); -var _fc=_fb.options; -var dc=_fb.dc; +$(_10d).datagrid("setSelectionState"); +$(_10d).datagrid("autoSizeColumn"); +opts.onLoadSuccess.call(_10d,data); +}; +function _114(_115){ +var _116=$.data(_115,"datagrid"); +var opts=_116.options; +var dc=_116.dc; dc.header1.add(dc.header2).find("input[type=checkbox]")._propAttr("checked",false); -if(_fc.idField){ -var _fd=$.data(_fa,"treegrid")?true:false; -var _fe=_fc.onSelect; -var _ff=_fc.onCheck; -_fc.onSelect=_fc.onCheck=function(){ +if(opts.idField){ +var _117=$.data(_115,"treegrid")?true:false; +var _118=opts.onSelect; +var _119=opts.onCheck; +opts.onSelect=opts.onCheck=function(){ }; -var rows=_fc.finder.getRows(_fa); +var rows=opts.finder.getRows(_115); for(var i=0;i_110.height()-18){ -_110.scrollTop(_110.scrollTop()+top+tr._outerHeight()-_110.height()+18); +if(top+tr._outerHeight()>_12a.height()-_12b){ +_12a.scrollTop(_12a.scrollTop()+top+tr._outerHeight()-_12a.height()+_12b); } } } }; -function _8c(_112,_113){ -var _114=$.data(_112,"datagrid"); -var opts=_114.options; -opts.finder.getTr(_112,_114.highlightIndex).removeClass("datagrid-row-over"); -opts.finder.getTr(_112,_113).addClass("datagrid-row-over"); -_114.highlightIndex=_113; +function _9c(_12d,_12e){ +var _12f=$.data(_12d,"datagrid"); +var opts=_12f.options; +opts.finder.getTr(_12d,_12f.highlightIndex).removeClass("datagrid-row-over"); +opts.finder.getTr(_12d,_12e).addClass("datagrid-row-over"); +_12f.highlightIndex=_12e; }; -function _95(_115,_116,_117){ -var _118=$.data(_115,"datagrid"); -var opts=_118.options; -var row=opts.finder.getRow(_115,_116); -if(opts.onBeforeSelect.call(_115,_116,row)==false){ +function _a5(_130,_131,_132,_133){ +var _134=$.data(_130,"datagrid"); +var opts=_134.options; +var row=opts.finder.getRow(_130,_131); +if(!row){ +return; +} +if(opts.onBeforeSelect.apply(_130,_5(_130,[_131,row]))==false){ return; } if(opts.singleSelect){ -_119(_115,true); -_118.selectedRows=[]; +_135(_130,true); +_134.selectedRows=[]; } -if(!_117&&opts.checkOnSelect){ -_92(_115,_116,true); +if(!_132&&opts.checkOnSelect){ +_a2(_130,_131,true); } if(opts.idField){ -_7(_118.selectedRows,opts.idField,row); -} -opts.finder.getTr(_115,_116).addClass("datagrid-row-selected"); -opts.onSelect.call(_115,_116,row); -_10b(_115,_116); -}; -function _96(_11a,_11b,_11c){ -var _11d=$.data(_11a,"datagrid"); -var dc=_11d.dc; -var opts=_11d.options; -var row=opts.finder.getRow(_11a,_11b); -if(opts.onBeforeUnselect.call(_11a,_11b,row)==false){ +_4(_134.selectedRows,opts.idField,row); +} +opts.finder.getTr(_130,_131).addClass("datagrid-row-selected"); +opts.onSelect.apply(_130,_5(_130,[_131,row])); +if(!_133&&opts.scrollOnSelect){ +_125(_130,_131); +} +}; +function _a6(_136,_137,_138){ +var _139=$.data(_136,"datagrid"); +var dc=_139.dc; +var opts=_139.options; +var row=opts.finder.getRow(_136,_137); +if(!row){ return; } -if(!_11c&&opts.checkOnSelect){ -_93(_11a,_11b,true); +if(opts.onBeforeUnselect.apply(_136,_5(_136,[_137,row]))==false){ +return; +} +if(!_138&&opts.checkOnSelect){ +_a3(_136,_137,true); } -opts.finder.getTr(_11a,_11b).removeClass("datagrid-row-selected"); +opts.finder.getTr(_136,_137).removeClass("datagrid-row-selected"); if(opts.idField){ -_4(_11d.selectedRows,opts.idField,row[opts.idField]); +_3(_139.selectedRows,opts.idField,row[opts.idField]); } -opts.onUnselect.call(_11a,_11b,row); +opts.onUnselect.apply(_136,_5(_136,[_137,row])); }; -function _11e(_11f,_120){ -var _121=$.data(_11f,"datagrid"); -var opts=_121.options; -var rows=opts.finder.getRows(_11f); -var _122=$.data(_11f,"datagrid").selectedRows; -if(!_120&&opts.checkOnSelect){ -_123(_11f,true); -} -opts.finder.getTr(_11f,"","allbody").addClass("datagrid-row-selected"); +function _13a(_13b,_13c){ +var _13d=$.data(_13b,"datagrid"); +var opts=_13d.options; +var rows=opts.finder.getRows(_13b); +var _13e=$.data(_13b,"datagrid").selectedRows; +if(!_13c&&opts.checkOnSelect){ +_89(_13b,true); +} +opts.finder.getTr(_13b,"","allbody").addClass("datagrid-row-selected"); if(opts.idField){ -for(var _124=0;_124"); cell.children("table").bind("click dblclick contextmenu",function(e){ e.stopPropagation(); }); -$.data(cell[0],"datagrid.editor",{actions:_15a,target:_15a.init(cell.find("td"),_159),field:_157,type:_158,oldHtml:_15b}); +$.data(cell[0],"datagrid.editor",{actions:_174,target:_174.init(cell.find("td"),$.extend({height:opts.editorHeight},_173)),field:_171,type:_172,oldHtml:_175}); } } }); -_36(_155,_156,true); +_34(_16f,_170,true); }; -function _14c(_15d,_15e){ -var opts=$.data(_15d,"datagrid").options; -var tr=opts.finder.getTr(_15d,_15e); +function _166(_177,_178){ +var opts=$.data(_177,"datagrid").options; +var tr=opts.finder.getTr(_177,_178); tr.children("td").each(function(){ var cell=$(this).find("div.datagrid-editable"); if(cell.length){ @@ -1455,402 +1545,415 @@ cell.css("width",""); } }); }; -function _13f(_15f,_160){ -var tr=$.data(_15f,"datagrid").options.finder.getTr(_15f,_160); +function _159(_179,_17a){ +var tr=$.data(_179,"datagrid").options.finder.getTr(_179,_17a); if(!tr.hasClass("datagrid-row-editing")){ return true; } var vbox=tr.find(".validatebox-text"); vbox.validatebox("validate"); vbox.trigger("mouseleave"); -var _161=tr.find(".validatebox-invalid"); -return _161.length==0; -}; -function _162(_163,_164){ -var _165=$.data(_163,"datagrid").insertedRows; -var _166=$.data(_163,"datagrid").deletedRows; -var _167=$.data(_163,"datagrid").updatedRows; -if(!_164){ +var _17b=tr.find(".validatebox-invalid"); +return _17b.length==0; +}; +function _17c(_17d,_17e){ +var _17f=$.data(_17d,"datagrid").insertedRows; +var _180=$.data(_17d,"datagrid").deletedRows; +var _181=$.data(_17d,"datagrid").updatedRows; +if(!_17e){ var rows=[]; -rows=rows.concat(_165); -rows=rows.concat(_166); -rows=rows.concat(_167); +rows=rows.concat(_17f); +rows=rows.concat(_180); +rows=rows.concat(_181); return rows; }else{ -if(_164=="inserted"){ -return _165; +if(_17e=="inserted"){ +return _17f; }else{ -if(_164=="deleted"){ -return _166; +if(_17e=="deleted"){ +return _180; }else{ -if(_164=="updated"){ -return _167; +if(_17e=="updated"){ +return _181; } } } } return []; }; -function _168(_169,_16a){ -var _16b=$.data(_169,"datagrid"); -var opts=_16b.options; -var data=_16b.data; -var _16c=_16b.insertedRows; -var _16d=_16b.deletedRows; -$(_169).datagrid("cancelEdit",_16a); -var row=opts.finder.getRow(_169,_16a); -if(_2(_16c,row)>=0){ -_4(_16c,row); -}else{ -_16d.push(row); -} -_4(_16b.selectedRows,opts.idField,row[opts.idField]); -_4(_16b.checkedRows,opts.idField,row[opts.idField]); -opts.view.deleteRow.call(opts.view,_169,_16a); +function _182(_183,_184){ +var _185=$.data(_183,"datagrid"); +var opts=_185.options; +var data=_185.data; +var _186=_185.insertedRows; +var _187=_185.deletedRows; +$(_183).datagrid("cancelEdit",_184); +var row=opts.finder.getRow(_183,_184); +if(_2(_186,row)>=0){ +_3(_186,row); +}else{ +_187.push(row); +} +_3(_185.selectedRows,opts.idField,row[opts.idField]); +_3(_185.checkedRows,opts.idField,row[opts.idField]); +opts.view.deleteRow.call(opts.view,_183,_184); if(opts.height=="auto"){ -_36(_169); -} -$(_169).datagrid("getPager").pagination("refresh",{total:data.total}); -}; -function _16e(_16f,_170){ -var data=$.data(_16f,"datagrid").data; -var view=$.data(_16f,"datagrid").options.view; -var _171=$.data(_16f,"datagrid").insertedRows; -view.insertRow.call(view,_16f,_170.index,_170.row); -_171.push(_170.row); -$(_16f).datagrid("getPager").pagination("refresh",{total:data.total}); -}; -function _172(_173,row){ -var data=$.data(_173,"datagrid").data; -var view=$.data(_173,"datagrid").options.view; -var _174=$.data(_173,"datagrid").insertedRows; -view.insertRow.call(view,_173,null,row); -_174.push(row); -$(_173).datagrid("getPager").pagination("refresh",{total:data.total}); -}; -function _175(_176){ -var _177=$.data(_176,"datagrid"); -var data=_177.data; +_34(_183); +} +$(_183).datagrid("getPager").pagination("refresh",{total:data.total}); +}; +function _188(_189,_18a){ +var data=$.data(_189,"datagrid").data; +var view=$.data(_189,"datagrid").options.view; +var _18b=$.data(_189,"datagrid").insertedRows; +view.insertRow.call(view,_189,_18a.index,_18a.row); +_18b.push(_18a.row); +$(_189).datagrid("getPager").pagination("refresh",{total:data.total}); +}; +function _18c(_18d,row){ +var data=$.data(_18d,"datagrid").data; +var view=$.data(_18d,"datagrid").options.view; +var _18e=$.data(_18d,"datagrid").insertedRows; +view.insertRow.call(view,_18d,null,row); +_18e.push(row); +$(_18d).datagrid("getPager").pagination("refresh",{total:data.total}); +}; +function _18f(_190,_191){ +var _192=$.data(_190,"datagrid"); +var opts=_192.options; +var row=opts.finder.getRow(_190,_191.index); +var _193=false; +_191.row=_191.row||{}; +for(var _194 in _191.row){ +if(row[_194]!==_191.row[_194]){ +_193=true; +break; +} +} +if(_193){ +if(_2(_192.insertedRows,row)==-1){ +if(_2(_192.updatedRows,row)==-1){ +_192.updatedRows.push(row); +} +} +opts.view.updateRow.call(opts.view,_190,_191.index,_191.row); +} +}; +function _195(_196){ +var _197=$.data(_196,"datagrid"); +var data=_197.data; var rows=data.rows; -var _178=[]; +var _198=[]; for(var i=0;i=0){ -(_185=="s"?_95:_92)(_17c,_186,true); +var _1a6=_11c(_19c,ids[i]); +if(_1a6>=0){ +(_1a5=="s"?_a5:_a2)(_19c,_1a6,true); } } }; for(var i=0;i0){ -_af(this,data); -_175(this); +$(this).datagrid("loadData",data); +}else{ +opts.view.setEmptyMsg(this); +$(this).datagrid("autoSizeColumn"); } } -_ae(this); +_bf(this); }); }; -function _197(_198){ -var _199={}; -$.map(_198,function(name){ -_199[name]=_19a(name); +function _1b6(_1b7){ +var _1b8={}; +$.map(_1b7,function(name){ +_1b8[name]=_1b9(name); }); -return _199; -function _19a(name){ -function isA(_19b){ -return $.data($(_19b)[0],name)!=undefined; +return _1b8; +function _1b9(name){ +function isA(_1ba){ +return $.data($(_1ba)[0],name)!=undefined; }; -return {init:function(_19c,_19d){ -var _19e=$("").appendTo(_19c); -if(_19e[name]&&name!="text"){ -return _19e[name](_19d); +return {init:function(_1bb,_1bc){ +var _1bd=$("").appendTo(_1bb); +if(_1bd[name]&&name!="text"){ +return _1bd[name](_1bc); }else{ -return _19e; +return _1bd; } -},destroy:function(_19f){ -if(isA(_19f,name)){ -$(_19f)[name]("destroy"); +},destroy:function(_1be){ +if(isA(_1be,name)){ +$(_1be)[name]("destroy"); } -},getValue:function(_1a0){ -if(isA(_1a0,name)){ -var opts=$(_1a0)[name]("options"); +},getValue:function(_1bf){ +if(isA(_1bf,name)){ +var opts=$(_1bf)[name]("options"); if(opts.multiple){ -return $(_1a0)[name]("getValues").join(opts.separator); +return $(_1bf)[name]("getValues").join(opts.separator); }else{ -return $(_1a0)[name]("getValue"); +return $(_1bf)[name]("getValue"); } }else{ -return $(_1a0).val(); +return $(_1bf).val(); } -},setValue:function(_1a1,_1a2){ -if(isA(_1a1,name)){ -var opts=$(_1a1)[name]("options"); +},setValue:function(_1c0,_1c1){ +if(isA(_1c0,name)){ +var opts=$(_1c0)[name]("options"); if(opts.multiple){ -if(_1a2){ -$(_1a1)[name]("setValues",_1a2.split(opts.separator)); +if(_1c1){ +$(_1c0)[name]("setValues",_1c1.split(opts.separator)); }else{ -$(_1a1)[name]("clear"); +$(_1c0)[name]("clear"); } }else{ -$(_1a1)[name]("setValue",_1a2); +$(_1c0)[name]("setValue",_1c1); } }else{ -$(_1a1).val(_1a2); +$(_1c0).val(_1c1); } -},resize:function(_1a3,_1a4){ -if(isA(_1a3,name)){ -$(_1a3)[name]("resize",_1a4); +},resize:function(_1c2,_1c3){ +if(isA(_1c2,name)){ +$(_1c2)[name]("resize",_1c3); }else{ -$(_1a3)._outerWidth(_1a4)._outerHeight(22); +$(_1c2)._size({width:_1c3,height:$.fn.datagrid.defaults.editorHeight}); } }}; }; }; -var _1a5=$.extend({},_197(["text","textbox","numberbox","numberspinner","combobox","combotree","combogrid","datebox","datetimebox","timespinner","datetimespinner"]),{textarea:{init:function(_1a6,_1a7){ -var _1a8=$("").appendTo(_1a6); -return _1a8; -},getValue:function(_1a9){ -return $(_1a9).val(); -},setValue:function(_1aa,_1ab){ -$(_1aa).val(_1ab); -},resize:function(_1ac,_1ad){ -$(_1ac)._outerWidth(_1ad); -}},checkbox:{init:function(_1ae,_1af){ -var _1b0=$("").appendTo(_1ae); -_1b0.val(_1af.on); -_1b0.attr("offval",_1af.off); -return _1b0; -},getValue:function(_1b1){ -if($(_1b1).is(":checked")){ -return $(_1b1).val(); -}else{ -return $(_1b1).attr("offval"); -} -},setValue:function(_1b2,_1b3){ -var _1b4=false; -if($(_1b2).val()==_1b3){ -_1b4=true; -} -$(_1b2)._propAttr("checked",_1b4); -}},validatebox:{init:function(_1b5,_1b6){ -var _1b7=$("").appendTo(_1b5); -_1b7.validatebox(_1b6); -return _1b7; -},destroy:function(_1b8){ -$(_1b8).validatebox("destroy"); -},getValue:function(_1b9){ -return $(_1b9).val(); -},setValue:function(_1ba,_1bb){ -$(_1ba).val(_1bb); -},resize:function(_1bc,_1bd){ -$(_1bc)._outerWidth(_1bd)._outerHeight(22); +var _1c4=$.extend({},_1b6(["text","textbox","passwordbox","filebox","numberbox","numberspinner","combobox","combotree","combogrid","combotreegrid","datebox","datetimebox","timespinner","datetimespinner"]),{textarea:{init:function(_1c5,_1c6){ +var _1c7=$("").appendTo(_1c5); +_1c7.css("vertical-align","middle")._outerHeight(_1c6.height); +return _1c7; +},getValue:function(_1c8){ +return $(_1c8).val(); +},setValue:function(_1c9,_1ca){ +$(_1c9).val(_1ca); +},resize:function(_1cb,_1cc){ +$(_1cb)._outerWidth(_1cc); +}},checkbox:{init:function(_1cd,_1ce){ +var _1cf=$("").appendTo(_1cd); +_1cf.val(_1ce.on); +_1cf.attr("offval",_1ce.off); +return _1cf; +},getValue:function(_1d0){ +if($(_1d0).is(":checked")){ +return $(_1d0).val(); +}else{ +return $(_1d0).attr("offval"); +} +},setValue:function(_1d1,_1d2){ +var _1d3=false; +if($(_1d1).val()==_1d2){ +_1d3=true; +} +$(_1d1)._propAttr("checked",_1d3); +}},validatebox:{init:function(_1d4,_1d5){ +var _1d6=$("").appendTo(_1d4); +_1d6.validatebox(_1d5); +return _1d6; +},destroy:function(_1d7){ +$(_1d7).validatebox("destroy"); +},getValue:function(_1d8){ +return $(_1d8).val(); +},setValue:function(_1d9,_1da){ +$(_1d9).val(_1da); +},resize:function(_1db,_1dc){ +$(_1db)._outerWidth(_1dc)._outerHeight($.fn.datagrid.defaults.editorHeight); }}}); $.fn.datagrid.methods={options:function(jq){ -var _1be=$.data(jq[0],"datagrid").options; -var _1bf=$.data(jq[0],"datagrid").panel.panel("options"); -var opts=$.extend(_1be,{width:_1bf.width,height:_1bf.height,closed:_1bf.closed,collapsed:_1bf.collapsed,minimized:_1bf.minimized,maximized:_1bf.maximized}); +var _1dd=$.data(jq[0],"datagrid").options; +var _1de=$.data(jq[0],"datagrid").panel.panel("options"); +var opts=$.extend(_1dd,{width:_1de.width,height:_1de.height,closed:_1de.closed,collapsed:_1de.collapsed,minimized:_1de.minimized,maximized:_1de.maximized}); return opts; },setSelectionState:function(jq){ return jq.each(function(){ -_f9(this); +_114(this); }); },createStyleSheet:function(jq){ -return _9(jq[0]); +return _7(jq[0]); },getPanel:function(jq){ return $.data(jq[0],"datagrid").panel; },getPager:function(jq){ return $.data(jq[0],"datagrid").panel.children("div.datagrid-pager"); -},getColumnFields:function(jq,_1c0){ -return _73(jq[0],_1c0); -},getColumnOption:function(jq,_1c1){ -return _74(jq[0],_1c1); -},resize:function(jq,_1c2){ +},getColumnFields:function(jq,_1df){ +return _73(jq[0],_1df); +},getColumnOption:function(jq,_1e0){ +return _74(jq[0],_1e0); +},resize:function(jq,_1e1){ return jq.each(function(){ -_1c(this,_1c2); +_1a(this,_1e1); }); -},load:function(jq,_1c3){ +},load:function(jq,_1e2){ return jq.each(function(){ var opts=$(this).datagrid("options"); -if(typeof _1c3=="string"){ -opts.url=_1c3; -_1c3=null; +if(typeof _1e2=="string"){ +opts.url=_1e2; +_1e2=null; } opts.pageNumber=1; -var _1c4=$(this).datagrid("getPager"); -_1c4.pagination("refresh",{pageNumber:1}); -_ae(this,_1c3); +var _1e3=$(this).datagrid("getPager"); +_1e3.pagination("refresh",{pageNumber:1}); +_bf(this,_1e2); }); -},reload:function(jq,_1c5){ +},reload:function(jq,_1e4){ return jq.each(function(){ var opts=$(this).datagrid("options"); -if(typeof _1c5=="string"){ -opts.url=_1c5; -_1c5=null; +if(typeof _1e4=="string"){ +opts.url=_1e4; +_1e4=null; } -_ae(this,_1c5); +_bf(this,_1e4); }); -},reloadFooter:function(jq,_1c6){ +},reloadFooter:function(jq,_1e5){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; var dc=$.data(this,"datagrid").dc; -if(_1c6){ -$.data(this,"datagrid").footer=_1c6; +if(_1e5){ +$.data(this,"datagrid").footer=_1e5; } if(opts.showFooter){ opts.view.renderFooter.call(opts.view,this,dc.footer2,false); @@ -1866,10 +1969,10 @@ return jq.each(function(){ var opts=$.data(this,"datagrid").options; $(this).datagrid("getPager").pagination("loading"); if(opts.loadMsg){ -var _1c7=$(this).datagrid("getPanel"); -if(!_1c7.children("div.datagrid-mask").length){ -$("
                  ").appendTo(_1c7); -var msg=$("
                  ").html(opts.loadMsg).appendTo(_1c7); +var _1e6=$(this).datagrid("getPanel"); +if(!_1e6.children("div.datagrid-mask").length){ +$("
                  ").appendTo(_1e6); +var msg=$("
                  ").html(opts.loadMsg).appendTo(_1e6); msg._outerHeight(40); msg.css({marginLeft:(-msg.outerWidth()/2),lineHeight:(msg.height()+"px")}); } @@ -1878,34 +1981,34 @@ msg.css({marginLeft:(-msg.outerWidth()/2),lineHeight:(msg.height()+"px")}); },loaded:function(jq){ return jq.each(function(){ $(this).datagrid("getPager").pagination("loaded"); -var _1c8=$(this).datagrid("getPanel"); -_1c8.children("div.datagrid-mask-msg").remove(); -_1c8.children("div.datagrid-mask").remove(); +var _1e7=$(this).datagrid("getPanel"); +_1e7.children("div.datagrid-mask-msg").remove(); +_1e7.children("div.datagrid-mask").remove(); }); },fitColumns:function(jq){ return jq.each(function(){ -_b0(this); +_cc(this); }); -},fixColumnSize:function(jq,_1c9){ +},fixColumnSize:function(jq,_1e8){ return jq.each(function(){ -_d1(this,_1c9); +_ef(this,_1e8); }); -},fixRowHeight:function(jq,_1ca){ +},fixRowHeight:function(jq,_1e9){ return jq.each(function(){ -_36(this,_1ca); +_34(this,_1e9); }); -},freezeRow:function(jq,_1cb){ +},freezeRow:function(jq,_1ea){ return jq.each(function(){ -_47(this,_1cb); +_45(this,_1ea); }); -},autoSizeColumn:function(jq,_1cc){ +},autoSizeColumn:function(jq,_1eb){ return jq.each(function(){ -_c2(this,_1cc); +_e0(this,_1eb); }); },loadData:function(jq,data){ return jq.each(function(){ -_af(this,data); -_175(this); +_c0(this,data); +_195(this); }); },getData:function(jq){ return $.data(jq[0],"datagrid").data; @@ -1914,276 +2017,285 @@ return $.data(jq[0],"datagrid").data.rows; },getFooterRows:function(jq){ return $.data(jq[0],"datagrid").footer; },getRowIndex:function(jq,id){ -return _102(jq[0],id); +return _11c(jq[0],id); },getChecked:function(jq){ -return _108(jq[0]); +return _122(jq[0]); },getSelected:function(jq){ -var rows=_105(jq[0]); +var rows=_11f(jq[0]); return rows.length>0?rows[0]:null; },getSelections:function(jq){ -return _105(jq[0]); +return _11f(jq[0]); },clearSelections:function(jq){ return jq.each(function(){ -var _1cd=$.data(this,"datagrid"); -var _1ce=_1cd.selectedRows; -var _1cf=_1cd.checkedRows; -_1ce.splice(0,_1ce.length); -_119(this); -if(_1cd.options.checkOnSelect){ -_1cf.splice(0,_1cf.length); +var _1ec=$.data(this,"datagrid"); +var _1ed=_1ec.selectedRows; +var _1ee=_1ec.checkedRows; +_1ed.splice(0,_1ed.length); +_135(this); +if(_1ec.options.checkOnSelect){ +_1ee.splice(0,_1ee.length); } }); },clearChecked:function(jq){ return jq.each(function(){ -var _1d0=$.data(this,"datagrid"); -var _1d1=_1d0.selectedRows; -var _1d2=_1d0.checkedRows; -_1d2.splice(0,_1d2.length); -_129(this); -if(_1d0.options.selectOnCheck){ -_1d1.splice(0,_1d1.length); +var _1ef=$.data(this,"datagrid"); +var _1f0=_1ef.selectedRows; +var _1f1=_1ef.checkedRows; +_1f1.splice(0,_1f1.length); +_8a(this); +if(_1ef.options.selectOnCheck){ +_1f0.splice(0,_1f0.length); } }); -},scrollTo:function(jq,_1d3){ +},scrollTo:function(jq,_1f2){ return jq.each(function(){ -_10b(this,_1d3); +_125(this,_1f2); }); -},highlightRow:function(jq,_1d4){ +},highlightRow:function(jq,_1f3){ return jq.each(function(){ -_8c(this,_1d4); -_10b(this,_1d4); +_9c(this,_1f3); +_125(this,_1f3); }); },selectAll:function(jq){ return jq.each(function(){ -_11e(this); +_13a(this); }); },unselectAll:function(jq){ return jq.each(function(){ -_119(this); +_135(this); }); -},selectRow:function(jq,_1d5){ +},selectRow:function(jq,_1f4){ return jq.each(function(){ -_95(this,_1d5); +_a5(this,_1f4); }); },selectRecord:function(jq,id){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; if(opts.idField){ -var _1d6=_102(this,id); -if(_1d6>=0){ -$(this).datagrid("selectRow",_1d6); +var _1f5=_11c(this,id); +if(_1f5>=0){ +$(this).datagrid("selectRow",_1f5); } } }); -},unselectRow:function(jq,_1d7){ +},unselectRow:function(jq,_1f6){ return jq.each(function(){ -_96(this,_1d7); +_a6(this,_1f6); }); -},checkRow:function(jq,_1d8){ +},checkRow:function(jq,_1f7){ return jq.each(function(){ -_92(this,_1d8); +_a2(this,_1f7); }); -},uncheckRow:function(jq,_1d9){ +},uncheckRow:function(jq,_1f8){ return jq.each(function(){ -_93(this,_1d9); +_a3(this,_1f8); }); },checkAll:function(jq){ return jq.each(function(){ -_123(this); +_89(this); }); },uncheckAll:function(jq){ return jq.each(function(){ -_129(this); +_8a(this); }); -},beginEdit:function(jq,_1da){ +},beginEdit:function(jq,_1f9){ return jq.each(function(){ -_13a(this,_1da); +_154(this,_1f9); }); -},endEdit:function(jq,_1db){ +},endEdit:function(jq,_1fa){ return jq.each(function(){ -_140(this,_1db,false); +_15a(this,_1fa,false); }); -},cancelEdit:function(jq,_1dc){ +},cancelEdit:function(jq,_1fb){ return jq.each(function(){ -_140(this,_1dc,true); +_15a(this,_1fb,true); }); -},getEditors:function(jq,_1dd){ -return _14d(jq[0],_1dd); -},getEditor:function(jq,_1de){ -return _151(jq[0],_1de); -},refreshRow:function(jq,_1df){ +},getEditors:function(jq,_1fc){ +return _167(jq[0],_1fc); +},getEditor:function(jq,_1fd){ +return _16b(jq[0],_1fd); +},refreshRow:function(jq,_1fe){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; -opts.view.refreshRow.call(opts.view,this,_1df); +opts.view.refreshRow.call(opts.view,this,_1fe); }); -},validateRow:function(jq,_1e0){ -return _13f(jq[0],_1e0); -},updateRow:function(jq,_1e1){ +},validateRow:function(jq,_1ff){ +return _159(jq[0],_1ff); +},updateRow:function(jq,_200){ return jq.each(function(){ -var opts=$.data(this,"datagrid").options; -opts.view.updateRow.call(opts.view,this,_1e1.index,_1e1.row); +_18f(this,_200); }); },appendRow:function(jq,row){ return jq.each(function(){ -_172(this,row); +_18c(this,row); }); -},insertRow:function(jq,_1e2){ +},insertRow:function(jq,_201){ return jq.each(function(){ -_16e(this,_1e2); +_188(this,_201); }); -},deleteRow:function(jq,_1e3){ +},deleteRow:function(jq,_202){ return jq.each(function(){ -_168(this,_1e3); +_182(this,_202); }); -},getChanges:function(jq,_1e4){ -return _162(jq[0],_1e4); +},getChanges:function(jq,_203){ +return _17c(jq[0],_203); },acceptChanges:function(jq){ return jq.each(function(){ -_179(this); +_199(this); }); },rejectChanges:function(jq){ return jq.each(function(){ -_17b(this); +_19b(this); }); -},mergeCells:function(jq,_1e5){ +},mergeCells:function(jq,_204){ return jq.each(function(){ -_18e(this,_1e5); +_1ad(this,_204); }); -},showColumn:function(jq,_1e6){ +},showColumn:function(jq,_205){ return jq.each(function(){ -var _1e7=$(this).datagrid("getPanel"); -_1e7.find("td[field=\""+_1e6+"\"]").show(); -$(this).datagrid("getColumnOption",_1e6).hidden=false; +var col=$(this).datagrid("getColumnOption",_205); +if(col.hidden){ +col.hidden=false; +$(this).datagrid("getPanel").find("td[field=\""+_205+"\"]").show(); +_c1(this,_205,1); $(this).datagrid("fitColumns"); +} }); -},hideColumn:function(jq,_1e8){ +},hideColumn:function(jq,_206){ return jq.each(function(){ -var _1e9=$(this).datagrid("getPanel"); -_1e9.find("td[field=\""+_1e8+"\"]").hide(); -$(this).datagrid("getColumnOption",_1e8).hidden=true; +var col=$(this).datagrid("getColumnOption",_206); +if(!col.hidden){ +col.hidden=true; +$(this).datagrid("getPanel").find("td[field=\""+_206+"\"]").hide(); +_c1(this,_206,-1); $(this).datagrid("fitColumns"); +} +}); +},sort:function(jq,_207){ +return jq.each(function(){ +_8c(this,_207); }); -},sort:function(jq,_1ea){ +},gotoPage:function(jq,_208){ return jq.each(function(){ -_a2(this,_1ea); +var _209=this; +var page,cb; +if(typeof _208=="object"){ +page=_208.page; +cb=_208.callback; +}else{ +page=_208; +} +$(_209).datagrid("options").pageNumber=page; +$(_209).datagrid("getPager").pagination("refresh",{pageNumber:page}); +_bf(_209,null,function(){ +if(cb){ +cb.call(_209,page); +} +}); }); }}; -$.fn.datagrid.parseOptions=function(_1eb){ -var t=$(_1eb); -return $.extend({},$.fn.panel.parseOptions(_1eb),$.parser.parseOptions(_1eb,["url","toolbar","idField","sortName","sortOrder","pagePosition","resizeHandle",{sharedStyleSheet:"boolean",fitColumns:"boolean",autoRowHeight:"boolean",striped:"boolean",nowrap:"boolean"},{rownumbers:"boolean",singleSelect:"boolean",ctrlSelect:"boolean",checkOnSelect:"boolean",selectOnCheck:"boolean"},{pagination:"boolean",pageSize:"number",pageNumber:"number"},{multiSort:"boolean",remoteSort:"boolean",showHeader:"boolean",showFooter:"boolean"},{scrollbarSize:"number"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined),loadMsg:(t.attr("loadMsg")!=undefined?t.attr("loadMsg"):undefined),rowStyler:(t.attr("rowStyler")?eval(t.attr("rowStyler")):undefined)}); +$.fn.datagrid.parseOptions=function(_20a){ +var t=$(_20a); +return $.extend({},$.fn.panel.parseOptions(_20a),$.parser.parseOptions(_20a,["url","toolbar","idField","sortName","sortOrder","pagePosition","resizeHandle",{sharedStyleSheet:"boolean",fitColumns:"boolean",autoRowHeight:"boolean",striped:"boolean",nowrap:"boolean"},{rownumbers:"boolean",singleSelect:"boolean",ctrlSelect:"boolean",checkOnSelect:"boolean",selectOnCheck:"boolean"},{pagination:"boolean",pageSize:"number",pageNumber:"number"},{multiSort:"boolean",remoteSort:"boolean",showHeader:"boolean",showFooter:"boolean"},{scrollbarSize:"number",scrollOnSelect:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined),loadMsg:(t.attr("loadMsg")!=undefined?t.attr("loadMsg"):undefined),rowStyler:(t.attr("rowStyler")?eval(t.attr("rowStyler")):undefined)}); }; -$.fn.datagrid.parseData=function(_1ec){ -var t=$(_1ec); +$.fn.datagrid.parseData=function(_20b){ +var t=$(_20b); var data={total:0,rows:[]}; -var _1ed=t.datagrid("getColumnFields",true).concat(t.datagrid("getColumnFields",false)); +var _20c=t.datagrid("getColumnFields",true).concat(t.datagrid("getColumnFields",false)); t.find("tbody tr").each(function(){ data.total++; var row={}; $.extend(row,$.parser.parseOptions(this,["iconCls","state"])); -for(var i=0;i<_1ed.length;i++){ -row[_1ed[i]]=$(this).find("td:eq("+i+")").html(); +for(var i=0;i<_20c.length;i++){ +row[_20c[i]]=$(this).find("td:eq("+i+")").html(); } data.rows.push(row); }); return data; }; -var _1ee={render:function(_1ef,_1f0,_1f1){ -var _1f2=$.data(_1ef,"datagrid"); -var opts=_1f2.options; -var rows=_1f2.data.rows; -var _1f3=$(_1ef).datagrid("getColumnFields",_1f1); -if(_1f1){ +var _20d={render:function(_20e,_20f,_210){ +var rows=$(_20e).datagrid("getRows"); +$(_20f).html(this.renderTable(_20e,0,rows,_210)); +},renderFooter:function(_211,_212,_213){ +var opts=$.data(_211,"datagrid").options; +var rows=$.data(_211,"datagrid").footer||[]; +var _214=$(_211).datagrid("getColumnFields",_213); +var _215=[""]; +for(var i=0;i"); +_215.push(this.renderRow.call(this,_211,_214,_213,i,rows[i])); +_215.push(""); +} +_215.push("
                  "); +$(_212).html(_215.join("")); +},renderTable:function(_216,_217,rows,_218){ +var _219=$.data(_216,"datagrid"); +var opts=_219.options; +if(_218){ if(!(opts.rownumbers||(opts.frozenColumns&&opts.frozenColumns.length))){ -return; +return ""; } } -var _1f4=[""]; +var _21a=$(_216).datagrid("getColumnFields",_218); +var _21b=["
                  "]; for(var i=0;i"); -_1f4.push(this.renderRow.call(this,_1ef,_1f3,_1f1,i,rows[i])); -_1f4.push(""); -} -_1f4.push("
                  "); -$(_1f0).html(_1f4.join("")); -},renderFooter:function(_1f9,_1fa,_1fb){ -var opts=$.data(_1f9,"datagrid").options; -var rows=$.data(_1f9,"datagrid").footer||[]; -var _1fc=$(_1f9).datagrid("getColumnFields",_1fb); -var _1fd=[""]; -for(var i=0;i"); -_1fd.push(this.renderRow.call(this,_1f9,_1fc,_1fb,i,rows[i])); -_1fd.push(""); -} -_1fd.push("
                  "); -$(_1fa).html(_1fd.join("")); -},renderRow:function(_1fe,_1ff,_200,_201,_202){ -var opts=$.data(_1fe,"datagrid").options; +var row=rows[i]; +var css=opts.rowStyler?opts.rowStyler.call(_216,_217,row):""; +var cs=this.getStyleValue(css); +var cls="class=\"datagrid-row "+(_217%2&&opts.striped?"datagrid-row-alt ":" ")+cs.c+"\""; +var _21c=cs.s?"style=\""+cs.s+"\"":""; +var _21d=_219.rowIdPrefix+"-"+(_218?1:2)+"-"+_217; +_21b.push(""); +_21b.push(this.renderRow.call(this,_216,_21a,_218,_217,row)); +_21b.push(""); +_217++; +} +_21b.push(""); +return _21b.join(""); +},renderRow:function(_21e,_21f,_220,_221,_222){ +var opts=$.data(_21e,"datagrid").options; var cc=[]; -if(_200&&opts.rownumbers){ -var _203=_201+1; +if(_220&&opts.rownumbers){ +var _223=_221+1; if(opts.pagination){ -_203+=(opts.pageNumber-1)*opts.pageSize; +_223+=(opts.pageNumber-1)*opts.pageSize; } -cc.push("
                  "+_203+"
                  "); +cc.push("
                  "+_223+"
                  "); } -for(var i=0;i<_1ff.length;i++){ -var _204=_1ff[i]; -var col=$(_1fe).datagrid("getColumnOption",_204); +for(var i=0;i<_21f.length;i++){ +var _224=_21f[i]; +var col=$(_21e).datagrid("getColumnOption",_224); if(col){ -var _205=_202[_204]; -var css=col.styler?(col.styler(_205,_202,_201)||""):""; -var _206=""; -var _207=""; -if(typeof css=="string"){ -_207=css; -}else{ -if(css){ -_206=css["class"]||""; -_207=css["style"]||""; -} -} -var cls=_206?"class=\""+_206+"\"":""; -var _208=col.hidden?"style=\"display:none;"+_207+"\"":(_207?"style=\""+_207+"\"":""); -cc.push(""); -var _208=""; +var _225=_222[_224]; +var css=col.styler?(col.styler.call(_21e,_225,_222,_221)||""):""; +var cs=this.getStyleValue(css); +var cls=cs.c?"class=\""+cs.c+"\"":""; +var _226=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":""); +cc.push(""); +var _226=""; if(!col.checkbox){ if(col.align){ -_208+="text-align:"+col.align+";"; +_226+="text-align:"+col.align+";"; } if(!opts.nowrap){ -_208+="white-space:normal;height:auto;"; +_226+="white-space:normal;height:auto;"; }else{ if(opts.autoRowHeight){ -_208+="height:auto;"; +_226+="height:auto;"; } } } -cc.push("
                  "); if(col.checkbox){ -cc.push(""); +cc.push(""); }else{ if(col.formatter){ -cc.push(col.formatter(_205,_202,_201)); +cc.push(col.formatter(_225,_222,_221)); }else{ -cc.push(_205); +cc.push(_225); } } cc.push("
                  "); @@ -2191,189 +2303,228 @@ cc.push(""); } } return cc.join(""); -},refreshRow:function(_209,_20a){ -this.updateRow.call(this,_209,_20a,{}); -},updateRow:function(_20b,_20c,row){ -var opts=$.data(_20b,"datagrid").options; -var rows=$(_20b).datagrid("getRows"); -var _20d=_20e(_20c); -$.extend(rows[_20c],row); -var _20f=_20e(_20c); -var _210=_20d.c; -var _211=_20f.s; -var _212="datagrid-row "+(_20c%2&&opts.striped?"datagrid-row-alt ":" ")+_20f.c; -function _20e(_213){ -var css=opts.rowStyler?opts.rowStyler.call(_20b,_213,rows[_213]):""; -var _214=""; -var _215=""; +},getStyleValue:function(css){ +var _227=""; +var _228=""; if(typeof css=="string"){ -_215=css; +_228=css; }else{ if(css){ -_214=css["class"]||""; -_215=css["style"]||""; -} +_227=css["class"]||""; +_228=css["style"]||""; +} +} +return {c:_227,s:_228}; +},refreshRow:function(_229,_22a){ +this.updateRow.call(this,_229,_22a,{}); +},updateRow:function(_22b,_22c,row){ +var opts=$.data(_22b,"datagrid").options; +var _22d=opts.finder.getRow(_22b,_22c); +$.extend(_22d,row); +var cs=_22e.call(this,_22c); +var _22f=cs.s; +var cls="datagrid-row "+(_22c%2&&opts.striped?"datagrid-row-alt ":" ")+cs.c; +function _22e(_230){ +var css=opts.rowStyler?opts.rowStyler.call(_22b,_230,_22d):""; +return this.getStyleValue(css); +}; +function _231(_232){ +var tr=opts.finder.getTr(_22b,_22c,"body",(_232?1:2)); +if(!tr.length){ +return; } -return {c:_214,s:_215}; -}; -function _216(_217){ -var _218=$(_20b).datagrid("getColumnFields",_217); -var tr=opts.finder.getTr(_20b,_20c,"body",(_217?1:2)); -var _219=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); -tr.html(this.renderRow.call(this,_20b,_218,_217,_20c,rows[_20c])); -tr.attr("style",_211).removeClass(_210).addClass(_212); -if(_219){ +var _233=$(_22b).datagrid("getColumnFields",_232); +var _234=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); +tr.html(this.renderRow.call(this,_22b,_233,_232,_22c,_22d)); +var _235=(tr.hasClass("datagrid-row-checked")?" datagrid-row-checked":"")+(tr.hasClass("datagrid-row-selected")?" datagrid-row-selected":""); +tr.attr("style",_22f).attr("class",cls+_235); +if(_234){ tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true); } }; -_216.call(this,true); -_216.call(this,false); -$(_20b).datagrid("fixRowHeight",_20c); -},insertRow:function(_21a,_21b,row){ -var _21c=$.data(_21a,"datagrid"); -var opts=_21c.options; -var dc=_21c.dc; -var data=_21c.data; -if(_21b==undefined||_21b==null){ -_21b=data.rows.length; -} -if(_21b>data.rows.length){ -_21b=data.rows.length; -} -function _21d(_21e){ -var _21f=_21e?1:2; -for(var i=data.rows.length-1;i>=_21b;i--){ -var tr=opts.finder.getTr(_21a,i,"body",_21f); +_231.call(this,true); +_231.call(this,false); +$(_22b).datagrid("fixRowHeight",_22c); +},insertRow:function(_236,_237,row){ +var _238=$.data(_236,"datagrid"); +var opts=_238.options; +var dc=_238.dc; +var data=_238.data; +if(_237==undefined||_237==null){ +_237=data.rows.length; +} +if(_237>data.rows.length){ +_237=data.rows.length; +} +function _239(_23a){ +var _23b=_23a?1:2; +for(var i=data.rows.length-1;i>=_237;i--){ +var tr=opts.finder.getTr(_236,i,"body",_23b); tr.attr("datagrid-row-index",i+1); -tr.attr("id",_21c.rowIdPrefix+"-"+_21f+"-"+(i+1)); -if(_21e&&opts.rownumbers){ -var _220=i+2; +tr.attr("id",_238.rowIdPrefix+"-"+_23b+"-"+(i+1)); +if(_23a&&opts.rownumbers){ +var _23c=i+2; if(opts.pagination){ -_220+=(opts.pageNumber-1)*opts.pageSize; +_23c+=(opts.pageNumber-1)*opts.pageSize; } -tr.find("div.datagrid-cell-rownumber").html(_220); +tr.find("div.datagrid-cell-rownumber").html(_23c); } if(opts.striped){ tr.removeClass("datagrid-row-alt").addClass((i+1)%2?"datagrid-row-alt":""); } } }; -function _221(_222){ -var _223=_222?1:2; -var _224=$(_21a).datagrid("getColumnFields",_222); -var _225=_21c.rowIdPrefix+"-"+_223+"-"+_21b; -var tr=""; -if(_21b>=data.rows.length){ +function _23d(_23e){ +var _23f=_23e?1:2; +var _240=$(_236).datagrid("getColumnFields",_23e); +var _241=_238.rowIdPrefix+"-"+_23f+"-"+_237; +var tr=""; +if(_237>=data.rows.length){ if(data.rows.length){ -opts.finder.getTr(_21a,"","last",_223).after(tr); +opts.finder.getTr(_236,"","last",_23f).after(tr); }else{ -var cc=_222?dc.body1:dc.body2; -cc.html(""+tr+"
                  "); +var cc=_23e?dc.body1:dc.body2; +cc.html(""+tr+"
                  "); } }else{ -opts.finder.getTr(_21a,_21b+1,"body",_223).before(tr); +opts.finder.getTr(_236,_237+1,"body",_23f).before(tr); } }; -_21d.call(this,true); -_21d.call(this,false); -_221.call(this,true); -_221.call(this,false); +_239.call(this,true); +_239.call(this,false); +_23d.call(this,true); +_23d.call(this,false); data.total+=1; -data.rows.splice(_21b,0,row); -this.refreshRow.call(this,_21a,_21b); -},deleteRow:function(_226,_227){ -var _228=$.data(_226,"datagrid"); -var opts=_228.options; -var data=_228.data; -function _229(_22a){ -var _22b=_22a?1:2; -for(var i=_227+1;i").appendTo(_24e.dc.view); +d.html(opts.emptyMsg).css("top",h+"px"); +} +} +},renderEmptyRow:function(_250){ +var cols=$.map($(_250).datagrid("getColumnFields"),function(_251){ +return $(_250).datagrid("getColumnOption",_251); +}); +$.map(cols,function(col){ +col.formatter1=col.formatter; +col.styler1=col.styler; +col.formatter=col.styler=undefined; +}); +var _252=$.data(_250,"datagrid").dc.body2; +_252.html(this.renderTable(_250,0,[{}],false)); +_252.find("tbody *").css({height:1,borderColor:"transparent",background:"transparent"}); +var tr=_252.find(".datagrid-row"); +tr.removeClass("datagrid-row").removeAttr("datagrid-row-index"); +tr.find(".datagrid-cell,.datagrid-cell-check").empty(); +$.map(cols,function(col){ +col.formatter=col.formatter1; +col.styler=col.styler1; +col.formatter1=col.styler1=undefined; +}); }}; -$.fn.datagrid.defaults=$.extend({},$.fn.panel.defaults,{sharedStyleSheet:false,frozenColumns:undefined,columns:undefined,fitColumns:false,resizeHandle:"right",autoRowHeight:true,toolbar:null,striped:false,method:"post",nowrap:true,idField:null,url:null,data:null,loadMsg:"Processing, please wait ...",rownumbers:false,singleSelect:false,ctrlSelect:false,selectOnCheck:true,checkOnSelect:true,pagination:false,pagePosition:"bottom",pageNumber:1,pageSize:10,pageList:[10,20,30,40,50],queryParams:{},sortName:null,sortOrder:"asc",multiSort:false,remoteSort:true,showHeader:true,showFooter:false,scrollbarSize:18,rowEvents:{mouseover:_85(true),mouseout:_85(false),click:_8e,dblclick:_99,contextmenu:_9e},rowStyler:function(_230,_231){ -},loader:function(_232,_233,_234){ +$.fn.datagrid.defaults=$.extend({},$.fn.panel.defaults,{sharedStyleSheet:false,frozenColumns:undefined,columns:undefined,fitColumns:false,resizeHandle:"right",autoRowHeight:true,toolbar:null,striped:false,method:"post",nowrap:true,idField:null,url:null,data:null,loadMsg:"Processing, please wait ...",emptyMsg:"",rownumbers:false,singleSelect:false,ctrlSelect:false,selectOnCheck:true,checkOnSelect:true,pagination:false,pagePosition:"bottom",pageNumber:1,pageSize:10,pageList:[10,20,30,40,50],queryParams:{},sortName:null,sortOrder:"asc",multiSort:false,remoteSort:true,showHeader:true,showFooter:false,scrollOnSelect:true,scrollbarSize:18,rownumberWidth:30,editorHeight:24,headerEvents:{mouseover:_82(true),mouseout:_82(false),click:_86,dblclick:_8d,contextmenu:_93},rowEvents:{mouseover:_96(true),mouseout:_96(false),click:_9e,dblclick:_a9,contextmenu:_ae},rowStyler:function(_253,_254){ +},loader:function(_255,_256,_257){ var opts=$(this).datagrid("options"); if(!opts.url){ return false; } -$.ajax({type:opts.method,url:opts.url,data:_232,dataType:"json",success:function(data){ -_233(data); +$.ajax({type:opts.method,url:opts.url,data:_255,dataType:"json",success:function(data){ +_256(data); },error:function(){ -_234.apply(this,arguments); +_257.apply(this,arguments); }}); },loadFilter:function(data){ -if(typeof data.length=="number"&&typeof data.splice=="function"){ -return {total:data.length,rows:data}; -}else{ return data; -} -},editors:_1a5,finder:{getTr:function(_235,_236,type,_237){ +},editors:_1c4,finder:{getTr:function(_258,_259,type,_25a){ type=type||"body"; -_237=_237||0; -var _238=$.data(_235,"datagrid"); -var dc=_238.dc; -var opts=_238.options; -if(_237==0){ -var tr1=opts.finder.getTr(_235,_236,type,1); -var tr2=opts.finder.getTr(_235,_236,type,2); +_25a=_25a||0; +var _25b=$.data(_258,"datagrid"); +var dc=_25b.dc; +var opts=_25b.options; +if(_25a==0){ +var tr1=opts.finder.getTr(_258,_259,type,1); +var tr2=opts.finder.getTr(_258,_259,type,2); return tr1.add(tr2); }else{ if(type=="body"){ -var tr=$("#"+_238.rowIdPrefix+"-"+_237+"-"+_236); +var tr=$("#"+_25b.rowIdPrefix+"-"+_25a+"-"+_259); if(!tr.length){ -tr=(_237==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index="+_236+"]"); +tr=(_25a==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index="+_259+"]"); } return tr; }else{ if(type=="footer"){ -return (_237==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index="+_236+"]"); +return (_25a==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index="+_259+"]"); }else{ if(type=="selected"){ -return (_237==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-selected"); +return (_25a==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-selected"); }else{ if(type=="highlight"){ -return (_237==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-over"); +return (_25a==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-over"); }else{ if(type=="checked"){ -return (_237==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-checked"); +return (_25a==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-checked"); }else{ if(type=="editing"){ -return (_237==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-editing"); +return (_25a==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-editing"); }else{ if(type=="last"){ -return (_237==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]:last"); +return (_25a==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]:last"); }else{ if(type=="allbody"){ -return (_237==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]"); +return (_25a==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]"); }else{ if(type=="allfooter"){ -return (_237==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index]"); +return (_25a==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index]"); } } } @@ -2384,40 +2535,40 @@ return (_237==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index] } } } -},getRow:function(_239,p){ -var _23a=(typeof p=="object")?p.attr("datagrid-row-index"):p; -return $.data(_239,"datagrid").data.rows[parseInt(_23a)]; -},getRows:function(_23b){ -return $(_23b).datagrid("getRows"); -}},view:_1ee,onBeforeLoad:function(_23c){ +},getRow:function(_25c,p){ +var _25d=(typeof p=="object")?p.attr("datagrid-row-index"):p; +return $.data(_25c,"datagrid").data.rows[parseInt(_25d)]; +},getRows:function(_25e){ +return $(_25e).datagrid("getRows"); +}},view:_20d,onBeforeLoad:function(_25f){ },onLoadSuccess:function(){ },onLoadError:function(){ -},onClickRow:function(_23d,_23e){ -},onDblClickRow:function(_23f,_240){ -},onClickCell:function(_241,_242,_243){ -},onDblClickCell:function(_244,_245,_246){ -},onBeforeSortColumn:function(sort,_247){ -},onSortColumn:function(sort,_248){ -},onResizeColumn:function(_249,_24a){ -},onBeforeSelect:function(_24b,_24c){ -},onSelect:function(_24d,_24e){ -},onBeforeUnselect:function(_24f,_250){ -},onUnselect:function(_251,_252){ +},onClickRow:function(_260,_261){ +},onDblClickRow:function(_262,_263){ +},onClickCell:function(_264,_265,_266){ +},onDblClickCell:function(_267,_268,_269){ +},onBeforeSortColumn:function(sort,_26a){ +},onSortColumn:function(sort,_26b){ +},onResizeColumn:function(_26c,_26d){ +},onBeforeSelect:function(_26e,_26f){ +},onSelect:function(_270,_271){ +},onBeforeUnselect:function(_272,_273){ +},onUnselect:function(_274,_275){ },onSelectAll:function(rows){ },onUnselectAll:function(rows){ -},onBeforeCheck:function(_253,_254){ -},onCheck:function(_255,_256){ -},onBeforeUncheck:function(_257,_258){ -},onUncheck:function(_259,_25a){ +},onBeforeCheck:function(_276,_277){ +},onCheck:function(_278,_279){ +},onBeforeUncheck:function(_27a,_27b){ +},onUncheck:function(_27c,_27d){ },onCheckAll:function(rows){ },onUncheckAll:function(rows){ -},onBeforeEdit:function(_25b,_25c){ -},onBeginEdit:function(_25d,_25e){ -},onEndEdit:function(_25f,_260,_261){ -},onAfterEdit:function(_262,_263,_264){ -},onCancelEdit:function(_265,_266){ -},onHeaderContextMenu:function(e,_267){ -},onRowContextMenu:function(e,_268,_269){ +},onBeforeEdit:function(_27e,_27f){ +},onBeginEdit:function(_280,_281){ +},onEndEdit:function(_282,_283,_284){ +},onAfterEdit:function(_285,_286,_287){ +},onCancelEdit:function(_288,_289){ +},onHeaderContextMenu:function(e,_28a){ +},onRowContextMenu:function(e,_28b,_28c){ }}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.datalist.js b/assets/js/easy-ui/plugins/jquery.datalist.js new file mode 100644 index 0000000000..580f241312 --- /dev/null +++ b/assets/js/easy-ui/plugins/jquery.datalist.js @@ -0,0 +1,136 @@ +/** + * jQuery EasyUI 1.5.2 + * + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. + * + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com + * + */ +(function($){ +function _1(_2){ +var _3=$.data(_2,"datalist").options; +$(_2).datagrid($.extend({},_3,{cls:"datalist"+(_3.lines?" datalist-lines":""),frozenColumns:(_3.frozenColumns&&_3.frozenColumns.length)?_3.frozenColumns:(_3.checkbox?[[{field:"_ck",checkbox:true}]]:undefined),columns:(_3.columns&&_3.columns.length)?_3.columns:[[{field:_3.textField,width:"100%",formatter:function(_4,_5,_6){ +return _3.textFormatter?_3.textFormatter(_4,_5,_6):_4; +}}]]})); +}; +var _7=$.extend({},$.fn.datagrid.defaults.view,{render:function(_8,_9,_a){ +var _b=$.data(_8,"datagrid"); +var _c=_b.options; +if(_c.groupField){ +var g=this.groupRows(_8,_b.data.rows); +this.groups=g.groups; +_b.data.rows=g.rows; +var _d=[]; +for(var i=0;i"); +if(!_11){ +_15.push(""); +_15.push(_13.groupFormatter.call(_e,_10.value,_10.rows)); +_15.push(""); +} +_15.push(""); +_15.push(this.renderTable(_e,_10.startIndex,_10.rows,_11)); +return _15.join(""); +},groupRows:function(_16,_17){ +var _18=$.data(_16,"datagrid"); +var _19=_18.options; +var _1a=[]; +for(var i=0;i<_17.length;i++){ +var row=_17[i]; +var _1b=_1c(row[_19.groupField]); +if(!_1b){ +_1b={value:row[_19.groupField],rows:[row]}; +_1a.push(_1b); +}else{ +_1b.rows.push(row); +} +} +var _1d=0; +var _17=[]; +for(var i=0;i<_1a.length;i++){ +var _1b=_1a[i]; +_1b.startIndex=_1d; +_1d+=_1b.rows.length; +_17=_17.concat(_1b.rows); +} +return {groups:_1a,rows:_17}; +function _1c(_1e){ +for(var i=0;i<_1a.length;i++){ +var _1f=_1a[i]; +if(_1f.value==_1e){ +return _1f; +} +} +return null; +}; +}}); +$.fn.datalist=function(_20,_21){ +if(typeof _20=="string"){ +var _22=$.fn.datalist.methods[_20]; +if(_22){ +return _22(this,_21); +}else{ +return this.datagrid(_20,_21); +} +} +_20=_20||{}; +return this.each(function(){ +var _23=$.data(this,"datalist"); +if(_23){ +$.extend(_23.options,_20); +}else{ +var _24=$.extend({},$.fn.datalist.defaults,$.fn.datalist.parseOptions(this),_20); +_24.columns=$.extend(true,[],_24.columns); +_23=$.data(this,"datalist",{options:_24}); +} +_1(this); +if(!_23.options.data){ +var _25=$.fn.datalist.parseData(this); +if(_25.total){ +$(this).datalist("loadData",_25); +} +} +}); +}; +$.fn.datalist.methods={options:function(jq){ +return $.data(jq[0],"datalist").options; +}}; +$.fn.datalist.parseOptions=function(_26){ +return $.extend({},$.fn.datagrid.parseOptions(_26),$.parser.parseOptions(_26,["valueField","textField","groupField",{checkbox:"boolean",lines:"boolean"}])); +}; +$.fn.datalist.parseData=function(_27){ +var _28=$.data(_27,"datalist").options; +var _29={total:0,rows:[]}; +$(_27).children().each(function(){ +var _2a=$.parser.parseOptions(this,["value","group"]); +var row={}; +var _2b=$(this).html(); +row[_28.valueField]=_2a.value!=undefined?_2a.value:_2b; +row[_28.textField]=_2b; +if(_28.groupField){ +row[_28.groupField]=_2a.group; +} +_29.total++; +_29.rows.push(row); +}); +return _29; +}; +$.fn.datalist.defaults=$.extend({},$.fn.datagrid.defaults,{fitColumns:true,singleSelect:true,showHeader:false,checkbox:false,lines:false,valueField:"value",textField:"text",groupField:"",view:_7,textFormatter:function(_2c,row){ +return _2c; +},groupFormatter:function(_2d,_2e){ +return _2d; +}}); +})(jQuery); + diff --git a/assets/js/easy-ui/plugins/jquery.datebox.js b/assets/js/easy-ui/plugins/jquery.datebox.js old mode 100755 new mode 100644 index f12bc42d73..d4aaec83d5 --- a/assets/js/easy-ui/plugins/jquery.datebox.js +++ b/assets/js/easy-ui/plugins/jquery.datebox.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -70,7 +70,7 @@ var tr=_12.find("tr"); for(var i=0;i<_4.buttons.length;i++){ var td=$("").appendTo(tr); var btn=_4.buttons[i]; -var t=$("").html($.isFunction(btn.text)?btn.text(_10):btn.text).appendTo(td); +var t=$("").html($.isFunction(btn.text)?btn.text(_10):btn.text).appendTo(td); t.attr("datebox-button-index",i); } tr.find("td").css("width",(100/_4.buttons.length)+"%"); @@ -107,15 +107,14 @@ function _18(_1e,_1f,_20){ var _21=$.data(_1e,"datebox"); var _22=_21.options; var _23=_21.calendar; -$(_1e).combo("setValue",_1f); _23.calendar("moveTo",_22.parser.call(_1e,_1f)); -if(!_20){ +if(_20){ +$(_1e).combo("setValue",_1f); +}else{ if(_1f){ _1f=_22.formatter.call(_1e,_23.calendar("options").current); -$(_1e).combo("setValue",_1f).combo("setText",_1f); -}else{ -$(_1e).combo("setText",_1f); } +$(_1e).combo("setText",_1f).combo("setValue",_1f); } }; $.fn.datebox=function(_24,_25){ @@ -182,7 +181,8 @@ _16(this,q); }},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_30){ return $(_30).datebox("options").currentText; },handler:function(_31){ -$(_31).datebox("calendar").calendar({year:new Date().getFullYear(),month:new Date().getMonth()+1,current:new Date()}); +var now=new Date(); +$(_31).datebox("calendar").calendar({year:now.getFullYear(),month:now.getMonth()+1,current:new Date(now.getFullYear(),now.getMonth(),now.getDate())}); _19(_31); }},{text:function(_32){ return $(_32).datebox("options").closeText; diff --git a/assets/js/easy-ui/plugins/jquery.datetimebox.js b/assets/js/easy-ui/plugins/jquery.datetimebox.js old mode 100755 new mode 100644 index 9ed5854e54..47dc1d705f --- a/assets/js/easy-ui/plugins/jquery.datetimebox.js +++ b/assets/js/easy-ui/plugins/jquery.datetimebox.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -49,8 +49,8 @@ $(_12).combo("setValue",_13); if(!_14){ if(_13){ var _16=_15.parser.call(_12,_13); -$(_12).combo("setValue",_15.formatter.call(_12,_16)); $(_12).combo("setText",_15.formatter.call(_12,_16)); +$(_12).combo("setValue",_15.formatter.call(_12,_16)); }else{ $(_12).combo("setText",_13); } diff --git a/assets/js/easy-ui/plugins/jquery.datetimespinner.js b/assets/js/easy-ui/plugins/jquery.datetimespinner.js old mode 100755 new mode 100644 index 79f2d9df7b..9d0376988f --- a/assets/js/easy-ui/plugins/jquery.datetimespinner.js +++ b/assets/js/easy-ui/plugins/jquery.datetimespinner.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ diff --git a/assets/js/easy-ui/plugins/jquery.dialog.js b/assets/js/easy-ui/plugins/jquery.dialog.js old mode 100755 new mode 100644 index a13db9097b..c611ecdcc2 --- a/assets/js/easy-ui/plugins/jquery.dialog.js +++ b/assets/js/easy-ui/plugins/jquery.dialog.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -13,7 +13,7 @@ var _3=$.data(_2,"dialog").options; _3.inited=false; $(_2).window($.extend({},_3,{onResize:function(w,h){ if(_3.inited){ -_a(this); +_b(this); _3.onResize.call(this,w,h); } }})); @@ -29,7 +29,7 @@ if(_6=="-"){ $("
                  ").appendTo(tr); }else{ var td=$("").appendTo(tr); -var _7=$("").appendTo(td); +var _7=$("").appendTo(td); _7[0].onclick=eval(_6.handler||function(){ }); _7.linkbutton($.extend({},_6,{plain:true})); @@ -48,7 +48,7 @@ $(_2).siblings("div.dialog-button").remove(); var _8=$("
                  ").appendTo(_4); for(var i=0;i<_3.buttons.length;i++){ var p=_3.buttons[i]; -var _9=$("").appendTo(_8); +var _9=$("").appendTo(_8); if(p.handler){ _9[0].onclick=p.handler; } @@ -62,60 +62,74 @@ $(_3.buttons).show(); $(_2).siblings("div.dialog-button").remove(); } _3.inited=true; +var _a=_3.closed; _4.show(); $(_2).window("resize"); -if(_3.closed){ +if(_a){ _4.hide(); } }; -function _a(_b,_c){ -var t=$(_b); -var _d=t.dialog("options"); -var _e=_d.noheader; +function _b(_c,_d){ +var t=$(_c); +var _e=t.dialog("options"); +var _f=_e.noheader; var tb=t.siblings(".dialog-toolbar"); var bb=t.siblings(".dialog-button"); -tb.insertBefore(_b).css({position:"relative",borderTopWidth:(_e?1:0),top:(_e?tb.length:0)}); -bb.insertAfter(_b).css({position:"relative",top:-1}); -if(!isNaN(parseInt(_d.height))){ -t._outerHeight(t._outerHeight()-tb._outerHeight()-bb._outerHeight()); -} -tb.add(bb)._outerWidth(t._outerWidth()); -var _f=$.data(_b,"window").shadow; -if(_f){ +tb.insertBefore(_c).css({borderTopWidth:(_f?1:0),top:(_f?tb.length:0)}); +bb.insertAfter(_c); +tb.add(bb)._outerWidth(t._outerWidth()).find(".easyui-fluid:visible").each(function(){ +$(this).triggerHandler("_resize"); +}); +var _10=tb._outerHeight()+bb._outerHeight(); +if(!isNaN(parseInt(_e.height))){ +t._outerHeight(t._outerHeight()-_10); +}else{ +var _11=t._size("min-height"); +if(_11){ +t._size("min-height",_11-_10); +} +var _12=t._size("max-height"); +if(_12){ +t._size("max-height",_12-_10); +} +} +var _13=$.data(_c,"window").shadow; +if(_13){ var cc=t.panel("panel"); -_f.css({width:cc._outerWidth(),height:cc._outerHeight()}); +_13.css({width:cc._outerWidth(),height:cc._outerHeight()}); } }; -$.fn.dialog=function(_10,_11){ -if(typeof _10=="string"){ -var _12=$.fn.dialog.methods[_10]; -if(_12){ -return _12(this,_11); +$.fn.dialog=function(_14,_15){ +if(typeof _14=="string"){ +var _16=$.fn.dialog.methods[_14]; +if(_16){ +return _16(this,_15); }else{ -return this.window(_10,_11); +return this.window(_14,_15); } } -_10=_10||{}; +_14=_14||{}; return this.each(function(){ -var _13=$.data(this,"dialog"); -if(_13){ -$.extend(_13.options,_10); +var _17=$.data(this,"dialog"); +if(_17){ +$.extend(_17.options,_14); }else{ -$.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_10)}); +$.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_14)}); } _1(this); }); }; $.fn.dialog.methods={options:function(jq){ -var _14=$.data(jq[0],"dialog").options; -var _15=jq.panel("options"); -$.extend(_14,{width:_15.width,height:_15.height,left:_15.left,top:_15.top,closed:_15.closed,collapsed:_15.collapsed,minimized:_15.minimized,maximized:_15.maximized}); -return _14; +var _18=$.data(jq[0],"dialog").options; +var _19=jq.panel("options"); +$.extend(_18,{width:_19.width,height:_19.height,left:_19.left,top:_19.top,closed:_19.closed,collapsed:_19.collapsed,minimized:_19.minimized,maximized:_19.maximized}); +return _18; },dialog:function(jq){ return jq.window("window"); }}; -$.fn.dialog.parseOptions=function(_16){ -return $.extend({},$.fn.window.parseOptions(_16),$.parser.parseOptions(_16,["toolbar","buttons"])); +$.fn.dialog.parseOptions=function(_1a){ +var t=$(_1a); +return $.extend({},$.fn.window.parseOptions(_1a),$.parser.parseOptions(_1a,["toolbar","buttons"]),{toolbar:(t.children(".dialog-toolbar").length?t.children(".dialog-toolbar").removeClass("dialog-toolbar"):undefined),buttons:(t.children(".dialog-button").length?t.children(".dialog-button").removeClass("dialog-button"):undefined)}); }; $.fn.dialog.defaults=$.extend({},$.fn.window.defaults,{title:"New Dialog",collapsible:false,minimizable:false,maximizable:false,resizable:false,toolbar:null,buttons:null}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.draggable.js b/assets/js/easy-ui/plugins/jquery.draggable.js old mode 100755 new mode 100644 index 5f7e346034..1dfcd1ba16 --- a/assets/js/easy-ui/plugins/jquery.draggable.js +++ b/assets/js/easy-ui/plugins/jquery.draggable.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -62,10 +62,12 @@ _b.css({left:e.data.left,top:e.data.top}); $("body").css("cursor",_a.cursor); }; function _c(e){ -$.fn.draggable.isDragging=true; +if(!$.fn.draggable.isDragging){ +return false; +} var _d=$.data(e.data.target,"draggable"); var _e=_d.options; -var _f=$(".droppable").filter(function(){ +var _f=$(".droppable:visible").filter(function(){ return e.data.target!=this; }).filter(function(){ var _10=$.data(this,"droppable").options.accept; @@ -98,6 +100,9 @@ _e.onStartDrag.call(e.data.target,e); return false; }; function _12(e){ +if(!$.fn.draggable.isDragging){ +return false; +} var _13=$.data(e.data.target,"draggable"); _1(e); if(_13.options.onDrag.call(e.data.target,e)!=false){ @@ -126,26 +131,29 @@ this.entered=false; return false; }; function _16(e){ -$.fn.draggable.isDragging=false; +if(!$.fn.draggable.isDragging){ +_17(); +return false; +} _12(e); -var _17=$.data(e.data.target,"draggable"); -var _18=_17.proxy; -var _19=_17.options; -if(_19.revert){ -if(_1a()==true){ +var _18=$.data(e.data.target,"draggable"); +var _19=_18.proxy; +var _1a=_18.options; +if(_1a.revert){ +if(_1b()==true){ $(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop}); }else{ -if(_18){ -var _1b,top; -if(_18.parent()[0]==document.body){ -_1b=e.data.startX-e.data.offsetWidth; +if(_19){ +var _1c,top; +if(_19.parent()[0]==document.body){ +_1c=e.data.startX-e.data.offsetWidth; top=e.data.startY-e.data.offsetHeight; }else{ -_1b=e.data.startLeft; +_1c=e.data.startLeft; top=e.data.startTop; } -_18.animate({left:_1b,top:top},function(){ -_1c(); +_19.animate({left:_1c,top:top},function(){ +_1d(); }); }else{ $(e.data.target).animate({left:e.data.startLeft,top:e.data.startTop},function(){ @@ -155,104 +163,117 @@ $(e.data.target).css("position",e.data.startPosition); } }else{ $(e.data.target).css({position:"absolute",left:e.data.left,top:e.data.top}); -_1a(); +_1b(); } -_19.onStopDrag.call(e.data.target,e); -$(document).unbind(".draggable"); -setTimeout(function(){ -$("body").css("cursor",""); -},100); -function _1c(){ -if(_18){ -_18.remove(); +_1a.onStopDrag.call(e.data.target,e); +_17(); +function _1d(){ +if(_19){ +_19.remove(); } -_17.proxy=null; +_18.proxy=null; }; -function _1a(){ -var _1d=false; -_17.droppables.each(function(){ -var _1e=$(this); -if(_1e.droppable("options").disabled){ +function _1b(){ +var _1e=false; +_18.droppables.each(function(){ +var _1f=$(this); +if(_1f.droppable("options").disabled){ return; } -var p2=_1e.offset(); -if(e.pageX>p2.left&&e.pageXp2.top&&e.pageYp2.left&&e.pageXp2.top&&e.pageY_2a.options.edge; +function _26(e){ +var _2b=$.data(e.data.target,"draggable"); +var _2c=_2b.handle; +var _2d=$(_2c).offset(); +var _2e=$(_2c).outerWidth(); +var _2f=$(_2c).outerHeight(); +var t=e.pageY-_2d.top; +var r=_2d.left+_2e-e.pageX; +var b=_2d.top+_2f-e.pageY; +var l=e.pageX-_2d.left; +return Math.min(t,r,b,l)>_2b.options.edge; }; }); }; @@ -269,11 +290,11 @@ return jq.each(function(){ $(this).draggable({disabled:true}); }); }}; -$.fn.draggable.parseOptions=function(_2f){ -var t=$(_2f); -return $.extend({},$.parser.parseOptions(_2f,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); +$.fn.draggable.parseOptions=function(_30){ +var t=$(_30); +return $.extend({},$.parser.parseOptions(_30,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number","delay":"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); }; -$.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,onBeforeDrag:function(e){ +$.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,delay:100,onBeforeDrag:function(e){ },onStartDrag:function(e){ },onDrag:function(e){ },onStopDrag:function(e){ diff --git a/assets/js/easy-ui/plugins/jquery.droppable.js b/assets/js/easy-ui/plugins/jquery.droppable.js old mode 100755 new mode 100644 index 5fa08fec48..f8236e1d41 --- a/assets/js/easy-ui/plugins/jquery.droppable.js +++ b/assets/js/easy-ui/plugins/jquery.droppable.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ diff --git a/assets/js/easy-ui/plugins/jquery.filebox.js b/assets/js/easy-ui/plugins/jquery.filebox.js old mode 100755 new mode 100644 index 99f50cf5b2..4fab6094b3 --- a/assets/js/easy-ui/plugins/jquery.filebox.js +++ b/assets/js/easy-ui/plugins/jquery.filebox.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -12,55 +12,87 @@ var _1=0; function _2(_3){ var _4=$.data(_3,"filebox"); var _5=_4.options; -var id="filebox_file_id_"+(++_1); -$(_3).addClass("filebox-f").textbox($.extend({},_5,{buttonText:_5.buttonText?(""):""})); +_5.fileboxId="filebox_file_id_"+(++_1); +$(_3).addClass("filebox-f").textbox(_5); $(_3).textbox("textbox").attr("readonly","readonly"); _4.filebox=$(_3).next().addClass("filebox"); -_4.filebox.find(".textbox-value").remove(); -_5.oldValue=""; -var _6=$("").appendTo(_4.filebox); -_6.attr("id",id).attr("name",$(_3).attr("textboxName")||""); -_6.change(function(){ -$(_3).filebox("setText",this.value); -_5.onChange.call(_3,this.value,_5.oldValue); -_5.oldValue=this.value; -}); -var _7=$(_3).filebox("button"); -if(_7.length){ -if(_7.linkbutton("options").disabled){ +var _6=_7(_3); +var _8=$(_3).filebox("button"); +if(_8.length){ +$("").appendTo(_8); +if(_8.linkbutton("options").disabled){ _6.attr("disabled","disabled"); }else{ _6.removeAttr("disabled"); } } }; -$.fn.filebox=function(_8,_9){ -if(typeof _8=="string"){ -var _a=$.fn.filebox.methods[_8]; -if(_a){ -return _a(this,_9); +function _7(_9){ +var _a=$.data(_9,"filebox"); +var _b=_a.options; +_a.filebox.find(".textbox-value").remove(); +_b.oldValue=""; +var _c=$("").appendTo(_a.filebox); +_c.attr("id",_b.fileboxId).attr("name",$(_9).attr("textboxName")||""); +_c.attr("accept",_b.accept); +_c.attr("capture",_b.capture); +if(_b.multiple){ +_c.attr("multiple","multiple"); +} +_c.change(function(){ +var _d=this.value; +if(this.files){ +_d=$.map(this.files,function(_e){ +return _e.name; +}).join(_b.separator); +} +$(_9).filebox("setText",_d); +_b.onChange.call(_9,_d,_b.oldValue); +_b.oldValue=_d; +}); +return _c; +}; +$.fn.filebox=function(_f,_10){ +if(typeof _f=="string"){ +var _11=$.fn.filebox.methods[_f]; +if(_11){ +return _11(this,_10); }else{ -return this.textbox(_8,_9); +return this.textbox(_f,_10); } } -_8=_8||{}; +_f=_f||{}; return this.each(function(){ -var _b=$.data(this,"filebox"); -if(_b){ -$.extend(_b.options,_8); +var _12=$.data(this,"filebox"); +if(_12){ +$.extend(_12.options,_f); }else{ -$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_8)}); +$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_f)}); } _2(this); }); }; $.fn.filebox.methods={options:function(jq){ -var _c=jq.textbox("options"); -return $.extend($.data(jq[0],"filebox").options,{width:_c.width,value:_c.value,originalValue:_c.originalValue,disabled:_c.disabled,readonly:_c.readonly}); +var _13=jq.textbox("options"); +return $.extend($.data(jq[0],"filebox").options,{width:_13.width,value:_13.value,originalValue:_13.originalValue,disabled:_13.disabled,readonly:_13.readonly}); +},clear:function(jq){ +return jq.each(function(){ +$(this).textbox("clear"); +_7(this); +}); +},reset:function(jq){ +return jq.each(function(){ +$(this).filebox("clear"); +}); +},setValue:function(jq){ +return jq; +},setValues:function(jq){ +return jq; }}; -$.fn.filebox.parseOptions=function(_d){ -return $.extend({},$.fn.textbox.parseOptions(_d),{}); +$.fn.filebox.parseOptions=function(_14){ +var t=$(_14); +return $.extend({},$.fn.textbox.parseOptions(_14),$.parser.parseOptions(_14,["accept","capture","separator"]),{multiple:(t.attr("multiple")?true:undefined)}); }; -$.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{}}); +$.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{},accept:"",capture:"",separator:",",multiple:false}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.form.js b/assets/js/easy-ui/plugins/jquery.form.js old mode 100755 new mode 100644 index aed2df2353..b262a36ffc --- a/assets/js/easy-ui/plugins/jquery.form.js +++ b/assets/js/easy-ui/plugins/jquery.form.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -15,178 +15,245 @@ var _5=$.extend({},_4.queryParams); if(_4.onSubmit.call(_2,_5)==false){ return; } -$(_2).find(".textbox-text:focus").blur(); -var _6="easyui_frame_"+(new Date().getTime()); -var _7=$("").appendTo("body"); -_7.attr("src",window.ActiveXObject?"javascript:false":"about:blank"); -_7.css({position:"absolute",top:-1000,left:-1000}); -_7.bind("load",cb); -_8(_5); -function _8(_9){ -var _a=$(_2); -if(_4.url){ -_a.attr("action",_4.url); -} -var t=_a.attr("target"),a=_a.attr("action"); -_a.attr("target",_6); -var _b=$(); +var _6=$(_2).find(".textbox-text:focus"); +_6.triggerHandler("blur"); +_6.focus(); +var _7=null; +if(_4.dirty){ +var ff=[]; +$.map(_4.dirtyFields,function(f){ +if($(f).hasClass("textbox-f")){ +$(f).next().find(".textbox-value").each(function(){ +ff.push(this); +}); +}else{ +ff.push(f); +} +}); +_7=$(_2).find("input[name]:enabled,textarea[name]:enabled,select[name]:enabled").filter(function(){ +return $.inArray(this,ff)==-1; +}); +_7.attr("disabled","disabled"); +} +if(_4.ajax){ +if(_4.iframe){ +_8(_2,_5); +}else{ +if(window.FormData!==undefined){ +_9(_2,_5); +}else{ +_8(_2,_5); +} +} +}else{ +$(_2).submit(); +} +if(_4.dirty){ +_7.removeAttr("disabled"); +} +}; +function _8(_a,_b){ +var _c=$.data(_a,"form").options; +var _d="easyui_frame_"+(new Date().getTime()); +var _e=$("").appendTo("body"); +_e.attr("src",window.ActiveXObject?"javascript:false":"about:blank"); +_e.css({position:"absolute",top:-1000,left:-1000}); +_e.bind("load",cb); +_f(_b); +function _f(_10){ +var _11=$(_a); +if(_c.url){ +_11.attr("action",_c.url); +} +var t=_11.attr("target"),a=_11.attr("action"); +_11.attr("target",_d); +var _12=$(); try{ -for(var n in _9){ -var _c=$("").val(_9[n]).appendTo(_a); -_b=_b.add(_c); +for(var n in _10){ +var _13=$("").val(_10[n]).appendTo(_11); +_12=_12.add(_13); } -_d(); -_a[0].submit(); +_14(); +_11[0].submit(); } finally{ -_a.attr("action",a); -t?_a.attr("target",t):_a.removeAttr("target"); -_b.remove(); +_11.attr("action",a); +t?_11.attr("target",t):_11.removeAttr("target"); +_12.remove(); } }; -function _d(){ -var f=$("#"+_6); +function _14(){ +var f=$("#"+_d); if(!f.length){ return; } try{ var s=f.contents()[0].readyState; if(s&&s.toLowerCase()=="uninitialized"){ -setTimeout(_d,100); +setTimeout(_14,100); } } catch(e){ cb(); } }; -var _e=10; +var _15=10; function cb(){ -var f=$("#"+_6); +var f=$("#"+_d); if(!f.length){ return; } f.unbind(); -var _f=""; +var _16=""; try{ -var _10=f.contents().find("body"); -_f=_10.html(); -if(_f==""){ -if(--_e){ +var _17=f.contents().find("body"); +_16=_17.html(); +if(_16==""){ +if(--_15){ setTimeout(cb,100); return; } } -var ta=_10.find(">textarea"); +var ta=_17.find(">textarea"); if(ta.length){ -_f=ta.val(); +_16=ta.val(); }else{ -var pre=_10.find(">pre"); +var pre=_17.find(">pre"); if(pre.length){ -_f=pre.html(); +_16=pre.html(); } } } catch(e){ } -_4.success(_f); +_c.success.call(_a,_16); setTimeout(function(){ f.unbind(); f.remove(); },100); }; }; -function _11(_12,_13){ -var _14=$.data(_12,"form").options; -if(typeof _13=="string"){ -var _15={}; -if(_14.onBeforeLoad.call(_12,_15)==false){ +function _9(_18,_19){ +var _1a=$.data(_18,"form").options; +var _1b=new FormData($(_18)[0]); +for(var _1c in _19){ +_1b.append(_1c,_19[_1c]); +} +$.ajax({url:_1a.url,type:"post",xhr:function(){ +var xhr=$.ajaxSettings.xhr(); +if(xhr.upload){ +xhr.upload.addEventListener("progress",function(e){ +if(e.lengthComputable){ +var _1d=e.total; +var _1e=e.loaded||e.position; +var _1f=Math.ceil(_1e*100/_1d); +_1a.onProgress.call(_18,_1f); +} +},false); +} +return xhr; +},data:_1b,dataType:"html",cache:false,contentType:false,processData:false,complete:function(res){ +_1a.success.call(_18,res.responseText); +}}); +}; +function _20(_21,_22){ +var _23=$.data(_21,"form").options; +if(typeof _22=="string"){ +var _24={}; +if(_23.onBeforeLoad.call(_21,_24)==false){ return; } -$.ajax({url:_13,data:_15,dataType:"json",success:function(_16){ -_17(_16); +$.ajax({url:_22,data:_24,dataType:"json",success:function(_25){ +_26(_25); },error:function(){ -_14.onLoadError.apply(_12,arguments); +_23.onLoadError.apply(_21,arguments); }}); }else{ -_17(_13); +_26(_22); } -function _17(_18){ -var _19=$(_12); -for(var _1a in _18){ -var val=_18[_1a]; -var rr=_1b(_1a,val); -if(!rr.length){ -var _1c=_1d(_1a,val); -if(!_1c){ -$("input[name=\""+_1a+"\"]",_19).val(val); -$("textarea[name=\""+_1a+"\"]",_19).val(val); -$("select[name=\""+_1a+"\"]",_19).val(val); +function _26(_27){ +var _28=$(_21); +for(var _29 in _27){ +var val=_27[_29]; +if(!_2a(_29,val)){ +if(!_2b(_29,val)){ +_28.find("input[name=\""+_29+"\"]").val(val); +_28.find("textarea[name=\""+_29+"\"]").val(val); +_28.find("select[name=\""+_29+"\"]").val(val); } } -_1e(_1a,val); } -_14.onLoadSuccess.call(_12,_18); -_2b(_12); +_23.onLoadSuccess.call(_21,_27); +_28.form("validate"); }; -function _1b(_1f,val){ -var rr=$(_12).find("input[name=\""+_1f+"\"][type=radio], input[name=\""+_1f+"\"][type=checkbox]"); -rr._propAttr("checked",false); -rr.each(function(){ -var f=$(this); -if(f.val()==String(val)||$.inArray(f.val(),$.isArray(val)?val:[val])>=0){ -f._propAttr("checked",true); +function _2a(_2c,val){ +var cc=$(_21).find("[switchbuttonName=\""+_2c+"\"]"); +if(cc.length){ +cc.switchbutton("uncheck"); +cc.each(function(){ +if(_2d($(this).switchbutton("options").value,val)){ +$(this).switchbutton("check"); } }); -return rr; +return true; +} +cc=$(_21).find("input[name=\""+_2c+"\"][type=radio], input[name=\""+_2c+"\"][type=checkbox]"); +if(cc.length){ +cc._propAttr("checked",false); +cc.each(function(){ +if(_2d($(this).val(),val)){ +$(this)._propAttr("checked",true); +} +}); +return true; +} +return false; }; -function _1d(_20,val){ -var _21=0; -var pp=["textbox","numberbox","slider"]; -for(var i=0;i=0){ +return true; +}else{ +return false; +} }; -function _1e(_22,val){ -var _23=$(_12); -var cc=["combobox","combotree","combogrid","datetimebox","datebox","combo"]; -var c=_23.find("[comboName=\""+_22+"\"]"); -if(c.length){ -for(var i=0;i=0;i--){ +var _3e=_3d.fieldTypes[i]; +var _3f=_3c.find("."+_3e+"-f"); +if(_3f.length&&_3f[_3e]){ +_3f[_3e]("reset"); +} +} +_3c.form("validate"); }; -function _30(_31){ -var _32=$.data(_31,"form").options; -$(_31).unbind(".form"); -if(_32.ajax){ -$(_31).bind("submit.form",function(){ +function _40(_41){ +var _42=$.data(_41,"form").options; +$(_41).unbind(".form"); +if(_42.ajax){ +$(_41).bind("submit.form",function(){ setTimeout(function(){ -_1(_31,_32); +_1(_41,_42); },0); return false; }); } -_33(_31,_32.novalidate); +$(_41).bind("_change.form",function(e,t){ +if($.inArray(t,_42.dirtyFields)==-1){ +_42.dirtyFields.push(t); +} +_42.onChange.call(this,t); +}).bind("change.form",function(e){ +var t=e.target; +if(!$(t).hasClass("textbox-text")){ +if($.inArray(t,_42.dirtyFields)==-1){ +_42.dirtyFields.push(t); +} +_42.onChange.call(this,t); +} +}); +_43(_41,_42.novalidate); }; -function _34(_35,_36){ -_36=_36||{}; -var _37=$.data(_35,"form"); -if(_37){ -$.extend(_37.options,_36); +function _44(_45,_46){ +_46=_46||{}; +var _47=$.data(_45,"form"); +if(_47){ +$.extend(_47.options,_46); }else{ -$.data(_35,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_35),_36)}); +$.data(_45,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_45),_46)}); } }; -function _2b(_38){ +function _48(_49){ if($.fn.validatebox){ -var t=$(_38); +var t=$(_49); t.find(".validatebox-text:not(:disabled)").validatebox("validate"); -var _39=t.find(".validatebox-invalid"); -_39.filter(":not(:disabled):first").focus(); -return _39.length==0; +var _4a=t.find(".validatebox-invalid"); +_4a.filter(":not(:disabled):first").focus(); +return _4a.length==0; } return true; }; -function _33(_3a,_3b){ -var _3c=$.data(_3a,"form").options; -_3c.novalidate=_3b; -$(_3a).find(".validatebox-text:not(:disabled)").validatebox(_3b?"disableValidation":"enableValidation"); +function _43(_4b,_4c){ +var _4d=$.data(_4b,"form").options; +_4d.novalidate=_4c; +$(_4b).find(".validatebox-text:not(:disabled)").validatebox(_4c?"disableValidation":"enableValidation"); }; -$.fn.form=function(_3d,_3e){ -if(typeof _3d=="string"){ +$.fn.form=function(_4e,_4f){ +if(typeof _4e=="string"){ this.each(function(){ -_34(this); +_44(this); }); -return $.fn.form.methods[_3d](this,_3e); +return $.fn.form.methods[_4e](this,_4f); } return this.each(function(){ -_34(this,_3d); -_30(this); +_44(this,_4e); +_40(this); }); }; $.fn.form.methods={options:function(jq){ return $.data(jq[0],"form").options; -},submit:function(jq,_3f){ +},submit:function(jq,_50){ return jq.each(function(){ -_1(this,_3f); +_1(this,_50); }); -},load:function(jq,_40){ +},load:function(jq,_51){ return jq.each(function(){ -_11(this,_40); +_20(this,_51); }); },clear:function(jq){ return jq.each(function(){ -_25(this); +_32(this); }); },reset:function(jq){ return jq.each(function(){ -_2c(this); +_3a(this); }); },validate:function(jq){ -return _2b(jq[0]); +return _48(jq[0]); },disableValidation:function(jq){ return jq.each(function(){ -_33(this,true); +_43(this,true); }); },enableValidation:function(jq){ return jq.each(function(){ -_33(this,false); +_43(this,false); +}); +},resetValidation:function(jq){ +return jq.each(function(){ +$(this).find(".validatebox-text:not(:disabled)").validatebox("resetValidation"); +}); +},resetDirty:function(jq){ +return jq.each(function(){ +$(this).form("options").dirtyFields=[]; }); }}; -$.fn.form.parseOptions=function(_41){ -var t=$(_41); -return $.extend({},$.parser.parseOptions(_41,[{ajax:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)}); +$.fn.form.parseOptions=function(_52){ +var t=$(_52); +return $.extend({},$.parser.parseOptions(_52,[{ajax:"boolean",dirty:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)}); }; -$.fn.form.defaults={novalidate:false,ajax:true,url:null,queryParams:{},onSubmit:function(_42){ +$.fn.form.defaults={fieldTypes:["combobox","combotree","combogrid","combotreegrid","datetimebox","datebox","combo","datetimespinner","timespinner","numberspinner","spinner","slider","searchbox","numberbox","passwordbox","filebox","textbox","switchbutton"],novalidate:false,ajax:true,iframe:true,dirty:false,dirtyFields:[],url:null,queryParams:{},onSubmit:function(_53){ return $(this).form("validate"); -},success:function(_43){ -},onBeforeLoad:function(_44){ -},onLoadSuccess:function(_45){ +},onProgress:function(_54){ +},success:function(_55){ +},onBeforeLoad:function(_56){ +},onLoadSuccess:function(_57){ },onLoadError:function(){ +},onChange:function(_58){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.layout.js b/assets/js/easy-ui/plugins/jquery.layout.js old mode 100755 new mode 100644 index 2e90410574..1f9ad3cedc --- a/assets/js/easy-ui/plugins/jquery.layout.js +++ b/assets/js/easy-ui/plugins/jquery.layout.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -70,201 +70,235 @@ _8.width++; function _12(_13){ var cc=$(_13); cc.addClass("layout"); -function _14(cc){ -cc.children("div").each(function(){ -var _15=$.fn.layout.parsePanelOptions(this); +function _14(el){ +var _15=$.fn.layout.parsePanelOptions(el); if("north,south,east,west,center".indexOf(_15.region)>=0){ -_17(_13,_15,this); +_19(_13,_15,el); } -}); }; -cc.children("form").length?_14(cc.children("form")):_14(cc); +var _16=cc.layout("options"); +var _17=_16.onAdd; +_16.onAdd=function(){ +}; +cc.find(">div,>form>div").each(function(){ +_14(this); +}); +_16.onAdd=_17; cc.append("
                  "); -cc.bind("_resize",function(e,_16){ -if($(this).hasClass("easyui-fluid")||_16){ +cc.bind("_resize",function(e,_18){ +if($(this).hasClass("easyui-fluid")||_18){ _2(_13); } return false; }); }; -function _17(_18,_19,el){ -_19.region=_19.region||"center"; -var _1a=$.data(_18,"layout").panels; -var cc=$(_18); -var dir=_19.region; -if(_1a[dir].length){ +function _19(_1a,_1b,el){ +_1b.region=_1b.region||"center"; +var _1c=$.data(_1a,"layout").panels; +var cc=$(_1a); +var dir=_1b.region; +if(_1c[dir].length){ return; } var pp=$(el); if(!pp.length){ pp=$("
                  ").appendTo(cc); } -var _1b=$.extend({},$.fn.layout.paneldefaults,{width:(pp.length?parseInt(pp[0].style.width)||pp.outerWidth():"auto"),height:(pp.length?parseInt(pp[0].style.height)||pp.outerHeight():"auto"),doSize:false,collapsible:true,cls:("layout-panel layout-panel-"+dir),bodyCls:"layout-body",onOpen:function(){ -var _1c=$(this).panel("header").children("div.panel-tool"); -_1c.children("a.panel-tool-collapse").hide(); -var _1d={north:"up",south:"down",east:"right",west:"left"}; -if(!_1d[dir]){ +var _1d=$.extend({},$.fn.layout.paneldefaults,{width:(pp.length?parseInt(pp[0].style.width)||pp.outerWidth():"auto"),height:(pp.length?parseInt(pp[0].style.height)||pp.outerHeight():"auto"),doSize:false,collapsible:true,onOpen:function(){ +var _1e=$(this).panel("header").children("div.panel-tool"); +_1e.children("a.panel-tool-collapse").hide(); +var _1f={north:"up",south:"down",east:"right",west:"left"}; +if(!_1f[dir]){ return; } -var _1e="layout-button-"+_1d[dir]; -var t=_1c.children("a."+_1e); +var _20="layout-button-"+_1f[dir]; +var t=_1e.children("a."+_20); if(!t.length){ -t=$("").addClass(_1e).appendTo(_1c); +t=$("").addClass(_20).appendTo(_1e); t.bind("click",{dir:dir},function(e){ -_2b(_18,e.data.dir); +_39(_1a,e.data.dir); return false; }); } $(this).panel("options").collapsible?t.show():t.hide(); -}},_19); -pp.panel(_1b); -_1a[dir]=pp; +}},_1b,{cls:((_1b.cls||"")+" layout-panel layout-panel-"+dir),bodyCls:((_1b.bodyCls||"")+" layout-body")}); +pp.panel(_1d); +_1c[dir]=pp; +var _21={north:"s",south:"n",east:"w",west:"e"}; +var _22=pp.panel("panel"); if(pp.panel("options").split){ -var _1f=pp.panel("panel"); -_1f.addClass("layout-split-"+dir); -var _20=""; -if(dir=="north"){ -_20="s"; -} -if(dir=="south"){ -_20="n"; +_22.addClass("layout-split-"+dir); } -if(dir=="east"){ -_20="w"; -} -if(dir=="west"){ -_20="e"; -} -_1f.resizable($.extend({},{handles:_20,onStartResize:function(e){ +_22.resizable($.extend({},{handles:(_21[dir]||""),disabled:(!pp.panel("options").split),onStartResize:function(e){ _1=true; if(dir=="north"||dir=="south"){ -var _21=$(">div.layout-split-proxy-v",_18); +var _23=$(">div.layout-split-proxy-v",_1a); }else{ -var _21=$(">div.layout-split-proxy-h",_18); +var _23=$(">div.layout-split-proxy-h",_1a); } -var top=0,_22=0,_23=0,_24=0; +var top=0,_24=0,_25=0,_26=0; var pos={display:"block"}; if(dir=="north"){ -pos.top=parseInt(_1f.css("top"))+_1f.outerHeight()-_21.height(); -pos.left=parseInt(_1f.css("left")); -pos.width=_1f.outerWidth(); -pos.height=_21.height(); +pos.top=parseInt(_22.css("top"))+_22.outerHeight()-_23.height(); +pos.left=parseInt(_22.css("left")); +pos.width=_22.outerWidth(); +pos.height=_23.height(); }else{ if(dir=="south"){ -pos.top=parseInt(_1f.css("top")); -pos.left=parseInt(_1f.css("left")); -pos.width=_1f.outerWidth(); -pos.height=_21.height(); +pos.top=parseInt(_22.css("top")); +pos.left=parseInt(_22.css("left")); +pos.width=_22.outerWidth(); +pos.height=_23.height(); }else{ if(dir=="east"){ -pos.top=parseInt(_1f.css("top"))||0; -pos.left=parseInt(_1f.css("left"))||0; -pos.width=_21.width(); -pos.height=_1f.outerHeight(); +pos.top=parseInt(_22.css("top"))||0; +pos.left=parseInt(_22.css("left"))||0; +pos.width=_23.width(); +pos.height=_22.outerHeight(); }else{ if(dir=="west"){ -pos.top=parseInt(_1f.css("top"))||0; -pos.left=_1f.outerWidth()-_21.width(); -pos.width=_21.width(); -pos.height=_1f.outerHeight(); +pos.top=parseInt(_22.css("top"))||0; +pos.left=_22.outerWidth()-_23.width(); +pos.width=_23.width(); +pos.height=_22.outerHeight(); } } } } -_21.css(pos); +_23.css(pos); $("
                  ").css({left:0,top:0,width:cc.width(),height:cc.height()}).appendTo(cc); },onResize:function(e){ if(dir=="north"||dir=="south"){ -var _25=$(">div.layout-split-proxy-v",_18); -_25.css("top",e.pageY-$(_18).offset().top-_25.height()/2); +var _27=_28(this); +$(this).resizable("options").maxHeight=_27; +var _29=$(">div.layout-split-proxy-v",_1a); +var top=dir=="north"?e.data.height-_29.height():$(_1a).height()-e.data.height; +_29.css("top",top); }else{ -var _25=$(">div.layout-split-proxy-h",_18); -_25.css("left",e.pageX-$(_18).offset().left-_25.width()/2); +var _2a=_28(this); +$(this).resizable("options").maxWidth=_2a; +var _29=$(">div.layout-split-proxy-h",_1a); +var _2b=dir=="west"?e.data.width-_29.width():$(_1a).width()-e.data.width; +_29.css("left",_2b); } return false; },onStopResize:function(e){ cc.children("div.layout-split-proxy-v,div.layout-split-proxy-h").hide(); pp.panel("resize",e.data); -_2(_18); +_2(_1a); _1=false; cc.find(">div.layout-mask").remove(); -}},_19)); +}},_1b)); +cc.layout("options").onAdd.call(_1a,dir); +function _28(p){ +var _2c="expand"+dir.substring(0,1).toUpperCase()+dir.substring(1); +var _2d=_1c["center"]; +var _2e=(dir=="north"||dir=="south")?"minHeight":"minWidth"; +var _2f=(dir=="north"||dir=="south")?"maxHeight":"maxWidth"; +var _30=(dir=="north"||dir=="south")?"_outerHeight":"_outerWidth"; +var _31=$.parser.parseValue(_2f,_1c[dir].panel("options")[_2f],$(_1a)); +var _32=$.parser.parseValue(_2e,_2d.panel("options")[_2e],$(_1a)); +var _33=_2d.panel("panel")[_30]()-_32; +if(_a(_1c[_2c])){ +_33+=_1c[_2c][_30]()-1; +}else{ +_33+=$(p)[_30](); } -}; -function _26(_27,_28){ -var _29=$.data(_27,"layout").panels; -if(_29[_28].length){ -_29[_28].panel("destroy"); -_29[_28]=$(); -var _2a="expand"+_28.substring(0,1).toUpperCase()+_28.substring(1); -if(_29[_2a]){ -_29[_2a].panel("destroy"); -_29[_2a]=undefined; +if(_33>_31){ +_33=_31; } +return _33; +}; +}; +function _34(_35,_36){ +var _37=$.data(_35,"layout").panels; +if(_37[_36].length){ +_37[_36].panel("destroy"); +_37[_36]=$(); +var _38="expand"+_36.substring(0,1).toUpperCase()+_36.substring(1); +if(_37[_38]){ +_37[_38].panel("destroy"); +_37[_38]=undefined; +} +$(_35).layout("options").onRemove.call(_35,_36); } }; -function _2b(_2c,_2d,_2e){ -if(_2e==undefined){ -_2e="normal"; -} -var _2f=$.data(_2c,"layout").panels; -var p=_2f[_2d]; -var _30=p.panel("options"); -if(_30.onBeforeCollapse.call(p)==false){ +function _39(_3a,_3b,_3c){ +if(_3c==undefined){ +_3c="normal"; +} +var _3d=$.data(_3a,"layout").panels; +var p=_3d[_3b]; +var _3e=p.panel("options"); +if(_3e.onBeforeCollapse.call(p)==false){ return; } -var _31="expand"+_2d.substring(0,1).toUpperCase()+_2d.substring(1); -if(!_2f[_31]){ -_2f[_31]=_32(_2d); -_2f[_31].panel("panel").bind("click",function(){ +var _3f="expand"+_3b.substring(0,1).toUpperCase()+_3b.substring(1); +if(!_3d[_3f]){ +_3d[_3f]=_40(_3b); +var ep=_3d[_3f].panel("panel"); +if(!_3e.expandMode){ +ep.css("cursor","default"); +}else{ +ep.bind("click",function(){ +if(_3e.expandMode=="dock"){ +_4f(_3a,_3b); +}else{ p.panel("expand",false).panel("open"); -var _33=_34(); -p.panel("resize",_33.collapse); -p.panel("panel").animate(_33.expand,function(){ -$(this).unbind(".layout").bind("mouseleave.layout",{region:_2d},function(e){ +var _41=_42(); +p.panel("resize",_41.collapse); +p.panel("panel").animate(_41.expand,function(){ +$(this).unbind(".layout").bind("mouseleave.layout",{region:_3b},function(e){ if(_1==true){ return; } if($("body>div.combo-p>div.combo-panel:visible").length){ return; } -_2b(_2c,e.data.region); +_39(_3a,e.data.region); }); +$(_3a).layout("options").onExpand.call(_3a,_3b); }); +} return false; }); } -var _35=_34(); -if(!_a(_2f[_31])){ -_2f.center.panel("resize",_35.resizeC); } -p.panel("panel").animate(_35.collapse,_2e,function(){ +var _43=_42(); +if(!_a(_3d[_3f])){ +_3d.center.panel("resize",_43.resizeC); +} +p.panel("panel").animate(_43.collapse,_3c,function(){ p.panel("collapse",false).panel("close"); -_2f[_31].panel("open").panel("resize",_35.expandP); +_3d[_3f].panel("open").panel("resize",_43.expandP); $(this).unbind(".layout"); +$(_3a).layout("options").onCollapse.call(_3a,_3b); }); -function _32(dir){ -var _36; -if(dir=="east"){ -_36="layout-button-left"; -}else{ -if(dir=="west"){ -_36="layout-button-right"; -}else{ -if(dir=="north"){ -_36="layout-button-down"; -}else{ -if(dir=="south"){ -_36="layout-button-up"; -} -} -} -} -var p=$("
                  ").appendTo(_2c); -p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",closed:true,minWidth:0,minHeight:0,doSize:false,tools:[{iconCls:_36,handler:function(){ -_3c(_2c,_2d); +function _40(dir){ +var _44={"east":"left","west":"right","north":"down","south":"up"}; +var _45=(_3e.region=="north"||_3e.region=="south"); +var _46="layout-button-"+_44[dir]; +var p=$("
                  ").appendTo(_3a); +p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",titleDirection:_3e.titleDirection,iconCls:(_3e.hideCollapsedContent?null:_3e.iconCls),closed:true,minWidth:0,minHeight:0,doSize:false,region:_3e.region,collapsedSize:_3e.collapsedSize,noheader:(!_45&&_3e.hideExpandTool),tools:((_45&&_3e.hideExpandTool)?null:[{iconCls:_46,handler:function(){ +_4f(_3a,_3b); return false; -}}]})); +}}]),onResize:function(){ +var _47=$(this).children(".layout-expand-title"); +if(_47.length){ +_47._outerWidth($(this).height()); +var _48=($(this).width()-Math.min(_47._outerWidth(),_47._outerHeight()))/2; +var top=Math.max(_47._outerWidth(),_47._outerHeight()); +if(_47.hasClass("layout-expand-title-down")){ +_48+=Math.min(_47._outerWidth(),_47._outerHeight()); +top=0; +} +_47.css({left:(_48+"px"),top:(top+"px")}); +} +}})); +if(!_3e.hideCollapsedContent){ +var _49=typeof _3e.collapsedContent=="function"?_3e.collapsedContent.call(p[0],_3e.title):_3e.collapsedContent; +_45?p.panel("setTitle",_49):p.html(_49); +} p.panel("panel").hover(function(){ $(this).addClass("layout-expand-over"); },function(){ @@ -272,80 +306,81 @@ $(this).removeClass("layout-expand-over"); }); return p; }; -function _34(){ -var cc=$(_2c); -var _37=_2f.center.panel("options"); -var _38=_30.collapsedSize; -if(_2d=="east"){ -var _39=p.panel("panel")._outerWidth(); -var _3a=_37.width+_39-_38; -if(_30.split||!_30.border){ -_3a++; -} -return {resizeC:{width:_3a},expand:{left:cc.width()-_39},expandP:{top:_37.top,left:cc.width()-_38,width:_38,height:_37.height},collapse:{left:cc.width(),top:_37.top,height:_37.height}}; +function _42(){ +var cc=$(_3a); +var _4a=_3d.center.panel("options"); +var _4b=_3e.collapsedSize; +if(_3b=="east"){ +var _4c=p.panel("panel")._outerWidth(); +var _4d=_4a.width+_4c-_4b; +if(_3e.split||!_3e.border){ +_4d++; +} +return {resizeC:{width:_4d},expand:{left:cc.width()-_4c},expandP:{top:_4a.top,left:cc.width()-_4b,width:_4b,height:_4a.height},collapse:{left:cc.width(),top:_4a.top,height:_4a.height}}; }else{ -if(_2d=="west"){ -var _39=p.panel("panel")._outerWidth(); -var _3a=_37.width+_39-_38; -if(_30.split||!_30.border){ -_3a++; +if(_3b=="west"){ +var _4c=p.panel("panel")._outerWidth(); +var _4d=_4a.width+_4c-_4b; +if(_3e.split||!_3e.border){ +_4d++; } -return {resizeC:{width:_3a,left:_38-1},expand:{left:0},expandP:{left:0,top:_37.top,width:_38,height:_37.height},collapse:{left:-_39,top:_37.top,height:_37.height}}; +return {resizeC:{width:_4d,left:_4b-1},expand:{left:0},expandP:{left:0,top:_4a.top,width:_4b,height:_4a.height},collapse:{left:-_4c,top:_4a.top,height:_4a.height}}; }else{ -if(_2d=="north"){ -var _3b=p.panel("panel")._outerHeight(); -var hh=_37.height; -if(!_a(_2f.expandNorth)){ -hh+=_3b-_38+((_30.split||!_30.border)?1:0); -} -_2f.east.add(_2f.west).add(_2f.expandEast).add(_2f.expandWest).panel("resize",{top:_38-1,height:hh}); -return {resizeC:{top:_38-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_38},collapse:{top:-_3b,width:cc.width()}}; +if(_3b=="north"){ +var _4e=p.panel("panel")._outerHeight(); +var hh=_4a.height; +if(!_a(_3d.expandNorth)){ +hh+=_4e-_4b+((_3e.split||!_3e.border)?1:0); +} +_3d.east.add(_3d.west).add(_3d.expandEast).add(_3d.expandWest).panel("resize",{top:_4b-1,height:hh}); +return {resizeC:{top:_4b-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_4b},collapse:{top:-_4e,width:cc.width()}}; }else{ -if(_2d=="south"){ -var _3b=p.panel("panel")._outerHeight(); -var hh=_37.height; -if(!_a(_2f.expandSouth)){ -hh+=_3b-_38+((_30.split||!_30.border)?1:0); +if(_3b=="south"){ +var _4e=p.panel("panel")._outerHeight(); +var hh=_4a.height; +if(!_a(_3d.expandSouth)){ +hh+=_4e-_4b+((_3e.split||!_3e.border)?1:0); } -_2f.east.add(_2f.west).add(_2f.expandEast).add(_2f.expandWest).panel("resize",{height:hh}); -return {resizeC:{height:hh},expand:{top:cc.height()-_3b},expandP:{top:cc.height()-_38,left:0,width:cc.width(),height:_38},collapse:{top:cc.height(),width:cc.width()}}; +_3d.east.add(_3d.west).add(_3d.expandEast).add(_3d.expandWest).panel("resize",{height:hh}); +return {resizeC:{height:hh},expand:{top:cc.height()-_4e},expandP:{top:cc.height()-_4b,left:0,width:cc.width(),height:_4b},collapse:{top:cc.height(),width:cc.width()}}; } } } } }; }; -function _3c(_3d,_3e){ -var _3f=$.data(_3d,"layout").panels; -var p=_3f[_3e]; -var _40=p.panel("options"); -if(_40.onBeforeExpand.call(p)==false){ +function _4f(_50,_51){ +var _52=$.data(_50,"layout").panels; +var p=_52[_51]; +var _53=p.panel("options"); +if(_53.onBeforeExpand.call(p)==false){ return; } -var _41="expand"+_3e.substring(0,1).toUpperCase()+_3e.substring(1); -if(_3f[_41]){ -_3f[_41].panel("close"); +var _54="expand"+_51.substring(0,1).toUpperCase()+_51.substring(1); +if(_52[_54]){ +_52[_54].panel("close"); p.panel("panel").stop(true,true); p.panel("expand",false).panel("open"); -var _42=_43(); -p.panel("resize",_42.collapse); -p.panel("panel").animate(_42.expand,function(){ -_2(_3d); +var _55=_56(); +p.panel("resize",_55.collapse); +p.panel("panel").animate(_55.expand,function(){ +_2(_50); +$(_50).layout("options").onExpand.call(_50,_51); }); } -function _43(){ -var cc=$(_3d); -var _44=_3f.center.panel("options"); -if(_3e=="east"&&_3f.expandEast){ -return {collapse:{left:cc.width(),top:_44.top,height:_44.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}}; +function _56(){ +var cc=$(_50); +var _57=_52.center.panel("options"); +if(_51=="east"&&_52.expandEast){ +return {collapse:{left:cc.width(),top:_57.top,height:_57.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}}; }else{ -if(_3e=="west"&&_3f.expandWest){ -return {collapse:{left:-p.panel("panel")._outerWidth(),top:_44.top,height:_44.height},expand:{left:0}}; +if(_51=="west"&&_52.expandWest){ +return {collapse:{left:-p.panel("panel")._outerWidth(),top:_57.top,height:_57.height},expand:{left:0}}; }else{ -if(_3e=="north"&&_3f.expandNorth){ +if(_51=="north"&&_52.expandNorth){ return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}}; }else{ -if(_3e=="south"&&_3f.expandSouth){ +if(_51=="south"&&_52.expandSouth){ return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.panel("panel")._outerHeight()}}; } } @@ -363,77 +398,121 @@ return pp.panel("panel").is(":visible"); return false; } }; -function _45(_46){ -var _47=$.data(_46,"layout").panels; -if(_47.east.length&&_47.east.panel("options").collapsed){ -_2b(_46,"east",0); -} -if(_47.west.length&&_47.west.panel("options").collapsed){ -_2b(_46,"west",0); -} -if(_47.north.length&&_47.north.panel("options").collapsed){ -_2b(_46,"north",0); -} -if(_47.south.length&&_47.south.panel("options").collapsed){ -_2b(_46,"south",0); +function _58(_59){ +var _5a=$.data(_59,"layout"); +var _5b=_5a.options; +var _5c=_5a.panels; +var _5d=_5b.onCollapse; +_5b.onCollapse=function(){ +}; +_5e("east"); +_5e("west"); +_5e("north"); +_5e("south"); +_5b.onCollapse=_5d; +function _5e(_5f){ +var p=_5c[_5f]; +if(p.length&&p.panel("options").collapsed){ +_39(_59,_5f,0); } }; -$.fn.layout=function(_48,_49){ -if(typeof _48=="string"){ -return $.fn.layout.methods[_48](this,_49); +}; +function _60(_61,_62,_63){ +var p=$(_61).layout("panel",_62); +p.panel("options").split=_63; +var cls="layout-split-"+_62; +var _64=p.panel("panel").removeClass(cls); +if(_63){ +_64.addClass(cls); +} +_64.resizable({disabled:(!_63)}); +_2(_61); +}; +$.fn.layout=function(_65,_66){ +if(typeof _65=="string"){ +return $.fn.layout.methods[_65](this,_66); } -_48=_48||{}; +_65=_65||{}; return this.each(function(){ -var _4a=$.data(this,"layout"); -if(_4a){ -$.extend(_4a.options,_48); +var _67=$.data(this,"layout"); +if(_67){ +$.extend(_67.options,_65); }else{ -var _4b=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_48); -$.data(this,"layout",{options:_4b,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}}); +var _68=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_65); +$.data(this,"layout",{options:_68,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}}); _12(this); } _2(this); -_45(this); +_58(this); }); }; $.fn.layout.methods={options:function(jq){ return $.data(jq[0],"layout").options; -},resize:function(jq,_4c){ +},resize:function(jq,_69){ return jq.each(function(){ -_2(this,_4c); +_2(this,_69); }); -},panel:function(jq,_4d){ -return $.data(jq[0],"layout").panels[_4d]; -},collapse:function(jq,_4e){ +},panel:function(jq,_6a){ +return $.data(jq[0],"layout").panels[_6a]; +},collapse:function(jq,_6b){ return jq.each(function(){ -_2b(this,_4e); +_39(this,_6b); }); -},expand:function(jq,_4f){ +},expand:function(jq,_6c){ return jq.each(function(){ -_3c(this,_4f); +_4f(this,_6c); }); -},add:function(jq,_50){ +},add:function(jq,_6d){ return jq.each(function(){ -_17(this,_50); +_19(this,_6d); _2(this); -if($(this).layout("panel",_50.region).panel("options").collapsed){ -_2b(this,_50.region,0); +if($(this).layout("panel",_6d.region).panel("options").collapsed){ +_39(this,_6d.region,0); } }); -},remove:function(jq,_51){ +},remove:function(jq,_6e){ return jq.each(function(){ -_26(this,_51); +_34(this,_6e); _2(this); }); +},split:function(jq,_6f){ +return jq.each(function(){ +_60(this,_6f,true); +}); +},unsplit:function(jq,_70){ +return jq.each(function(){ +_60(this,_70,false); +}); }}; -$.fn.layout.parseOptions=function(_52){ -return $.extend({},$.parser.parseOptions(_52,[{fit:"boolean"}])); +$.fn.layout.parseOptions=function(_71){ +return $.extend({},$.parser.parseOptions(_71,[{fit:"boolean"}])); }; -$.fn.layout.defaults={fit:false}; -$.fn.layout.parsePanelOptions=function(_53){ -var t=$(_53); -return $.extend({},$.fn.panel.parseOptions(_53),$.parser.parseOptions(_53,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}])); +$.fn.layout.defaults={fit:false,onExpand:function(_72){ +},onCollapse:function(_73){ +},onAdd:function(_74){ +},onRemove:function(_75){ +}}; +$.fn.layout.parsePanelOptions=function(_76){ +var t=$(_76); +return $.extend({},$.fn.panel.parseOptions(_76),$.parser.parseOptions(_76,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}])); }; -$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapsedSize:28,minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000}); +$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapsedSize:28,expandMode:"float",hideExpandTool:false,hideCollapsedContent:true,collapsedContent:function(_77){ +var p=$(this); +var _78=p.panel("options"); +if(_78.region=="north"||_78.region=="south"){ +return _77; +} +var cc=[]; +if(_78.iconCls){ +cc.push("
                  "); +} +cc.push("
                  "); +cc.push(_77); +cc.push("
                  "); +return cc.join(""); +},minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.linkbutton.js b/assets/js/easy-ui/plugins/jquery.linkbutton.js old mode 100755 new mode 100644 index d258e7dbba..74c1697de1 --- a/assets/js/easy-ui/plugins/jquery.linkbutton.js +++ b/assets/js/easy-ui/plugins/jquery.linkbutton.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -37,11 +37,14 @@ _8.remove(); function _b(_c){ var _d=$.data(_c,"linkbutton").options; var t=$(_c).empty(); -t.addClass("l-btn").removeClass("l-btn-plain l-btn-selected l-btn-plain-selected"); +t.addClass("l-btn").removeClass("l-btn-plain l-btn-selected l-btn-plain-selected l-btn-outline"); t.removeClass("l-btn-small l-btn-medium l-btn-large").addClass("l-btn-"+_d.size); if(_d.plain){ t.addClass("l-btn-plain"); } +if(_d.outline){ +t.addClass("l-btn-outline"); +} if(_d.selected){ t.addClass(_d.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); } @@ -108,7 +111,7 @@ _17.disabled=true; var _18=$(_14).attr("href"); if(_18){ _16.href=_18; -$(_14).attr("href","javascript:void(0)"); +$(_14).attr("href","javascript:;"); } if(_14.onclick){ _16.onclick=_14.onclick; @@ -173,9 +176,9 @@ _f(this,false); }}; $.fn.linkbutton.parseOptions=function(_1e){ var t=$(_1e); -return $.extend({},$.parser.parseOptions(_1e,["id","iconCls","iconAlign","group","size",{plain:"boolean",toggle:"boolean",selected:"boolean"}]),{disabled:(t.attr("disabled")?true:undefined),text:$.trim(t.html()),iconCls:(t.attr("icon")||t.attr("iconCls"))}); +return $.extend({},$.parser.parseOptions(_1e,["id","iconCls","iconAlign","group","size","text",{plain:"boolean",toggle:"boolean",selected:"boolean",outline:"boolean"}]),{disabled:(t.attr("disabled")?true:undefined),text:($.trim(t.html())||undefined),iconCls:(t.attr("icon")||t.attr("iconCls"))}); }; -$.fn.linkbutton.defaults={id:null,disabled:false,toggle:false,selected:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){ +$.fn.linkbutton.defaults={id:null,disabled:false,toggle:false,selected:false,outline:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.menu.js b/assets/js/easy-ui/plugins/jquery.menu.js old mode 100755 new mode 100644 index 83744d30d1..b132a8c9b8 --- a/assets/js/easy-ui/plugins/jquery.menu.js +++ b/assets/js/easy-ui/plugins/jquery.menu.js @@ -1,233 +1,284 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ -function _1(_2){ -$(_2).appendTo("body"); -$(_2).addClass("menu-top"); +$(function(){ $(document).unbind(".menu").bind("mousedown.menu",function(e){ var m=$(e.target).closest("div.menu,div.combo-p"); if(m.length){ return; } -$("body>div.menu-top:visible").menu("hide"); +$("body>div.menu-top:visible").not(".menu-inline").menu("hide"); +_1($("body>div.menu:visible").not(".menu-inline")); }); -var _3=_4($(_2)); -for(var i=0;i<_3.length;i++){ -_5(_3[i]); -} -function _4(_6){ -var _7=[]; -_6.addClass("menu"); -_7.push(_6); -if(!_6.hasClass("menu-content")){ -_6.children("div").each(function(){ -var _8=$(this).children("div"); -if(_8.length){ -_8.insertAfter(_2); -this.submenu=_8; -var mm=_4(_8); -_7=_7.concat(mm); +}); +function _2(_3){ +var _4=$.data(_3,"menu").options; +$(_3).addClass("menu-top"); +_4.inline?$(_3).addClass("menu-inline"):$(_3).appendTo("body"); +$(_3).bind("_resize",function(e,_5){ +if($(this).hasClass("easyui-fluid")||_5){ +$(_3).menu("resize",_3); +} +return false; +}); +var _6=_7($(_3)); +for(var i=0;i<_6.length;i++){ +_b(_3,_6[i]); +} +function _7(_8){ +var _9=[]; +_8.addClass("menu"); +_9.push(_8); +if(!_8.hasClass("menu-content")){ +_8.children("div").each(function(){ +var _a=$(this).children("div"); +if(_a.length){ +_a.appendTo("body"); +this.submenu=_a; +var mm=_7(_a); +_9=_9.concat(mm); } }); } -return _7; +return _9; +}; +}; +function _b(_c,_d){ +var _e=$(_d).addClass("menu"); +if(!_e.data("menu")){ +_e.data("menu",{options:$.parser.parseOptions(_e[0],["width","height"])}); +} +if(!_e.hasClass("menu-content")){ +_e.children("div").each(function(){ +_f(_c,this); +}); +$("
                  ").prependTo(_e); +} +_10(_c,_e); +if(!_e.hasClass("menu-inline")){ +_e.hide(); +} +_11(_c,_e); }; -function _5(_9){ -var wh=$.parser.parseOptions(_9[0],["width","height"]); -_9[0].originalHeight=wh.height||0; -if(_9.hasClass("menu-content")){ -_9[0].originalWidth=wh.width||_9._outerWidth(); +function _f(_12,div,_13){ +var _14=$(div); +var _15=$.extend({},$.parser.parseOptions(_14[0],["id","name","iconCls","href",{separator:"boolean"}]),{disabled:(_14.attr("disabled")?true:undefined),text:$.trim(_14.html()),onclick:_14[0].onclick},_13||{}); +_15.onclick=_15.onclick||_15.handler||null; +_14.data("menuitem",{options:_15}); +if(_15.separator){ +_14.addClass("menu-sep"); +} +if(!_14.hasClass("menu-sep")){ +_14.addClass("menu-item"); +_14.empty().append($("
                  ").html(_15.text)); +if(_15.iconCls){ +$("
                  ").addClass(_15.iconCls).appendTo(_14); +} +if(_15.id){ +_14.attr("id",_15.id); +} +if(_15.onclick){ +if(typeof _15.onclick=="string"){ +_14.attr("onclick",_15.onclick); }else{ -_9[0].originalWidth=wh.width||0; -_9.children("div").each(function(){ -var _a=$(this); -var _b=$.extend({},$.parser.parseOptions(this,["name","iconCls","href",{separator:"boolean"}]),{disabled:(_a.attr("disabled")?true:undefined)}); -if(_b.separator){ -_a.addClass("menu-sep"); +_14[0].onclick=eval(_15.onclick); } -if(!_a.hasClass("menu-sep")){ -_a[0].itemName=_b.name||""; -_a[0].itemHref=_b.href||""; -var _c=_a.addClass("menu-item").html(); -_a.empty().append($("
                  ").html(_c)); -if(_b.iconCls){ -$("
                  ").addClass(_b.iconCls).appendTo(_a); } -if(_b.disabled){ -_d(_2,_a[0],true); +if(_15.disabled){ +_16(_12,_14[0],true); } -if(_a[0].submenu){ -$("
                  ").appendTo(_a); +if(_14[0].submenu){ +$("
                  ").appendTo(_14); } -_e(_2,_a); } +}; +function _10(_17,_18){ +var _19=$.data(_17,"menu").options; +var _1a=_18.attr("style")||""; +var _1b=_18.is(":visible"); +_18.css({display:"block",left:-10000,height:"auto",overflow:"hidden"}); +_18.find(".menu-item").each(function(){ +$(this)._outerHeight(_19.itemHeight); +$(this).find(".menu-text").css({height:(_19.itemHeight-2)+"px",lineHeight:(_19.itemHeight-2)+"px"}); }); -$("
                  ").prependTo(_9); +_18.removeClass("menu-noline").addClass(_19.noline?"menu-noline":""); +var _1c=_18.data("menu").options; +var _1d=_1c.width; +var _1e=_1c.height; +if(isNaN(parseInt(_1d))){ +_1d=0; +_18.find("div.menu-text").each(function(){ +if(_1d<$(this).outerWidth()){ +_1d=$(this).outerWidth(); } -_f(_2,_9); -_9.hide(); -_10(_2,_9); -}; -}; -function _f(_11,_12){ -var _13=$.data(_11,"menu").options; -var _14=_12.attr("style")||""; -_12.css({display:"block",left:-10000,height:"auto",overflow:"hidden"}); -var el=_12[0]; -var _15=el.originalWidth||0; -if(!_15){ -_15=0; -_12.find("div.menu-text").each(function(){ -if(_15<$(this)._outerWidth()){ -_15=$(this)._outerWidth(); -} -$(this).closest("div.menu-item")._outerHeight($(this)._outerHeight()+2); }); -_15+=40; -} -_15=Math.max(_15,_13.minWidth); -var _16=el.originalHeight||0; -if(!_16){ -_16=_12.outerHeight(); -if(_12.hasClass("menu-top")&&_13.alignTo){ -var at=$(_13.alignTo); +_1d=_1d?_1d+40:""; +} +var _1f=_18.outerHeight(); +if(isNaN(parseInt(_1e))){ +_1e=_1f; +if(_18.hasClass("menu-top")&&_19.alignTo){ +var at=$(_19.alignTo); var h1=at.offset().top-$(document).scrollTop(); var h2=$(window)._outerHeight()+$(document).scrollTop()-at.offset().top-at._outerHeight(); -_16=Math.min(_16,Math.max(h1,h2)); -}else{ -if(_16>$(window)._outerHeight()){ -_16=$(window).height(); -_14+=";overflow:auto"; +_1e=Math.min(_1e,Math.max(h1,h2)); }else{ -_14+=";overflow:hidden"; +if(_1e>$(window)._outerHeight()){ +_1e=$(window).height(); } } } -var _17=Math.max(el.originalHeight,_12.outerHeight())-2; -_12._outerWidth(_15)._outerHeight(_16); -_12.children("div.menu-line")._outerHeight(_17); -_14+=";width:"+el.style.width+";height:"+el.style.height; -_12.attr("style",_14); -}; -function _10(_18,_19){ -var _1a=$.data(_18,"menu"); -_19.unbind(".menu").bind("mouseenter.menu",function(){ -if(_1a.timer){ -clearTimeout(_1a.timer); -_1a.timer=null; -} -}).bind("mouseleave.menu",function(){ -if(_1a.options.hideOnUnhover){ -_1a.timer=setTimeout(function(){ -_1b(_18); -},_1a.options.duration); +_18.attr("style",_1a); +_18.show(); +_18._size($.extend({},_1c,{width:_1d,height:_1e,minWidth:_1c.minWidth||_19.minWidth,maxWidth:_1c.maxWidth||_19.maxWidth})); +_18.find(".easyui-fluid").triggerHandler("_resize",[true]); +_18.css("overflow",_18.outerHeight()<_1f?"auto":"hidden"); +_18.children("div.menu-line")._outerHeight(_1f-2); +if(!_1b){ +_18.hide(); } -}); }; -function _e(_1c,_1d){ -if(!_1d.hasClass("menu-item")){ -return; +function _11(_20,_21){ +var _22=$.data(_20,"menu"); +var _23=_22.options; +_21.unbind(".menu"); +for(var _24 in _23.events){ +_21.bind(_24+".menu",{target:_20},_23.events[_24]); } -_1d.unbind(".menu"); -_1d.bind("click.menu",function(){ -if($(this).hasClass("menu-item-disabled")){ -return; -} -if(!this.submenu){ -_1b(_1c); -var _1e=this.itemHref; -if(_1e){ -location.href=_1e; +}; +function _25(e){ +var _26=e.data.target; +var _27=$.data(_26,"menu"); +if(_27.timer){ +clearTimeout(_27.timer); +_27.timer=null; } +}; +function _28(e){ +var _29=e.data.target; +var _2a=$.data(_29,"menu"); +if(_2a.options.hideOnUnhover){ +_2a.timer=setTimeout(function(){ +_2b(_29,$(_29).hasClass("menu-inline")); +},_2a.options.duration); } -var _1f=$(_1c).menu("getItem",this); -$.data(_1c,"menu").options.onClick.call(_1c,_1f); -}).bind("mouseenter.menu",function(e){ -_1d.siblings().each(function(){ +}; +function _2c(e){ +var _2d=e.data.target; +var _2e=$(e.target).closest(".menu-item"); +if(_2e.length){ +_2e.siblings().each(function(){ if(this.submenu){ -_22(this.submenu); +_1(this.submenu); } $(this).removeClass("menu-active"); }); -_1d.addClass("menu-active"); -if($(this).hasClass("menu-item-disabled")){ -_1d.addClass("menu-active-disabled"); +_2e.addClass("menu-active"); +if(_2e.hasClass("menu-item-disabled")){ +_2e.addClass("menu-active-disabled"); return; } -var _20=_1d[0].submenu; -if(_20){ -$(_1c).menu("show",{menu:_20,parent:_1d}); +var _2f=_2e[0].submenu; +if(_2f){ +$(_2d).menu("show",{menu:_2f,parent:_2e}); +} } -}).bind("mouseleave.menu",function(e){ -_1d.removeClass("menu-active menu-active-disabled"); -var _21=_1d[0].submenu; -if(_21){ -if(e.pageX>=parseInt(_21.css("left"))){ -_1d.addClass("menu-active"); +}; +function _30(e){ +var _31=$(e.target).closest(".menu-item"); +if(_31.length){ +_31.removeClass("menu-active menu-active-disabled"); +var _32=_31[0].submenu; +if(_32){ +if(e.pageX>=parseInt(_32.css("left"))){ +_31.addClass("menu-active"); }else{ -_22(_21); +_1(_32); } }else{ -_1d.removeClass("menu-active"); +_31.removeClass("menu-active"); +} } -}); }; -function _1b(_23){ -var _24=$.data(_23,"menu"); -if(_24){ -if($(_23).is(":visible")){ -_22($(_23)); -_24.options.onHide.call(_23); +function _33(e){ +var _34=e.data.target; +var _35=$(e.target).closest(".menu-item"); +if(_35.length){ +var _36=$(_34).data("menu").options; +var _37=_35.data("menuitem").options; +if(_37.disabled){ +return; +} +if(!_35[0].submenu){ +_2b(_34,_36.inline); +if(_37.href){ +location.href=_37.href; +} +} +_35.trigger("mouseenter"); +_36.onClick.call(_34,$(_34).menu("getItem",_35[0])); +} +}; +function _2b(_38,_39){ +var _3a=$.data(_38,"menu"); +if(_3a){ +if($(_38).is(":visible")){ +_1($(_38)); +if(_39){ +$(_38).show(); +}else{ +_3a.options.onHide.call(_38); +} } } return false; }; -function _25(_26,_27){ -var _28,top; -_27=_27||{}; -var _29=$(_27.menu||_26); -$(_26).menu("resize",_29[0]); -if(_29.hasClass("menu-top")){ -var _2a=$.data(_26,"menu").options; -$.extend(_2a,_27); -_28=_2a.left; -top=_2a.top; -if(_2a.alignTo){ -var at=$(_2a.alignTo); -_28=at.offset().left; +function _3b(_3c,_3d){ +_3d=_3d||{}; +var _3e,top; +var _3f=$.data(_3c,"menu").options; +var _40=$(_3d.menu||_3c); +$(_3c).menu("resize",_40[0]); +if(_40.hasClass("menu-top")){ +$.extend(_3f,_3d); +_3e=_3f.left; +top=_3f.top; +if(_3f.alignTo){ +var at=$(_3f.alignTo); +_3e=at.offset().left; top=at.offset().top+at._outerHeight(); -if(_2a.align=="right"){ -_28+=at.outerWidth()-_29.outerWidth(); +if(_3f.align=="right"){ +_3e+=at.outerWidth()-_40.outerWidth(); } } -if(_28+_29.outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){ -_28=$(window)._outerWidth()+$(document).scrollLeft()-_29.outerWidth()-5; +if(_3e+_40.outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){ +_3e=$(window)._outerWidth()+$(document).scrollLeft()-_40.outerWidth()-5; } -if(_28<0){ -_28=0; +if(_3e<0){ +_3e=0; } -top=_2b(top,_2a.alignTo); +top=_41(top,_3f.alignTo); }else{ -var _2c=_27.parent; -_28=_2c.offset().left+_2c.outerWidth()-2; -if(_28+_29.outerWidth()+5>$(window)._outerWidth()+$(document).scrollLeft()){ -_28=_2c.offset().left-_29.outerWidth()+2; +var _42=_3d.parent; +_3e=_42.offset().left+_42.outerWidth()-2; +if(_3e+_40.outerWidth()+5>$(window)._outerWidth()+$(document).scrollLeft()){ +_3e=_42.offset().left-_40.outerWidth()+2; } -top=_2b(_2c.offset().top-3); +top=_41(_42.offset().top-3); } -function _2b(top,_2d){ -if(top+_29.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ -if(_2d){ -top=$(_2d).offset().top-_29._outerHeight(); +function _41(top,_43){ +if(top+_40.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ +if(_43){ +top=$(_43).offset().top-_40._outerHeight(); }else{ -top=$(window)._outerHeight()+$(document).scrollTop()-_29.outerHeight(); +top=$(window)._outerHeight()+$(document).scrollTop()-_40.outerHeight(); } } if(top<0){ @@ -235,30 +286,29 @@ top=0; } return top; }; -_29.css({left:_28,top:top}); -_29.show(0,function(){ -if(!_29[0].shadow){ -_29[0].shadow=$("
                  ").insertAfter(_29); +_40.css(_3f.position.call(_3c,_40[0],_3e,top)); +_40.show(0,function(){ +if(!_40[0].shadow){ +_40[0].shadow=$("
                  ").insertAfter(_40); } -_29[0].shadow.css({display:"block",zIndex:$.fn.menu.defaults.zIndex++,left:_29.css("left"),top:_29.css("top"),width:_29.outerWidth(),height:_29.outerHeight()}); -_29.css("z-index",$.fn.menu.defaults.zIndex++); -if(_29.hasClass("menu-top")){ -$.data(_29[0],"menu").options.onShow.call(_29[0]); +_40[0].shadow.css({display:(_40.hasClass("menu-inline")?"none":"block"),zIndex:$.fn.menu.defaults.zIndex++,left:_40.css("left"),top:_40.css("top"),width:_40.outerWidth(),height:_40.outerHeight()}); +_40.css("z-index",$.fn.menu.defaults.zIndex++); +if(_40.hasClass("menu-top")){ +_3f.onShow.call(_3c); } }); }; -function _22(_2e){ -if(!_2e){ -return; -} -_2f(_2e); -_2e.find("div.menu-item").each(function(){ +function _1(_44){ +if(_44&&_44.length){ +_45(_44); +_44.find("div.menu-item").each(function(){ if(this.submenu){ -_22(this.submenu); +_1(this.submenu); } $(this).removeClass("menu-active"); }); -function _2f(m){ +} +function _45(m){ m.stop(true,true); if(m[0].shadow){ m[0].shadow.hide(); @@ -266,220 +316,176 @@ m[0].shadow.hide(); m.hide(); }; }; -function _30(_31,_32){ -var _33=null; +function _46(_47,_48){ +var _49=null; var tmp=$("
                  "); -function _34(_35){ -_35.children("div.menu-item").each(function(){ -var _36=$(_31).menu("getItem",this); -var s=tmp.empty().html(_36.text).text(); -if(_32==$.trim(s)){ -_33=_36; +function _4a(_4b){ +_4b.children("div.menu-item").each(function(){ +var _4c=$(_47).menu("getItem",this); +var s=tmp.empty().html(_4c.text).text(); +if(_48==$.trim(s)){ +_49=_4c; }else{ -if(this.submenu&&!_33){ -_34(this.submenu); +if(this.submenu&&!_49){ +_4a(this.submenu); } } }); }; -_34($(_31)); +_4a($(_47)); tmp.remove(); -return _33; +return _49; }; -function _d(_37,_38,_39){ -var t=$(_38); -if(!t.hasClass("menu-item")){ -return; -} -if(_39){ +function _16(_4d,_4e,_4f){ +var t=$(_4e); +if(t.hasClass("menu-item")){ +var _50=t.data("menuitem").options; +_50.disabled=_4f; +if(_4f){ t.addClass("menu-item-disabled"); -if(_38.onclick){ -_38.onclick1=_38.onclick; -_38.onclick=null; -} +t[0].onclick=null; }else{ t.removeClass("menu-item-disabled"); -if(_38.onclick1){ -_38.onclick=_38.onclick1; -_38.onclick1=null; +t[0].onclick=_50.onclick; } } }; -function _3a(_3b,_3c){ -var _3d=$(_3b); -if(_3c.parent){ -if(!_3c.parent.submenu){ -var _3e=$("
                  ").appendTo("body"); -_3e.hide(); -_3c.parent.submenu=_3e; -$("
                  ").appendTo(_3c.parent); -} -_3d=_3c.parent.submenu; -} -if(_3c.separator){ -var _3f=$("
                  ").appendTo(_3d); -}else{ -var _3f=$("
                  ").appendTo(_3d); -$("
                  ").html(_3c.text).appendTo(_3f); -} -if(_3c.iconCls){ -$("
                  ").addClass(_3c.iconCls).appendTo(_3f); -} -if(_3c.id){ -_3f.attr("id",_3c.id); -} -if(_3c.name){ -_3f[0].itemName=_3c.name; -} -if(_3c.href){ -_3f[0].itemHref=_3c.href; -} -if(_3c.onclick){ -if(typeof _3c.onclick=="string"){ -_3f.attr("onclick",_3c.onclick); -}else{ -_3f[0].onclick=eval(_3c.onclick); -} -} -if(_3c.handler){ -_3f[0].onclick=eval(_3c.handler); -} -if(_3c.disabled){ -_d(_3b,_3f[0],true); -} -_e(_3b,_3f); -_10(_3b,_3d); -_f(_3b,_3d); +function _51(_52,_53){ +var _54=$.data(_52,"menu").options; +var _55=$(_52); +if(_53.parent){ +if(!_53.parent.submenu){ +var _56=$("
                  ").appendTo("body"); +_53.parent.submenu=_56; +$("
                  ").appendTo(_53.parent); +_b(_52,_56); +} +_55=_53.parent.submenu; +} +var div=$("
                  ").appendTo(_55); +_f(_52,div,_53); }; -function _40(_41,_42){ -function _43(el){ +function _57(_58,_59){ +function _5a(el){ if(el.submenu){ el.submenu.children("div.menu-item").each(function(){ -_43(this); +_5a(this); }); -var _44=el.submenu[0].shadow; -if(_44){ -_44.remove(); +var _5b=el.submenu[0].shadow; +if(_5b){ +_5b.remove(); } el.submenu.remove(); } $(el).remove(); }; -var _45=$(_42).parent(); -_43(_42); -_f(_41,_45); +_5a(_59); }; -function _46(_47,_48,_49){ -var _4a=$(_48).parent(); -if(_49){ -$(_48).show(); +function _5c(_5d,_5e,_5f){ +var _60=$(_5e).parent(); +if(_5f){ +$(_5e).show(); }else{ -$(_48).hide(); +$(_5e).hide(); } -_f(_47,_4a); +_10(_5d,_60); }; -function _4b(_4c){ -$(_4c).children("div.menu-item").each(function(){ -_40(_4c,this); +function _61(_62){ +$(_62).children("div.menu-item").each(function(){ +_57(_62,this); }); -if(_4c.shadow){ -_4c.shadow.remove(); +if(_62.shadow){ +_62.shadow.remove(); } -$(_4c).remove(); +$(_62).remove(); }; -$.fn.menu=function(_4d,_4e){ -if(typeof _4d=="string"){ -return $.fn.menu.methods[_4d](this,_4e); +$.fn.menu=function(_63,_64){ +if(typeof _63=="string"){ +return $.fn.menu.methods[_63](this,_64); } -_4d=_4d||{}; +_63=_63||{}; return this.each(function(){ -var _4f=$.data(this,"menu"); -if(_4f){ -$.extend(_4f.options,_4d); +var _65=$.data(this,"menu"); +if(_65){ +$.extend(_65.options,_63); }else{ -_4f=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_4d)}); -_1(this); +_65=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_63)}); +_2(this); } -$(this).css({left:_4f.options.left,top:_4f.options.top}); +$(this).css({left:_65.options.left,top:_65.options.top}); }); }; $.fn.menu.methods={options:function(jq){ return $.data(jq[0],"menu").options; },show:function(jq,pos){ return jq.each(function(){ -_25(this,pos); +_3b(this,pos); }); },hide:function(jq){ return jq.each(function(){ -_1b(this); +_2b(this); }); },destroy:function(jq){ return jq.each(function(){ -_4b(this); +_61(this); }); -},setText:function(jq,_50){ +},setText:function(jq,_66){ return jq.each(function(){ -$(_50.target).children("div.menu-text").html(_50.text); +var _67=$(_66.target).data("menuitem").options; +_67.text=_66.text; +$(_66.target).children("div.menu-text").html(_66.text); }); -},setIcon:function(jq,_51){ +},setIcon:function(jq,_68){ return jq.each(function(){ -$(_51.target).children("div.menu-icon").remove(); -if(_51.iconCls){ -$("
                  ").addClass(_51.iconCls).appendTo(_51.target); +var _69=$(_68.target).data("menuitem").options; +_69.iconCls=_68.iconCls; +$(_68.target).children("div.menu-icon").remove(); +if(_68.iconCls){ +$("
                  ").addClass(_68.iconCls).appendTo(_68.target); } }); -},getItem:function(jq,_52){ -var t=$(_52); -var _53={target:_52,id:t.attr("id"),text:$.trim(t.children("div.menu-text").html()),disabled:t.hasClass("menu-item-disabled"),name:_52.itemName,href:_52.itemHref,onclick:_52.onclick}; -var _54=t.children("div.menu-icon"); -if(_54.length){ -var cc=[]; -var aa=_54.attr("class").split(" "); -for(var i=0;i").addClass(_3.cls.arrow).appendTo(_5); $("").addClass("m-btn-line").appendTo(_5); +} +$(_2).menubutton("resize"); if(_3.menu){ $(_3.menu).menu({duration:_3.duration}); var _6=$(_3.menu).menu("options"); @@ -118,8 +121,8 @@ $(this).remove(); }}; $.fn.menubutton.parseOptions=function(_1d){ var t=$(_1d); -return $.extend({},$.fn.linkbutton.parseOptions(_1d),$.parser.parseOptions(_1d,["menu",{plain:"boolean",duration:"number"}])); +return $.extend({},$.fn.linkbutton.parseOptions(_1d),$.parser.parseOptions(_1d,["menu",{plain:"boolean",hasDownArrow:"boolean",duration:"number"}])); }; -$.fn.menubutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,menu:null,menuAlign:"left",duration:100,cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}}); +$.fn.menubutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,hasDownArrow:true,menu:null,menuAlign:"left",duration:100,cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.messager.js b/assets/js/easy-ui/plugins/jquery.messager.js old mode 100755 new mode 100644 index a4d186a25e..b4d6f54344 --- a/assets/js/easy-ui/plugins/jquery.messager.js +++ b/assets/js/easy-ui/plugins/jquery.messager.js @@ -1,215 +1,187 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ -function _1(el,_2,_3,_4){ -var _5=$(el).window("window"); -if(!_5){ +function _1(){ +$(document).unbind(".messager").bind("keydown.messager",function(e){ +if(e.keyCode==27){ +$("body").children("div.messager-window").children("div.messager-body").each(function(){ +$(this).dialog("close"); +}); +}else{ +if(e.keyCode==9){ +var _2=$("body").children("div.messager-window"); +if(!_2.length){ return; } -switch(_2){ -case null: -_5.show(); -break; -case "slide": -_5.slideDown(_3); -break; -case "fade": -_5.fadeIn(_3); -break; -case "show": -_5.show(_3); -break; -} -var _6=null; -if(_4>0){ -_6=setTimeout(function(){ -_7(el,_2,_3); -},_4); -} -_5.hover(function(){ -if(_6){ -clearTimeout(_6); +var _3=_2.find(".messager-input,.messager-button .l-btn"); +for(var i=0;i<_3.length;i++){ +if($(_3[i]).is(":focus")){ +$(_3[i>=_3.length-1?0:i+1]).focus(); +return false; } -},function(){ -if(_4>0){ -_6=setTimeout(function(){ -_7(el,_2,_3); -},_4); } -}); -}; -function _7(el,_8,_9){ -if(el.locked==true){ -return; +}else{ +if(e.keyCode==13){ +var _4=$(e.target).closest("input.messager-input"); +if(_4.length){ +var _5=_4.closest(".messager-body"); +_6(_5,_4.val()); } -el.locked=true; -var _a=$(el).window("window"); -if(!_a){ -return; } -switch(_8){ -case null: -_a.hide(); -break; -case "slide": -_a.slideUp(_9); -break; -case "fade": -_a.fadeOut(_9); -break; -case "show": -_a.hide(_9); -break; } -setTimeout(function(){ -$(el).window("destroy"); -},_9); +} +}); }; -function _b(_c){ -var _d=$.extend({},$.fn.window.defaults,{collapsible:false,minimizable:false,maximizable:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},onBeforeOpen:function(){ -_1(this,_d.showType,_d.showSpeed,_d.timeout); -return false; -},onBeforeClose:function(){ -_7(this,_d.showType,_d.showSpeed); -return false; -}},{title:"",width:250,height:100,showType:"slide",showSpeed:600,msg:"",timeout:4000},_c); -_d.style.zIndex=$.fn.window.defaults.zIndex++; -var _e=$("
                  ").html(_d.msg).appendTo("body"); -_e.window(_d); -_e.window("window").css(_d.style); -_e.window("open"); -return _e; +function _7(){ +$(document).unbind(".messager"); }; -function _f(_10,_11,_12){ -var win=$("
                  ").appendTo("body"); -win.append(_11); -if(_12){ -var tb=$("
                  ").appendTo(win); -for(var _13 in _12){ -$("").attr("href","javascript:void(0)").text(_13).css("margin-left",10).bind("click",eval(_12[_13])).appendTo(tb).linkbutton(); +function _8(_9){ +var _a=$.extend({},$.messager.defaults,{modal:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},title:"",width:250,height:100,minHeight:0,showType:"slide",showSpeed:600,content:_9.msg,timeout:4000},_9); +var _b=$("
                  ").appendTo("body"); +_b.dialog($.extend({},_a,{noheader:(_a.title?false:true),openAnimation:(_a.showType),closeAnimation:(_a.showType=="show"?"hide":_a.showType),openDuration:_a.showSpeed,closeDuration:_a.showSpeed,onOpen:function(){ +_b.dialog("dialog").hover(function(){ +if(_a.timer){ +clearTimeout(_a.timer); } +},function(){ +_c(); +}); +_c(); +function _c(){ +if(_a.timeout>0){ +_a.timer=setTimeout(function(){ +if(_b.length&&_b.data("dialog")){ +_b.dialog("close"); } -win.window({title:_10,noheader:(_10?false:true),width:300,height:"auto",modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,onClose:function(){ -setTimeout(function(){ -win.window("destroy"); -},100); -}}); -win.window("window").addClass("messager-window"); -win.children("div.messager-button").children("a:first").focus(); -return win; -}; -$.messager={show:function(_14){ -return _b(_14); -},alert:function(_15,msg,_16,fn){ -var _17="
                  "+msg+"
                  "; -switch(_16){ -case "error": -_17="
                  "+_17; -break; -case "info": -_17="
                  "+_17; -break; -case "question": -_17="
                  "+_17; -break; -case "warning": -_17="
                  "+_17; -break; -} -_17+="
                  "; -var _18={}; -_18[$.messager.defaults.ok]=function(){ -win.window("close"); -if(fn){ -fn(); -return false; -} -}; -var win=_f(_15,_17,_18); -return win; -},confirm:function(_19,msg,fn){ -var _1a="
                  "+"
                  "+msg+"
                  "+"
                  "; -var _1b={}; -_1b[$.messager.defaults.ok]=function(){ -win.window("close"); -if(fn){ -fn(true); -return false; +},_a.timeout); } }; -_1b[$.messager.defaults.cancel]=function(){ -win.window("close"); -if(fn){ -fn(false); -return false; -} +if(_9.onOpen){ +_9.onOpen.call(this); +}else{ +_a.onOpen.call(this); +} +},onClose:function(){ +if(_a.timer){ +clearTimeout(_a.timer); +} +if(_9.onClose){ +_9.onClose.call(this); +}else{ +_a.onClose.call(this); +} +_b.dialog("destroy"); +}})); +_b.dialog("dialog").css(_a.style); +_b.dialog("open"); +return _b; }; -var win=_f(_19,_1a,_1b); -return win; -},prompt:function(_1c,msg,fn){ -var _1d="
                  "+"
                  "+msg+"
                  "+"
                  "+"
                  "+"
                  "; -var _1e={}; -_1e[$.messager.defaults.ok]=function(){ -win.window("close"); -if(fn){ -fn($(".messager-input",win).val()); -return false; +function _d(_e){ +_1(); +var _f=$("
                  ").appendTo("body"); +_f.dialog($.extend({},_e,{noheader:(_e.title?false:true),onClose:function(){ +_7(); +if(_e.onClose){ +_e.onClose.call(this); } +setTimeout(function(){ +_f.dialog("destroy"); +},100); +}})); +var win=_f.dialog("dialog").addClass("messager-window"); +win.find(".dialog-button").addClass("messager-button").find("a:first").focus(); +return _f; }; -_1e[$.messager.defaults.cancel]=function(){ -win.window("close"); -if(fn){ -fn(); -return false; -} +function _6(dlg,_10){ +dlg.dialog("close"); +dlg.dialog("options").fn(_10); }; -var win=_f(_1c,_1d,_1e); -win.children("input.messager-input").focus(); -return win; -},progress:function(_1f){ -var _20={bar:function(){ +$.messager={show:function(_11){ +return _8(_11); +},alert:function(_12,msg,_13,fn){ +var _14=typeof _12=="object"?_12:{title:_12,msg:msg,icon:_13,fn:fn}; +var cls=_14.icon?"messager-icon messager-"+_14.icon:""; +_14=$.extend({},$.messager.defaults,{content:"
                  "+"
                  "+_14.msg+"
                  "+"
                  "},_14); +if(!_14.buttons){ +_14.buttons=[{text:_14.ok,onClick:function(){ +_6(dlg); +}}]; +} +var dlg=_d(_14); +return dlg; +},confirm:function(_15,msg,fn){ +var _16=typeof _15=="object"?_15:{title:_15,msg:msg,fn:fn}; +_16=$.extend({},$.messager.defaults,{content:"
                  "+"
                  "+_16.msg+"
                  "+"
                  "},_16); +if(!_16.buttons){ +_16.buttons=[{text:_16.ok,onClick:function(){ +_6(dlg,true); +}},{text:_16.cancel,onClick:function(){ +_6(dlg,false); +}}]; +} +var dlg=_d(_16); +return dlg; +},prompt:function(_17,msg,fn){ +var _18=typeof _17=="object"?_17:{title:_17,msg:msg,fn:fn}; +_18=$.extend({},$.messager.defaults,{content:"
                  "+"
                  "+_18.msg+"
                  "+"
                  "+"
                  "+"
                  "},_18); +if(!_18.buttons){ +_18.buttons=[{text:_18.ok,onClick:function(){ +_6(dlg,dlg.find(".messager-input").val()); +}},{text:_18.cancel,onClick:function(){ +_6(dlg); +}}]; +} +var dlg=_d(_18); +dlg.find(".messager-input").focus(); +return dlg; +},progress:function(_19){ +var _1a={bar:function(){ return $("body>div.messager-window").find("div.messager-p-bar"); },close:function(){ -var win=$("body>div.messager-window>div.messager-body:has(div.messager-progress)"); -if(win.length){ -win.window("close"); +var dlg=$("body>div.messager-window>div.messager-body:has(div.messager-progress)"); +if(dlg.length){ +dlg.dialog("close"); } }}; -if(typeof _1f=="string"){ -var _21=_20[_1f]; -return _21(); -} -var _22=$.extend({title:"",msg:"",text:undefined,interval:300},_1f||{}); -var _23="
                  "; -var win=_f(_22.title,_23,null); -win.find("div.messager-p-msg").html(_22.msg); -var bar=win.find("div.messager-p-bar"); -bar.progressbar({text:_22.text}); -win.window({closable:false,onClose:function(){ +if(typeof _19=="string"){ +var _1b=_1a[_19]; +return _1b(); +} +_19=_19||{}; +var _1c=$.extend({},{title:"",minHeight:0,content:undefined,msg:"",text:undefined,interval:300},_19); +var dlg=_d($.extend({},$.messager.defaults,{content:"
                  "+_1c.msg+"
                  ",closable:false,doSize:false},_1c,{onClose:function(){ if(this.timer){ clearInterval(this.timer); } -$(this).window("destroy"); -}}); -if(_22.interval){ -win[0].timer=setInterval(function(){ +if(_19.onClose){ +_19.onClose.call(this); +}else{ +$.messager.defaults.onClose.call(this); +} +}})); +var bar=dlg.find("div.messager-p-bar"); +bar.progressbar({text:_1c.text}); +dlg.dialog("resize"); +if(_1c.interval){ +dlg[0].timer=setInterval(function(){ var v=bar.progressbar("getValue"); v+=10; if(v>100){ v=0; } bar.progressbar("setValue",v); -},_22.interval); +},_1c.interval); } -return win; +return dlg; }}; -$.messager.defaults={ok:"Ok",cancel:"Cancel"}; +$.messager.defaults=$.extend({},$.fn.dialog.defaults,{ok:"Ok",cancel:"Cancel",width:300,height:"auto",minHeight:150,modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,fn:function(){ +}}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.mobile.js b/assets/js/easy-ui/plugins/jquery.mobile.js new file mode 100644 index 0000000000..31f97024f8 --- /dev/null +++ b/assets/js/easy-ui/plugins/jquery.mobile.js @@ -0,0 +1,141 @@ +/** + * jQuery EasyUI 1.5.2 + * + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. + * + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com + * + */ +(function($){ +$.fn.navpanel=function(_1,_2){ +if(typeof _1=="string"){ +var _3=$.fn.navpanel.methods[_1]; +return _3?_3(this,_2):this.panel(_1,_2); +}else{ +_1=_1||{}; +return this.each(function(){ +var _4=$.data(this,"navpanel"); +if(_4){ +$.extend(_4.options,_1); +}else{ +_4=$.data(this,"navpanel",{options:$.extend({},$.fn.navpanel.defaults,$.fn.navpanel.parseOptions(this),_1)}); +} +$(this).panel(_4.options); +}); +} +}; +$.fn.navpanel.methods={options:function(jq){ +return $.data(jq[0],"navpanel").options; +}}; +$.fn.navpanel.parseOptions=function(_5){ +return $.extend({},$.fn.panel.parseOptions(_5),$.parser.parseOptions(_5,[])); +}; +$.fn.navpanel.defaults=$.extend({},$.fn.panel.defaults,{fit:true,border:false,cls:"navpanel"}); +$.parser.plugins.push("navpanel"); +})(jQuery); +(function($){ +$(function(){ +$.mobile.init(); +}); +$.mobile={defaults:{animation:"slide",direction:"left",reverseDirections:{up:"down",down:"up",left:"right",right:"left"}},panels:[],init:function(_6){ +$.mobile.panels=[]; +var _7=$(_6||"body").children(".navpanel:visible"); +if(_7.length){ +_7.not(":first").children(".panel-body").navpanel("close"); +var p=_7.eq(0).children(".panel-body"); +$.mobile.panels.push({panel:p,animation:$.mobile.defaults.animation,direction:$.mobile.defaults.direction}); +} +$(document).unbind(".mobile").bind("click.mobile",function(e){ +var a=$(e.target).closest("a"); +if(a.length){ +var _8=$.parser.parseOptions(a[0],["animation","direction",{back:"boolean"}]); +if(_8.back){ +$.mobile.back(); +e.preventDefault(); +}else{ +var _9=$.trim(a.attr("href")); +if(/^#/.test(_9)){ +var to=$(_9); +if(to.length&&to.hasClass("panel-body")){ +$.mobile.go(to,_8.animation,_8.direction); +e.preventDefault(); +} +} +} +} +}); +$(window).unbind(".mobile").bind("hashchange.mobile",function(){ +var _a=$.mobile.panels.length; +if(_a>1){ +var _b=location.hash; +var p=$.mobile.panels[_a-2]; +if(!_b||_b=="#&"+p.panel.attr("id")){ +$.mobile._back(); +} +} +}); +},nav:function(_c,to,_d,_e){ +if(window.WebKitAnimationEvent){ +_d=_d!=undefined?_d:$.mobile.defaults.animation; +_e=_e!=undefined?_e:$.mobile.defaults.direction; +var _f="m-"+_d+(_e?"-"+_e:""); +var p1=$(_c).panel("open").panel("resize").panel("panel"); +var p2=$(to).panel("open").panel("resize").panel("panel"); +p1.add(p2).bind("webkitAnimationEnd",function(){ +$(this).unbind("webkitAnimationEnd"); +var p=$(this).children(".panel-body"); +if($(this).hasClass("m-in")){ +p.panel("open").panel("resize"); +}else{ +p.panel("close"); +} +$(this).removeClass(_f+" m-in m-out"); +}); +p2.addClass(_f+" m-in"); +p1.addClass(_f+" m-out"); +}else{ +$(to).panel("open").panel("resize"); +$(_c).panel("close"); +} +},_go:function(_10,_11,_12){ +_11=_11!=undefined?_11:$.mobile.defaults.animation; +_12=_12!=undefined?_12:$.mobile.defaults.direction; +var _13=$.mobile.panels[$.mobile.panels.length-1].panel; +var to=$(_10); +if(_13[0]!=to[0]){ +$.mobile.nav(_13,to,_11,_12); +$.mobile.panels.push({panel:to,animation:_11,direction:_12}); +} +},_back:function(){ +if($.mobile.panels.length<2){ +return; +} +var p1=$.mobile.panels.pop(); +var p2=$.mobile.panels[$.mobile.panels.length-1]; +var _14=p1.animation; +var _15=$.mobile.defaults.reverseDirections[p1.direction]||""; +$.mobile.nav(p1.panel,p2.panel,_14,_15); +},go:function(_16,_17,_18){ +_17=_17!=undefined?_17:$.mobile.defaults.animation; +_18=_18!=undefined?_18:$.mobile.defaults.direction; +location.hash="#&"+$(_16).attr("id"); +$.mobile._go(_16,_17,_18); +},back:function(){ +history.go(-1); +}}; +$.map(["validatebox","textbox","passwordbox","filebox","searchbox","combo","combobox","combogrid","combotree","combotreegrid","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){ +if($.fn[_19]){ +$.extend($.fn[_19].defaults,{iconWidth:28,tipPosition:"bottom"}); +} +}); +$.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){ +if($.fn[_1a]){ +$.extend($.fn[_1a].defaults,{iconWidth:56,spinAlign:"horizontal"}); +} +}); +if($.fn.menu){ +$.extend($.fn.menu.defaults,{itemHeight:30,noline:true}); +} +})(jQuery); + diff --git a/assets/js/easy-ui/plugins/jquery.numberbox.js b/assets/js/easy-ui/plugins/jquery.numberbox.js old mode 100755 new mode 100644 index 2af80a4611..f9d4398978 --- a/assets/js/easy-ui/plugins/jquery.numberbox.js +++ b/assets/js/easy-ui/plugins/jquery.numberbox.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -23,10 +23,13 @@ $(_2).numberbox("initValue",_5).numberbox("setText",_6); function _7(_8,_9){ var _a=$.data(_8,"numberbox"); var _b=_a.options; +_b.value=parseFloat(_9); var _9=_b.parser.call(_8,_9); var _c=_b.formatter.call(_8,_9); _b.value=_9; -$(_8).textbox("setValue",_9).textbox("setText",_c); +$(_8).textbox("setText",_c).textbox("setValue",_9); +_c=_b.formatter.call(_8,$(_8).textbox("getValue")); +$(_8).textbox("setText",_c); }; $.fn.numberbox=function(_d,_e){ if(typeof _d=="string"){ @@ -53,11 +56,14 @@ var _11=jq.data("textbox")?jq.textbox("options"):{}; return $.extend($.data(jq[0],"numberbox").options,{width:_11.width,originalValue:_11.originalValue,disabled:_11.disabled,readonly:_11.readonly}); },fix:function(jq){ return jq.each(function(){ -$(this).numberbox("setValue",$(this).numberbox("getText")); +var _12=$(this).numberbox("options"); +_12.value=null; +var _13=_12.parser.call(this,$(this).numberbox("getText")); +$(this).numberbox("setValue",_13); }); -},setValue:function(jq,_12){ +},setValue:function(jq,_14){ return jq.each(function(){ -_7(this,_12); +_7(this,_14); }); },clear:function(jq){ return jq.each(function(){ @@ -70,49 +76,49 @@ $(this).textbox("reset"); $(this).numberbox("setValue",$(this).numberbox("getValue")); }); }}; -$.fn.numberbox.parseOptions=function(_13){ -var t=$(_13); -return $.extend({},$.fn.textbox.parseOptions(_13),$.parser.parseOptions(_13,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)}); +$.fn.numberbox.parseOptions=function(_15){ +var t=$(_15); +return $.extend({},$.fn.textbox.parseOptions(_15),$.parser.parseOptions(_15,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)}); }; $.fn.numberbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{keypress:function(e){ -var _14=e.data.target; -var _15=$(_14).numberbox("options"); -return _15.filter.call(_14,e); -},blur:function(e){ var _16=e.data.target; -$(_16).numberbox("setValue",$(_16).numberbox("getText")); +var _17=$(_16).numberbox("options"); +return _17.filter.call(_16,e); +},blur:function(e){ +$(e.data.target).numberbox("fix"); },keydown:function(e){ if(e.keyCode==13){ -var _17=e.data.target; -$(_17).numberbox("setValue",$(_17).numberbox("getText")); +$(e.data.target).numberbox("fix"); } }},min:null,max:null,precision:0,decimalSeparator:".",groupSeparator:"",prefix:"",suffix:"",filter:function(e){ var _18=$(this).numberbox("options"); var s=$(this).numberbox("getText"); -if(e.which==13){ +if(e.metaKey||e.ctrlKey){ return true; } -if(e.which==45){ -return (s.indexOf("-")==-1?true:false); +if($.inArray(String(e.which),["46","8","13","0"])>=0){ +return true; } -var c=String.fromCharCode(e.which); -if(c==_18.decimalSeparator){ -return (s.indexOf(c)==-1?true:false); -}else{ -if(c==_18.groupSeparator){ +var tmp=$(""); +tmp.html(String.fromCharCode(e.which)); +var c=tmp.text(); +tmp.remove(); +if(!c){ return true; +} +if(c=="-"||c==_18.decimalSeparator){ +return (s.indexOf(c)==-1)?true:false; }else{ -if((e.which>=48&&e.which<=57&&e.ctrlKey==false&&e.shiftKey==false)||e.which==0||e.which==8){ +if(c==_18.groupSeparator){ return true; }else{ -if(e.ctrlKey==true&&(e.which==99||e.which==118)){ +if("0123456789".indexOf(c)>=0){ return true; }else{ return false; } } } -} },formatter:function(_19){ if(!_19){ return _19; @@ -139,13 +145,13 @@ return _1a.prefix+s1+_1a.suffix; },parser:function(s){ s=s+""; var _1c=$(this).numberbox("options"); -if(parseFloat(s)!=s){ if(_1c.prefix){ s=$.trim(s.replace(new RegExp("\\"+$.trim(_1c.prefix),"g"),"")); } if(_1c.suffix){ s=$.trim(s.replace(new RegExp("\\"+$.trim(_1c.suffix),"g"),"")); } +if(parseFloat(s)!=_1c.value){ if(_1c.groupSeparator){ s=$.trim(s.replace(new RegExp("\\"+_1c.groupSeparator,"g"),"")); } diff --git a/assets/js/easy-ui/plugins/jquery.numberspinner.js b/assets/js/easy-ui/plugins/jquery.numberspinner.js old mode 100755 new mode 100644 index a479ca0dda..058be6921b --- a/assets/js/easy-ui/plugins/jquery.numberspinner.js +++ b/assets/js/easy-ui/plugins/jquery.numberspinner.js @@ -1,17 +1,17 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ $(_2).addClass("numberspinner-f"); var _3=$.data(_2,"numberspinner").options; -$(_2).numberbox(_3).spinner(_3); +$(_2).numberbox($.extend({},_3,{doSize:false})).spinner(_3); $(_2).numberbox("setValue",_3.value); }; function _4(_5,_6){ diff --git a/assets/js/easy-ui/plugins/jquery.pagination.js b/assets/js/easy-ui/plugins/jquery.pagination.js old mode 100755 new mode 100644 index d53c7099f7..37d6074c3a --- a/assets/js/easy-ui/plugins/jquery.pagination.js +++ b/assets/js/easy-ui/plugins/jquery.pagination.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -18,6 +18,9 @@ var aa=$.extend([],_4.layout); if(!_4.showPageList){ _6(aa,"list"); } +if(!_4.showPageInfo){ +_6(aa,"info"); +} if(!_4.showRefresh){ _6(aa,"refresh"); } @@ -73,6 +76,15 @@ bb.refresh=_9("refresh"); }else{ if(_8=="links"){ $("").appendTo(tr); +}else{ +if(_8=="info"){ +if(_7==aa.length-1){ +$("
                  ").appendTo(_5); +$("
                  ").appendTo(_5); +}else{ +$("
                  ").appendTo(tr); +} +} } } } @@ -92,7 +104,7 @@ if(_b=="-"){ $("
                  ").appendTo(tr); }else{ var td=$("").appendTo(tr); -var a=$("").appendTo(td); +var a=$("").appendTo(td); a[0].onclick=eval(_b.handler||function(){ }); a.linkbutton($.extend({},_b,{plain:true})); @@ -103,11 +115,9 @@ var td=$("").appendTo(tr); $(_4.buttons).appendTo(td).show(); } } -$("
                  ").appendTo(_5); -$("
                  ").appendTo(_5); function _9(_c){ var _d=_4.nav[_c]; -var a=$("").appendTo(tr); +var a=$("").appendTo(tr); a.wrap(""); a.linkbutton({iconCls:_d.iconCls,plain:true}).unbind(".pagination").bind("click.pagination",function(){ _d.handler.call(_2); @@ -170,7 +180,7 @@ if(_1a<1){ _1a=1; } for(var i=_1a;i<=_1b;i++){ -var a=$("").appendTo(td); +var a=$("").appendTo(td); a.linkbutton({plain:true,text:i}); if(i==_18.pageNumber){ a.linkbutton("select"); @@ -247,9 +257,9 @@ _10(this,_27); }}; $.fn.pagination.parseOptions=function(_28){ var t=$(_28); -return $.extend({},$.parser.parseOptions(_28,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)}); +return $.extend({},$.parser.parseOptions(_28,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showPageInfo:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)}); }; -$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh"],onSelectPage:function(_29,_2a){ +$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showPageInfo:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh","info"],onSelectPage:function(_29,_2a){ },onBeforeRefresh:function(_2b,_2c){ },onRefresh:function(_2d,_2e){ },onChangePageSize:function(_2f){ diff --git a/assets/js/easy-ui/plugins/jquery.panel.js b/assets/js/easy-ui/plugins/jquery.panel.js old mode 100755 new mode 100644 index 02cb7d1b9a..daa4a9511e --- a/assets/js/easy-ui/plugins/jquery.panel.js +++ b/assets/js/easy-ui/plugins/jquery.panel.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -25,191 +25,230 @@ function _3(_4,_5){ var _6=$.data(_4,"panel"); var _7=_6.options; var _8=_6.panel; -var _9=_8.children("div.panel-header"); -var _a=_8.children("div.panel-body"); -var _b=_8.children("div.panel-footer"); +var _9=_8.children(".panel-header"); +var _a=_8.children(".panel-body"); +var _b=_8.children(".panel-footer"); +var _c=(_7.halign=="left"||_7.halign=="right"); if(_5){ $.extend(_7,{width:_5.width,height:_5.height,minWidth:_5.minWidth,maxWidth:_5.maxWidth,minHeight:_5.minHeight,maxHeight:_5.maxHeight,left:_5.left,top:_5.top}); } _8._size(_7); -_9.add(_a)._outerWidth(_8.width()); +if(!_c){ +_9._outerWidth(_8.width()); +} +_a._outerWidth(_8.width()); if(!isNaN(parseInt(_7.height))){ +if(_c){ +if(_7.header){ +var _d=$(_7.header)._outerWidth(); +}else{ +_9.css("width",""); +var _d=_9._outerWidth(); +} +var _e=_9.find(".panel-title"); +_d+=Math.min(_e._outerWidth(),_e._outerHeight()); +var _f=_8.height(); +_9._outerWidth(_d)._outerHeight(_f); +_e._outerWidth(_9.height()); +_a._outerWidth(_8.width()-_d-_b._outerWidth())._outerHeight(_f); +_b._outerHeight(_f); +_a.css({left:"",right:""}).css(_7.halign,(_9.position()[_7.halign]+_d)+"px"); +_7.panelCssWidth=_8.css("width"); +if(_7.collapsed){ +_8._outerWidth(_d+_b._outerWidth()); +} +}else{ _a._outerHeight(_8.height()-_9._outerHeight()-_b._outerHeight()); +} }else{ _a.css("height",""); -var _c=$.parser.parseValue("minHeight",_7.minHeight,_8.parent()); -var _d=$.parser.parseValue("maxHeight",_7.maxHeight,_8.parent()); -var _e=_9._outerHeight()+_b._outerHeight()+_8._outerHeight()-_8.height(); -_a._size("minHeight",_c?(_c-_e):""); -_a._size("maxHeight",_d?(_d-_e):""); +var min=$.parser.parseValue("minHeight",_7.minHeight,_8.parent()); +var max=$.parser.parseValue("maxHeight",_7.maxHeight,_8.parent()); +var _10=_9._outerHeight()+_b._outerHeight()+_8._outerHeight()-_8.height(); +_a._size("minHeight",min?(min-_10):""); +_a._size("maxHeight",max?(max-_10):""); } -_8.css({height:"",minHeight:"",maxHeight:"",left:_7.left,top:_7.top}); +_8.css({height:(_c?undefined:""),minHeight:"",maxHeight:"",left:_7.left,top:_7.top}); _7.onResize.apply(_4,[_7.width,_7.height]); $(_4).panel("doLayout"); }; -function _f(_10,_11){ -var _12=$.data(_10,"panel").options; -var _13=$.data(_10,"panel").panel; -if(_11){ -if(_11.left!=null){ -_12.left=_11.left; +function _11(_12,_13){ +var _14=$.data(_12,"panel"); +var _15=_14.options; +var _16=_14.panel; +if(_13){ +if(_13.left!=null){ +_15.left=_13.left; } -if(_11.top!=null){ -_12.top=_11.top; +if(_13.top!=null){ +_15.top=_13.top; } } -_13.css({left:_12.left,top:_12.top}); -_12.onMove.apply(_10,[_12.left,_12.top]); +_16.css({left:_15.left,top:_15.top}); +_16.find(".tooltip-f").each(function(){ +$(this).tooltip("reposition"); +}); +_15.onMove.apply(_12,[_15.left,_15.top]); }; -function _14(_15){ -$(_15).addClass("panel-body")._size("clear"); -var _16=$("
                  ").insertBefore(_15); -_16[0].appendChild(_15); -_16.bind("_resize",function(e,_17){ -if($(this).hasClass("easyui-fluid")||_17){ -_3(_15); +function _17(_18){ +$(_18).addClass("panel-body")._size("clear"); +var _19=$("
                  ").insertBefore(_18); +_19[0].appendChild(_18); +_19.bind("_resize",function(e,_1a){ +if($(this).hasClass("easyui-fluid")||_1a){ +_3(_18); } return false; }); -return _16; +return _19; }; -function _18(_19){ -var _1a=$.data(_19,"panel"); -var _1b=_1a.options; -var _1c=_1a.panel; -_1c.css(_1b.style); -_1c.addClass(_1b.cls); -_1d(); -_1e(); -var _1f=$(_19).panel("header"); -var _20=$(_19).panel("body"); -var _21=$(_19).siblings("div.panel-footer"); -if(_1b.border){ -_1f.removeClass("panel-header-noborder"); -_20.removeClass("panel-body-noborder"); -_21.removeClass("panel-footer-noborder"); +function _1b(_1c){ +var _1d=$.data(_1c,"panel"); +var _1e=_1d.options; +var _1f=_1d.panel; +_1f.css(_1e.style); +_1f.addClass(_1e.cls); +_1f.removeClass("panel-hleft panel-hright").addClass("panel-h"+_1e.halign); +_20(); +_21(); +var _22=$(_1c).panel("header"); +var _23=$(_1c).panel("body"); +var _24=$(_1c).siblings(".panel-footer"); +if(_1e.border){ +_22.removeClass("panel-header-noborder"); +_23.removeClass("panel-body-noborder"); +_24.removeClass("panel-footer-noborder"); }else{ -_1f.addClass("panel-header-noborder"); -_20.addClass("panel-body-noborder"); -_21.addClass("panel-footer-noborder"); -} -_1f.addClass(_1b.headerCls); -_20.addClass(_1b.bodyCls); -$(_19).attr("id",_1b.id||""); -if(_1b.content){ -$(_19).panel("clear"); -$(_19).html(_1b.content); -$.parser.parse($(_19)); -} -function _1d(){ -if(_1b.tools&&typeof _1b.tools=="string"){ -_1c.find(">div.panel-header>div.panel-tool .panel-tool-a").appendTo(_1b.tools); -} -_1(_1c.children("div.panel-header")); -if(_1b.title&&!_1b.noheader){ -var _22=$("
                  ").prependTo(_1c); -var _23=$("
                  ").html(_1b.title).appendTo(_22); -if(_1b.iconCls){ -_23.addClass("panel-with-icon"); -$("
                  ").addClass(_1b.iconCls).appendTo(_22); -} -var _24=$("
                  ").appendTo(_22); -_24.bind("click",function(e){ -e.stopPropagation(); -}); -if(_1b.tools){ -if($.isArray(_1b.tools)){ -for(var i=0;i<_1b.tools.length;i++){ -var t=$("").addClass(_1b.tools[i].iconCls).appendTo(_24); -if(_1b.tools[i].handler){ -t.bind("click",eval(_1b.tools[i].handler)); +_22.addClass("panel-header-noborder"); +_23.addClass("panel-body-noborder"); +_24.addClass("panel-footer-noborder"); +} +_22.addClass(_1e.headerCls); +_23.addClass(_1e.bodyCls); +$(_1c).attr("id",_1e.id||""); +if(_1e.content){ +$(_1c).panel("clear"); +$(_1c).html(_1e.content); +$.parser.parse($(_1c)); +} +function _20(){ +if(_1e.noheader||(!_1e.title&&!_1e.header)){ +_1(_1f.children(".panel-header")); +_1f.children(".panel-body").addClass("panel-body-noheader"); +}else{ +if(_1e.header){ +$(_1e.header).addClass("panel-header").prependTo(_1f); +}else{ +var _25=_1f.children(".panel-header"); +if(!_25.length){ +_25=$("
                  ").prependTo(_1f); +} +if(!$.isArray(_1e.tools)){ +_25.find("div.panel-tool .panel-tool-a").appendTo(_1e.tools); +} +_25.empty(); +var _26=$("
                  ").html(_1e.title).appendTo(_25); +if(_1e.iconCls){ +_26.addClass("panel-with-icon"); +$("
                  ").addClass(_1e.iconCls).appendTo(_25); } +if(_1e.halign=="left"||_1e.halign=="right"){ +_26.addClass("panel-title-"+_1e.titleDirection); } +var _27=$("
                  ").appendTo(_25); +_27.bind("click",function(e){ +e.stopPropagation(); +}); +if(_1e.tools){ +if($.isArray(_1e.tools)){ +$.map(_1e.tools,function(t){ +_28(_27,t.iconCls,eval(t.handler)); +}); }else{ -$(_1b.tools).children().each(function(){ -$(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(_24); +$(_1e.tools).children().each(function(){ +$(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(_27); }); } } -if(_1b.collapsible){ -$("").appendTo(_24).bind("click",function(){ -if(_1b.collapsed==true){ -_4a(_19,true); +if(_1e.collapsible){ +_28(_27,"panel-tool-collapse",function(){ +if(_1e.collapsed==true){ +_52(_1c,true); }else{ -_38(_19,true); +_3e(_1c,true); } -return false; }); } -if(_1b.minimizable){ -$("").appendTo(_24).bind("click",function(){ -_55(_19); -return false; +if(_1e.minimizable){ +_28(_27,"panel-tool-min",function(){ +_5d(_1c); }); } -if(_1b.maximizable){ -$("").appendTo(_24).bind("click",function(){ -if(_1b.maximized==true){ -_59(_19); +if(_1e.maximizable){ +_28(_27,"panel-tool-max",function(){ +if(_1e.maximized==true){ +_61(_1c); }else{ -_37(_19); +_3d(_1c); } -return false; }); } -if(_1b.closable){ -$("").appendTo(_24).bind("click",function(){ -_39(_19); -return false; +if(_1e.closable){ +_28(_27,"panel-tool-close",function(){ +_3f(_1c); }); } -_1c.children("div.panel-body").removeClass("panel-body-noheader"); -}else{ -_1c.children("div.panel-body").addClass("panel-body-noheader"); } +_1f.children("div.panel-body").removeClass("panel-body-noheader"); +} +}; +function _28(c,_29,_2a){ +var a=$("").addClass(_29).appendTo(c); +a.bind("click",_2a); }; -function _1e(){ -if(_1b.footer){ -$(_1b.footer).addClass("panel-footer").appendTo(_1c); -$(_19).addClass("panel-body-nobottom"); +function _21(){ +if(_1e.footer){ +$(_1e.footer).addClass("panel-footer").appendTo(_1f); +$(_1c).addClass("panel-body-nobottom"); }else{ -_1c.children("div.panel-footer").remove(); -$(_19).removeClass("panel-body-nobottom"); +_1f.children(".panel-footer").remove(); +$(_1c).removeClass("panel-body-nobottom"); } }; }; -function _25(_26,_27){ -var _28=$.data(_26,"panel"); -var _29=_28.options; -if(_2a){ -_29.queryParams=_27; +function _2b(_2c,_2d){ +var _2e=$.data(_2c,"panel"); +var _2f=_2e.options; +if(_30){ +_2f.queryParams=_2d; } -if(!_29.href){ +if(!_2f.href){ return; } -if(!_28.isLoaded||!_29.cache){ -var _2a=$.extend({},_29.queryParams); -if(_29.onBeforeLoad.call(_26,_2a)==false){ +if(!_2e.isLoaded||!_2f.cache){ +var _30=$.extend({},_2f.queryParams); +if(_2f.onBeforeLoad.call(_2c,_30)==false){ return; } -_28.isLoaded=false; -$(_26).panel("clear"); -if(_29.loadingMessage){ -$(_26).html($("
                  ").html(_29.loadingMessage)); -} -_29.loader.call(_26,_2a,function(_2b){ -var _2c=_29.extractor.call(_26,_2b); -$(_26).html(_2c); -$.parser.parse($(_26)); -_29.onLoad.apply(_26,arguments); -_28.isLoaded=true; +_2e.isLoaded=false; +if(_2f.loadingMessage){ +$(_2c).panel("clear"); +$(_2c).html($("
                  ").html(_2f.loadingMessage)); +} +_2f.loader.call(_2c,_30,function(_31){ +var _32=_2f.extractor.call(_2c,_31); +$(_2c).panel("clear"); +$(_2c).html(_32); +$.parser.parse($(_2c)); +_2f.onLoad.apply(_2c,arguments); +_2e.isLoaded=true; },function(){ -_29.onLoadError.apply(_26,arguments); +_2f.onLoadError.apply(_2c,arguments); }); } }; -function _2d(_2e){ -var t=$(_2e); +function _33(_34){ +var t=$(_34); t.find(".combo-f").each(function(){ $(this).combo("destroy"); }); @@ -227,245 +266,274 @@ $(this)._size("unfit"); }); t.empty(); }; -function _2f(_30){ -$(_30).panel("doLayout",true); +function _35(_36){ +$(_36).panel("doLayout",true); }; -function _31(_32,_33){ -var _34=$.data(_32,"panel").options; -var _35=$.data(_32,"panel").panel; -if(_33!=true){ -if(_34.onBeforeOpen.call(_32)==false){ +function _37(_38,_39){ +var _3a=$.data(_38,"panel").options; +var _3b=$.data(_38,"panel").panel; +if(_39!=true){ +if(_3a.onBeforeOpen.call(_38)==false){ return; } } -_35.stop(true,true); -if($.isFunction(_34.openAnimation)){ -_34.openAnimation.call(_32,cb); +_3b.stop(true,true); +if($.isFunction(_3a.openAnimation)){ +_3a.openAnimation.call(_38,cb); }else{ -switch(_34.openAnimation){ +switch(_3a.openAnimation){ case "slide": -_35.slideDown(_34.openDuration,cb); +_3b.slideDown(_3a.openDuration,cb); break; case "fade": -_35.fadeIn(_34.openDuration,cb); +_3b.fadeIn(_3a.openDuration,cb); break; case "show": -_35.show(_34.openDuration,cb); +_3b.show(_3a.openDuration,cb); break; default: -_35.show(); +_3b.show(); cb(); } } function cb(){ -_34.closed=false; -_34.minimized=false; -var _36=_35.children("div.panel-header").find("a.panel-tool-restore"); -if(_36.length){ -_34.maximized=true; +_3a.closed=false; +_3a.minimized=false; +var _3c=_3b.children(".panel-header").find("a.panel-tool-restore"); +if(_3c.length){ +_3a.maximized=true; } -_34.onOpen.call(_32); -if(_34.maximized==true){ -_34.maximized=false; -_37(_32); +_3a.onOpen.call(_38); +if(_3a.maximized==true){ +_3a.maximized=false; +_3d(_38); } -if(_34.collapsed==true){ -_34.collapsed=false; -_38(_32); +if(_3a.collapsed==true){ +_3a.collapsed=false; +_3e(_38); } -if(!_34.collapsed){ -_25(_32); -_2f(_32); +if(!_3a.collapsed){ +_2b(_38); +_35(_38); } }; }; -function _39(_3a,_3b){ -var _3c=$.data(_3a,"panel").options; -var _3d=$.data(_3a,"panel").panel; -if(_3b!=true){ -if(_3c.onBeforeClose.call(_3a)==false){ +function _3f(_40,_41){ +var _42=$.data(_40,"panel"); +var _43=_42.options; +var _44=_42.panel; +if(_41!=true){ +if(_43.onBeforeClose.call(_40)==false){ return; } } -_3d.stop(true,true); -_3d._size("unfit"); -if($.isFunction(_3c.closeAnimation)){ -_3c.closeAnimation.call(_3a,cb); +_44.find(".tooltip-f").each(function(){ +$(this).tooltip("hide"); +}); +_44.stop(true,true); +_44._size("unfit"); +if($.isFunction(_43.closeAnimation)){ +_43.closeAnimation.call(_40,cb); }else{ -switch(_3c.closeAnimation){ +switch(_43.closeAnimation){ case "slide": -_3d.slideUp(_3c.closeDuration,cb); +_44.slideUp(_43.closeDuration,cb); break; case "fade": -_3d.fadeOut(_3c.closeDuration,cb); +_44.fadeOut(_43.closeDuration,cb); break; case "hide": -_3d.hide(_3c.closeDuration,cb); +_44.hide(_43.closeDuration,cb); break; default: -_3d.hide(); +_44.hide(); cb(); } } function cb(){ -_3c.closed=true; -_3c.onClose.call(_3a); +_43.closed=true; +_43.onClose.call(_40); }; }; -function _3e(_3f,_40){ -var _41=$.data(_3f,"panel"); -var _42=_41.options; -var _43=_41.panel; -if(_40!=true){ -if(_42.onBeforeDestroy.call(_3f)==false){ +function _45(_46,_47){ +var _48=$.data(_46,"panel"); +var _49=_48.options; +var _4a=_48.panel; +if(_47!=true){ +if(_49.onBeforeDestroy.call(_46)==false){ return; } } -$(_3f).panel("clear").panel("clear","footer"); -_1(_43); -_42.onDestroy.call(_3f); +$(_46).panel("clear").panel("clear","footer"); +_1(_4a); +_49.onDestroy.call(_46); }; -function _38(_44,_45){ -var _46=$.data(_44,"panel").options; -var _47=$.data(_44,"panel").panel; -var _48=_47.children("div.panel-body"); -var _49=_47.children("div.panel-header").find("a.panel-tool-collapse"); -if(_46.collapsed==true){ +function _3e(_4b,_4c){ +var _4d=$.data(_4b,"panel").options; +var _4e=$.data(_4b,"panel").panel; +var _4f=_4e.children(".panel-body"); +var _50=_4e.children(".panel-header"); +var _51=_50.find("a.panel-tool-collapse"); +if(_4d.collapsed==true){ return; } -_48.stop(true,true); -if(_46.onBeforeCollapse.call(_44)==false){ +_4f.stop(true,true); +if(_4d.onBeforeCollapse.call(_4b)==false){ return; } -_49.addClass("panel-tool-expand"); -if(_45==true){ -_48.slideUp("normal",function(){ -_46.collapsed=true; -_46.onCollapse.call(_44); +_51.addClass("panel-tool-expand"); +if(_4c==true){ +if(_4d.halign=="left"||_4d.halign=="right"){ +_4e.animate({width:_50._outerWidth()+_4e.children(".panel-footer")._outerWidth()},function(){ +cb(); +}); +}else{ +_4f.slideUp("normal",function(){ +cb(); }); +} }else{ -_48.hide(); -_46.collapsed=true; -_46.onCollapse.call(_44); +if(_4d.halign=="left"||_4d.halign=="right"){ +_4e._outerWidth(_50._outerWidth()+_4e.children(".panel-footer")._outerWidth()); +} +cb(); } +function cb(){ +_4f.hide(); +_4d.collapsed=true; +_4d.onCollapse.call(_4b); }; -function _4a(_4b,_4c){ -var _4d=$.data(_4b,"panel").options; -var _4e=$.data(_4b,"panel").panel; -var _4f=_4e.children("div.panel-body"); -var _50=_4e.children("div.panel-header").find("a.panel-tool-collapse"); -if(_4d.collapsed==false){ +}; +function _52(_53,_54){ +var _55=$.data(_53,"panel").options; +var _56=$.data(_53,"panel").panel; +var _57=_56.children(".panel-body"); +var _58=_56.children(".panel-header").find("a.panel-tool-collapse"); +if(_55.collapsed==false){ return; } -_4f.stop(true,true); -if(_4d.onBeforeExpand.call(_4b)==false){ +_57.stop(true,true); +if(_55.onBeforeExpand.call(_53)==false){ return; } -_50.removeClass("panel-tool-expand"); -if(_4c==true){ -_4f.slideDown("normal",function(){ -_4d.collapsed=false; -_4d.onExpand.call(_4b); -_25(_4b); -_2f(_4b); +_58.removeClass("panel-tool-expand"); +if(_54==true){ +if(_55.halign=="left"||_55.halign=="right"){ +_57.show(); +_56.animate({width:_55.panelCssWidth},function(){ +cb(); }); }else{ -_4f.show(); -_4d.collapsed=false; -_4d.onExpand.call(_4b); -_25(_4b); -_2f(_4b); +_57.slideDown("normal",function(){ +cb(); +}); } +}else{ +if(_55.halign=="left"||_55.halign=="right"){ +_56.css("width",_55.panelCssWidth); +} +cb(); +} +function cb(){ +_57.show(); +_55.collapsed=false; +_55.onExpand.call(_53); +_2b(_53); +_35(_53); }; -function _37(_51){ -var _52=$.data(_51,"panel").options; -var _53=$.data(_51,"panel").panel; -var _54=_53.children("div.panel-header").find("a.panel-tool-max"); -if(_52.maximized==true){ +}; +function _3d(_59){ +var _5a=$.data(_59,"panel").options; +var _5b=$.data(_59,"panel").panel; +var _5c=_5b.children(".panel-header").find("a.panel-tool-max"); +if(_5a.maximized==true){ return; } -_54.addClass("panel-tool-restore"); -if(!$.data(_51,"panel").original){ -$.data(_51,"panel").original={width:_52.width,height:_52.height,left:_52.left,top:_52.top,fit:_52.fit}; -} -_52.left=0; -_52.top=0; -_52.fit=true; -_3(_51); -_52.minimized=false; -_52.maximized=true; -_52.onMaximize.call(_51); +_5c.addClass("panel-tool-restore"); +if(!$.data(_59,"panel").original){ +$.data(_59,"panel").original={width:_5a.width,height:_5a.height,left:_5a.left,top:_5a.top,fit:_5a.fit}; +} +_5a.left=0; +_5a.top=0; +_5a.fit=true; +_3(_59); +_5a.minimized=false; +_5a.maximized=true; +_5a.onMaximize.call(_59); }; -function _55(_56){ -var _57=$.data(_56,"panel").options; -var _58=$.data(_56,"panel").panel; -_58._size("unfit"); -_58.hide(); -_57.minimized=true; -_57.maximized=false; -_57.onMinimize.call(_56); +function _5d(_5e){ +var _5f=$.data(_5e,"panel").options; +var _60=$.data(_5e,"panel").panel; +_60._size("unfit"); +_60.hide(); +_5f.minimized=true; +_5f.maximized=false; +_5f.onMinimize.call(_5e); }; -function _59(_5a){ -var _5b=$.data(_5a,"panel").options; -var _5c=$.data(_5a,"panel").panel; -var _5d=_5c.children("div.panel-header").find("a.panel-tool-max"); -if(_5b.maximized==false){ +function _61(_62){ +var _63=$.data(_62,"panel").options; +var _64=$.data(_62,"panel").panel; +var _65=_64.children(".panel-header").find("a.panel-tool-max"); +if(_63.maximized==false){ return; } -_5c.show(); -_5d.removeClass("panel-tool-restore"); -$.extend(_5b,$.data(_5a,"panel").original); -_3(_5a); -_5b.minimized=false; -_5b.maximized=false; -$.data(_5a,"panel").original=null; -_5b.onRestore.call(_5a); +_64.show(); +_65.removeClass("panel-tool-restore"); +$.extend(_63,$.data(_62,"panel").original); +_3(_62); +_63.minimized=false; +_63.maximized=false; +$.data(_62,"panel").original=null; +_63.onRestore.call(_62); }; -function _5e(_5f,_60){ -$.data(_5f,"panel").options.title=_60; -$(_5f).panel("header").find("div.panel-title").html(_60); +function _66(_67,_68){ +$.data(_67,"panel").options.title=_68; +$(_67).panel("header").find("div.panel-title").html(_68); }; -var _61=null; +var _69=null; $(window).unbind(".panel").bind("resize.panel",function(){ -if(_61){ -clearTimeout(_61); -} -_61=setTimeout(function(){ -var _62=$("body.layout"); -if(_62.length){ -_62.layout("resize"); -$("body").children(".easyui-fluid:visible").trigger("_resize"); +if(_69){ +clearTimeout(_69); +} +_69=setTimeout(function(){ +var _6a=$("body.layout"); +if(_6a.length){ +_6a.layout("resize"); +$("body").children(".easyui-fluid:visible").each(function(){ +$(this).triggerHandler("_resize"); +}); }else{ $("body").panel("doLayout"); } -_61=null; +_69=null; },100); }); -$.fn.panel=function(_63,_64){ -if(typeof _63=="string"){ -return $.fn.panel.methods[_63](this,_64); +$.fn.panel=function(_6b,_6c){ +if(typeof _6b=="string"){ +return $.fn.panel.methods[_6b](this,_6c); } -_63=_63||{}; +_6b=_6b||{}; return this.each(function(){ -var _65=$.data(this,"panel"); -var _66; -if(_65){ -_66=$.extend(_65.options,_63); -_65.isLoaded=false; +var _6d=$.data(this,"panel"); +var _6e; +if(_6d){ +_6e=$.extend(_6d.options,_6b); +_6d.isLoaded=false; }else{ -_66=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_63); +_6e=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_6b); $(this).attr("title",""); -_65=$.data(this,"panel",{options:_66,panel:_14(this),isLoaded:false}); +_6d=$.data(this,"panel",{options:_6e,panel:_17(this),isLoaded:false}); } -_18(this); -if(_66.doSize==true){ -_65.panel.css("display","block"); +_1b(this); +$(this).show(); +if(_6e.doSize==true){ +_6d.panel.css("display","block"); _3(this); } -if(_66.closed==true||_66.minimized==true){ -_65.panel.hide(); +if(_6e.closed==true||_6e.minimized==true){ +_6d.panel.hide(); }else{ -_31(this); +_37(this); } }); }; @@ -474,112 +542,116 @@ return $.data(jq[0],"panel").options; },panel:function(jq){ return $.data(jq[0],"panel").panel; },header:function(jq){ -return $.data(jq[0],"panel").panel.find(">div.panel-header"); +return $.data(jq[0],"panel").panel.children(".panel-header"); },footer:function(jq){ return jq.panel("panel").children(".panel-footer"); },body:function(jq){ -return $.data(jq[0],"panel").panel.find(">div.panel-body"); -},setTitle:function(jq,_67){ +return $.data(jq[0],"panel").panel.children(".panel-body"); +},setTitle:function(jq,_6f){ return jq.each(function(){ -_5e(this,_67); +_66(this,_6f); }); -},open:function(jq,_68){ +},open:function(jq,_70){ return jq.each(function(){ -_31(this,_68); +_37(this,_70); }); -},close:function(jq,_69){ +},close:function(jq,_71){ return jq.each(function(){ -_39(this,_69); +_3f(this,_71); }); -},destroy:function(jq,_6a){ +},destroy:function(jq,_72){ return jq.each(function(){ -_3e(this,_6a); +_45(this,_72); }); -},clear:function(jq,_6b){ +},clear:function(jq,_73){ return jq.each(function(){ -_2d(_6b=="footer"?$(this).panel("footer"):this); +_33(_73=="footer"?$(this).panel("footer"):this); }); -},refresh:function(jq,_6c){ +},refresh:function(jq,_74){ return jq.each(function(){ -var _6d=$.data(this,"panel"); -_6d.isLoaded=false; -if(_6c){ -if(typeof _6c=="string"){ -_6d.options.href=_6c; +var _75=$.data(this,"panel"); +_75.isLoaded=false; +if(_74){ +if(typeof _74=="string"){ +_75.options.href=_74; }else{ -_6d.options.queryParams=_6c; +_75.options.queryParams=_74; } } -_25(this); +_2b(this); }); -},resize:function(jq,_6e){ +},resize:function(jq,_76){ return jq.each(function(){ -_3(this,_6e); +_3(this,_76); }); },doLayout:function(jq,all){ return jq.each(function(){ -_6f(this,"body"); -_6f($(this).siblings("div.panel-footer")[0],"footer"); -function _6f(_70,_71){ -if(!_70){ +_77(this,"body"); +_77($(this).siblings(".panel-footer")[0],"footer"); +function _77(_78,_79){ +if(!_78){ return; } -var _72=_70==$("body")[0]; -var s=$(_70).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_73,el){ -var p=$(el).parents("div.panel-"+_71+":first"); -return _72?p.length==0:p[0]==_70; +var _7a=_78==$("body")[0]; +var s=$(_78).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_7b,el){ +var p=$(el).parents(".panel-"+_79+":first"); +return _7a?p.length==0:p[0]==_78; +}); +s.each(function(){ +$(this).triggerHandler("_resize",[all||false]); }); -s.trigger("_resize",[all||false]); }; }); -},move:function(jq,_74){ +},move:function(jq,_7c){ return jq.each(function(){ -_f(this,_74); +_11(this,_7c); }); },maximize:function(jq){ return jq.each(function(){ -_37(this); +_3d(this); }); },minimize:function(jq){ return jq.each(function(){ -_55(this); +_5d(this); }); },restore:function(jq){ return jq.each(function(){ -_59(this); +_61(this); }); -},collapse:function(jq,_75){ +},collapse:function(jq,_7d){ return jq.each(function(){ -_38(this,_75); +_3e(this,_7d); }); -},expand:function(jq,_76){ +},expand:function(jq,_7e){ return jq.each(function(){ -_4a(this,_76); +_52(this,_7e); }); }}; -$.fn.panel.parseOptions=function(_77){ -var t=$(_77); -return $.extend({},$.parser.parseOptions(_77,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined)}); +$.fn.panel.parseOptions=function(_7f){ +var t=$(_7f); +var hh=t.children(".panel-header,header"); +var ff=t.children(".panel-footer,footer"); +return $.extend({},$.parser.parseOptions(_7f,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method","header","footer","halign","titleDirection",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined),header:(hh.length?hh.removeClass("panel-header"):undefined),footer:(ff.length?ff.removeClass("panel-footer"):undefined)}); }; -$.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_78,_79,_7a){ -var _7b=$(this).panel("options"); -if(!_7b.href){ +$.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,halign:"top",titleDirection:"down",collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,header:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_80,_81,_82){ +var _83=$(this).panel("options"); +if(!_83.href){ return false; } -$.ajax({type:_7b.method,url:_7b.href,cache:false,data:_78,dataType:"html",success:function(_7c){ -_79(_7c); +$.ajax({type:_83.method,url:_83.href,cache:false,data:_80,dataType:"html",success:function(_84){ +_81(_84); },error:function(){ -_7a.apply(this,arguments); +_82.apply(this,arguments); }}); -},extractor:function(_7d){ -var _7e=/]*>((.|[\n\r])*)<\/body>/im; -var _7f=_7e.exec(_7d); -if(_7f){ -return _7f[1]; +},extractor:function(_85){ +var _86=/]*>((.|[\n\r])*)<\/body>/im; +var _87=_86.exec(_85); +if(_87){ +return _87[1]; }else{ -return _7d; +return _85; } -},onBeforeLoad:function(_80){ +},onBeforeLoad:function(_88){ },onLoad:function(){ },onLoadError:function(){ },onBeforeOpen:function(){ @@ -588,8 +660,8 @@ return _7d; },onClose:function(){ },onBeforeDestroy:function(){ },onDestroy:function(){ -},onResize:function(_81,_82){ -},onMove:function(_83,top){ +},onResize:function(_89,_8a){ +},onMove:function(_8b,top){ },onMaximize:function(){ },onRestore:function(){ },onMinimize:function(){ diff --git a/assets/js/easy-ui/plugins/jquery.parser.js b/assets/js/easy-ui/plugins/jquery.parser.js old mode 100755 new mode 100644 index dac645b732..da48ecf688 --- a/assets/js/easy-ui/plugins/jquery.parser.js +++ b/assets/js/easy-ui/plugins/jquery.parser.js @@ -1,158 +1,222 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ -$.parser={auto:true,onComplete:function(_1){ -},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","progressbar","tree","textbox","filebox","combo","combobox","combotree","combogrid","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","tabs","accordion","window","dialog","form"],parse:function(_2){ +$.easyui={indexOfArray:function(a,o,id){ +for(var i=0,_1=a.length;i<_1;i++){ +if(id==undefined){ +if(a[i]==o){ +return i; +} +}else{ +if(a[i][o]==id){ +return i; +} +} +} +return -1; +},removeArrayItem:function(a,o,id){ +if(typeof o=="string"){ +for(var i=0,_2=a.length;i<_2;i++){ +if(a[i][o]==id){ +a.splice(i,1); +return; +} +} +}else{ +var _3=this.indexOfArray(a,o); +if(_3!=-1){ +a.splice(_3,1); +} +} +},addArrayItem:function(a,o,r){ +var _4=this.indexOfArray(a,o,r?r[o]:undefined); +if(_4==-1){ +a.push(r?r:o); +}else{ +a[_4]=r?r:o; +} +},getArrayItem:function(a,o,id){ +var _5=this.indexOfArray(a,o,id); +return _5==-1?null:a[_5]; +},forEach:function(_6,_7,_8){ +var _9=[]; +for(var i=0;i<_6.length;i++){ +_9.push(_6[i]); +} +while(_9.length){ +var _a=_9.shift(); +if(_8(_a)==false){ +return; +} +if(_7&&_a.children){ +for(var i=_a.children.length-1;i>=0;i--){ +_9.unshift(_a.children[i]); +} +} +} +}}; +$.parser={auto:true,onComplete:function(_b){ +},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","switchbutton","progressbar","tree","textbox","passwordbox","filebox","combo","combobox","combotree","combogrid","combotreegrid","tagbox","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_c){ var aa=[]; for(var i=0;i<$.parser.plugins.length;i++){ -var _3=$.parser.plugins[i]; -var r=$(".easyui-"+_3,_2); +var _d=$.parser.plugins[i]; +var r=$(".easyui-"+_d,_c); if(r.length){ -if(r[_3]){ -r[_3](); +if(r[_d]){ +r.each(function(){ +$(this)[_d]($.data(this,"options")||{}); +}); }else{ -aa.push({name:_3,jq:r}); +aa.push({name:_d,jq:r}); } } } if(aa.length&&window.easyloader){ -var _4=[]; +var _e=[]; for(var i=0;i=0){ -v=Math.floor((_8.width()-_9)*v/100); +$.parser.onComplete.call($.parser,_c); +} +},parseValue:function(_10,_11,_12,_13){ +_13=_13||0; +var v=$.trim(String(_11||"")); +var _14=v.substr(v.length-1,1); +if(_14=="%"){ +v=parseFloat(v.substr(0,v.length-1)); +if(_10.toLowerCase().indexOf("width")>=0){ +v=Math.floor((_12.width()-_13)*v/100); }else{ -v=Math.floor((_8.height()-_9)*v/100); +v=Math.floor((_12.height()-_13)*v/100); } }else{ v=parseInt(v)||undefined; } return v; -},parseOptions:function(_b,_c){ -var t=$(_b); -var _d={}; +},parseOptions:function(_15,_16){ +var t=$(_15); +var _17={}; var s=$.trim(t.attr("data-options")); if(s){ if(s.substring(0,1)!="{"){ s="{"+s+"}"; } -_d=(new Function("return "+s))(); +_17=(new Function("return "+s))(); } $.map(["width","height","left","top","minWidth","maxWidth","minHeight","maxHeight"],function(p){ -var pv=$.trim(_b.style[p]||""); +var pv=$.trim(_15.style[p]||""); if(pv){ if(pv.indexOf("%")==-1){ -pv=parseInt(pv)||undefined; +pv=parseInt(pv); +if(isNaN(pv)){ +pv=undefined; } -_d[p]=pv; +} +_17[p]=pv; } }); -if(_c){ -var _e={}; -for(var i=0;i<_c.length;i++){ -var pp=_c[i]; +if(_16){ +var _18={}; +for(var i=0;i<_16.length;i++){ +var pp=_16[i]; if(typeof pp=="string"){ -_e[pp]=t.attr(pp); +_18[pp]=t.attr(pp); }else{ -for(var _f in pp){ -var _10=pp[_f]; -if(_10=="boolean"){ -_e[_f]=t.attr(_f)?(t.attr(_f)=="true"):undefined; +for(var _19 in pp){ +var _1a=pp[_19]; +if(_1a=="boolean"){ +_18[_19]=t.attr(_19)?(t.attr(_19)=="true"):undefined; }else{ -if(_10=="number"){ -_e[_f]=t.attr(_f)=="0"?0:parseFloat(t.attr(_f))||undefined; +if(_1a=="number"){ +_18[_19]=t.attr(_19)=="0"?0:parseFloat(t.attr(_19))||undefined; } } } } } -$.extend(_d,_e); +$.extend(_17,_18); } -return _d; +return _17; }}; $(function(){ var d=$("
                  ").appendTo("body"); $._boxModel=d.outerWidth()!=100; d.remove(); +d=$("
                  ").appendTo("body"); +$._positionFixed=(d.css("position")=="fixed"); +d.remove(); if(!window.easyloader&&$.parser.auto){ $.parser.parse(); } }); -$.fn._outerWidth=function(_11){ -if(_11==undefined){ +$.fn._outerWidth=function(_1b){ +if(_1b==undefined){ if(this[0]==window){ return this.width()||document.body.clientWidth; } return this.outerWidth()||0; } -return this._size("width",_11); +return this._size("width",_1b); }; -$.fn._outerHeight=function(_12){ -if(_12==undefined){ +$.fn._outerHeight=function(_1c){ +if(_1c==undefined){ if(this[0]==window){ return this.height()||document.body.clientHeight; } return this.outerHeight()||0; } -return this._size("height",_12); +return this._size("height",_1c); }; -$.fn._scrollLeft=function(_13){ -if(_13==undefined){ +$.fn._scrollLeft=function(_1d){ +if(_1d==undefined){ return this.scrollLeft(); }else{ return this.each(function(){ -$(this).scrollLeft(_13); +$(this).scrollLeft(_1d); }); } }; $.fn._propAttr=$.fn.prop||$.fn.attr; -$.fn._size=function(_14,_15){ -if(typeof _14=="string"){ -if(_14=="clear"){ +$.fn._size=function(_1e,_1f){ +if(typeof _1e=="string"){ +if(_1e=="clear"){ return this.each(function(){ $(this).css({width:"",minWidth:"",maxWidth:"",height:"",minHeight:"",maxHeight:""}); }); }else{ -if(_14=="fit"){ +if(_1e=="fit"){ return this.each(function(){ -_16(this,this.tagName=="BODY"?$("body"):$(this).parent(),true); +_20(this,this.tagName=="BODY"?$("body"):$(this).parent(),true); }); }else{ -if(_14=="unfit"){ +if(_1e=="unfit"){ return this.each(function(){ -_16(this,$(this).parent(),false); +_20(this,$(this).parent(),false); }); }else{ -if(_15==undefined){ -return _17(this[0],_14); +if(_1f==undefined){ +return _21(this[0],_1e); }else{ return this.each(function(){ -_17(this,_14,_15); +_21(this,_1e,_1f); }); } } @@ -160,10 +224,10 @@ _17(this,_14,_15); } }else{ return this.each(function(){ -_15=_15||$(this).parent(); -$.extend(_14,_16(this,_15,_14.fit)||{}); -var r1=_18(this,"width",_15,_14); -var r2=_18(this,"height",_15,_14); +_1f=_1f||$(this).parent(); +$.extend(_1e,_20(this,_1f,_1e.fit)||{}); +var r1=_22(this,"width",_1f,_1e); +var r2=_22(this,"height",_1f,_1e); if(r1||r2){ $(this).addClass("easyui-fluid"); }else{ @@ -171,17 +235,17 @@ $(this).removeClass("easyui-fluid"); } }); } -function _16(_19,_1a,fit){ -if(!_1a.length){ +function _20(_23,_24,fit){ +if(!_24.length){ return false; } -var t=$(_19)[0]; -var p=_1a[0]; -var _1b=p.fcount||0; +var t=$(_23)[0]; +var p=_24[0]; +var _25=p.fcount||0; if(fit){ if(!t.fitted){ t.fitted=true; -p.fcount=_1b+1; +p.fcount=_25+1; $(p).addClass("panel-noscroll"); if(p.tagName=="BODY"){ $("html").addClass("panel-fit"); @@ -191,7 +255,7 @@ return {width:($(p).width()||1),height:($(p).height()||1)}; }else{ if(t.fitted){ t.fitted=false; -p.fcount=_1b-1; +p.fcount=_25-1; if(p.fcount==0){ $(p).removeClass("panel-noscroll"); if(p.tagName=="BODY"){ @@ -202,18 +266,18 @@ $("html").removeClass("panel-fit"); return false; } }; -function _18(_1c,_1d,_1e,_1f){ -var t=$(_1c); -var p=_1d; +function _22(_26,_27,_28,_29){ +var t=$(_26); +var p=_27; var p1=p.substr(0,1).toUpperCase()+p.substr(1); -var min=$.parser.parseValue("min"+p1,_1f["min"+p1],_1e); -var max=$.parser.parseValue("max"+p1,_1f["max"+p1],_1e); -var val=$.parser.parseValue(p,_1f[p],_1e); -var _20=(String(_1f[p]||"").indexOf("%")>=0?true:false); +var min=$.parser.parseValue("min"+p1,_29["min"+p1],_28); +var max=$.parser.parseValue("max"+p1,_29["max"+p1],_28); +var val=$.parser.parseValue(p,_29[p],_28); +var _2a=(String(_29[p]||"").indexOf("%")>=0?true:false); if(!isNaN(val)){ var v=Math.min(Math.max(val,min||0),max||99999); -if(!_20){ -_1f[p]=v; +if(!_2a){ +_29[p]=v; } t._size("min"+p1,""); t._size("max"+p1,""); @@ -223,34 +287,34 @@ t._size(p,""); t._size("min"+p1,min); t._size("max"+p1,max); } -return _20||_1f.fit; +return _2a||_29.fit; }; -function _17(_21,_22,_23){ -var t=$(_21); -if(_23==undefined){ -_23=parseInt(_21.style[_22]); -if(isNaN(_23)){ +function _21(_2b,_2c,_2d){ +var t=$(_2b); +if(_2d==undefined){ +_2d=parseInt(_2b.style[_2c]); +if(isNaN(_2d)){ return undefined; } if($._boxModel){ -_23+=_24(); +_2d+=_2e(); } -return _23; +return _2d; }else{ -if(_23===""){ -t.css(_22,""); +if(_2d===""){ +t.css(_2c,""); }else{ if($._boxModel){ -_23-=_24(); -if(_23<0){ -_23=0; +_2d-=_2e(); +if(_2d<0){ +_2d=0; } } -t.css(_22,_23+"px"); +t.css(_2c,_2d+"px"); } } -function _24(){ -if(_22.toLowerCase().indexOf("width")>=0){ +function _2e(){ +if(_2c.toLowerCase().indexOf("width")>=0){ return t.outerWidth()-t.width(); }else{ return t.outerHeight()-t.height(); @@ -260,63 +324,63 @@ return t.outerHeight()-t.height(); }; })(jQuery); (function($){ -var _25=null; -var _26=null; -var _27=false; -function _28(e){ +var _2f=null; +var _30=null; +var _31=false; +function _32(e){ if(e.touches.length!=1){ return; } -if(!_27){ -_27=true; +if(!_31){ +_31=true; dblClickTimer=setTimeout(function(){ -_27=false; +_31=false; },500); }else{ clearTimeout(dblClickTimer); -_27=false; -_29(e,"dblclick"); +_31=false; +_33(e,"dblclick"); } -_25=setTimeout(function(){ -_29(e,"contextmenu",3); +_2f=setTimeout(function(){ +_33(e,"contextmenu",3); },1000); -_29(e,"mousedown"); +_33(e,"mousedown"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; -function _2a(e){ +function _34(e){ if(e.touches.length!=1){ return; } -if(_25){ -clearTimeout(_25); +if(_2f){ +clearTimeout(_2f); } -_29(e,"mousemove"); +_33(e,"mousemove"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; -function _2b(e){ -if(_25){ -clearTimeout(_25); +function _35(e){ +if(_2f){ +clearTimeout(_2f); } -_29(e,"mouseup"); +_33(e,"mouseup"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; -function _29(e,_2c,_2d){ -var _2e=new $.Event(_2c); -_2e.pageX=e.changedTouches[0].pageX; -_2e.pageY=e.changedTouches[0].pageY; -_2e.which=_2d||1; -$(e.target).trigger(_2e); +function _33(e,_36,_37){ +var _38=new $.Event(_36); +_38.pageX=e.changedTouches[0].pageX; +_38.pageY=e.changedTouches[0].pageY; +_38.which=_37||1; +$(e.target).trigger(_38); }; if(document.addEventListener){ -document.addEventListener("touchstart",_28,true); -document.addEventListener("touchmove",_2a,true); -document.addEventListener("touchend",_2b,true); +document.addEventListener("touchstart",_32,true); +document.addEventListener("touchmove",_34,true); +document.addEventListener("touchend",_35,true); } })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.passwordbox.js b/assets/js/easy-ui/plugins/jquery.passwordbox.js new file mode 100644 index 0000000000..5f2b3ce789 --- /dev/null +++ b/assets/js/easy-ui/plugins/jquery.passwordbox.js @@ -0,0 +1,156 @@ +/** + * jQuery EasyUI 1.5.2 + * + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. + * + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com + * + */ +(function($){ +function _1(_2){ +var _3=$.data(_2,"passwordbox"); +var _4=_3.options; +var _5=$.extend(true,[],_4.icons); +if(_4.showEye){ +_5.push({iconCls:"passwordbox-open",handler:function(e){ +_4.revealed=!_4.revealed; +_6(_2); +}}); +} +$(_2).addClass("passwordbox-f").textbox($.extend({},_4,{icons:_5})); +_6(_2); +}; +function _7(_8,_9,_a){ +var t=$(_8); +var _b=t.passwordbox("options"); +if(_b.revealed){ +t.textbox("setValue",_9); +return; +} +var _c=unescape(_b.passwordChar); +var cc=_9.split(""); +var vv=t.passwordbox("getValue").split(""); +for(var i=0;i
                  "); -$(_2).bind("_resize",function(e,_3){ -if($(this).hasClass("easyui-fluid")||_3){ -_4(_2); -} -return false; -}); -return $(_2); -}; -function _4(_5,_6){ -var _7=$.data(_5,"progressbar").options; -var _8=$.data(_5,"progressbar").bar; -if(_6){ -_7.width=_6; -} -_8._size(_7); -_8.find("div.progressbar-text").css("width",_8.width()); -_8.find("div.progressbar-text,div.progressbar-value").css({height:_8.height()+"px",lineHeight:_8.height()+"px"}); -}; -$.fn.progressbar=function(_9,_a){ -if(typeof _9=="string"){ -var _b=$.fn.progressbar.methods[_9]; -if(_b){ -return _b(this,_a); -} -} -_9=_9||{}; -return this.each(function(){ -var _c=$.data(this,"progressbar"); -if(_c){ -$.extend(_c.options,_9); -}else{ -_c=$.data(this,"progressbar",{options:$.extend({},$.fn.progressbar.defaults,$.fn.progressbar.parseOptions(this),_9),bar:_1(this)}); -} -$(this).progressbar("setValue",_c.options.value); -_4(this); -}); -}; -$.fn.progressbar.methods={options:function(jq){ -return $.data(jq[0],"progressbar").options; -},resize:function(jq,_d){ -return jq.each(function(){ -_4(this,_d); -}); -},getValue:function(jq){ -return $.data(jq[0],"progressbar").options.value; -},setValue:function(jq,_e){ -if(_e<0){ -_e=0; -} -if(_e>100){ -_e=100; -} -return jq.each(function(){ -var _f=$.data(this,"progressbar").options; -var _10=_f.text.replace(/{value}/,_e); -var _11=_f.value; -_f.value=_e; -$(this).find("div.progressbar-value").width(_e+"%"); -$(this).find("div.progressbar-text").html(_10); -if(_11!=_e){ -_f.onChange.call(this,_e,_11); -} -}); -}}; -$.fn.progressbar.parseOptions=function(_12){ -return $.extend({},$.parser.parseOptions(_12,["width","height","text",{value:"number"}])); -}; -$.fn.progressbar.defaults={width:"auto",height:22,value:0,text:"{value}%",onChange:function(_13,_14){ -}}; -})(jQuery); + function init(target){ + $(target).addClass('progressbar'); + $(target).html('
                  '); + $(target).bind('_resize', function(e,force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(target); + } + return false; + }); + return $(target); + } + + function setSize(target,width){ + var opts = $.data(target, 'progressbar').options; + var bar = $.data(target, 'progressbar').bar; + if (width) opts.width = width; + bar._size(opts); + bar.find('div.progressbar-text').css('width', bar.width()); + bar.find('div.progressbar-text,div.progressbar-value').css({ + height: bar.height()+'px', + lineHeight: bar.height()+'px' + }); + } + + $.fn.progressbar = function(options, param){ + if (typeof options == 'string'){ + var method = $.fn.progressbar.methods[options]; + if (method){ + return method(this, param); + } + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'progressbar'); + if (state){ + $.extend(state.options, options); + } else { + state = $.data(this, 'progressbar', { + options: $.extend({}, $.fn.progressbar.defaults, $.fn.progressbar.parseOptions(this), options), + bar: init(this) + }); + } + $(this).progressbar('setValue', state.options.value); + setSize(this); + }); + }; + + $.fn.progressbar.methods = { + options: function(jq){ + return $.data(jq[0], 'progressbar').options; + }, + resize: function(jq, width){ + return jq.each(function(){ + setSize(this, width); + }); + }, + getValue: function(jq){ + return $.data(jq[0], 'progressbar').options.value; + }, + setText: function(jq, text) { + return jq.each(function() { + var opts = $.data(this, 'progressbar').options; + opts.text = text; + }) + }, + setValue: function(jq, value){ + if (value < 0) value = 0; + if (value > 100) value = 100; + return jq.each(function(){ + var opts = $.data(this, 'progressbar').options; + var text = opts.text.replace(/{value}/, value); + var oldValue = opts.value; + opts.value = value; + $(this).find('div.progressbar-value').width(value+'%'); + $(this).find('div.progressbar-text').html(text); + if (oldValue != value){ + opts.onChange.call(this, value, oldValue); + } + }); + } + }; + + $.fn.progressbar.parseOptions = function(target){ + return $.extend({}, $.parser.parseOptions(target, ['width','height','text',{value:'number'}])); + }; + + $.fn.progressbar.defaults = { + width: 'auto', + height: 22, + value: 0, // percentage value + text: '{value}%', + onChange:function(newValue,oldValue){} + }; +})(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.propertygrid.js b/assets/js/easy-ui/plugins/jquery.propertygrid.js old mode 100755 new mode 100644 index 36b85ed023..e64837d2e5 --- a/assets/js/easy-ui/plugins/jquery.propertygrid.js +++ b/assets/js/easy-ui/plugins/jquery.propertygrid.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -67,6 +67,7 @@ t.datagrid("endEdit",_11); t.datagrid("cancelEdit",_11); } }); +_10.editIndex=undefined; }; $.fn.propertygrid=function(_12,_13){ if(typeof _12=="string"){ @@ -110,20 +111,16 @@ var _23=_22.options; var _24=$(_1e).datagrid("getColumnFields",_21); var _25=[]; _25.push("
                  "); -_25.push(""); -_25.push(""); if((_21&&(_23.rownumbers||_23.frozenColumns.length))||(!_21&&!(_23.rownumbers||_23.frozenColumns.length))){ -_25.push(""); +_25.push(""); +_25.push(" "); +_25.push(""); } -_25.push(""); -_25.push(""); -_25.push("
                   "); if(!_21){ _25.push(""); _25.push(_23.groupFormatter.call(_1e,_20.value,_20.rows)); _25.push(""); } -_25.push("
                  "); _25.push("
                  "); _25.push(""); var _26=_20.startIndex; @@ -209,11 +206,13 @@ return null; }; function _35(){ if(!$("#datagrid-group-style").length){ -$("head").append(""); +$("head").append(""); } }; }}); -$.extend($.fn.datagrid.methods,{expandGroup:function(jq,_3e){ +$.extend($.fn.datagrid.methods,{groups:function(jq){ +return jq.datagrid("options").view.groups; +},expandGroup:function(jq,_3e){ return jq.each(function(){ var _3f=$.data(this,"datagrid").dc.view; var _40=_3f.find(_3e!=undefined?"div.datagrid-group[group-index=\""+_3e+"\"]":"div.datagrid-group"); @@ -249,6 +248,10 @@ var _4f=_4e.options; var dc=_4e.dc; var _50=null; var _51; +if(!_4e.data.rows.length){ +$(_4c).datagrid("loadData",[row]); +return; +} for(var i=0;i"+"
                  "+""+""+"
                  "+"
                  "+"
                  "+"
                  "+""+"").insertAfter(_2); +var _3=$("
                  "+"
                  "+""+""+"
                  "+"
                  "+"
                  "+"
                  "+""+"
                  ").insertAfter(_2); var t=$(_2); t.addClass("slider-f").hide(); var _4=t.attr("name"); @@ -85,27 +85,29 @@ var _1b=_19.slider; _1b.removeClass("slider-h slider-v slider-disabled"); _1b.addClass(_1a.mode=="h"?"slider-h":"slider-v"); _1b.addClass(_1a.disabled?"slider-disabled":""); +var _1c=_1b.find(".slider-inner"); +_1c.html(""+""); +if(_1a.range){ +_1c.append(""+""); +} _1b.find("a.slider-handle").draggable({axis:_1a.mode,cursor:"pointer",disabled:_1a.disabled,onDrag:function(e){ -var _1c=e.data.left; -var _1d=_1b.width(); +var _1d=e.data.left; +var _1e=_1b.width(); if(_1a.mode!="h"){ -_1c=e.data.top; -_1d=_1b.height(); +_1d=e.data.top; +_1e=_1b.height(); } -if(_1c<0||_1c>_1d){ +if(_1d<0||_1d>_1e){ return false; }else{ -var _1e=_34(_18,_1c); -_1f(_1e); +_1f(_1d,this); return false; } -},onBeforeDrag:function(){ -_19.isDragging=true; },onStartDrag:function(){ +_19.isDragging=true; _1a.onSlideStart.call(_18,_1a.value); },onStopDrag:function(e){ -var _20=_34(_18,(_1a.mode=="h"?e.data.left:e.data.top)); -_1f(_20); +_1f(_1a.mode=="h"?e.data.left:e.data.top,this); _1a.onSlideEnd.call(_18,_1a.value); _1a.onComplete.call(_18,_1a.value); _19.isDragging=false; @@ -115,104 +117,158 @@ if(_19.isDragging||_1a.disabled){ return; } var pos=$(this).offset(); -var _21=_34(_18,(_1a.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top))); -_1f(_21); +_1f(_1a.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top)); _1a.onComplete.call(_18,_1a.value); }); -function _1f(_22){ -var s=Math.abs(_22%_1a.step); +function _1f(pos,_20){ +var _21=_22(_18,pos); +var s=Math.abs(_21%_1a.step); if(s<_1a.step/2){ -_22-=s; +_21-=s; +}else{ +_21=_21-s+_1a.step; +} +if(_1a.range){ +var v1=_1a.value[0]; +var v2=_1a.value[1]; +var m=parseFloat((v1+v2)/2); +if(_20){ +var _23=$(_20).nextAll(".slider-handle").length>0; +if(_21<=v2&&_23){ +v1=_21; +}else{ +if(_21>=v1&&(!_23)){ +v2=_21; +} +} +}else{ +if(_21v2){ +v2=_21; +}else{ +_21_27.max){ -_25=_27.max; -} -_27.value=_25; -$(_24).val(_25); -_28.find("input.slider-value").val(_25); -var pos=_2a(_24,_25); -var tip=_28.find(".slider-tip"); -if(_27.showTip){ +function _24(_25,_26){ +var _27=$.data(_25,"slider"); +var _28=_27.options; +var _29=_27.slider; +var _2a=$.isArray(_28.value)?_28.value:[_28.value]; +var _2b=[]; +if(!$.isArray(_26)){ +_26=$.map(String(_26).split(_28.separator),function(v){ +return parseFloat(v); +}); +} +_29.find(".slider-value").remove(); +var _2c=$(_25).attr("sliderName")||""; +for(var i=0;i<_26.length;i++){ +var _2d=_26[i]; +if(_2d<_28.min){ +_2d=_28.min; +} +if(_2d>_28.max){ +_2d=_28.max; +} +var _2e=$("").appendTo(_29); +_2e.attr("name",_2c); +_2e.val(_2d); +_2b.push(_2d); +var _2f=_29.find(".slider-handle:eq("+i+")"); +var tip=_2f.next(); +var pos=_30(_25,_2d); +if(_28.showTip){ tip.show(); -tip.html(_27.tipFormatter.call(_24,_27.value)); +tip.html(_28.tipFormatter.call(_25,_2d)); }else{ tip.hide(); } -if(_27.mode=="h"){ -var _2b="left:"+pos+"px;"; -_28.find(".slider-handle").attr("style",_2b); -tip.attr("style",_2b+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px"); +if(_28.mode=="h"){ +var _31="left:"+pos+"px;"; +_2f.attr("style",_31); +tip.attr("style",_31+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px"); }else{ -var _2b="top:"+pos+"px;"; -_28.find(".slider-handle").attr("style",_2b); -tip.attr("style",_2b+"margin-left:"+(-Math.round(tip.outerWidth()))+"px"); +var _31="top:"+pos+"px;"; +_2f.attr("style",_31); +tip.attr("style",_31+"margin-left:"+(-Math.round(tip.outerWidth()))+"px"); } -if(_29!=_25){ -_27.onChange.call(_24,_25,_29); +} +_28.value=_28.range?_2b:_2b[0]; +$(_25).val(_28.range?_2b.join(_28.separator):_2b[0]); +if(_2a.join(",")!=_2b.join(",")){ +_28.onChange.call(_25,_28.value,(_28.range?_2a:_2a[0])); } }; -function _c(_2c){ -var _2d=$.data(_2c,"slider").options; -var fn=_2d.onChange; -_2d.onChange=function(){ +function _c(_32){ +var _33=$.data(_32,"slider").options; +var fn=_33.onChange; +_33.onChange=function(){ }; -_23(_2c,_2d.value); -_2d.onChange=fn; +_24(_32,_33.value); +_33.onChange=fn; }; -function _2a(_2e,_2f){ -var _30=$.data(_2e,"slider"); -var _31=_30.options; -var _32=_30.slider; -var _33=_31.mode=="h"?_32.width():_32.height(); -var pos=_31.converter.toPosition.call(_2e,_2f,_33); -if(_31.mode=="v"){ -pos=_32.height()-pos; -} -if(_31.reversed){ -pos=_33-pos; -} -return pos.toFixed(0); -}; -function _34(_35,pos){ -var _36=$.data(_35,"slider"); +function _30(_34,_35){ +var _36=$.data(_34,"slider"); var _37=_36.options; var _38=_36.slider; var _39=_37.mode=="h"?_38.width():_38.height(); -var _3a=_37.converter.toValue.call(_35,_37.mode=="h"?(_37.reversed?(_39-pos):pos):(_39-pos),_39); -return _3a.toFixed(0); +var pos=_37.converter.toPosition.call(_34,_35,_39); +if(_37.mode=="v"){ +pos=_38.height()-pos; +} +if(_37.reversed){ +pos=_39-pos; +} +return pos.toFixed(0); }; -$.fn.slider=function(_3b,_3c){ -if(typeof _3b=="string"){ -return $.fn.slider.methods[_3b](this,_3c); +function _22(_3a,pos){ +var _3b=$.data(_3a,"slider"); +var _3c=_3b.options; +var _3d=_3b.slider; +var _3e=_3c.mode=="h"?_3d.width():_3d.height(); +var pos=_3c.mode=="h"?(_3c.reversed?(_3e-pos):pos):(_3c.reversed?pos:(_3e-pos)); +var _3f=_3c.converter.toValue.call(_3a,pos,_3e); +return _3f.toFixed(0); +}; +$.fn.slider=function(_40,_41){ +if(typeof _40=="string"){ +return $.fn.slider.methods[_40](this,_41); } -_3b=_3b||{}; +_40=_40||{}; return this.each(function(){ -var _3d=$.data(this,"slider"); -if(_3d){ -$.extend(_3d.options,_3b); +var _42=$.data(this,"slider"); +if(_42){ +$.extend(_42.options,_40); }else{ -_3d=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_3b),slider:_1(this)}); +_42=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_40),slider:_1(this)}); $(this).removeAttr("disabled"); } -var _3e=_3d.options; -_3e.min=parseFloat(_3e.min); -_3e.max=parseFloat(_3e.max); -_3e.value=parseFloat(_3e.value); -_3e.step=parseFloat(_3e.step); -_3e.originalValue=_3e.value; +var _43=_42.options; +_43.min=parseFloat(_43.min); +_43.max=parseFloat(_43.max); +if(_43.range){ +if(!$.isArray(_43.value)){ +_43.value=$.map(String(_43.value).split(_43.separator),function(v){ +return parseFloat(v); +}); +} +if(_43.value.length<2){ +_43.value.push(_43.max); +} +}else{ +_43.value=parseFloat(_43.value); +} +_43.step=parseFloat(_43.step); +_43.originalValue=_43.value; _17(this); _d(this); _6(this); @@ -225,25 +281,31 @@ return jq.each(function(){ $.data(this,"slider").slider.remove(); $(this).remove(); }); -},resize:function(jq,_3f){ +},resize:function(jq,_44){ return jq.each(function(){ -_6(this,_3f); +_6(this,_44); }); },getValue:function(jq){ return jq.slider("options").value; -},setValue:function(jq,_40){ +},getValues:function(jq){ +return jq.slider("options").value; +},setValue:function(jq,_45){ return jq.each(function(){ -_23(this,_40); +_24(this,[_45]); +}); +},setValues:function(jq,_46){ +return jq.each(function(){ +_24(this,_46); }); },clear:function(jq){ return jq.each(function(){ -var _41=$(this).slider("options"); -_23(this,_41.min); +var _47=$(this).slider("options"); +_24(this,_47.range?[_47.min,_47.max]:[_47.min]); }); },reset:function(jq){ return jq.each(function(){ -var _42=$(this).slider("options"); -_23(this,_42.originalValue); +var _48=$(this).slider("options"); +$(this).slider(_48.range?"setValues":"setValue",_48.originalValue); }); },enable:function(jq){ return jq.each(function(){ @@ -256,22 +318,22 @@ $.data(this,"slider").options.disabled=true; _17(this); }); }}; -$.fn.slider.parseOptions=function(_43){ -var t=$(_43); -return $.extend({},$.parser.parseOptions(_43,["width","height","mode",{reversed:"boolean",showTip:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)}); +$.fn.slider.parseOptions=function(_49){ +var t=$(_49); +return $.extend({},$.parser.parseOptions(_49,["width","height","mode",{reversed:"boolean",showTip:"boolean",range:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)}); }; -$.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,value:0,min:0,max:100,step:1,rule:[],tipFormatter:function(_44){ -return _44; -},converter:{toPosition:function(_45,_46){ -var _47=$(this).slider("options"); -return (_45-_47.min)/(_47.max-_47.min)*_46; -},toValue:function(pos,_48){ -var _49=$(this).slider("options"); -return _49.min+(_49.max-_49.min)*(pos/_48); -}},onChange:function(_4a,_4b){ -},onSlideStart:function(_4c){ -},onSlideEnd:function(_4d){ -},onComplete:function(_4e){ +$.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,range:false,value:0,separator:",",min:0,max:100,step:1,rule:[],tipFormatter:function(_4a){ +return _4a; +},converter:{toPosition:function(_4b,_4c){ +var _4d=$(this).slider("options"); +return (_4b-_4d.min)/(_4d.max-_4d.min)*_4c; +},toValue:function(pos,_4e){ +var _4f=$(this).slider("options"); +return _4f.min+(_4f.max-_4f.min)*(pos/_4e); +}},onChange:function(_50,_51){ +},onSlideStart:function(_52){ +},onSlideEnd:function(_53){ +},onComplete:function(_54){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.spinner.js b/assets/js/easy-ui/plugins/jquery.spinner.js old mode 100755 new mode 100644 index 88f2cb7797..82644ef711 --- a/assets/js/easy-ui/plugins/jquery.spinner.js +++ b/assets/js/easy-ui/plugins/jquery.spinner.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -12,61 +12,116 @@ function _1(_2){ var _3=$.data(_2,"spinner"); var _4=_3.options; var _5=$.extend(true,[],_4.icons); -_5.push({iconCls:"spinner-arrow",handler:function(e){ -_6(e); -}}); -$(_2).addClass("spinner-f").textbox($.extend({},_4,{icons:_5})); -var _7=$(_2).textbox("getIcon",_5.length-1); -_7.append(""); -_7.append(""); +if(_4.spinAlign=="left"||_4.spinAlign=="right"){ +_4.spinArrow=true; +_4.iconAlign=_4.spinAlign; +var _6={iconCls:"spinner-arrow",handler:function(e){ +var _7=$(e.target).closest(".spinner-arrow-up,.spinner-arrow-down"); +_13(e.data.target,_7.hasClass("spinner-arrow-down")); +}}; +if(_4.spinAlign=="left"){ +_5.unshift(_6); +}else{ +_5.push(_6); +} +}else{ +_4.spinArrow=false; +if(_4.spinAlign=="vertical"){ +if(_4.buttonAlign!="top"){ +_4.buttonAlign="bottom"; +} +_4.clsLeft="textbox-button-bottom"; +_4.clsRight="textbox-button-top"; +}else{ +_4.clsLeft="textbox-button-left"; +_4.clsRight="textbox-button-right"; +} +} +$(_2).addClass("spinner-f").textbox($.extend({},_4,{icons:_5,doSize:false,onResize:function(_8,_9){ +if(!_4.spinArrow){ +var _a=$(this).next(); +var _b=_a.find(".textbox-button:not(.spinner-button)"); +if(_b.length){ +var _c=_b.outerWidth(); +var _d=_b.outerHeight(); +var _e=_a.find(".spinner-button."+_4.clsLeft); +var _f=_a.find(".spinner-button."+_4.clsRight); +if(_4.buttonAlign=="right"){ +_f.css("marginRight",_c+"px"); +}else{ +if(_4.buttonAlign=="left"){ +_e.css("marginLeft",_c+"px"); +}else{ +if(_4.buttonAlign=="top"){ +_f.css("marginTop",_d+"px"); +}else{ +_e.css("marginBottom",_d+"px"); +} +} +} +} +} +_4.onResize.call(this,_8,_9); +}})); $(_2).attr("spinnerName",$(_2).attr("textboxName")); _3.spinner=$(_2).next(); _3.spinner.addClass("spinner"); -}; -function _6(e){ -var _8=e.data.target; -var _9=$(_8).spinner("options"); -var up=$(e.target).closest("a.spinner-arrow-up"); -if(up.length){ -_9.spin.call(_8,false); -_9.onSpinUp.call(_8); -$(_8).spinner("validate"); +if(_4.spinArrow){ +var _10=_3.spinner.find(".spinner-arrow"); +_10.append(""); +_10.append(""); +}else{ +var _11=$("").addClass(_4.clsLeft).appendTo(_3.spinner); +var _12=$("").addClass(_4.clsRight).appendTo(_3.spinner); +_11.linkbutton({iconCls:_4.reversed?"spinner-button-up":"spinner-button-down",onClick:function(){ +_13(_2,!_4.reversed); +}}); +_12.linkbutton({iconCls:_4.reversed?"spinner-button-down":"spinner-button-up",onClick:function(){ +_13(_2,_4.reversed); +}}); +if(_4.disabled){ +$(_2).spinner("disable"); } -var _a=$(e.target).closest("a.spinner-arrow-down"); -if(_a.length){ -_9.spin.call(_8,true); -_9.onSpinDown.call(_8); -$(_8).spinner("validate"); +if(_4.readonly){ +$(_2).spinner("readonly"); } +} +$(_2).spinner("resize"); +}; +function _13(_14,_15){ +var _16=$(_14).spinner("options"); +_16.spin.call(_14,_15); +_16[_15?"onSpinDown":"onSpinUp"].call(_14); +$(_14).spinner("validate"); }; -$.fn.spinner=function(_b,_c){ -if(typeof _b=="string"){ -var _d=$.fn.spinner.methods[_b]; -if(_d){ -return _d(this,_c); +$.fn.spinner=function(_17,_18){ +if(typeof _17=="string"){ +var _19=$.fn.spinner.methods[_17]; +if(_19){ +return _19(this,_18); }else{ -return this.textbox(_b,_c); +return this.textbox(_17,_18); } } -_b=_b||{}; +_17=_17||{}; return this.each(function(){ -var _e=$.data(this,"spinner"); -if(_e){ -$.extend(_e.options,_b); +var _1a=$.data(this,"spinner"); +if(_1a){ +$.extend(_1a.options,_17); }else{ -_e=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_b)}); +_1a=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_17)}); } _1(this); }); }; $.fn.spinner.methods={options:function(jq){ -var _f=jq.textbox("options"); -return $.extend($.data(jq[0],"spinner").options,{width:_f.width,value:_f.value,originalValue:_f.originalValue,disabled:_f.disabled,readonly:_f.readonly}); +var _1b=jq.textbox("options"); +return $.extend($.data(jq[0],"spinner").options,{width:_1b.width,value:_1b.value,originalValue:_1b.originalValue,disabled:_1b.disabled,readonly:_1b.readonly}); }}; -$.fn.spinner.parseOptions=function(_10){ -return $.extend({},$.fn.textbox.parseOptions(_10),$.parser.parseOptions(_10,["min","max",{increment:"number"}])); +$.fn.spinner.parseOptions=function(_1c){ +return $.extend({},$.fn.textbox.parseOptions(_1c),$.parser.parseOptions(_1c,["min","max","spinAlign",{increment:"number",reversed:"boolean"}])); }; -$.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spin:function(_11){ +$.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spinAlign:"right",reversed:false,spin:function(_1d){ },onSpinUp:function(){ },onSpinDown:function(){ }}); diff --git a/assets/js/easy-ui/plugins/jquery.splitbutton.js b/assets/js/easy-ui/plugins/jquery.splitbutton.js old mode 100755 new mode 100644 index 7ea389b310..06c7602387 --- a/assets/js/easy-ui/plugins/jquery.splitbutton.js +++ b/assets/js/easy-ui/plugins/jquery.splitbutton.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ diff --git a/assets/js/easy-ui/plugins/jquery.switchbutton.js b/assets/js/easy-ui/plugins/jquery.switchbutton.js new file mode 100644 index 0000000000..670ffd9f1c --- /dev/null +++ b/assets/js/easy-ui/plugins/jquery.switchbutton.js @@ -0,0 +1,193 @@ +/** + * jQuery EasyUI 1.5.2 + * + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. + * + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com + * + */ +(function($){ +function _1(_2){ +var _3=$(""+""+""+""+""+""+""+"").insertAfter(_2); +var t=$(_2); +t.addClass("switchbutton-f").hide(); +var _4=t.attr("name"); +if(_4){ +t.removeAttr("name").attr("switchbuttonName",_4); +_3.find(".switchbutton-value").attr("name",_4); +} +_3.bind("_resize",function(e,_5){ +if($(this).hasClass("easyui-fluid")||_5){ +_6(_2); +} +return false; +}); +return _3; +}; +function _6(_7,_8){ +var _9=$.data(_7,"switchbutton"); +var _a=_9.options; +var _b=_9.switchbutton; +if(_8){ +$.extend(_a,_8); +} +var _c=_b.is(":visible"); +if(!_c){ +_b.appendTo("body"); +} +_b._size(_a); +var w=_b.width(); +var h=_b.height(); +var w=_b.outerWidth(); +var h=_b.outerHeight(); +var _d=parseInt(_a.handleWidth)||_b.height(); +var _e=w*2-_d; +_b.find(".switchbutton-inner").css({width:_e+"px",height:h+"px",lineHeight:h+"px"}); +_b.find(".switchbutton-handle")._outerWidth(_d)._outerHeight(h).css({marginLeft:-_d/2+"px"}); +_b.find(".switchbutton-on").css({width:(w-_d/2)+"px",textIndent:(_a.reversed?"":"-")+_d/2+"px"}); +_b.find(".switchbutton-off").css({width:(w-_d/2)+"px",textIndent:(_a.reversed?"-":"")+_d/2+"px"}); +_a.marginWidth=w-_d; +_f(_7,_a.checked,false); +if(!_c){ +_b.insertAfter(_7); +} +}; +function _10(_11){ +var _12=$.data(_11,"switchbutton"); +var _13=_12.options; +var _14=_12.switchbutton; +var _15=_14.find(".switchbutton-inner"); +var on=_15.find(".switchbutton-on").html(_13.onText); +var off=_15.find(".switchbutton-off").html(_13.offText); +var _16=_15.find(".switchbutton-handle").html(_13.handleText); +if(_13.reversed){ +off.prependTo(_15); +on.insertAfter(_16); +}else{ +on.prependTo(_15); +off.insertAfter(_16); +} +_14.find(".switchbutton-value")._propAttr("checked",_13.checked); +_14.removeClass("switchbutton-disabled").addClass(_13.disabled?"switchbutton-disabled":""); +_14.removeClass("switchbutton-reversed").addClass(_13.reversed?"switchbutton-reversed":""); +_f(_11,_13.checked); +_17(_11,_13.readonly); +$(_11).switchbutton("setValue",_13.value); +}; +function _f(_18,_19,_1a){ +var _1b=$.data(_18,"switchbutton"); +var _1c=_1b.options; +_1c.checked=_19; +var _1d=_1b.switchbutton.find(".switchbutton-inner"); +var _1e=_1d.find(".switchbutton-on"); +var _1f=_1c.reversed?(_1c.checked?_1c.marginWidth:0):(_1c.checked?0:_1c.marginWidth); +var dir=_1e.css("float").toLowerCase(); +var css={}; +css["margin-"+dir]=-_1f+"px"; +_1a?_1d.animate(css,200):_1d.css(css); +var _20=_1d.find(".switchbutton-value"); +var ck=_20.is(":checked"); +$(_18).add(_20)._propAttr("checked",_1c.checked); +if(ck!=_1c.checked){ +_1c.onChange.call(_18,_1c.checked); +} +}; +function _21(_22,_23){ +var _24=$.data(_22,"switchbutton"); +var _25=_24.options; +var _26=_24.switchbutton; +var _27=_26.find(".switchbutton-value"); +if(_23){ +_25.disabled=true; +$(_22).add(_27).attr("disabled","disabled"); +_26.addClass("switchbutton-disabled"); +}else{ +_25.disabled=false; +$(_22).add(_27).removeAttr("disabled"); +_26.removeClass("switchbutton-disabled"); +} +}; +function _17(_28,_29){ +var _2a=$.data(_28,"switchbutton"); +var _2b=_2a.options; +_2b.readonly=_29==undefined?true:_29; +_2a.switchbutton.removeClass("switchbutton-readonly").addClass(_2b.readonly?"switchbutton-readonly":""); +}; +function _2c(_2d){ +var _2e=$.data(_2d,"switchbutton"); +var _2f=_2e.options; +_2e.switchbutton.unbind(".switchbutton").bind("click.switchbutton",function(){ +if(!_2f.disabled&&!_2f.readonly){ +_f(_2d,_2f.checked?false:true,true); +} +}); +}; +$.fn.switchbutton=function(_30,_31){ +if(typeof _30=="string"){ +return $.fn.switchbutton.methods[_30](this,_31); +} +_30=_30||{}; +return this.each(function(){ +var _32=$.data(this,"switchbutton"); +if(_32){ +$.extend(_32.options,_30); +}else{ +_32=$.data(this,"switchbutton",{options:$.extend({},$.fn.switchbutton.defaults,$.fn.switchbutton.parseOptions(this),_30),switchbutton:_1(this)}); +} +_32.options.originalChecked=_32.options.checked; +_10(this); +_6(this); +_2c(this); +}); +}; +$.fn.switchbutton.methods={options:function(jq){ +var _33=jq.data("switchbutton"); +return $.extend(_33.options,{value:_33.switchbutton.find(".switchbutton-value").val()}); +},resize:function(jq,_34){ +return jq.each(function(){ +_6(this,_34); +}); +},enable:function(jq){ +return jq.each(function(){ +_21(this,false); +}); +},disable:function(jq){ +return jq.each(function(){ +_21(this,true); +}); +},readonly:function(jq,_35){ +return jq.each(function(){ +_17(this,_35); +}); +},check:function(jq){ +return jq.each(function(){ +_f(this,true); +}); +},uncheck:function(jq){ +return jq.each(function(){ +_f(this,false); +}); +},clear:function(jq){ +return jq.each(function(){ +_f(this,false); +}); +},reset:function(jq){ +return jq.each(function(){ +var _36=$(this).switchbutton("options"); +_f(this,_36.originalChecked); +}); +},setValue:function(jq,_37){ +return jq.each(function(){ +$(this).val(_37); +$.data(this,"switchbutton").switchbutton.find(".switchbutton-value").val(_37); +}); +}}; +$.fn.switchbutton.parseOptions=function(_38){ +var t=$(_38); +return $.extend({},$.parser.parseOptions(_38,["onText","offText","handleText",{handleWidth:"number",reversed:"boolean"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)}); +}; +$.fn.switchbutton.defaults={handleWidth:"auto",width:60,height:26,checked:false,disabled:false,readonly:false,reversed:false,onText:"ON",offText:"OFF",handleText:"",value:"on",onChange:function(_39){ +}}; +})(jQuery); + diff --git a/assets/js/easy-ui/plugins/jquery.tabs.js b/assets/js/easy-ui/plugins/jquery.tabs.js old mode 100755 new mode 100644 index 58e05fff43..ad2a2805ef --- a/assets/js/easy-ui/plugins/jquery.tabs.js +++ b/assets/js/easy-ui/plugins/jquery.tabs.js @@ -1,192 +1,214 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ -function _1(_2){ -var _3=$.data(_2,"tabs").options; -if(_3.tabPosition=="left"||_3.tabPosition=="right"||!_3.showHeader){ +function _1(c){ +var w=0; +$(c).children().each(function(){ +w+=$(this).outerWidth(true); +}); +return w; +}; +function _2(_3){ +var _4=$.data(_3,"tabs").options; +if(_4.tabPosition=="left"||_4.tabPosition=="right"||!_4.showHeader){ return; } -var _4=$(_2).children("div.tabs-header"); -var _5=_4.children("div.tabs-tool"); -var _6=_4.children("div.tabs-scroller-left"); -var _7=_4.children("div.tabs-scroller-right"); -var _8=_4.children("div.tabs-wrap"); -var _9=_4.outerHeight(); -if(_3.plain){ -_9-=_9-_4.height(); -} -_5._outerHeight(_9); -var _a=0; -$("ul.tabs li",_4).each(function(){ -_a+=$(this).outerWidth(true); -}); -var _b=_4.width()-_5._outerWidth(); -if(_a>_b){ -_6.add(_7).show()._outerHeight(_9); -if(_3.toolPosition=="left"){ -_5.css({left:_6.outerWidth(),right:""}); -_8.css({marginLeft:_6.outerWidth()+_5._outerWidth(),marginRight:_7._outerWidth(),width:_b-_6.outerWidth()-_7.outerWidth()}); +var _5=$(_3).children("div.tabs-header"); +var _6=_5.children("div.tabs-tool:not(.tabs-tool-hidden)"); +var _7=_5.children("div.tabs-scroller-left"); +var _8=_5.children("div.tabs-scroller-right"); +var _9=_5.children("div.tabs-wrap"); +var _a=_5.outerHeight(); +if(_4.plain){ +_a-=_a-_5.height(); +} +_6._outerHeight(_a); +var _b=_1(_5.find("ul.tabs")); +var _c=_5.width()-_6._outerWidth(); +if(_b>_c){ +_7.add(_8).show()._outerHeight(_a); +if(_4.toolPosition=="left"){ +_6.css({left:_7.outerWidth(),right:""}); +_9.css({marginLeft:_7.outerWidth()+_6._outerWidth(),marginRight:_8._outerWidth(),width:_c-_7.outerWidth()-_8.outerWidth()}); }else{ -_5.css({left:"",right:_7.outerWidth()}); -_8.css({marginLeft:_6.outerWidth(),marginRight:_7.outerWidth()+_5._outerWidth(),width:_b-_6.outerWidth()-_7.outerWidth()}); +_6.css({left:"",right:_8.outerWidth()}); +_9.css({marginLeft:_7.outerWidth(),marginRight:_8.outerWidth()+_6._outerWidth(),width:_c-_7.outerWidth()-_8.outerWidth()}); } }else{ -_6.add(_7).hide(); -if(_3.toolPosition=="left"){ -_5.css({left:0,right:""}); -_8.css({marginLeft:_5._outerWidth(),marginRight:0,width:_b}); +_7.add(_8).hide(); +if(_4.toolPosition=="left"){ +_6.css({left:0,right:""}); +_9.css({marginLeft:_6._outerWidth(),marginRight:0,width:_c}); }else{ -_5.css({left:"",right:0}); -_8.css({marginLeft:0,marginRight:_5._outerWidth(),width:_b}); +_6.css({left:"",right:0}); +_9.css({marginLeft:0,marginRight:_6._outerWidth(),width:_c}); } } }; -function _c(_d){ -var _e=$.data(_d,"tabs").options; -var _f=$(_d).children("div.tabs-header"); -if(_e.tools){ -if(typeof _e.tools=="string"){ -$(_e.tools).addClass("tabs-tool").appendTo(_f); -$(_e.tools).show(); +function _d(_e){ +var _f=$.data(_e,"tabs").options; +var _10=$(_e).children("div.tabs-header"); +if(_f.tools){ +if(typeof _f.tools=="string"){ +$(_f.tools).addClass("tabs-tool").appendTo(_10); +$(_f.tools).show(); }else{ -_f.children("div.tabs-tool").remove(); -var _10=$("
                  ").appendTo(_f); -var tr=_10.find("tr"); -for(var i=0;i<_e.tools.length;i++){ +_10.children("div.tabs-tool").remove(); +var _11=$("
                  ").appendTo(_10); +var tr=_11.find("tr"); +for(var i=0;i<_f.tools.length;i++){ var td=$("").appendTo(tr); -var _11=$("").appendTo(td); -_11[0].onclick=eval(_e.tools[i].handler||function(){ +var _12=$("").appendTo(td); +_12[0].onclick=eval(_f.tools[i].handler||function(){ }); -_11.linkbutton($.extend({},_e.tools[i],{plain:true})); +_12.linkbutton($.extend({},_f.tools[i],{plain:true})); } } }else{ -_f.children("div.tabs-tool").remove(); +_10.children("div.tabs-tool").remove(); } }; -function _12(_13,_14){ -var _15=$.data(_13,"tabs"); -var _16=_15.options; -var cc=$(_13); -if(_14){ -$.extend(_16,{width:_14.width,height:_14.height}); -} -cc._size(_16); -var _17=cc.children("div.tabs-header"); -var _18=cc.children("div.tabs-panels"); -var _19=_17.find("div.tabs-wrap"); -var ul=_19.find(".tabs"); -for(var i=0;i<_15.tabs.length;i++){ -var _1a=_15.tabs[i].panel("options"); -var p_t=_1a.tab.find("a.tabs-inner"); -var _1b=parseInt(_1a.tabWidth||_16.tabWidth)||undefined; -if(_1b){ -p_t._outerWidth(_1b); -}else{ -p_t.css("width",""); -} -p_t._outerHeight(_16.tabHeight); -p_t.css("lineHeight",p_t.height()+"px"); +function _13(_14,_15){ +var _16=$.data(_14,"tabs"); +var _17=_16.options; +var cc=$(_14); +if(!_17.doSize){ +return; } -if(_16.tabPosition=="left"||_16.tabPosition=="right"){ -_17._outerWidth(_16.showHeader?_16.headerWidth:0); -_18._outerWidth(cc.width()-_17.outerWidth()); -_17.add(_18)._outerHeight(_16.height); -_19._outerWidth(_17.width()); -ul._outerWidth(_19.width()).css("height",""); +if(_15){ +$.extend(_17,{width:_15.width,height:_15.height}); +} +cc._size(_17); +var _18=cc.children("div.tabs-header"); +var _19=cc.children("div.tabs-panels"); +var _1a=_18.find("div.tabs-wrap"); +var ul=_1a.find(".tabs"); +ul.children("li").removeClass("tabs-first tabs-last"); +ul.children("li:first").addClass("tabs-first"); +ul.children("li:last").addClass("tabs-last"); +if(_17.tabPosition=="left"||_17.tabPosition=="right"){ +_18._outerWidth(_17.showHeader?_17.headerWidth:0); +_19._outerWidth(cc.width()-_18.outerWidth()); +_18.add(_19)._size("height",isNaN(parseInt(_17.height))?"":cc.height()); +_1a._outerWidth(_18.width()); +ul._outerWidth(_1a.width()).css("height",""); }else{ -var lrt=_17.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool"); -_17._outerWidth(_16.width).css("height",""); -if(_16.showHeader){ -_17.css("background-color",""); -_19.css("height",""); -lrt.show(); +_18.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)").css("display",_17.showHeader?"block":"none"); +_18._outerWidth(cc.width()).css("height",""); +if(_17.showHeader){ +_18.css("background-color",""); +_1a.css("height",""); }else{ -_17.css("background-color","transparent"); -_17._outerHeight(0); -_19._outerHeight(0); -lrt.hide(); -} -ul._outerHeight(_16.tabHeight).css("width",""); -_1(_13); -_18._size("height",isNaN(_16.height)?"":(_16.height-_17.outerHeight())); -_18._size("width",isNaN(_16.width)?"":_16.width); +_18.css("background-color","transparent"); +_18._outerHeight(0); +_1a._outerHeight(0); +} +ul._outerHeight(_17.tabHeight).css("width",""); +ul._outerHeight(ul.outerHeight()-ul.height()-1+_17.tabHeight).css("width",""); +_19._size("height",isNaN(parseInt(_17.height))?"":(cc.height()-_18.outerHeight())); +_19._size("width",cc.width()); +} +if(_16.tabs.length){ +var d1=ul.outerWidth(true)-ul.width(); +var li=ul.children("li:first"); +var d2=li.outerWidth(true)-li.width(); +var _1b=_18.width()-_18.children(".tabs-tool:not(.tabs-tool-hidden)")._outerWidth(); +var _1c=Math.floor((_1b-d1-d2*_16.tabs.length)/_16.tabs.length); +$.map(_16.tabs,function(p){ +_1d(p,(_17.justified&&$.inArray(_17.tabPosition,["top","bottom"])>=0)?_1c:undefined); +}); +if(_17.justified&&$.inArray(_17.tabPosition,["top","bottom"])>=0){ +var _1e=_1b-d1-_1(ul); +_1d(_16.tabs[_16.tabs.length-1],_1c+_1e); +} +} +_2(_14); +function _1d(p,_1f){ +var _20=p.panel("options"); +var p_t=_20.tab.find("a.tabs-inner"); +var _1f=_1f?_1f:(parseInt(_20.tabWidth||_17.tabWidth||undefined)); +if(_1f){ +p_t._outerWidth(_1f); +}else{ +p_t.css("width",""); } +p_t._outerHeight(_17.tabHeight); +p_t.css("lineHeight",p_t.height()+"px"); +p_t.find(".easyui-fluid:visible").triggerHandler("_resize"); +}; }; -function _1c(_1d){ -var _1e=$.data(_1d,"tabs").options; -var tab=_1f(_1d); +function _21(_22){ +var _23=$.data(_22,"tabs").options; +var tab=_24(_22); if(tab){ -var _20=$(_1d).children("div.tabs-panels"); -var _21=_1e.width=="auto"?"auto":_20.width(); -var _22=_1e.height=="auto"?"auto":_20.height(); -tab.panel("resize",{width:_21,height:_22}); +var _25=$(_22).children("div.tabs-panels"); +var _26=_23.width=="auto"?"auto":_25.width(); +var _27=_23.height=="auto"?"auto":_25.height(); +tab.panel("resize",{width:_26,height:_27}); } }; -function _23(_24){ -var _25=$.data(_24,"tabs").tabs; -var cc=$(_24); -cc.addClass("tabs-container"); -var pp=$("
                  ").insertBefore(cc); +function _28(_29){ +var _2a=$.data(_29,"tabs").tabs; +var cc=$(_29).addClass("tabs-container"); +var _2b=$("
                  ").insertBefore(cc); cc.children("div").each(function(){ -pp[0].appendChild(this); +_2b[0].appendChild(this); }); -cc[0].appendChild(pp[0]); -$("
                  "+"
                  "+"
                  "+"
                  "+"
                    "+"
                    "+"
                    ").prependTo(_24); +cc[0].appendChild(_2b[0]); +$("
                    "+"
                    "+"
                    "+"
                    "+"
                      "+"
                      "+"
                      ").prependTo(_29); cc.children("div.tabs-panels").children("div").each(function(i){ -var _26=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); -var pp=$(this); -_25.push(pp); -_35(_24,pp,_26); +var _2c=$.extend({},$.parser.parseOptions(this),{disabled:($(this).attr("disabled")?true:undefined),selected:($(this).attr("selected")?true:undefined)}); +_3c(_29,_2c,$(this)); }); cc.children("div.tabs-header").find(".tabs-scroller-left, .tabs-scroller-right").hover(function(){ $(this).addClass("tabs-scroller-over"); },function(){ $(this).removeClass("tabs-scroller-over"); }); -cc.bind("_resize",function(e,_27){ -if($(this).hasClass("easyui-fluid")||_27){ -_12(_24); -_1c(_24); +cc.bind("_resize",function(e,_2d){ +if($(this).hasClass("easyui-fluid")||_2d){ +_13(_29); +_21(_29); } return false; }); }; -function _28(_29){ -var _2a=$.data(_29,"tabs"); -var _2b=_2a.options; -$(_29).children("div.tabs-header").unbind().bind("click",function(e){ +function _2e(_2f){ +var _30=$.data(_2f,"tabs"); +var _31=_30.options; +$(_2f).children("div.tabs-header").unbind().bind("click",function(e){ if($(e.target).hasClass("tabs-scroller-left")){ -$(_29).tabs("scrollBy",-_2b.scrollIncrement); +$(_2f).tabs("scrollBy",-_31.scrollIncrement); }else{ if($(e.target).hasClass("tabs-scroller-right")){ -$(_29).tabs("scrollBy",_2b.scrollIncrement); +$(_2f).tabs("scrollBy",_31.scrollIncrement); }else{ var li=$(e.target).closest("li"); if(li.hasClass("tabs-disabled")){ -return; +return false; } var a=$(e.target).closest("a.tabs-close"); if(a.length){ -_4c(_29,_2c(li)); +_5a(_2f,_32(li)); }else{ if(li.length){ -var _2d=_2c(li); -var _2e=_2a.tabs[_2d].panel("options"); -if(_2e.collapsible){ -_2e.closed?_41(_29,_2d):_6b(_29,_2d); +var _33=_32(li); +var _34=_30.tabs[_33].panel("options"); +if(_34.collapsible){ +_34.closed?_50(_2f,_33):_75(_2f,_33); }else{ -_41(_29,_2d); +_50(_2f,_33); } } } +return false; } } }).bind("contextmenu",function(e){ @@ -195,133 +217,207 @@ if(li.hasClass("tabs-disabled")){ return; } if(li.length){ -_2b.onContextMenu.call(_29,e,li.find("span.tabs-title").html(),_2c(li)); +_31.onContextMenu.call(_2f,e,li.find("span.tabs-title").html(),_32(li)); } }); -function _2c(li){ -var _2f=0; +function _32(li){ +var _35=0; li.parent().children("li").each(function(i){ if(li[0]==this){ -_2f=i; +_35=i; return false; } }); -return _2f; +return _35; }; }; -function _30(_31){ -var _32=$.data(_31,"tabs").options; -var _33=$(_31).children("div.tabs-header"); -var _34=$(_31).children("div.tabs-panels"); -_33.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right"); -_34.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right"); -if(_32.tabPosition=="top"){ -_33.insertBefore(_34); +function _36(_37){ +var _38=$.data(_37,"tabs").options; +var _39=$(_37).children("div.tabs-header"); +var _3a=$(_37).children("div.tabs-panels"); +_39.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right"); +_3a.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right"); +if(_38.tabPosition=="top"){ +_39.insertBefore(_3a); }else{ -if(_32.tabPosition=="bottom"){ -_33.insertAfter(_34); -_33.addClass("tabs-header-bottom"); -_34.addClass("tabs-panels-top"); +if(_38.tabPosition=="bottom"){ +_39.insertAfter(_3a); +_39.addClass("tabs-header-bottom"); +_3a.addClass("tabs-panels-top"); }else{ -if(_32.tabPosition=="left"){ -_33.addClass("tabs-header-left"); -_34.addClass("tabs-panels-right"); +if(_38.tabPosition=="left"){ +_39.addClass("tabs-header-left"); +_3a.addClass("tabs-panels-right"); }else{ -if(_32.tabPosition=="right"){ -_33.addClass("tabs-header-right"); -_34.addClass("tabs-panels-left"); +if(_38.tabPosition=="right"){ +_39.addClass("tabs-header-right"); +_3a.addClass("tabs-panels-left"); } } } } -if(_32.plain==true){ -_33.addClass("tabs-header-plain"); +if(_38.plain==true){ +_39.addClass("tabs-header-plain"); }else{ -_33.removeClass("tabs-header-plain"); -} -if(_32.border==true){ -_33.removeClass("tabs-header-noborder"); -_34.removeClass("tabs-panels-noborder"); +_39.removeClass("tabs-header-plain"); +} +_39.removeClass("tabs-header-narrow").addClass(_38.narrow?"tabs-header-narrow":""); +var _3b=_39.find(".tabs"); +_3b.removeClass("tabs-pill").addClass(_38.pill?"tabs-pill":""); +_3b.removeClass("tabs-narrow").addClass(_38.narrow?"tabs-narrow":""); +_3b.removeClass("tabs-justified").addClass(_38.justified?"tabs-justified":""); +if(_38.border==true){ +_39.removeClass("tabs-header-noborder"); +_3a.removeClass("tabs-panels-noborder"); }else{ -_33.addClass("tabs-header-noborder"); -_34.addClass("tabs-panels-noborder"); +_39.addClass("tabs-header-noborder"); +_3a.addClass("tabs-panels-noborder"); } +_38.doSize=true; }; -function _35(_36,pp,_37){ -var _38=$.data(_36,"tabs"); -_37=_37||{}; -pp.panel($.extend({},_37,{border:false,noheader:true,closed:true,doSize:false,iconCls:(_37.icon?_37.icon:undefined),onLoad:function(){ -if(_37.onLoad){ -_37.onLoad.call(this,arguments); -} -_38.options.onLoad.call(_36,$(this)); -}})); -var _39=pp.panel("options"); -var _3a=$(_36).children("div.tabs-header").find("ul.tabs"); -_39.tab=$("
                    • ").appendTo(_3a); -_39.tab.append(""+""+""+""); -$(_36).tabs("update",{tab:pp,options:_39,type:"header"}); -}; -function _3b(_3c,_3d){ -var _3e=$.data(_3c,"tabs"); -var _3f=_3e.options; -var _40=_3e.tabs; -if(_3d.selected==undefined){ -_3d.selected=true; -} -var pp=$("
                      ").appendTo($(_3c).children("div.tabs-panels")); +function _3c(_3d,_3e,pp){ +_3e=_3e||{}; +var _3f=$.data(_3d,"tabs"); +var _40=_3f.tabs; +if(_3e.index==undefined||_3e.index>_40.length){ +_3e.index=_40.length; +} +if(_3e.index<0){ +_3e.index=0; +} +var ul=$(_3d).children("div.tabs-header").find("ul.tabs"); +var _41=$(_3d).children("div.tabs-panels"); +var tab=$("
                    • "+""+""+""+""+"
                    • "); +if(!pp){ +pp=$("
                      "); +} +if(_3e.index>=_40.length){ +tab.appendTo(ul); +pp.appendTo(_41); _40.push(pp); -_35(_3c,pp,_3d); -_3f.onAdd.call(_3c,_3d.title,_40.length-1); -_12(_3c); -if(_3d.selected){ -_41(_3c,_40.length-1); +}else{ +tab.insertBefore(ul.children("li:eq("+_3e.index+")")); +pp.insertBefore(_41.children("div.panel:eq("+_3e.index+")")); +_40.splice(_3e.index,0,pp); +} +pp.panel($.extend({},_3e,{tab:tab,border:false,noheader:true,closed:true,doSize:false,iconCls:(_3e.icon?_3e.icon:undefined),onLoad:function(){ +if(_3e.onLoad){ +_3e.onLoad.call(this,arguments); +} +_3f.options.onLoad.call(_3d,$(this)); +},onBeforeOpen:function(){ +if(_3e.onBeforeOpen){ +if(_3e.onBeforeOpen.call(this)==false){ +return false; +} +} +var p=$(_3d).tabs("getSelected"); +if(p){ +if(p[0]!=this){ +$(_3d).tabs("unselect",_4a(_3d,p)); +p=$(_3d).tabs("getSelected"); +if(p){ +return false; } -}; -function _42(_43,_44){ -_44.type=_44.type||"all"; -var _45=$.data(_43,"tabs").selectHis; -var pp=_44.tab; -var _46=pp.panel("options").title; -if(_44.type=="all"||_44=="body"){ -pp.panel($.extend({},_44.options,{iconCls:(_44.options.icon?_44.options.icon:undefined)})); -} -if(_44.type=="all"||_44.type=="header"){ -var _47=pp.panel("options"); -var tab=_47.tab; -var _48=tab.find("span.tabs-title"); -var _49=tab.find("span.tabs-icon"); -_48.html(_47.title); -_49.attr("class","tabs-icon"); -tab.find("a.tabs-close").remove(); -if(_47.closable){ -_48.addClass("tabs-closable"); -$("").appendTo(tab); }else{ -_48.removeClass("tabs-closable"); +_21(_3d); +return false; +} } -if(_47.iconCls){ -_48.addClass("tabs-with-icon"); -_49.addClass(_47.iconCls); +var _42=$(this).panel("options"); +_42.tab.addClass("tabs-selected"); +var _43=$(_3d).find(">div.tabs-header>div.tabs-wrap"); +var _44=_42.tab.position().left; +var _45=_44+_42.tab.outerWidth(); +if(_44<0||_45>_43.width()){ +var _46=_44-(_43.width()-_42.tab.width())/2; +$(_3d).tabs("scrollBy",_46); }else{ -_48.removeClass("tabs-with-icon"); +$(_3d).tabs("scrollBy",0); +} +var _47=$(this).panel("panel"); +_47.css("display","block"); +_21(_3d); +_47.css("display","none"); +},onOpen:function(){ +if(_3e.onOpen){ +_3e.onOpen.call(this); +} +var _48=$(this).panel("options"); +_3f.selectHis.push(_48.title); +_3f.options.onSelect.call(_3d,_48.title,_4a(_3d,this)); +},onBeforeClose:function(){ +if(_3e.onBeforeClose){ +if(_3e.onBeforeClose.call(this)==false){ +return false; +} } -if(_46!=_47.title){ -for(var i=0;i<_45.length;i++){ -if(_45[i]==_46){ -_45[i]=_47.title; +$(this).panel("options").tab.removeClass("tabs-selected"); +},onClose:function(){ +if(_3e.onClose){ +_3e.onClose.call(this); } +var _49=$(this).panel("options"); +_3f.options.onUnselect.call(_3d,_49.title,_4a(_3d,this)); +}})); +$(_3d).tabs("update",{tab:pp,options:pp.panel("options"),type:"header"}); +}; +function _4b(_4c,_4d){ +var _4e=$.data(_4c,"tabs"); +var _4f=_4e.options; +if(_4d.selected==undefined){ +_4d.selected=true; } +_3c(_4c,_4d); +_4f.onAdd.call(_4c,_4d.title,_4d.index); +if(_4d.selected){ +_50(_4c,_4d.index); } -tab.find("span.tabs-p-tool").remove(); -if(_47.tools){ -var _4a=$("").insertAfter(tab.find("a.tabs-inner")); -if($.isArray(_47.tools)){ -for(var i=0;i<_47.tools.length;i++){ -var t=$("").appendTo(_4a); -t.addClass(_47.tools[i].iconCls); -if(_47.tools[i].handler){ -t.bind("click",{handler:_47.tools[i].handler},function(e){ +}; +function _51(_52,_53){ +_53.type=_53.type||"all"; +var _54=$.data(_52,"tabs").selectHis; +var pp=_53.tab; +var _55=pp.panel("options"); +var _56=_55.title; +$.extend(_55,_53.options,{iconCls:(_53.options.icon?_53.options.icon:undefined)}); +if(_53.type=="all"||_53.type=="body"){ +pp.panel(); +} +if(_53.type=="all"||_53.type=="header"){ +var tab=_55.tab; +if(_55.header){ +tab.find(".tabs-inner").html($(_55.header)); +}else{ +var _57=tab.find("span.tabs-title"); +var _58=tab.find("span.tabs-icon"); +_57.html(_55.title); +_58.attr("class","tabs-icon"); +tab.find("a.tabs-close").remove(); +if(_55.closable){ +_57.addClass("tabs-closable"); +$("").appendTo(tab); +}else{ +_57.removeClass("tabs-closable"); +} +if(_55.iconCls){ +_57.addClass("tabs-with-icon"); +_58.addClass(_55.iconCls); +}else{ +_57.removeClass("tabs-with-icon"); +} +if(_55.tools){ +var _59=tab.find("span.tabs-p-tool"); +if(!_59.length){ +var _59=$("").insertAfter(tab.find("a.tabs-inner")); +} +if($.isArray(_55.tools)){ +_59.empty(); +for(var i=0;i<_55.tools.length;i++){ +var t=$("").appendTo(_59); +t.addClass(_55.tools[i].iconCls); +if(_55.tools[i].handler){ +t.bind("click",{handler:_55.tools[i].handler},function(e){ if($(this).parents("li").hasClass("tabs-disabled")){ return; } @@ -330,274 +426,283 @@ e.data.handler.call(this); } } }else{ -$(_47.tools).children().appendTo(_4a); +$(_55.tools).children().appendTo(_59); } -var pr=_4a.children().length*12; -if(_47.closable){ +var pr=_59.children().length*12; +if(_55.closable){ pr+=8; +_59.css("right",""); }else{ pr-=3; -_4a.css("right","5px"); +_59.css("right","5px"); } -_48.css("padding-right",pr+"px"); +_57.css("padding-right",pr+"px"); +}else{ +tab.find("span.tabs-p-tool").remove(); +_57.css("padding-right",""); } } -_12(_43); -$.data(_43,"tabs").options.onUpdate.call(_43,_47.title,_4b(_43,pp)); +if(_56!=_55.title){ +for(var i=0;i<_54.length;i++){ +if(_54[i]==_56){ +_54[i]=_55.title; +} +} +} +} +if(_55.disabled){ +_55.tab.addClass("tabs-disabled"); +}else{ +_55.tab.removeClass("tabs-disabled"); +} +_13(_52); +$.data(_52,"tabs").options.onUpdate.call(_52,_55.title,_4a(_52,pp)); }; -function _4c(_4d,_4e){ -var _4f=$.data(_4d,"tabs").options; -var _50=$.data(_4d,"tabs").tabs; -var _51=$.data(_4d,"tabs").selectHis; -if(!_52(_4d,_4e)){ +function _5a(_5b,_5c){ +var _5d=$.data(_5b,"tabs").options; +var _5e=$.data(_5b,"tabs").tabs; +var _5f=$.data(_5b,"tabs").selectHis; +if(!_60(_5b,_5c)){ return; } -var tab=_53(_4d,_4e); -var _54=tab.panel("options").title; -var _55=_4b(_4d,tab); -if(_4f.onBeforeClose.call(_4d,_54,_55)==false){ +var tab=_61(_5b,_5c); +var _62=tab.panel("options").title; +var _63=_4a(_5b,tab); +if(_5d.onBeforeClose.call(_5b,_62,_63)==false){ return; } -var tab=_53(_4d,_4e,true); +var tab=_61(_5b,_5c,true); tab.panel("options").tab.remove(); tab.panel("destroy"); -_4f.onClose.call(_4d,_54,_55); -_12(_4d); -for(var i=0;i<_51.length;i++){ -if(_51[i]==_54){ -_51.splice(i,1); +_5d.onClose.call(_5b,_62,_63); +_13(_5b); +for(var i=0;i<_5f.length;i++){ +if(_5f[i]==_62){ +_5f.splice(i,1); i--; } } -var _56=_51.pop(); -if(_56){ -_41(_4d,_56); +var _64=_5f.pop(); +if(_64){ +_50(_5b,_64); }else{ -if(_50.length){ -_41(_4d,0); +if(_5e.length){ +_50(_5b,0); } } }; -function _53(_57,_58,_59){ -var _5a=$.data(_57,"tabs").tabs; -if(typeof _58=="number"){ -if(_58<0||_58>=_5a.length){ -return null; -}else{ -var tab=_5a[_58]; -if(_59){ -_5a.splice(_58,1); +function _61(_65,_66,_67){ +var _68=$.data(_65,"tabs").tabs; +var tab=null; +if(typeof _66=="number"){ +if(_66>=0&&_66<_68.length){ +tab=_68[_66]; +if(_67){ +_68.splice(_66,1); } -return tab; } +}else{ +var tmp=$(""); +for(var i=0;i<_68.length;i++){ +var p=_68[i]; +tmp.html(p.panel("options").title); +if(tmp.text()==_66){ +tab=p; +if(_67){ +_68.splice(i,1); } -for(var i=0;i<_5a.length;i++){ -var tab=_5a[i]; -if(tab.panel("options").title==_58){ -if(_59){ -_5a.splice(i,1); +break; } -return tab; } +tmp.remove(); } -return null; +return tab; }; -function _4b(_5b,tab){ -var _5c=$.data(_5b,"tabs").tabs; -for(var i=0;i<_5c.length;i++){ -if(_5c[i][0]==$(tab)[0]){ +function _4a(_69,tab){ +var _6a=$.data(_69,"tabs").tabs; +for(var i=0;i<_6a.length;i++){ +if(_6a[i][0]==$(tab)[0]){ return i; } } return -1; }; -function _1f(_5d){ -var _5e=$.data(_5d,"tabs").tabs; -for(var i=0;i<_5e.length;i++){ -var tab=_5e[i]; -if(tab.panel("options").closed==false){ +function _24(_6b){ +var _6c=$.data(_6b,"tabs").tabs; +for(var i=0;i<_6c.length;i++){ +var tab=_6c[i]; +if(tab.panel("options").tab.hasClass("tabs-selected")){ return tab; } } return null; }; -function _5f(_60){ -var _61=$.data(_60,"tabs"); -var _62=_61.tabs; -for(var i=0;i<_62.length;i++){ -if(_62[i].panel("options").selected){ -_41(_60,i); +function _6d(_6e){ +var _6f=$.data(_6e,"tabs"); +var _70=_6f.tabs; +for(var i=0;i<_70.length;i++){ +var _71=_70[i].panel("options"); +if(_71.selected&&!_71.disabled){ +_50(_6e,i); return; } } -_41(_60,_61.options.selected); +_50(_6e,_6f.options.selected); }; -function _41(_63,_64){ -var _65=$.data(_63,"tabs"); -var _66=_65.options; -var _67=_65.tabs; -var _68=_65.selectHis; -if(_67.length==0){ -return; -} -var _69=_53(_63,_64); -if(!_69){ -return; -} -var _6a=_1f(_63); -if(_6a){ -if(_69[0]==_6a[0]){ -_1c(_63); -return; -} -_6b(_63,_4b(_63,_6a)); -if(!_6a.panel("options").closed){ -return; +function _50(_72,_73){ +var p=_61(_72,_73); +if(p&&!p.is(":visible")){ +_74(_72); +if(!p.panel("options").disabled){ +p.panel("open"); } } -_69.panel("open"); -var _6c=_69.panel("options").title; -_68.push(_6c); -var tab=_69.panel("options").tab; -tab.addClass("tabs-selected"); -var _6d=$(_63).find(">div.tabs-header>div.tabs-wrap"); -var _6e=tab.position().left; -var _6f=_6e+tab.outerWidth(); -if(_6e<0||_6f>_6d.width()){ -var _70=_6e-(_6d.width()-tab.width())/2; -$(_63).tabs("scrollBy",_70); -}else{ -$(_63).tabs("scrollBy",0); -} -_1c(_63); -_66.onSelect.call(_63,_6c,_4b(_63,_69)); }; -function _6b(_71,_72){ -var _73=$.data(_71,"tabs"); -var p=_53(_71,_72); -if(p){ -var _74=p.panel("options"); -if(!_74.closed){ +function _75(_76,_77){ +var p=_61(_76,_77); +if(p&&p.is(":visible")){ +_74(_76); p.panel("close"); -if(_74.closed){ -_74.tab.removeClass("tabs-selected"); -_73.options.onUnselect.call(_71,_74.title,_4b(_71,p)); -} -} } }; -function _52(_75,_76){ -return _53(_75,_76)!=null; +function _74(_78){ +$(_78).children("div.tabs-panels").each(function(){ +$(this).stop(true,true); +}); }; -function _77(_78,_79){ -var _7a=$.data(_78,"tabs").options; -_7a.showHeader=_79; -$(_78).tabs("resize"); +function _60(_79,_7a){ +return _61(_79,_7a)!=null; }; -$.fn.tabs=function(_7b,_7c){ -if(typeof _7b=="string"){ -return $.fn.tabs.methods[_7b](this,_7c); +function _7b(_7c,_7d){ +var _7e=$.data(_7c,"tabs").options; +_7e.showHeader=_7d; +$(_7c).tabs("resize"); +}; +function _7f(_80,_81){ +var _82=$(_80).find(">.tabs-header>.tabs-tool"); +if(_81){ +_82.removeClass("tabs-tool-hidden").show(); +}else{ +_82.addClass("tabs-tool-hidden").hide(); } -_7b=_7b||{}; +$(_80).tabs("resize").tabs("scrollBy",0); +}; +$.fn.tabs=function(_83,_84){ +if(typeof _83=="string"){ +return $.fn.tabs.methods[_83](this,_84); +} +_83=_83||{}; return this.each(function(){ -var _7d=$.data(this,"tabs"); -if(_7d){ -$.extend(_7d.options,_7b); +var _85=$.data(this,"tabs"); +if(_85){ +$.extend(_85.options,_83); }else{ -$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_7b),tabs:[],selectHis:[]}); -_23(this); -} -_c(this); -_30(this); -_12(this); +$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_83),tabs:[],selectHis:[]}); _28(this); -_5f(this); +} +_d(this); +_36(this); +_13(this); +_2e(this); +_6d(this); }); }; $.fn.tabs.methods={options:function(jq){ var cc=jq[0]; -var _7e=$.data(cc,"tabs").options; -var s=_1f(cc); -_7e.selected=s?_4b(cc,s):-1; -return _7e; +var _86=$.data(cc,"tabs").options; +var s=_24(cc); +_86.selected=s?_4a(cc,s):-1; +return _86; },tabs:function(jq){ return $.data(jq[0],"tabs").tabs; -},resize:function(jq,_7f){ +},resize:function(jq,_87){ return jq.each(function(){ -_12(this,_7f); -_1c(this); +_13(this,_87); +_21(this); }); -},add:function(jq,_80){ +},add:function(jq,_88){ return jq.each(function(){ -_3b(this,_80); +_4b(this,_88); }); -},close:function(jq,_81){ +},close:function(jq,_89){ return jq.each(function(){ -_4c(this,_81); +_5a(this,_89); }); -},getTab:function(jq,_82){ -return _53(jq[0],_82); +},getTab:function(jq,_8a){ +return _61(jq[0],_8a); },getTabIndex:function(jq,tab){ -return _4b(jq[0],tab); +return _4a(jq[0],tab); },getSelected:function(jq){ -return _1f(jq[0]); -},select:function(jq,_83){ +return _24(jq[0]); +},select:function(jq,_8b){ return jq.each(function(){ -_41(this,_83); +_50(this,_8b); }); -},unselect:function(jq,_84){ +},unselect:function(jq,_8c){ return jq.each(function(){ -_6b(this,_84); +_75(this,_8c); }); -},exists:function(jq,_85){ -return _52(jq[0],_85); -},update:function(jq,_86){ +},exists:function(jq,_8d){ +return _60(jq[0],_8d); +},update:function(jq,_8e){ return jq.each(function(){ -_42(this,_86); +_51(this,_8e); }); -},enableTab:function(jq,_87){ +},enableTab:function(jq,_8f){ return jq.each(function(){ -$(this).tabs("getTab",_87).panel("options").tab.removeClass("tabs-disabled"); +var _90=$(this).tabs("getTab",_8f).panel("options"); +_90.tab.removeClass("tabs-disabled"); +_90.disabled=false; }); -},disableTab:function(jq,_88){ +},disableTab:function(jq,_91){ return jq.each(function(){ -$(this).tabs("getTab",_88).panel("options").tab.addClass("tabs-disabled"); +var _92=$(this).tabs("getTab",_91).panel("options"); +_92.tab.addClass("tabs-disabled"); +_92.disabled=true; }); },showHeader:function(jq){ return jq.each(function(){ -_77(this,true); +_7b(this,true); }); },hideHeader:function(jq){ return jq.each(function(){ -_77(this,false); +_7b(this,false); +}); +},showTool:function(jq){ +return jq.each(function(){ +_7f(this,true); +}); +},hideTool:function(jq){ +return jq.each(function(){ +_7f(this,false); }); -},scrollBy:function(jq,_89){ +},scrollBy:function(jq,_93){ return jq.each(function(){ -var _8a=$(this).tabs("options"); -var _8b=$(this).find(">div.tabs-header>div.tabs-wrap"); -var pos=Math.min(_8b._scrollLeft()+_89,_8c()); -_8b.animate({scrollLeft:pos},_8a.scrollDuration); -function _8c(){ +var _94=$(this).tabs("options"); +var _95=$(this).find(">div.tabs-header>div.tabs-wrap"); +var pos=Math.min(_95._scrollLeft()+_93,_96()); +_95.animate({scrollLeft:pos},_94.scrollDuration); +function _96(){ var w=0; -var ul=_8b.children("ul"); +var ul=_95.children("ul"); ul.children("li").each(function(){ w+=$(this).outerWidth(true); }); -return w-_8b.width()+(ul.outerWidth()-ul.width()); +return w-_95.width()+(ul.outerWidth()-ul.width()); }; }); }}; -$.fn.tabs.parseOptions=function(_8d){ -return $.extend({},$.parser.parseOptions(_8d,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean",headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number",showHeader:"boolean"}])); +$.fn.tabs.parseOptions=function(_97){ +return $.extend({},$.parser.parseOptions(_97,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean"},{headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number"},{showHeader:"boolean",justified:"boolean",narrow:"boolean",pill:"boolean"}])); }; -$.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:27,selected:0,showHeader:true,plain:false,fit:false,border:true,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_8e){ -},onSelect:function(_8f,_90){ -},onUnselect:function(_91,_92){ -},onBeforeClose:function(_93,_94){ -},onClose:function(_95,_96){ -},onAdd:function(_97,_98){ -},onUpdate:function(_99,_9a){ -},onContextMenu:function(e,_9b,_9c){ +$.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:27,selected:0,showHeader:true,plain:false,fit:false,border:true,justified:false,narrow:false,pill:false,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_98){ +},onSelect:function(_99,_9a){ +},onUnselect:function(_9b,_9c){ +},onBeforeClose:function(_9d,_9e){ +},onClose:function(_9f,_a0){ +},onAdd:function(_a1,_a2){ +},onUpdate:function(_a3,_a4){ +},onContextMenu:function(e,_a5,_a6){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.tagbox.js b/assets/js/easy-ui/plugins/jquery.tagbox.js new file mode 100644 index 0000000000..273eb86958 --- /dev/null +++ b/assets/js/easy-ui/plugins/jquery.tagbox.js @@ -0,0 +1,218 @@ +/** + * jQuery EasyUI 1.5.2 + * + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. + * + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com + * + */ +(function($){ +function _1(_2){ +var _3=$.data(_2,"tagbox"); +var _4=_3.options; +$(_2).addClass("tagbox-f").combobox($.extend({},_4,{cls:"tagbox",reversed:true,onChange:function(_5,_6){ +_7(); +$(this).combobox("hidePanel"); +_4.onChange.call(_2,_5,_6); +},onResizing:function(_8,_9){ +var _a=$(this).combobox("textbox"); +var tb=$(this).data("textbox").textbox; +tb.css({height:"",paddingLeft:_a.css("marginLeft"),paddingRight:_a.css("marginRight")}); +_a.css("margin",0); +tb._size({width:_4.width},$(this).parent()); +_23(_2); +_12(this); +_4.onResizing.call(_2,_8,_9); +},onLoadSuccess:function(_b){ +_7(); +_4.onLoadSuccess.call(_2,_b); +}})); +_7(); +_23(_2); +function _7(){ +$(_2).next().find(".tagbox-label").remove(); +var _c=$(_2).tagbox("textbox"); +var ss=[]; +$.map($(_2).tagbox("getValues"),function(_d,_e){ +var _f=_4.finder.getRow(_2,_d); +var _10=_4.tagFormatter.call(_2,_d,_f); +var cs={}; +var css=_4.tagStyler.call(_2,_d,_f)||""; +if(typeof css=="string"){ +cs={s:css}; +}else{ +cs={c:css["class"]||"",s:css["style"]||""}; +} +var _11=$("").insertBefore(_c).html(_10); +_11.attr("tagbox-index",_e); +_11.attr("style",cs.s).addClass(cs.c); +$("").appendTo(_11); +}); +_12(_2); +$(_2).combobox("setText",""); +}; +}; +function _12(_13,_14){ +var _15=$(_13).next(); +var _16=_14?$(_14):_15.find(".tagbox-label"); +if(_16.length){ +var _17=$(_13).tagbox("textbox"); +var _18=$(_16[0]); +var _19=_18.outerHeight(true)-_18.outerHeight(); +var _1a=_17.outerHeight()-_19*2; +_16.css({height:_1a+"px",lineHeight:_1a+"px"}); +var _1b=_15.find(".textbox-addon").css("height","100%"); +_1b.find(".textbox-icon").css("height","100%"); +_15.find(".textbox-button").linkbutton("resize",{height:"100%"}); +} +}; +function _1c(_1d){ +var _1e=$(_1d).next(); +_1e.unbind(".tagbox").bind("click.tagbox",function(e){ +var _1f=$(_1d).tagbox("options"); +if(_1f.disabled||_1f.readonly){ +return; +} +if($(e.target).hasClass("tagbox-remove")){ +var _20=parseInt($(e.target).parent().attr("tagbox-index")); +var _21=$(_1d).tagbox("getValues"); +if(_1f.onBeforeRemoveTag.call(_1d,_21[_20])==false){ +return; +} +_1f.onRemoveTag.call(_1d,_21[_20]); +_21.splice(_20,1); +$(_1d).tagbox("setValues",_21); +}else{ +var _22=$(e.target).closest(".tagbox-label"); +if(_22.length){ +var _20=parseInt(_22.attr("tagbox-index")); +var _21=$(_1d).tagbox("getValues"); +_1f.onClickTag.call(_1d,_21[_20]); +} +} +$(this).find(".textbox-text").focus(); +}).bind("keyup.tagbox",function(e){ +_23(_1d); +}).bind("mouseover.tagbox",function(e){ +if($(e.target).closest(".textbox-button,.textbox-addon,.tagbox-label").length){ +$(this).triggerHandler("mouseleave"); +}else{ +$(this).find(".textbox-text").triggerHandler("mouseenter"); +} +}).bind("mouseleave.tagbox",function(e){ +$(this).find(".textbox-text").triggerHandler("mouseleave"); +}); +}; +function _23(_24){ +var _25=$(_24).tagbox("options"); +var _26=$(_24).tagbox("textbox"); +var _27=$(_24).next(); +var tmp=$("").appendTo("body"); +tmp.attr("style",_26.attr("style")); +tmp.css({position:"absolute",top:-9999,left:-9999,width:"auto",fontFamily:_26.css("fontFamily"),fontSize:_26.css("fontSize"),fontWeight:_26.css("fontWeight"),whiteSpace:"nowrap"}); +var _28=_29(_26.val()); +var _2a=_29(_25.prompt||""); +tmp.remove(); +var _2b=Math.min(Math.max(_28,_2a)+20,_27.width()); +_26._outerWidth(_2b); +_27.find(".textbox-button").linkbutton("resize",{height:"100%"}); +function _29(val){ +var s=val.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">"); +tmp.html(s); +return tmp.outerWidth(); +}; +}; +function _2c(_2d){ +var t=$(_2d); +var _2e=t.tagbox("options"); +if(_2e.limitToList){ +var _2f=t.tagbox("panel"); +var _30=_2f.children("div.combobox-item-hover"); +if(_30.length){ +_30.removeClass("combobox-item-hover"); +var row=_2e.finder.getRow(_2d,_30); +var _31=row[_2e.valueField]; +$(_2d).tagbox(_30.hasClass("combobox-item-selected")?"unselect":"select",_31); +} +$(_2d).tagbox("hidePanel"); +}else{ +var v=$.trim($(_2d).tagbox("getText")); +if(v!==""){ +var _32=$(_2d).tagbox("getValues"); +_32.push(v); +$(_2d).tagbox("setValues",_32); +} +} +}; +function _33(_34,_35){ +$(_34).combobox("setText",""); +_23(_34); +$(_34).combobox("setValues",_35); +$(_34).combobox("setText",""); +$(_34).tagbox("validate"); +}; +$.fn.tagbox=function(_36,_37){ +if(typeof _36=="string"){ +var _38=$.fn.tagbox.methods[_36]; +if(_38){ +return _38(this,_37); +}else{ +return this.combobox(_36,_37); +} +} +_36=_36||{}; +return this.each(function(){ +var _39=$.data(this,"tagbox"); +if(_39){ +$.extend(_39.options,_36); +}else{ +$.data(this,"tagbox",{options:$.extend({},$.fn.tagbox.defaults,$.fn.tagbox.parseOptions(this),_36)}); +} +_1(this); +_1c(this); +}); +}; +$.fn.tagbox.methods={options:function(jq){ +var _3a=jq.combobox("options"); +return $.extend($.data(jq[0],"tagbox").options,{width:_3a.width,height:_3a.height,originalValue:_3a.originalValue,disabled:_3a.disabled,readonly:_3a.readonly}); +},setValues:function(jq,_3b){ +return jq.each(function(){ +_33(this,_3b); +}); +}}; +$.fn.tagbox.parseOptions=function(_3c){ +return $.extend({},$.fn.combobox.parseOptions(_3c),$.parser.parseOptions(_3c,[])); +}; +$.fn.tagbox.defaults=$.extend({},$.fn.combobox.defaults,{hasDownArrow:false,multiple:true,reversed:true,selectOnNavigation:false,tipOptions:$.extend({},$.fn.textbox.defaults.tipOptions,{showDelay:200}),val:function(_3d){ +var vv=$(_3d).parent().prev().tagbox("getValues"); +if($(_3d).is(":focus")){ +vv.push($(_3d).val()); +} +return vv.join(","); +},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ +var _3e=e.data.target; +var _3f=$(_3e).tagbox("options"); +if(_3f.limitToList){ +_2c(_3e); +} +}}),keyHandler:$.extend({},$.fn.combobox.defaults.keyHandler,{enter:function(e){ +_2c(this); +},query:function(q,e){ +var _40=$(this).tagbox("options"); +if(_40.limitToList){ +$.fn.combobox.defaults.keyHandler.query.call(this,q,e); +}else{ +$(this).combobox("hidePanel"); +} +}}),tagFormatter:function(_41,row){ +var _42=$(this).tagbox("options"); +return row?row[_42.textField]:_41; +},tagStyler:function(_43,row){ +return ""; +},onClickTag:function(_44){ +},onBeforeRemoveTag:function(_45){ +},onRemoveTag:function(_46){ +}}); +})(jQuery); + diff --git a/assets/js/easy-ui/plugins/jquery.textbox.js b/assets/js/easy-ui/plugins/jquery.textbox.js old mode 100755 new mode 100644 index 8be90d758b..e6bee872b7 --- a/assets/js/easy-ui/plugins/jquery.textbox.js +++ b/assets/js/easy-ui/plugins/jquery.textbox.js @@ -1,295 +1,405 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ -function _1(_2){ -$(_2).addClass("textbox-f").hide(); -var _3=$(""+""+""+"").insertAfter(_2); -var _4=$(_2).attr("name"); -if(_4){ -_3.find("input.textbox-value").attr("name",_4); -$(_2).removeAttr("name").attr("textboxName",_4); -} -return _3; +var _1=0; +function _2(_3){ +$(_3).addClass("textbox-f").hide(); +var _4=$(""+""+""+"").insertAfter(_3); +var _5=$(_3).attr("name"); +if(_5){ +_4.find("input.textbox-value").attr("name",_5); +$(_3).removeAttr("name").attr("textboxName",_5); +} +return _4; }; -function _5(_6){ -var _7=$.data(_6,"textbox"); -var _8=_7.options; -var tb=_7.textbox; +function _6(_7){ +var _8=$.data(_7,"textbox"); +var _9=_8.options; +var tb=_8.textbox; +var _a="_easyui_textbox_input"+(++_1); +tb.addClass(_9.cls); tb.find(".textbox-text").remove(); -if(_8.multiline){ -$("").prependTo(tb); +if(_9.multiline){ +$("").prependTo(tb); }else{ -$("").prependTo(tb); +$("").prependTo(tb); } +$("#"+_a).attr("tabindex",$(_7).attr("tabindex")||"").css("text-align",_7.style.textAlign||""); tb.find(".textbox-addon").remove(); -var bb=_8.icons?$.extend(true,[],_8.icons):[]; -if(_8.iconCls){ -bb.push({iconCls:_8.iconCls,disabled:true}); +var bb=_9.icons?$.extend(true,[],_9.icons):[]; +if(_9.iconCls){ +bb.push({iconCls:_9.iconCls,disabled:true}); } if(bb.length){ var bc=$("").prependTo(tb); -bc.addClass("textbox-addon-"+_8.iconAlign); +bc.addClass("textbox-addon-"+_9.iconAlign); for(var i=0;i"); +bc.append(""); } } tb.find(".textbox-button").remove(); -if(_8.buttonText||_8.buttonIcon){ -var _9=$("").prependTo(tb); -_9.addClass("textbox-button-"+_8.buttonAlign).linkbutton({text:_8.buttonText,iconCls:_8.buttonIcon}); +if(_9.buttonText||_9.buttonIcon){ +var _b=$("").prependTo(tb); +_b.addClass("textbox-button-"+_9.buttonAlign).linkbutton({text:_9.buttonText,iconCls:_9.buttonIcon,onClick:function(){ +var t=$(this).parent().prev(); +t.textbox("options").onClickButton.call(t[0]); +}}); +} +if(_9.label){ +if(typeof _9.label=="object"){ +_8.label=$(_9.label); +_8.label.attr("for",_a); +}else{ +$(_8.label).remove(); +_8.label=$("").html(_9.label); +_8.label.css("textAlign",_9.labelAlign).attr("for",_a); +if(_9.labelPosition=="after"){ +_8.label.insertAfter(tb); +}else{ +_8.label.insertBefore(_7); +} +_8.label.removeClass("textbox-label-left textbox-label-right textbox-label-top"); +_8.label.addClass("textbox-label-"+_9.labelPosition); +} +}else{ +$(_8.label).remove(); } -_a(_6,_8.disabled); -_b(_6,_8.readonly); +_c(_7); +_d(_7,_9.disabled); +_e(_7,_9.readonly); }; -function _c(_d){ -var tb=$.data(_d,"textbox").textbox; +function _f(_10){ +var _11=$.data(_10,"textbox"); +var tb=_11.textbox; tb.find(".textbox-text").validatebox("destroy"); tb.remove(); -$(_d).remove(); +$(_11.label).remove(); +$(_10).remove(); }; -function _e(_f,_10){ -var _11=$.data(_f,"textbox"); -var _12=_11.options; -var tb=_11.textbox; -var _13=tb.parent(); -if(_10){ -_12.width=_10; +function _12(_13,_14){ +var _15=$.data(_13,"textbox"); +var _16=_15.options; +var tb=_15.textbox; +var _17=tb.parent(); +if(_14){ +if(typeof _14=="object"){ +$.extend(_16,_14); +}else{ +_16.width=_14; +} } -if(isNaN(parseInt(_12.width))){ -var c=$(_f).clone(); +if(isNaN(parseInt(_16.width))){ +var c=$(_13).clone(); c.css("visibility","hidden"); -c.insertAfter(_f); -_12.width=c.outerWidth(); +c.insertAfter(_13); +_16.width=c.outerWidth(); c.remove(); } +var _18=tb.is(":visible"); +if(!_18){ tb.appendTo("body"); -var _14=tb.find(".textbox-text"); +} +var _19=tb.find(".textbox-text"); var btn=tb.find(".textbox-button"); -var _15=tb.find(".textbox-addon"); -var _16=_15.find(".textbox-icon"); -tb._size(_12,_13); +var _1a=tb.find(".textbox-addon"); +var _1b=_1a.find(".textbox-icon"); +if(_16.height=="auto"){ +_19.css({margin:"",paddingTop:"",paddingBottom:"",height:"",lineHeight:""}); +} +tb._size(_16,_17); +if(_16.label&&_16.labelPosition){ +if(_16.labelPosition=="top"){ +_15.label._size({width:_16.labelWidth=="auto"?tb.outerWidth():_16.labelWidth},tb); +if(_16.height!="auto"){ +tb._size("height",tb.outerHeight()-_15.label.outerHeight()); +} +}else{ +_15.label._size({width:_16.labelWidth,height:tb.outerHeight()},tb); +if(!_16.multiline){ +_15.label.css("lineHeight",_15.label.height()+"px"); +} +tb._size("width",tb.outerWidth()-_15.label.outerWidth()); +} +} +if(_16.buttonAlign=="left"||_16.buttonAlign=="right"){ btn.linkbutton("resize",{height:tb.height()}); -btn.css({left:(_12.buttonAlign=="left"?0:""),right:(_12.buttonAlign=="right"?0:"")}); -_15.css({left:(_12.iconAlign=="left"?(_12.buttonAlign=="left"?btn._outerWidth():0):""),right:(_12.iconAlign=="right"?(_12.buttonAlign=="right"?btn._outerWidth():0):"")}); -_16.css({width:_12.iconWidth+"px",height:tb.height()+"px"}); -_14.css({paddingLeft:(_f.style.paddingLeft||""),paddingRight:(_f.style.paddingRight||""),marginLeft:_17("left"),marginRight:_17("right")}); -if(_12.multiline){ -_14.css({paddingTop:(_f.style.paddingTop||""),paddingBottom:(_f.style.paddingBottom||"")}); -_14._outerHeight(tb.height()); }else{ -var _18=Math.floor((tb.height()-_14.height())/2); -_14.css({paddingTop:_18+"px",paddingBottom:_18+"px"}); -} -_14._outerWidth(tb.width()-_16.length*_12.iconWidth-btn._outerWidth()); -tb.insertAfter(_f); -_12.onResize.call(_f,_12.width,_12.height); -function _17(_19){ -return (_12.iconAlign==_19?_15._outerWidth():0)+(_12.buttonAlign==_19?btn._outerWidth():0); +btn.linkbutton("resize",{width:"100%"}); +} +var _1c=tb.width()-_1b.length*_16.iconWidth-_1d("left")-_1d("right"); +var _1e=_16.height=="auto"?_19.outerHeight():(tb.height()-_1d("top")-_1d("bottom")); +_1a.css(_16.iconAlign,_1d(_16.iconAlign)+"px"); +_1a.css("top",_1d("top")+"px"); +_1b.css({width:_16.iconWidth+"px",height:_1e+"px"}); +_19.css({paddingLeft:(_13.style.paddingLeft||""),paddingRight:(_13.style.paddingRight||""),marginLeft:_1f("left"),marginRight:_1f("right"),marginTop:_1d("top"),marginBottom:_1d("bottom")}); +if(_16.multiline){ +_19.css({paddingTop:(_13.style.paddingTop||""),paddingBottom:(_13.style.paddingBottom||"")}); +_19._outerHeight(_1e); +}else{ +_19.css({paddingTop:0,paddingBottom:0,height:_1e+"px",lineHeight:_1e+"px"}); +} +_19._outerWidth(_1c); +_16.onResizing.call(_13,_16.width,_16.height); +if(!_18){ +tb.insertAfter(_13); +} +_16.onResize.call(_13,_16.width,_16.height); +function _1f(_20){ +return (_16.iconAlign==_20?_1a._outerWidth():0)+_1d(_20); }; +function _1d(_21){ +var w=0; +btn.filter(".textbox-button-"+_21).each(function(){ +if(_21=="left"||_21=="right"){ +w+=$(this).outerWidth(); +}else{ +w+=$(this).outerHeight(); +} +}); +return w; }; -function _1a(_1b){ -var _1c=$(_1b).textbox("options"); -var _1d=$(_1b).textbox("textbox"); -_1d.validatebox($.extend({},_1c,{deltaX:$(_1b).textbox("getTipX"),onBeforeValidate:function(){ +}; +function _c(_22){ +var _23=$(_22).textbox("options"); +var _24=$(_22).textbox("textbox"); +_24.validatebox($.extend({},_23,{deltaX:function(_25){ +return $(_22).textbox("getTipX",_25); +},deltaY:function(_26){ +return $(_22).textbox("getTipY",_26); +},onBeforeValidate:function(){ +_23.onBeforeValidate.call(_22); var box=$(this); if(!box.is(":focus")){ -_1c.oldInputValue=box.val(); -box.val(_1c.value); +if(box.val()!==_23.value){ +_23.oldInputValue=box.val(); +box.val(_23.value); +} } -},onValidate:function(_1e){ +},onValidate:function(_27){ var box=$(this); -if(_1c.oldInputValue!=undefined){ -box.val(_1c.oldInputValue); -_1c.oldInputValue=undefined; +if(_23.oldInputValue!=undefined){ +box.val(_23.oldInputValue); +_23.oldInputValue=undefined; } var tb=box.parent(); -if(_1e){ +if(_27){ tb.removeClass("textbox-invalid"); }else{ tb.addClass("textbox-invalid"); } +_23.onValidate.call(_22,_27); }})); }; -function _1f(_20){ -var _21=$.data(_20,"textbox"); -var _22=_21.options; -var tb=_21.textbox; -var _23=tb.find(".textbox-text"); -_23.attr("placeholder",_22.prompt); -_23.unbind(".textbox"); -if(!_22.disabled&&!_22.readonly){ -_23.bind("blur.textbox",function(e){ +function _28(_29){ +var _2a=$.data(_29,"textbox"); +var _2b=_2a.options; +var tb=_2a.textbox; +var _2c=tb.find(".textbox-text"); +_2c.attr("placeholder",_2b.prompt); +_2c.unbind(".textbox"); +$(_2a.label).unbind(".textbox"); +if(!_2b.disabled&&!_2b.readonly){ +if(_2a.label){ +$(_2a.label).bind("click.textbox",function(e){ +if(!_2b.hasFocusMe){ +_2c.focus(); +$(_29).textbox("setSelectionRange",{start:0,end:_2c.val().length}); +} +}); +} +_2c.bind("blur.textbox",function(e){ if(!tb.hasClass("textbox-focused")){ return; } -_22.value=$(this).val(); -if(_22.value==""){ -$(this).val(_22.prompt).addClass("textbox-prompt"); +_2b.value=$(this).val(); +if(_2b.value==""){ +$(this).val(_2b.prompt).addClass("textbox-prompt"); }else{ $(this).removeClass("textbox-prompt"); } tb.removeClass("textbox-focused"); }).bind("focus.textbox",function(e){ +_2b.hasFocusMe=true; if(tb.hasClass("textbox-focused")){ return; } -if($(this).val()!=_22.value){ -$(this).val(_22.value); +if($(this).val()!=_2b.value){ +$(this).val(_2b.value); } $(this).removeClass("textbox-prompt"); tb.addClass("textbox-focused"); }); -for(var _24 in _22.inputEvents){ -_23.bind(_24+".textbox",{target:_20},_22.inputEvents[_24]); +for(var _2d in _2b.inputEvents){ +_2c.bind(_2d+".textbox",{target:_29},_2b.inputEvents[_2d]); } } -var _25=tb.find(".textbox-addon"); -_25.unbind().bind("click",{target:_20},function(e){ -var _26=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)"); -if(_26.length){ -var _27=parseInt(_26.attr("icon-index")); -var _28=_22.icons[_27]; -if(_28&&_28.handler){ -_28.handler.call(_26[0],e); -_22.onClickIcon.call(_20,_27); +var _2e=tb.find(".textbox-addon"); +_2e.unbind().bind("click",{target:_29},function(e){ +var _2f=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)"); +if(_2f.length){ +var _30=parseInt(_2f.attr("icon-index")); +var _31=_2b.icons[_30]; +if(_31&&_31.handler){ +_31.handler.call(_2f[0],e); } +_2b.onClickIcon.call(_29,_30); } }); -_25.find(".textbox-icon").each(function(_29){ -var _2a=_22.icons[_29]; -var _2b=$(this); -if(!_2a||_2a.disabled||_22.disabled||_22.readonly){ -_2b.addClass("textbox-icon-disabled"); +_2e.find(".textbox-icon").each(function(_32){ +var _33=_2b.icons[_32]; +var _34=$(this); +if(!_33||_33.disabled||_2b.disabled||_2b.readonly){ +_34.addClass("textbox-icon-disabled"); }else{ -_2b.removeClass("textbox-icon-disabled"); +_34.removeClass("textbox-icon-disabled"); } }); var btn=tb.find(".textbox-button"); -btn.unbind(".textbox").bind("click.textbox",function(){ -if(!btn.linkbutton("options").disabled){ -_22.onClickButton.call(_20); -} -}); -btn.linkbutton((_22.disabled||_22.readonly)?"disable":"enable"); -tb.unbind(".textbox").bind("_resize.textbox",function(e,_2c){ -if($(this).hasClass("easyui-fluid")||_2c){ -_e(_20); +btn.linkbutton((_2b.disabled||_2b.readonly)?"disable":"enable"); +tb.unbind(".textbox").bind("_resize.textbox",function(e,_35){ +if($(this).hasClass("easyui-fluid")||_35){ +_12(_29); } return false; }); }; -function _a(_2d,_2e){ -var _2f=$.data(_2d,"textbox"); -var _30=_2f.options; -var tb=_2f.textbox; -if(_2e){ -_30.disabled=true; -$(_2d).attr("disabled","disabled"); -tb.find(".textbox-text,.textbox-value").attr("disabled","disabled"); +function _d(_36,_37){ +var _38=$.data(_36,"textbox"); +var _39=_38.options; +var tb=_38.textbox; +var _3a=tb.find(".textbox-text"); +var ss=$(_36).add(tb.find(".textbox-value")); +_39.disabled=_37; +if(_39.disabled){ +_3a.blur(); +_3a.validatebox("disable"); +tb.addClass("textbox-disabled"); +ss.attr("disabled","disabled"); +$(_38.label).addClass("textbox-label-disabled"); }else{ -_30.disabled=false; -$(_2d).removeAttr("disabled"); -tb.find(".textbox-text,.textbox-value").removeAttr("disabled"); +_3a.validatebox("enable"); +tb.removeClass("textbox-disabled"); +ss.removeAttr("disabled"); +$(_38.label).removeClass("textbox-label-disabled"); } }; -function _b(_31,_32){ -var _33=$.data(_31,"textbox"); -var _34=_33.options; -_34.readonly=_32==undefined?true:_32; -var _35=_33.textbox.find(".textbox-text"); -_35.removeAttr("readonly").removeClass("textbox-text-readonly"); -if(_34.readonly||!_34.editable){ -_35.attr("readonly","readonly").addClass("textbox-text-readonly"); -} +function _e(_3b,_3c){ +var _3d=$.data(_3b,"textbox"); +var _3e=_3d.options; +var tb=_3d.textbox; +var _3f=tb.find(".textbox-text"); +_3e.readonly=_3c==undefined?true:_3c; +if(_3e.readonly){ +_3f.triggerHandler("blur.textbox"); +} +_3f.validatebox("readonly",_3e.readonly); +tb.removeClass("textbox-readonly").addClass(_3e.readonly?"textbox-readonly":""); }; -$.fn.textbox=function(_36,_37){ -if(typeof _36=="string"){ -var _38=$.fn.textbox.methods[_36]; -if(_38){ -return _38(this,_37); +$.fn.textbox=function(_40,_41){ +if(typeof _40=="string"){ +var _42=$.fn.textbox.methods[_40]; +if(_42){ +return _42(this,_41); }else{ return this.each(function(){ -var _39=$(this).textbox("textbox"); -_39.validatebox(_36,_37); +var _43=$(this).textbox("textbox"); +_43.validatebox(_40,_41); }); } } -_36=_36||{}; +_40=_40||{}; return this.each(function(){ -var _3a=$.data(this,"textbox"); -if(_3a){ -$.extend(_3a.options,_36); -if(_36.value!=undefined){ -_3a.options.originalValue=_36.value; +var _44=$.data(this,"textbox"); +if(_44){ +$.extend(_44.options,_40); +if(_40.value!=undefined){ +_44.options.originalValue=_40.value; } }else{ -_3a=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_36),textbox:_1(this)}); -_3a.options.originalValue=_3a.options.value; -} -_5(this); -_1f(this); -_e(this); -_1a(this); -$(this).textbox("initValue",_3a.options.value); +_44=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_40),textbox:_2(this)}); +_44.options.originalValue=_44.options.value; +} +_6(this); +_28(this); +if(_44.options.doSize){ +_12(this); +} +var _45=_44.options.value; +_44.options.value=""; +$(this).textbox("initValue",_45); }); }; $.fn.textbox.methods={options:function(jq){ return $.data(jq[0],"textbox").options; -},cloneFrom:function(jq,_3b){ +},cloneFrom:function(jq,_46){ return jq.each(function(){ var t=$(this); if(t.data("textbox")){ return; } -if(!$(_3b).data("textbox")){ -$(_3b).textbox(); +if(!$(_46).data("textbox")){ +$(_46).textbox(); } -var _3c=t.attr("name")||""; +var _47=$.extend(true,{},$(_46).textbox("options")); +var _48=t.attr("name")||""; t.addClass("textbox-f").hide(); -t.removeAttr("name").attr("textboxName",_3c); -var _3d=$(_3b).next().clone().insertAfter(t); -_3d.find("input.textbox-value").attr("name",_3c); -$.data(this,"textbox",{options:$.extend(true,{},$(_3b).textbox("options")),textbox:_3d}); -var _3e=$(_3b).textbox("button"); -if(_3e.length){ -t.textbox("button").linkbutton($.extend(true,{},_3e.linkbutton("options"))); -} -_1f(this); -_1a(this); +t.removeAttr("name").attr("textboxName",_48); +var _49=$(_46).next().clone().insertAfter(t); +var _4a="_easyui_textbox_input"+(++_1); +_49.find(".textbox-value").attr("name",_48); +_49.find(".textbox-text").attr("id",_4a); +var _4b=$($(_46).textbox("label")).clone(); +if(_4b.length){ +_4b.attr("for",_4a); +if(_47.labelPosition=="after"){ +_4b.insertAfter(t.next()); +}else{ +_4b.insertBefore(t); +} +} +$.data(this,"textbox",{options:_47,textbox:_49,label:(_4b.length?_4b:undefined)}); +var _4c=$(_46).textbox("button"); +if(_4c.length){ +t.textbox("button").linkbutton($.extend(true,{},_4c.linkbutton("options"))); +} +_28(this); +_c(this); }); },textbox:function(jq){ return $.data(jq[0],"textbox").textbox.find(".textbox-text"); },button:function(jq){ return $.data(jq[0],"textbox").textbox.find(".textbox-button"); +},label:function(jq){ +return $.data(jq[0],"textbox").label; },destroy:function(jq){ return jq.each(function(){ -_c(this); +_f(this); }); -},resize:function(jq,_3f){ +},resize:function(jq,_4d){ return jq.each(function(){ -_e(this,_3f); +_12(this,_4d); }); },disable:function(jq){ return jq.each(function(){ -_a(this,true); -_1f(this); +_d(this,true); +_28(this); }); },enable:function(jq){ return jq.each(function(){ -_a(this,false); -_1f(this); +_d(this,false); +_28(this); }); -},readonly:function(jq,_40){ +},readonly:function(jq,_4e){ return jq.each(function(){ -_b(this,_40); -_1f(this); +_e(this,_4e); +_28(this); }); },isValid:function(jq){ return jq.textbox("textbox").validatebox("isValid"); @@ -297,44 +407,45 @@ return jq.textbox("textbox").validatebox("isValid"); return jq.each(function(){ $(this).textbox("setValue",""); }); -},setText:function(jq,_41){ +},setText:function(jq,_4f){ return jq.each(function(){ -var _42=$(this).textbox("options"); -var _43=$(this).textbox("textbox"); -if($(this).textbox("getText")!=_41){ -_42.value=_41; -_43.val(_41); -} -if(!_43.is(":focus")){ -if(_41){ -_43.removeClass("textbox-prompt"); +var _50=$(this).textbox("options"); +var _51=$(this).textbox("textbox"); +_4f=_4f==undefined?"":String(_4f); +if($(this).textbox("getText")!=_4f){ +_51.val(_4f); +} +_50.value=_4f; +if(!_51.is(":focus")){ +if(_4f){ +_51.removeClass("textbox-prompt"); }else{ -_43.val(_42.prompt).addClass("textbox-prompt"); +_51.val(_50.prompt).addClass("textbox-prompt"); } } $(this).textbox("validate"); }); -},initValue:function(jq,_44){ +},initValue:function(jq,_52){ return jq.each(function(){ -var _45=$.data(this,"textbox"); -_45.options.value=""; -$(this).textbox("setText",_44); -_45.textbox.find(".textbox-value").val(_44); -$(this).val(_44); +var _53=$.data(this,"textbox"); +$(this).textbox("setText",_52); +_53.textbox.find(".textbox-value").val(_52); +$(this).val(_52); }); -},setValue:function(jq,_46){ +},setValue:function(jq,_54){ return jq.each(function(){ -var _47=$.data(this,"textbox").options; -var _48=$(this).textbox("getValue"); -$(this).textbox("initValue",_46); -if(_48!=_46){ -_47.onChange.call(this,_46,_48); +var _55=$.data(this,"textbox").options; +var _56=$(this).textbox("getValue"); +$(this).textbox("initValue",_54); +if(_56!=_54){ +_55.onChange.call(this,_54,_56); +$(this).closest("form").trigger("_change",[this]); } }); },getText:function(jq){ -var _49=jq.textbox("textbox"); -if(_49.is(":focus")){ -return _49.val(); +var _57=jq.textbox("textbox"); +if(_57.is(":focus")){ +return _57.val(); }else{ return jq.textbox("options").value; } @@ -342,45 +453,107 @@ return jq.textbox("options").value; return jq.data("textbox").textbox.find(".textbox-value").val(); },reset:function(jq){ return jq.each(function(){ -var _4a=$(this).textbox("options"); -$(this).textbox("setValue",_4a.originalValue); +var _58=$(this).textbox("options"); +$(this).textbox("textbox").val(_58.originalValue); +$(this).textbox("setValue",_58.originalValue); }); -},getIcon:function(jq,_4b){ -return jq.data("textbox").textbox.find(".textbox-icon:eq("+_4b+")"); -},getTipX:function(jq){ -var _4c=jq.data("textbox"); -var _4d=_4c.options; -var tb=_4c.textbox; -var _4e=tb.find(".textbox-text"); -var _4f=tb.find(".textbox-addon")._outerWidth(); -var _50=tb.find(".textbox-button")._outerWidth(); -if(_4d.tipPosition=="right"){ -return (_4d.iconAlign=="right"?_4f:0)+(_4d.buttonAlign=="right"?_50:0)+1; +},getIcon:function(jq,_59){ +return jq.data("textbox").textbox.find(".textbox-icon:eq("+_59+")"); +},getTipX:function(jq,_5a){ +var _5b=jq.data("textbox"); +var _5c=_5b.options; +var tb=_5b.textbox; +var _5d=tb.find(".textbox-text"); +var _5a=_5a||_5c.tipPosition; +var p1=tb.offset(); +var p2=_5d.offset(); +var w1=tb.outerWidth(); +var w2=_5d.outerWidth(); +if(_5a=="right"){ +return w1-w2-p2.left+p1.left; +}else{ +if(_5a=="left"){ +return p1.left-p2.left; +}else{ +return (w1-w2-p2.left+p1.left)/2-(p2.left-p1.left)/2; +} +} +},getTipY:function(jq,_5e){ +var _5f=jq.data("textbox"); +var _60=_5f.options; +var tb=_5f.textbox; +var _61=tb.find(".textbox-text"); +var _5e=_5e||_60.tipPosition; +var p1=tb.offset(); +var p2=_61.offset(); +var h1=tb.outerHeight(); +var h2=_61.outerHeight(); +if(_5e=="left"||_5e=="right"){ +return (h1-h2-p2.top+p1.top)/2-(p2.top-p1.top)/2; +}else{ +if(_5e=="bottom"){ +return (h1-h2-p2.top+p1.top); }else{ -if(_4d.tipPosition=="left"){ -return (_4d.iconAlign=="left"?-_4f:0)+(_4d.buttonAlign=="left"?-_50:0)-1; +return (p1.top-p2.top); +} +} +},getSelectionStart:function(jq){ +return jq.textbox("getSelectionRange").start; +},getSelectionRange:function(jq){ +var _62=jq.textbox("textbox")[0]; +var _63=0; +var end=0; +if(typeof _62.selectionStart=="number"){ +_63=_62.selectionStart; +end=_62.selectionEnd; }else{ -return _4f/2*(_4d.iconAlign=="right"?1:-1); +if(_62.createTextRange){ +var s=document.selection.createRange(); +var _64=_62.createTextRange(); +_64.setEndPoint("EndToStart",s); +_63=_64.text.length; +end=_63+s.text.length; } } +return {start:_63,end:end}; +},setSelectionRange:function(jq,_65){ +return jq.each(function(){ +var _66=$(this).textbox("textbox")[0]; +var _67=_65.start; +var end=_65.end; +if(_66.setSelectionRange){ +_66.setSelectionRange(_67,end); +}else{ +if(_66.createTextRange){ +var _68=_66.createTextRange(); +_68.collapse(); +_68.moveEnd("character",end); +_68.moveStart("character",_67); +_68.select(); +} +} +}); }}; -$.fn.textbox.parseOptions=function(_51){ -var t=$(_51); -return $.extend({},$.fn.validatebox.parseOptions(_51),$.parser.parseOptions(_51,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign",{multiline:"boolean",editable:"boolean",iconWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)}); +$.fn.textbox.parseOptions=function(_69){ +var t=$(_69); +return $.extend({},$.fn.validatebox.parseOptions(_69),$.parser.parseOptions(_69,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign","label","labelPosition","labelAlign",{multiline:"boolean",iconWidth:"number",labelWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined)}); }; -$.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{width:"auto",height:22,prompt:"",value:"",type:"text",multiline:false,editable:true,disabled:false,readonly:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:18,buttonText:"",buttonIcon:null,buttonAlign:"right",inputEvents:{blur:function(e){ +$.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{doSize:true,width:"auto",height:"auto",cls:null,prompt:"",value:"",type:"text",multiline:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:18,buttonText:"",buttonIcon:null,buttonAlign:"right",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",inputEvents:{blur:function(e){ var t=$(e.data.target); -var _52=t.textbox("options"); -t.textbox("setValue",_52.value); +var _6a=t.textbox("options"); +if(t.textbox("getValue")!=_6a.value){ +t.textbox("setValue",_6a.value); +} },keydown:function(e){ if(e.keyCode==13){ var t=$(e.data.target); t.textbox("setValue",t.textbox("getText")); } -}},onChange:function(_53,_54){ -},onResize:function(_55,_56){ +}},onChange:function(_6b,_6c){ +},onResizing:function(_6d,_6e){ +},onResize:function(_6f,_70){ },onClickButton:function(){ -},onClickIcon:function(_57){ +},onClickIcon:function(_71){ }}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.timespinner.js b/assets/js/easy-ui/plugins/jquery.timespinner.js old mode 100755 new mode 100644 index 2854917216..deaddcacde --- a/assets/js/easy-ui/plugins/jquery.timespinner.js +++ b/assets/js/easy-ui/plugins/jquery.timespinner.js @@ -1,132 +1,105 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ -var _3=0; -if(_2.selectionStart){ -_3=_2.selectionStart; -}else{ -if(_2.createTextRange){ -var _4=_2.createTextRange(); -var s=document.selection.createRange(); -s.setEndPoint("StartToStart",_4); -_3=s.text.length; -} -} -return _3; -}; -function _5(_6,_7,_8){ -if(_6.selectionStart){ -_6.setSelectionRange(_7,_8); -}else{ -if(_6.createTextRange){ -var _9=_6.createTextRange(); -_9.collapse(); -_9.moveEnd("character",_8); -_9.moveStart("character",_7); -_9.select(); -} -} +var _3=$.data(_2,"timespinner").options; +$(_2).addClass("timespinner-f").spinner(_3); +var _4=_3.formatter.call(_2,_3.parser.call(_2,_3.value)); +$(_2).timespinner("initValue",_4); }; -function _a(_b){ -var _c=$.data(_b,"timespinner").options; -$(_b).addClass("timespinner-f").spinner(_c); -var _d=_c.formatter.call(_b,_c.parser.call(_b,_c.value)); -$(_b).timespinner("initValue",_d); -}; -function _e(e){ -var _f=e.data.target; -var _10=$.data(_f,"timespinner").options; -var _11=_1(this); -for(var i=0;i<_10.selections.length;i++){ -var _12=_10.selections[i]; -if(_11>=_12[0]&&_11<=_12[1]){ -_13(_f,i); +function _5(e){ +var _6=e.data.target; +var _7=$.data(_6,"timespinner").options; +var _8=$(_6).timespinner("getSelectionStart"); +for(var i=0;i<_7.selections.length;i++){ +var _9=_7.selections[i]; +if(_8>=_9[0]&&_8<=_9[1]){ +_a(_6,i); return; } } }; -function _13(_14,_15){ -var _16=$.data(_14,"timespinner").options; -if(_15!=undefined){ -_16.highlight=_15; -} -var _17=_16.selections[_16.highlight]; -if(_17){ -var tb=$(_14).timespinner("textbox"); -_5(tb[0],_17[0],_17[1]); +function _a(_b,_c){ +var _d=$.data(_b,"timespinner").options; +if(_c!=undefined){ +_d.highlight=_c; +} +var _e=_d.selections[_d.highlight]; +if(_e){ +var tb=$(_b).timespinner("textbox"); +$(_b).timespinner("setSelectionRange",{start:_e[0],end:_e[1]}); tb.focus(); } }; -function _18(_19,_1a){ -var _1b=$.data(_19,"timespinner").options; -var _1a=_1b.parser.call(_19,_1a); -var _1c=_1b.formatter.call(_19,_1a); -$(_19).spinner("setValue",_1c); +function _f(_10,_11){ +var _12=$.data(_10,"timespinner").options; +var _11=_12.parser.call(_10,_11); +var _13=_12.formatter.call(_10,_11); +$(_10).spinner("setValue",_13); }; -function _1d(_1e,_1f){ -var _20=$.data(_1e,"timespinner").options; -var s=$(_1e).timespinner("getValue"); -var _21=_20.selections[_20.highlight]; -var s1=s.substring(0,_21[0]); -var s2=s.substring(_21[0],_21[1]); -var s3=s.substring(_21[1]); -var v=s1+((parseInt(s2)||0)+_20.increment*(_1f?-1:1))+s3; -$(_1e).timespinner("setValue",v); -_13(_1e); +function _14(_15,_16){ +var _17=$.data(_15,"timespinner").options; +var s=$(_15).timespinner("getValue"); +var _18=_17.selections[_17.highlight]; +var s1=s.substring(0,_18[0]); +var s2=s.substring(_18[0],_18[1]); +var s3=s.substring(_18[1]); +var v=s1+((parseInt(s2,10)||0)+_17.increment*(_16?-1:1))+s3; +$(_15).timespinner("setValue",v); +_a(_15); }; -$.fn.timespinner=function(_22,_23){ -if(typeof _22=="string"){ -var _24=$.fn.timespinner.methods[_22]; -if(_24){ -return _24(this,_23); +$.fn.timespinner=function(_19,_1a){ +if(typeof _19=="string"){ +var _1b=$.fn.timespinner.methods[_19]; +if(_1b){ +return _1b(this,_1a); }else{ -return this.spinner(_22,_23); +return this.spinner(_19,_1a); } } -_22=_22||{}; +_19=_19||{}; return this.each(function(){ -var _25=$.data(this,"timespinner"); -if(_25){ -$.extend(_25.options,_22); +var _1c=$.data(this,"timespinner"); +if(_1c){ +$.extend(_1c.options,_19); }else{ -$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_22)}); +$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_19)}); } -_a(this); +_1(this); }); }; $.fn.timespinner.methods={options:function(jq){ -var _26=jq.data("spinner")?jq.spinner("options"):{}; -return $.extend($.data(jq[0],"timespinner").options,{width:_26.width,value:_26.value,originalValue:_26.originalValue,disabled:_26.disabled,readonly:_26.readonly}); -},setValue:function(jq,_27){ +var _1d=jq.data("spinner")?jq.spinner("options"):{}; +return $.extend($.data(jq[0],"timespinner").options,{width:_1d.width,value:_1d.value,originalValue:_1d.originalValue,disabled:_1d.disabled,readonly:_1d.readonly}); +},setValue:function(jq,_1e){ return jq.each(function(){ -_18(this,_27); +_f(this,_1e); }); },getHours:function(jq){ -var _28=$.data(jq[0],"timespinner").options; -var vv=jq.timespinner("getValue").split(_28.separator); +var _1f=$.data(jq[0],"timespinner").options; +var vv=jq.timespinner("getValue").split(_1f.separator); return parseInt(vv[0],10); },getMinutes:function(jq){ -var _29=$.data(jq[0],"timespinner").options; -var vv=jq.timespinner("getValue").split(_29.separator); +var _20=$.data(jq[0],"timespinner").options; +var vv=jq.timespinner("getValue").split(_20.separator); return parseInt(vv[1],10); },getSeconds:function(jq){ -var _2a=$.data(jq[0],"timespinner").options; -var vv=jq.timespinner("getValue").split(_2a.separator); +var _21=$.data(jq[0],"timespinner").options; +var vv=jq.timespinner("getValue").split(_21.separator); return parseInt(vv[2],10)||0; }}; -$.fn.timespinner.parseOptions=function(_2b){ -return $.extend({},$.fn.spinner.parseOptions(_2b),$.parser.parseOptions(_2b,["separator",{showSeconds:"boolean",highlight:"number"}])); +$.fn.timespinner.parseOptions=function(_22){ +return $.extend({},$.fn.spinner.parseOptions(_22),$.parser.parseOptions(_22,["separator",{showSeconds:"boolean",highlight:"number"}])); }; $.fn.timespinner.defaults=$.extend({},$.fn.spinner.defaults,{inputEvents:$.extend({},$.fn.spinner.defaults.inputEvents,{click:function(e){ -_e.call(this,e); +_5.call(this,e); },blur:function(e){ var t=$(e.data.target); t.timespinner("setValue",t.timespinner("getText")); @@ -135,47 +108,42 @@ if(e.keyCode==13){ var t=$(e.data.target); t.timespinner("setValue",t.timespinner("getText")); } -}}),formatter:function(_2c){ -if(!_2c){ +}}),formatter:function(_23){ +if(!_23){ return ""; } -var _2d=$(this).timespinner("options"); -var tt=[_2e(_2c.getHours()),_2e(_2c.getMinutes())]; -if(_2d.showSeconds){ -tt.push(_2e(_2c.getSeconds())); +var _24=$(this).timespinner("options"); +var tt=[_25(_23.getHours()),_25(_23.getMinutes())]; +if(_24.showSeconds){ +tt.push(_25(_23.getSeconds())); } -return tt.join(_2d.separator); -function _2e(_2f){ -return (_2f<10?"0":"")+_2f; +return tt.join(_24.separator); +function _25(_26){ +return (_26<10?"0":"")+_26; }; },parser:function(s){ -var _30=$(this).timespinner("options"); -var _31=_32(s); -if(_31){ -var min=_32(_30.min); -var max=_32(_30.max); -if(min&&min>_31){ -_31=min; +var _27=$(this).timespinner("options"); +var _28=_29(s); +if(_28){ +var min=_29(_27.min); +var max=_29(_27.max); +if(min&&min>_28){ +_28=min; } -if(max&&max<_31){ -_31=max; +if(max&&max<_28){ +_28=max; } } -return _31; -function _32(s){ +return _28; +function _29(s){ if(!s){ return null; } -var tt=s.split(_30.separator); +var tt=s.split(_27.separator); return new Date(1900,0,0,parseInt(tt[0],10)||0,parseInt(tt[1],10)||0,parseInt(tt[2],10)||0); }; -if(!s){ -return null; -} -var tt=s.split(_30.separator); -return new Date(1900,0,0,parseInt(tt[0],10)||0,parseInt(tt[1],10)||0,parseInt(tt[2],10)||0); -},selections:[[0,2],[3,5],[6,8]],separator:":",showSeconds:false,highlight:0,spin:function(_33){ -_1d(this,_33); +},selections:[[0,2],[3,5],[6,8]],separator:":",showSeconds:false,highlight:0,spin:function(_2a){ +_14(this,_2a); }}); })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.tooltip.js b/assets/js/easy-ui/plugins/jquery.tooltip.js old mode 100755 new mode 100644 index b3ffeb8ee1..272dc7afdf --- a/assets/js/easy-ui/plugins/jquery.tooltip.js +++ b/assets/js/easy-ui/plugins/jquery.tooltip.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -78,14 +78,16 @@ function _f(_11){ _c.position=_11||"bottom"; _d.removeClass("tooltip-top tooltip-bottom tooltip-left tooltip-right").addClass("tooltip-"+_c.position); var _12,top; +var _13=$.isFunction(_c.deltaX)?_c.deltaX.call(_a,_c.position):_c.deltaX; +var _14=$.isFunction(_c.deltaY)?_c.deltaY.call(_a,_c.position):_c.deltaY; if(_c.trackMouse){ t=$(); -_12=_c.trackMouseX+_c.deltaX; -top=_c.trackMouseY+_c.deltaY; +_12=_c.trackMouseX+_13; +top=_c.trackMouseY+_14; }else{ var t=$(_a); -_12=t.offset().left+_c.deltaX; -top=t.offset().top+_c.deltaY; +_12=t.offset().left+_13; +top=t.offset().top+_14; } switch(_c.position){ case "right": @@ -108,82 +110,82 @@ break; return {left:_12,top:top}; }; }; -function _13(_14,e){ -var _15=$.data(_14,"tooltip"); -var _16=_15.options; -var tip=_15.tip; +function _15(_16,e){ +var _17=$.data(_16,"tooltip"); +var _18=_17.options; +var tip=_17.tip; if(!tip){ tip=$("
                      "+"
                      "+"
                      "+"
                      "+"
                      ").appendTo("body"); -_15.tip=tip; -_17(_14); +_17.tip=tip; +_19(_16); } -_6(_14); -_15.showTimer=setTimeout(function(){ -$(_14).tooltip("reposition"); +_6(_16); +_17.showTimer=setTimeout(function(){ +$(_16).tooltip("reposition"); tip.show(); -_16.onShow.call(_14,e); -var _18=tip.children(".tooltip-arrow-outer"); -var _19=tip.children(".tooltip-arrow"); -var bc="border-"+_16.position+"-color"; -_18.add(_19).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""}); -_18.css(bc,tip.css(bc)); -_19.css(bc,tip.css("backgroundColor")); -},_16.showDelay); +_18.onShow.call(_16,e); +var _1a=tip.children(".tooltip-arrow-outer"); +var _1b=tip.children(".tooltip-arrow"); +var bc="border-"+_18.position+"-color"; +_1a.add(_1b).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""}); +_1a.css(bc,tip.css(bc)); +_1b.css(bc,tip.css("backgroundColor")); +},_18.showDelay); }; -function _1a(_1b,e){ -var _1c=$.data(_1b,"tooltip"); -if(_1c&&_1c.tip){ -_6(_1b); -_1c.hideTimer=setTimeout(function(){ -_1c.tip.hide(); -_1c.options.onHide.call(_1b,e); -},_1c.options.hideDelay); +function _1c(_1d,e){ +var _1e=$.data(_1d,"tooltip"); +if(_1e&&_1e.tip){ +_6(_1d); +_1e.hideTimer=setTimeout(function(){ +_1e.tip.hide(); +_1e.options.onHide.call(_1d,e); +},_1e.options.hideDelay); } }; -function _17(_1d,_1e){ -var _1f=$.data(_1d,"tooltip"); -var _20=_1f.options; -if(_1e){ -_20.content=_1e; +function _19(_1f,_20){ +var _21=$.data(_1f,"tooltip"); +var _22=_21.options; +if(_20){ +_22.content=_20; } -if(!_1f.tip){ +if(!_21.tip){ return; } -var cc=typeof _20.content=="function"?_20.content.call(_1d):_20.content; -_1f.tip.children(".tooltip-content").html(cc); -_20.onUpdate.call(_1d,cc); +var cc=typeof _22.content=="function"?_22.content.call(_1f):_22.content; +_21.tip.children(".tooltip-content").html(cc); +_22.onUpdate.call(_1f,cc); }; -function _21(_22){ -var _23=$.data(_22,"tooltip"); -if(_23){ -_6(_22); -var _24=_23.options; -if(_23.tip){ -_23.tip.remove(); +function _23(_24){ +var _25=$.data(_24,"tooltip"); +if(_25){ +_6(_24); +var _26=_25.options; +if(_25.tip){ +_25.tip.remove(); } -if(_24._title){ -$(_22).attr("title",_24._title); +if(_26._title){ +$(_24).attr("title",_26._title); } -$.removeData(_22,"tooltip"); -$(_22).unbind(".tooltip").removeClass("tooltip-f"); -_24.onDestroy.call(_22); +$.removeData(_24,"tooltip"); +$(_24).unbind(".tooltip").removeClass("tooltip-f"); +_26.onDestroy.call(_24); } }; -$.fn.tooltip=function(_25,_26){ -if(typeof _25=="string"){ -return $.fn.tooltip.methods[_25](this,_26); +$.fn.tooltip=function(_27,_28){ +if(typeof _27=="string"){ +return $.fn.tooltip.methods[_27](this,_28); } -_25=_25||{}; +_27=_27||{}; return this.each(function(){ -var _27=$.data(this,"tooltip"); -if(_27){ -$.extend(_27.options,_25); +var _29=$.data(this,"tooltip"); +if(_29){ +$.extend(_29.options,_27); }else{ -$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_25)}); +$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_27)}); _1(this); } _3(this); -_17(this); +_19(this); }); }; $.fn.tooltip.methods={options:function(jq){ @@ -194,15 +196,15 @@ return $.data(jq[0],"tooltip").tip; return jq.tooltip("tip").children(".tooltip-arrow-outer,.tooltip-arrow"); },show:function(jq,e){ return jq.each(function(){ -_13(this,e); +_15(this,e); }); },hide:function(jq,e){ return jq.each(function(){ -_1a(this,e); +_1c(this,e); }); -},update:function(jq,_28){ +},update:function(jq,_2a){ return jq.each(function(){ -_17(this,_28); +_19(this,_2a); }); },reposition:function(jq){ return jq.each(function(){ @@ -210,22 +212,22 @@ _9(this); }); },destroy:function(jq){ return jq.each(function(){ -_21(this); +_23(this); }); }}; -$.fn.tooltip.parseOptions=function(_29){ -var t=$(_29); -var _2a=$.extend({},$.parser.parseOptions(_29,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")}); +$.fn.tooltip.parseOptions=function(_2b){ +var t=$(_2b); +var _2c=$.extend({},$.parser.parseOptions(_2b,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")}); t.attr("title",""); -if(!_2a.content){ -_2a.content=_2a._title; +if(!_2c.content){ +_2c.content=_2c._title; } -return _2a; +return _2c; }; $.fn.tooltip.defaults={position:"bottom",content:null,trackMouse:false,deltaX:0,deltaY:0,showEvent:"mouseenter",hideEvent:"mouseleave",showDelay:200,hideDelay:100,onShow:function(e){ },onHide:function(e){ -},onUpdate:function(_2b){ -},onPosition:function(_2c,top){ +},onUpdate:function(_2d){ +},onPosition:function(_2e,top){ },onDestroy:function(){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.tree.js b/assets/js/easy-ui/plugins/jquery.tree.js old mode 100755 new mode 100644 index 984df1e442..d6a220e33d --- a/assets/js/easy-ui/plugins/jquery.tree.js +++ b/assets/js/easy-ui/plugins/jquery.tree.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -52,14 +52,14 @@ if(!_9.length){ return; } if(tt.hasClass("tree-hit")){ -_81(_5,_9[0]); +_85(_5,_9[0]); return false; }else{ if(tt.hasClass("tree-checkbox")){ -_34(_5,_9[0],!tt.hasClass("tree-checkbox1")); +_34(_5,_9[0]); return false; }else{ -_db(_5,_9[0]); +_d9(_5,_9[0]); _6.onClick.call(_5,_c(_5,_9[0])); } } @@ -69,7 +69,7 @@ var _a=$(e.target).closest("div.tree-node"); if(!_a.length){ return; } -_db(_5,_a[0]); +_d9(_5,_a[0]); _6.onDblClick.call(_5,_c(_5,_a[0])); e.stopPropagation(); }).bind("contextmenu",function(e){ @@ -109,18 +109,21 @@ return false; if(e.which!=1){ return false; } -$(this).next("ul").find("div.tree-node").droppable({accept:"no-accept"}); var _17=$(this).find("span.tree-indent"); if(_17.length){ e.data.offsetWidth-=_17.length*_17.width(); } -},onStartDrag:function(){ +},onStartDrag:function(e){ +$(this).next("ul").find("div.tree-node").each(function(){ +$(this).droppable("disable"); +_13.disabledNodes.push(this); +}); $(this).draggable("proxy").css({left:-10000,top:-10000}); _14.onStartDrag.call(_12,_c(_12,this)); var _18=_c(_12,this); if(_18.id==undefined){ _18.id="easyui_tree_node_id_temp"; -_56(_12,_18); +_60(_12,_18); } _13.draggingNodeId=_18.id; },onDrag:function(e){ @@ -131,15 +134,14 @@ $(this).draggable("proxy").show(); } this.pageY=e.pageY; },onStopDrag:function(){ -$(this).next("ul").find("div.tree-node").droppable({accept:"div.tree-node"}); for(var i=0;i<_13.disabledNodes.length;i++){ $(_13.disabledNodes[i]).droppable("enable"); } _13.disabledNodes=[]; -var _19=_ce(_12,_13.draggingNodeId); +var _19=_d0(_12,_13.draggingNodeId); if(_19&&_19.id=="easyui_tree_node_id_temp"){ _19.id=""; -_56(_12,_19); +_60(_12,_19); } _14.onStopDrag.call(_12,_19); }}).droppable({accept:"div.tree-node",onDragEnter:function(e,_1a){ @@ -207,7 +209,7 @@ _2a.removeClass("tree-dnd-yes tree-dnd-no").addClass(_29?"tree-dnd-yes":"tree-dn }; function _25(_2b,_2c){ if(_c(_12,_2c).state=="closed"){ -_75(_12,_2c,function(){ +_79(_12,_2c,function(){ _2d(); }); }else{ @@ -232,650 +234,636 @@ $(_12).tree("insert",_32); _14.onDrop.call(_12,_30,_33,_31); }; }; -function _34(_35,_36,_37){ -var _38=$.data(_35,"tree").options; -if(!_38.checkbox){ +function _34(_35,_36,_37,_38){ +var _39=$.data(_35,"tree"); +var _3a=_39.options; +if(!_3a.checkbox){ return; } -var _39=_c(_35,_36); -if(_38.onBeforeCheck.call(_35,_39,_37)==false){ +var _3b=_c(_35,_36); +if(!_3b.checkState){ return; } -var _3a=$(_36); -var ck=_3a.find(".tree-checkbox"); -ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); -if(_37){ -ck.addClass("tree-checkbox1"); +var ck=$(_36).find(".tree-checkbox"); +if(_37==undefined){ +if(ck.hasClass("tree-checkbox1")){ +_37=false; }else{ -ck.addClass("tree-checkbox0"); -} -if(_38.cascadeCheck){ -_3b(_3a); -_3c(_3a); -} -_38.onCheck.call(_35,_39,_37); -function _3c(_3d){ -var _3e=_3d.next().find(".tree-checkbox"); -_3e.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); -if(_3d.find(".tree-checkbox").hasClass("tree-checkbox1")){ -_3e.addClass("tree-checkbox1"); +if(ck.hasClass("tree-checkbox0")){ +_37=true; }else{ -_3e.addClass("tree-checkbox0"); +if(_3b._checked==undefined){ +_3b._checked=$(_36).find(".tree-checkbox").hasClass("tree-checkbox1"); +} +_37=!_3b._checked; +} +} +} +_3b._checked=_37; +if(_37){ +if(ck.hasClass("tree-checkbox1")){ +return; } -}; -function _3b(_3f){ -var _40=_8c(_35,_3f[0]); -if(_40){ -var ck=$(_40.target).find(".tree-checkbox"); -ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); -if(_41(_3f)){ -ck.addClass("tree-checkbox1"); -}else{ -if(_42(_3f)){ -ck.addClass("tree-checkbox0"); }else{ -ck.addClass("tree-checkbox2"); +if(ck.hasClass("tree-checkbox0")){ +return; } } -_3b($(_40.target)); +if(!_38){ +if(_3a.onBeforeCheck.call(_35,_3b,_37)==false){ +return; } -function _41(n){ -var ck=n.find(".tree-checkbox"); -if(ck.hasClass("tree-checkbox0")||ck.hasClass("tree-checkbox2")){ -return false; } -var b=true; -n.parent().siblings().each(function(){ -if(!$(this).children("div.tree-node").children(".tree-checkbox").hasClass("tree-checkbox1")){ -b=false; +if(_3a.cascadeCheck){ +_3c(_35,_3b,_37); +_3d(_35,_3b); +}else{ +_3e(_35,_3b,_37?"1":"0"); +} +if(!_38){ +_3a.onCheck.call(_35,_3b,_37); } -}); -return b; }; -function _42(n){ -var ck=n.find(".tree-checkbox"); -if(ck.hasClass("tree-checkbox1")||ck.hasClass("tree-checkbox2")){ -return false; +function _3c(_3f,_40,_41){ +var _42=$.data(_3f,"tree").options; +var _43=_41?1:0; +_3e(_3f,_40,_43); +if(_42.deepCheck){ +$.easyui.forEach(_40.children||[],true,function(n){ +_3e(_3f,n,_43); +}); +}else{ +var _44=[]; +if(_40.children&&_40.children.length){ +_44.push(_40); +} +$.easyui.forEach(_40.children||[],true,function(n){ +if(!n.hidden){ +_3e(_3f,n,_43); +if(n.children&&n.children.length){ +_44.push(n); } -var b=true; -n.parent().siblings().each(function(){ -if(!$(this).children("div.tree-node").children(".tree-checkbox").hasClass("tree-checkbox0")){ -b=false; } }); -return b; -}; -}; +for(var i=_44.length-1;i>=0;i--){ +var _45=_44[i]; +_3e(_3f,_45,_46(_45)); +} +} }; -function _43(_44,_45){ -var _46=$.data(_44,"tree").options; -if(!_46.checkbox){ +function _3e(_47,_48,_49){ +var _4a=$.data(_47,"tree").options; +if(!_48.checkState||_49==undefined){ return; } -var _47=$(_45); -if(_48(_44,_45)){ -var ck=_47.find(".tree-checkbox"); -if(ck.length){ -if(ck.hasClass("tree-checkbox1")){ -_34(_44,_45,true); -}else{ -_34(_44,_45,false); +if(_48.hidden&&!_4a.deepCheck){ +return; +} +var ck=$("#"+_48.domId).find(".tree-checkbox"); +_48.checkState=["unchecked","checked","indeterminate"][_49]; +_48.checked=(_48.checkState=="checked"); +ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); +ck.addClass("tree-checkbox"+_49); +}; +function _3d(_4b,_4c){ +var pd=_4d(_4b,$("#"+_4c.domId)[0]); +if(pd){ +_3e(_4b,pd,_46(pd)); +_3d(_4b,pd); } +}; +function _46(row){ +var c0=0; +var c1=0; +var len=0; +$.easyui.forEach(row.children||[],false,function(r){ +if(r.checkState){ +len++; +if(r.checkState=="checked"){ +c1++; }else{ -if(_46.onlyLeafCheck){ -$("").insertBefore(_47.find(".tree-title")); +if(r.checkState=="unchecked"){ +c0++; } } +} +}); +if(len==0){ +return undefined; +} +var _4e=0; +if(c0==len){ +_4e=0; }else{ -var ck=_47.find(".tree-checkbox"); -if(_46.onlyLeafCheck){ -ck.remove(); -}else{ -if(ck.hasClass("tree-checkbox1")){ -_34(_44,_45,true); -}else{ -if(ck.hasClass("tree-checkbox2")){ -var _49=true; -var _4a=true; -var _4b=_4c(_44,_45); -for(var i=0;i<_4b.length;i++){ -if(_4b[i].checked){ -_4a=false; +if(c1==len){ +_4e=1; }else{ -_49=false; +_4e=2; } } -if(_49){ -_34(_44,_45,true); +return _4e; +}; +function _4f(_50,_51){ +var _52=$.data(_50,"tree").options; +if(!_52.checkbox){ +return; } -if(_4a){ -_34(_44,_45,false); +var _53=$(_51); +var ck=_53.find(".tree-checkbox"); +var _54=_c(_50,_51); +if(_52.view.hasCheckbox(_50,_54)){ +if(!ck.length){ +_54.checkState=_54.checkState||"unchecked"; +$("").insertBefore(_53.find(".tree-title")); } +if(_54.checkState=="checked"){ +_34(_50,_51,true,true); +}else{ +if(_54.checkState=="unchecked"){ +_34(_50,_51,false,true); +}else{ +var _55=_46(_54); +if(_55===0){ +_34(_50,_51,false,true); +}else{ +if(_55===1){ +_34(_50,_51,true,true); } } } } +}else{ +ck.remove(); +_54.checkState=undefined; +_54.checked=undefined; +_3d(_50,_54); +} }; -function _4d(_4e,ul,_4f,_50){ -var _51=$.data(_4e,"tree"); -var _52=_51.options; -var _53=$(ul).prevAll("div.tree-node:first"); -_4f=_52.loadFilter.call(_4e,_4f,_53[0]); -var _54=_55(_4e,"domId",_53.attr("id")); -if(!_50){ -_54?_54.children=_4f:_51.data=_4f; +function _56(_57,ul,_58,_59,_5a){ +var _5b=$.data(_57,"tree"); +var _5c=_5b.options; +var _5d=$(ul).prevAll("div.tree-node:first"); +_58=_5c.loadFilter.call(_57,_58,_5d[0]); +var _5e=_5f(_57,"domId",_5d.attr("id")); +if(!_59){ +_5e?_5e.children=_58:_5b.data=_58; $(ul).empty(); }else{ -if(_54){ -_54.children?_54.children=_54.children.concat(_4f):_54.children=_4f; +if(_5e){ +_5e.children?_5e.children=_5e.children.concat(_58):_5e.children=_58; }else{ -_51.data=_51.data.concat(_4f); +_5b.data=_5b.data.concat(_58); } } -_52.view.render.call(_52.view,_4e,ul,_4f); -if(_52.dnd){ -_11(_4e); +_5c.view.render.call(_5c.view,_57,ul,_58); +if(_5c.dnd){ +_11(_57); } -if(_54){ -_56(_4e,_54); +if(_5e){ +_60(_57,_5e); } -var _57=[]; -var _58=[]; -for(var i=0;i<_4f.length;i++){ -var _59=_4f[i]; -if(!_59.checked){ -_57.push(_59); +for(var i=0;i<_5b.tmpIds.length;i++){ +_34(_57,$("#"+_5b.tmpIds[i])[0],true,true); } -} -_5a(_4f,function(_5b){ -if(_5b.checked){ -_58.push(_5b); -} -}); -var _5c=_52.onCheck; -_52.onCheck=function(){ -}; -if(_57.length){ -_34(_4e,$("#"+_57[0].domId)[0],false); -} -for(var i=0;i<_58.length;i++){ -_34(_4e,$("#"+_58[i].domId)[0],true); -} -_52.onCheck=_5c; +_5b.tmpIds=[]; setTimeout(function(){ -_5d(_4e,_4e); +_61(_57,_57); },0); -_52.onLoadSuccess.call(_4e,_54,_4f); +if(!_5a){ +_5c.onLoadSuccess.call(_57,_5e,_58); +} }; -function _5d(_5e,ul,_5f){ -var _60=$.data(_5e,"tree").options; -if(_60.lines){ -$(_5e).addClass("tree-lines"); +function _61(_62,ul,_63){ +var _64=$.data(_62,"tree").options; +if(_64.lines){ +$(_62).addClass("tree-lines"); }else{ -$(_5e).removeClass("tree-lines"); +$(_62).removeClass("tree-lines"); return; } -if(!_5f){ -_5f=true; -$(_5e).find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); -$(_5e).find("div.tree-node").removeClass("tree-node-last tree-root-first tree-root-one"); -var _61=$(_5e).tree("getRoots"); -if(_61.length>1){ -$(_61[0].target).addClass("tree-root-first"); +if(!_63){ +_63=true; +$(_62).find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); +$(_62).find("div.tree-node").removeClass("tree-node-last tree-root-first tree-root-one"); +var _65=$(_62).tree("getRoots"); +if(_65.length>1){ +$(_65[0].target).addClass("tree-root-first"); }else{ -if(_61.length==1){ -$(_61[0].target).addClass("tree-root-one"); +if(_65.length==1){ +$(_65[0].target).addClass("tree-root-one"); } } } $(ul).children("li").each(function(){ -var _62=$(this).children("div.tree-node"); -var ul=_62.next("ul"); +var _66=$(this).children("div.tree-node"); +var ul=_66.next("ul"); if(ul.length){ if($(this).next().length){ -_63(_62); +_67(_66); } -_5d(_5e,ul,_5f); +_61(_62,ul,_63); }else{ -_64(_62); +_68(_66); } }); -var _65=$(ul).children("li:last").children("div.tree-node").addClass("tree-node-last"); -_65.children("span.tree-join").removeClass("tree-join").addClass("tree-joinbottom"); -function _64(_66,_67){ -var _68=_66.find("span.tree-icon"); -_68.prev("span.tree-indent").addClass("tree-join"); +var _69=$(ul).children("li:last").children("div.tree-node").addClass("tree-node-last"); +_69.children("span.tree-join").removeClass("tree-join").addClass("tree-joinbottom"); +function _68(_6a,_6b){ +var _6c=_6a.find("span.tree-icon"); +_6c.prev("span.tree-indent").addClass("tree-join"); }; -function _63(_69){ -var _6a=_69.find("span.tree-indent, span.tree-hit").length; -_69.next().find("div.tree-node").each(function(){ -$(this).children("span:eq("+(_6a-1)+")").addClass("tree-line"); +function _67(_6d){ +var _6e=_6d.find("span.tree-indent, span.tree-hit").length; +_6d.next().find("div.tree-node").each(function(){ +$(this).children("span:eq("+(_6e-1)+")").addClass("tree-line"); }); }; }; -function _6b(_6c,ul,_6d,_6e){ -var _6f=$.data(_6c,"tree").options; -_6d=$.extend({},_6f.queryParams,_6d||{}); -var _70=null; -if(_6c!=ul){ -var _71=$(ul).prev(); -_70=_c(_6c,_71[0]); -} -if(_6f.onBeforeLoad.call(_6c,_70,_6d)==false){ +function _6f(_70,ul,_71,_72){ +var _73=$.data(_70,"tree").options; +_71=$.extend({},_73.queryParams,_71||{}); +var _74=null; +if(_70!=ul){ +var _75=$(ul).prev(); +_74=_c(_70,_75[0]); +} +if(_73.onBeforeLoad.call(_70,_74,_71)==false){ return; } -var _72=$(ul).prev().children("span.tree-folder"); -_72.addClass("tree-loading"); -var _73=_6f.loader.call(_6c,_6d,function(_74){ -_72.removeClass("tree-loading"); -_4d(_6c,ul,_74); -if(_6e){ -_6e(); +var _76=$(ul).prev().children("span.tree-folder"); +_76.addClass("tree-loading"); +var _77=_73.loader.call(_70,_71,function(_78){ +_76.removeClass("tree-loading"); +_56(_70,ul,_78); +if(_72){ +_72(); } },function(){ -_72.removeClass("tree-loading"); -_6f.onLoadError.apply(_6c,arguments); -if(_6e){ -_6e(); +_76.removeClass("tree-loading"); +_73.onLoadError.apply(_70,arguments); +if(_72){ +_72(); } }); -if(_73==false){ -_72.removeClass("tree-loading"); +if(_77==false){ +_76.removeClass("tree-loading"); } }; -function _75(_76,_77,_78){ -var _79=$.data(_76,"tree").options; -var hit=$(_77).children("span.tree-hit"); +function _79(_7a,_7b,_7c){ +var _7d=$.data(_7a,"tree").options; +var hit=$(_7b).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ return; } -var _7a=_c(_76,_77); -if(_79.onBeforeExpand.call(_76,_7a)==false){ +var _7e=_c(_7a,_7b); +if(_7d.onBeforeExpand.call(_7a,_7e)==false){ return; } hit.removeClass("tree-collapsed tree-collapsed-hover").addClass("tree-expanded"); hit.next().addClass("tree-folder-open"); -var ul=$(_77).next(); +var ul=$(_7b).next(); if(ul.length){ -if(_79.animate){ +if(_7d.animate){ ul.slideDown("normal",function(){ -_7a.state="open"; -_79.onExpand.call(_76,_7a); -if(_78){ -_78(); +_7e.state="open"; +_7d.onExpand.call(_7a,_7e); +if(_7c){ +_7c(); } }); }else{ ul.css("display","block"); -_7a.state="open"; -_79.onExpand.call(_76,_7a); -if(_78){ -_78(); +_7e.state="open"; +_7d.onExpand.call(_7a,_7e); +if(_7c){ +_7c(); } } }else{ -var _7b=$("
                        ").insertAfter(_77); -_6b(_76,_7b[0],{id:_7a.id},function(){ -if(_7b.is(":empty")){ -_7b.remove(); -} -if(_79.animate){ -_7b.slideDown("normal",function(){ -_7a.state="open"; -_79.onExpand.call(_76,_7a); -if(_78){ -_78(); +var _7f=$("
                          ").insertAfter(_7b); +_6f(_7a,_7f[0],{id:_7e.id},function(){ +if(_7f.is(":empty")){ +_7f.remove(); +} +if(_7d.animate){ +_7f.slideDown("normal",function(){ +_7e.state="open"; +_7d.onExpand.call(_7a,_7e); +if(_7c){ +_7c(); } }); }else{ -_7b.css("display","block"); -_7a.state="open"; -_79.onExpand.call(_76,_7a); -if(_78){ -_78(); +_7f.css("display","block"); +_7e.state="open"; +_7d.onExpand.call(_7a,_7e); +if(_7c){ +_7c(); } } }); } }; -function _7c(_7d,_7e){ -var _7f=$.data(_7d,"tree").options; -var hit=$(_7e).children("span.tree-hit"); +function _80(_81,_82){ +var _83=$.data(_81,"tree").options; +var hit=$(_82).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-collapsed")){ return; } -var _80=_c(_7d,_7e); -if(_7f.onBeforeCollapse.call(_7d,_80)==false){ +var _84=_c(_81,_82); +if(_83.onBeforeCollapse.call(_81,_84)==false){ return; } hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); hit.next().removeClass("tree-folder-open"); -var ul=$(_7e).next(); -if(_7f.animate){ +var ul=$(_82).next(); +if(_83.animate){ ul.slideUp("normal",function(){ -_80.state="closed"; -_7f.onCollapse.call(_7d,_80); +_84.state="closed"; +_83.onCollapse.call(_81,_84); }); }else{ ul.css("display","none"); -_80.state="closed"; -_7f.onCollapse.call(_7d,_80); +_84.state="closed"; +_83.onCollapse.call(_81,_84); } }; -function _81(_82,_83){ -var hit=$(_83).children("span.tree-hit"); +function _85(_86,_87){ +var hit=$(_87).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ -_7c(_82,_83); +_80(_86,_87); }else{ -_75(_82,_83); +_79(_86,_87); } }; -function _84(_85,_86){ -var _87=_4c(_85,_86); -if(_86){ -_87.unshift(_c(_85,_86)); +function _88(_89,_8a){ +var _8b=_8c(_89,_8a); +if(_8a){ +_8b.unshift(_c(_89,_8a)); } -for(var i=0;i<_87.length;i++){ -_75(_85,_87[i].target); +for(var i=0;i<_8b.length;i++){ +_79(_89,_8b[i].target); } }; -function _88(_89,_8a){ -var _8b=[]; -var p=_8c(_89,_8a); +function _8d(_8e,_8f){ +var _90=[]; +var p=_4d(_8e,_8f); while(p){ -_8b.unshift(p); -p=_8c(_89,p.target); +_90.unshift(p); +p=_4d(_8e,p.target); } -for(var i=0;i<_8b.length;i++){ -_75(_89,_8b[i].target); +for(var i=0;i<_90.length;i++){ +_79(_8e,_90[i].target); } }; -function _8d(_8e,_8f){ -var c=$(_8e).parent(); +function _91(_92,_93){ +var c=$(_92).parent(); while(c[0].tagName!="BODY"&&c.css("overflow-y")!="auto"){ c=c.parent(); } -var n=$(_8f); -var _90=n.offset().top; +var n=$(_93); +var _94=n.offset().top; if(c[0].tagName!="BODY"){ -var _91=c.offset().top; -if(_90<_91){ -c.scrollTop(c.scrollTop()+_90-_91); +var _95=c.offset().top; +if(_94<_95){ +c.scrollTop(c.scrollTop()+_94-_95); }else{ -if(_90+n.outerHeight()>_91+c.outerHeight()-18){ -c.scrollTop(c.scrollTop()+_90+n.outerHeight()-_91-c.outerHeight()+18); +if(_94+n.outerHeight()>_95+c.outerHeight()-18){ +c.scrollTop(c.scrollTop()+_94+n.outerHeight()-_95-c.outerHeight()+18); } } }else{ -c.scrollTop(_90); +c.scrollTop(_94); } }; -function _92(_93,_94){ -var _95=_4c(_93,_94); -if(_94){ -_95.unshift(_c(_93,_94)); +function _96(_97,_98){ +var _99=_8c(_97,_98); +if(_98){ +_99.unshift(_c(_97,_98)); } -for(var i=0;i<_95.length;i++){ -_7c(_93,_95[i].target); +for(var i=0;i<_99.length;i++){ +_80(_97,_99[i].target); } }; -function _96(_97,_98){ -var _99=$(_98.parent); -var _9a=_98.data; -if(!_9a){ +function _9a(_9b,_9c){ +var _9d=$(_9c.parent); +var _9e=_9c.data; +if(!_9e){ return; } -_9a=$.isArray(_9a)?_9a:[_9a]; -if(!_9a.length){ +_9e=$.isArray(_9e)?_9e:[_9e]; +if(!_9e.length){ return; } var ul; -if(_99.length==0){ -ul=$(_97); +if(_9d.length==0){ +ul=$(_9b); }else{ -if(_48(_97,_99[0])){ -var _9b=_99.find("span.tree-icon"); -_9b.removeClass("tree-file").addClass("tree-folder tree-folder-open"); -var hit=$("").insertBefore(_9b); +if(_9f(_9b,_9d[0])){ +var _a0=_9d.find("span.tree-icon"); +_a0.removeClass("tree-file").addClass("tree-folder tree-folder-open"); +var hit=$("").insertBefore(_a0); if(hit.prev().length){ hit.prev().remove(); } } -ul=_99.next(); +ul=_9d.next(); if(!ul.length){ -ul=$("
                            ").insertAfter(_99); +ul=$("
                              ").insertAfter(_9d); } } -_4d(_97,ul[0],_9a,true); -_43(_97,ul.prev()); +_56(_9b,ul[0],_9e,true,true); }; -function _9c(_9d,_9e){ -var ref=_9e.before||_9e.after; -var _9f=_8c(_9d,ref); -var _a0=_9e.data; -if(!_a0){ +function _a1(_a2,_a3){ +var ref=_a3.before||_a3.after; +var _a4=_4d(_a2,ref); +var _a5=_a3.data; +if(!_a5){ return; } -_a0=$.isArray(_a0)?_a0:[_a0]; -if(!_a0.length){ +_a5=$.isArray(_a5)?_a5:[_a5]; +if(!_a5.length){ return; } -_96(_9d,{parent:(_9f?_9f.target:null),data:_a0}); -var _a1=_9f?_9f.children:$(_9d).tree("getRoots"); -for(var i=0;i<_a1.length;i++){ -if(_a1[i].domId==$(ref).attr("id")){ -for(var j=_a0.length-1;j>=0;j--){ -_a1.splice((_9e.before?i:(i+1)),0,_a0[j]); +_9a(_a2,{parent:(_a4?_a4.target:null),data:_a5}); +var _a6=_a4?_a4.children:$(_a2).tree("getRoots"); +for(var i=0;i<_a6.length;i++){ +if(_a6[i].domId==$(ref).attr("id")){ +for(var j=_a5.length-1;j>=0;j--){ +_a6.splice((_a3.before?i:(i+1)),0,_a5[j]); } -_a1.splice(_a1.length-_a0.length,_a0.length); +_a6.splice(_a6.length-_a5.length,_a5.length); break; } } var li=$(); -for(var i=0;i<_a0.length;i++){ -li=li.add($("#"+_a0[i].domId).parent()); +for(var i=0;i<_a5.length;i++){ +li=li.add($("#"+_a5[i].domId).parent()); } -if(_9e.before){ +if(_a3.before){ li.insertBefore($(ref).parent()); }else{ li.insertAfter($(ref).parent()); } }; -function _a2(_a3,_a4){ -var _a5=del(_a4); -$(_a4).parent().remove(); -if(_a5){ -if(!_a5.children||!_a5.children.length){ -var _a6=$(_a5.target); -_a6.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); -_a6.find(".tree-hit").remove(); -$("").prependTo(_a6); -_a6.next().remove(); -} -_56(_a3,_a5); -_43(_a3,_a5.target); -} -_5d(_a3,_a3); -function del(_a7){ -var id=$(_a7).attr("id"); -var _a8=_8c(_a3,_a7); -var cc=_a8?_a8.children:$.data(_a3,"tree").data; +function _a7(_a8,_a9){ +var _aa=del(_a9); +$(_a9).parent().remove(); +if(_aa){ +if(!_aa.children||!_aa.children.length){ +var _ab=$(_aa.target); +_ab.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); +_ab.find(".tree-hit").remove(); +$("").prependTo(_ab); +_ab.next().remove(); +} +_60(_a8,_aa); +} +_61(_a8,_a8); +function del(_ac){ +var id=$(_ac).attr("id"); +var _ad=_4d(_a8,_ac); +var cc=_ad?_ad.children:$.data(_a8,"tree").data; for(var i=0;i=0;i--){ -_d9.unshift(_da.children[i]); -} -} -} +function _ba(_d8){ +_d8.target=$("#"+_d8.domId)[0]; +return _d8; }; -function _db(_dc,_dd){ -var _de=$.data(_dc,"tree").options; -var _df=_c(_dc,_dd); -if(_de.onBeforeSelect.call(_dc,_df)==false){ +function _d9(_da,_db){ +var _dc=$.data(_da,"tree").options; +var _dd=_c(_da,_db); +if(_dc.onBeforeSelect.call(_da,_dd)==false){ return; } -$(_dc).find("div.tree-node-selected").removeClass("tree-node-selected"); -$(_dd).addClass("tree-node-selected"); -_de.onSelect.call(_dc,_df); +$(_da).find("div.tree-node-selected").removeClass("tree-node-selected"); +$(_db).addClass("tree-node-selected"); +_dc.onSelect.call(_da,_dd); }; -function _48(_e0,_e1){ -return $(_e1).children("span.tree-hit").length==0; +function _9f(_de,_df){ +return $(_df).children("span.tree-hit").length==0; }; -function _e2(_e3,_e4){ -var _e5=$.data(_e3,"tree").options; -var _e6=_c(_e3,_e4); -if(_e5.onBeforeEdit.call(_e3,_e6)==false){ +function _e0(_e1,_e2){ +var _e3=$.data(_e1,"tree").options; +var _e4=_c(_e1,_e2); +if(_e3.onBeforeEdit.call(_e1,_e4)==false){ return; } -$(_e4).css("position","relative"); -var nt=$(_e4).find(".tree-title"); -var _e7=nt.outerWidth(); +$(_e2).css("position","relative"); +var nt=$(_e2).find(".tree-title"); +var _e5=nt.outerWidth(); nt.empty(); -var _e8=$("").appendTo(nt); -_e8.val(_e6.text).focus(); -_e8.width(_e7+20); -_e8.height(document.compatMode=="CSS1Compat"?(18-(_e8.outerHeight()-_e8.height())):18); -_e8.bind("click",function(e){ +var _e6=$("").appendTo(nt); +_e6.val(_e4.text).focus(); +_e6.width(_e5+20); +_e6._outerHeight(18); +_e6.bind("click",function(e){ return false; }).bind("mousedown",function(e){ e.stopPropagation(); @@ -883,162 +871,188 @@ e.stopPropagation(); e.stopPropagation(); }).bind("keydown",function(e){ if(e.keyCode==13){ -_e9(_e3,_e4); +_e7(_e1,_e2); return false; }else{ if(e.keyCode==27){ -_ef(_e3,_e4); +_ed(_e1,_e2); return false; } } }).bind("blur",function(e){ e.stopPropagation(); -_e9(_e3,_e4); +_e7(_e1,_e2); }); }; -function _e9(_ea,_eb){ -var _ec=$.data(_ea,"tree").options; -$(_eb).css("position",""); -var _ed=$(_eb).find("input.tree-editor"); -var val=_ed.val(); -_ed.remove(); -var _ee=_c(_ea,_eb); -_ee.text=val; -_56(_ea,_ee); -_ec.onAfterEdit.call(_ea,_ee); +function _e7(_e8,_e9){ +var _ea=$.data(_e8,"tree").options; +$(_e9).css("position",""); +var _eb=$(_e9).find("input.tree-editor"); +var val=_eb.val(); +_eb.remove(); +var _ec=_c(_e8,_e9); +_ec.text=val; +_60(_e8,_ec); +_ea.onAfterEdit.call(_e8,_ec); +}; +function _ed(_ee,_ef){ +var _f0=$.data(_ee,"tree").options; +$(_ef).css("position",""); +$(_ef).find("input.tree-editor").remove(); +var _f1=_c(_ee,_ef); +_60(_ee,_f1); +_f0.onCancelEdit.call(_ee,_f1); +}; +function _f2(_f3,q){ +var _f4=$.data(_f3,"tree"); +var _f5=_f4.options; +var ids={}; +$.easyui.forEach(_f4.data,true,function(_f6){ +if(_f5.filter.call(_f3,q,_f6)){ +$("#"+_f6.domId).removeClass("tree-node-hidden"); +ids[_f6.domId]=1; +_f6.hidden=false; +}else{ +$("#"+_f6.domId).addClass("tree-node-hidden"); +_f6.hidden=true; +} +}); +for(var id in ids){ +_f7(id); +} +function _f7(_f8){ +var p=$(_f3).tree("getParent",$("#"+_f8)[0]); +while(p){ +$(p.target).removeClass("tree-node-hidden"); +p.hidden=false; +p=$(_f3).tree("getParent",p.target); +} }; -function _ef(_f0,_f1){ -var _f2=$.data(_f0,"tree").options; -$(_f1).css("position",""); -$(_f1).find("input.tree-editor").remove(); -var _f3=_c(_f0,_f1); -_56(_f0,_f3); -_f2.onCancelEdit.call(_f0,_f3); }; -$.fn.tree=function(_f4,_f5){ -if(typeof _f4=="string"){ -return $.fn.tree.methods[_f4](this,_f5); +$.fn.tree=function(_f9,_fa){ +if(typeof _f9=="string"){ +return $.fn.tree.methods[_f9](this,_fa); } -var _f4=_f4||{}; +var _f9=_f9||{}; return this.each(function(){ -var _f6=$.data(this,"tree"); -var _f7; -if(_f6){ -_f7=$.extend(_f6.options,_f4); -_f6.options=_f7; +var _fb=$.data(this,"tree"); +var _fc; +if(_fb){ +_fc=$.extend(_fb.options,_f9); +_fb.options=_fc; }else{ -_f7=$.extend({},$.fn.tree.defaults,$.fn.tree.parseOptions(this),_f4); -$.data(this,"tree",{options:_f7,tree:_1(this),data:[]}); -var _f8=$.fn.tree.parseData(this); -if(_f8.length){ -_4d(this,this,_f8); +_fc=$.extend({},$.fn.tree.defaults,$.fn.tree.parseOptions(this),_f9); +$.data(this,"tree",{options:_fc,tree:_1(this),data:[],tmpIds:[]}); +var _fd=$.fn.tree.parseData(this); +if(_fd.length){ +_56(this,this,_fd); } } _4(this); -if(_f7.data){ -_4d(this,this,$.extend(true,[],_f7.data)); +if(_fc.data){ +_56(this,this,$.extend(true,[],_fc.data)); } -_6b(this,this); +_6f(this,this); }); }; $.fn.tree.methods={options:function(jq){ return $.data(jq[0],"tree").options; -},loadData:function(jq,_f9){ +},loadData:function(jq,_fe){ return jq.each(function(){ -_4d(this,this,_f9); +_56(this,this,_fe); }); -},getNode:function(jq,_fa){ -return _c(jq[0],_fa); -},getData:function(jq,_fb){ -return _c7(jq[0],_fb); -},reload:function(jq,_fc){ +},getNode:function(jq,_ff){ +return _c(jq[0],_ff); +},getData:function(jq,_100){ +return _c9(jq[0],_100); +},reload:function(jq,_101){ return jq.each(function(){ -if(_fc){ -var _fd=$(_fc); -var hit=_fd.children("span.tree-hit"); +if(_101){ +var node=$(_101); +var hit=node.children("span.tree-hit"); hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); -_fd.next().remove(); -_75(this,_fc); +node.next().remove(); +_79(this,_101); }else{ $(this).empty(); -_6b(this,this); +_6f(this,this); } }); -},getRoot:function(jq,_fe){ -return _af(jq[0],_fe); +},getRoot:function(jq,_102){ +return _b3(jq[0],_102); },getRoots:function(jq){ -return _b3(jq[0]); -},getParent:function(jq,_ff){ -return _8c(jq[0],_ff); -},getChildren:function(jq,_100){ -return _4c(jq[0],_100); -},getChecked:function(jq,_101){ -return _be(jq[0],_101); +return _b7(jq[0]); +},getParent:function(jq,_103){ +return _4d(jq[0],_103); +},getChildren:function(jq,_104){ +return _8c(jq[0],_104); +},getChecked:function(jq,_105){ +return _c2(jq[0],_105); },getSelected:function(jq){ -return _c4(jq[0]); -},isLeaf:function(jq,_102){ -return _48(jq[0],_102); +return _c6(jq[0]); +},isLeaf:function(jq,_106){ +return _9f(jq[0],_106); },find:function(jq,id){ -return _ce(jq[0],id); -},select:function(jq,_103){ +return _d0(jq[0],id); +},select:function(jq,_107){ return jq.each(function(){ -_db(this,_103); +_d9(this,_107); }); -},check:function(jq,_104){ +},check:function(jq,_108){ return jq.each(function(){ -_34(this,_104,true); +_34(this,_108,true); }); -},uncheck:function(jq,_105){ +},uncheck:function(jq,_109){ return jq.each(function(){ -_34(this,_105,false); +_34(this,_109,false); }); -},collapse:function(jq,_106){ +},collapse:function(jq,_10a){ return jq.each(function(){ -_7c(this,_106); +_80(this,_10a); }); -},expand:function(jq,_107){ +},expand:function(jq,_10b){ return jq.each(function(){ -_75(this,_107); +_79(this,_10b); }); -},collapseAll:function(jq,_108){ +},collapseAll:function(jq,_10c){ return jq.each(function(){ -_92(this,_108); +_96(this,_10c); }); -},expandAll:function(jq,_109){ +},expandAll:function(jq,_10d){ return jq.each(function(){ -_84(this,_109); +_88(this,_10d); }); -},expandTo:function(jq,_10a){ +},expandTo:function(jq,_10e){ return jq.each(function(){ -_88(this,_10a); +_8d(this,_10e); }); -},scrollTo:function(jq,_10b){ +},scrollTo:function(jq,_10f){ return jq.each(function(){ -_8d(this,_10b); +_91(this,_10f); }); -},toggle:function(jq,_10c){ +},toggle:function(jq,_110){ return jq.each(function(){ -_81(this,_10c); +_85(this,_110); }); -},append:function(jq,_10d){ +},append:function(jq,_111){ return jq.each(function(){ -_96(this,_10d); +_9a(this,_111); }); -},insert:function(jq,_10e){ +},insert:function(jq,_112){ return jq.each(function(){ -_9c(this,_10e); +_a1(this,_112); }); -},remove:function(jq,_10f){ +},remove:function(jq,_113){ return jq.each(function(){ -_a2(this,_10f); +_a7(this,_113); }); -},pop:function(jq,_110){ -var node=jq.tree("getData",_110); -jq.tree("remove",_110); +},pop:function(jq,_114){ +var node=jq.tree("getData",_114); +jq.tree("remove",_114); return node; -},update:function(jq,_111){ +},update:function(jq,_115){ return jq.each(function(){ -_56(this,_111); +_60(this,$.extend({},_115,{checkState:_115.checked?"checked":(_115.checked===false?"unchecked":undefined)})); }); },enableDnd:function(jq){ return jq.each(function(){ @@ -1048,28 +1062,32 @@ _11(this); return jq.each(function(){ _d(this); }); -},beginEdit:function(jq,_112){ +},beginEdit:function(jq,_116){ +return jq.each(function(){ +_e0(this,_116); +}); +},endEdit:function(jq,_117){ return jq.each(function(){ -_e2(this,_112); +_e7(this,_117); }); -},endEdit:function(jq,_113){ +},cancelEdit:function(jq,_118){ return jq.each(function(){ -_e9(this,_113); +_ed(this,_118); }); -},cancelEdit:function(jq,_114){ +},doFilter:function(jq,q){ return jq.each(function(){ -_ef(this,_114); +_f2(this,q); }); }}; -$.fn.tree.parseOptions=function(_115){ -var t=$(_115); -return $.extend({},$.parser.parseOptions(_115,["url","method",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean",lines:"boolean",dnd:"boolean"}])); +$.fn.tree.parseOptions=function(_119){ +var t=$(_119); +return $.extend({},$.parser.parseOptions(_119,["url","method",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean",lines:"boolean",dnd:"boolean"}])); }; -$.fn.tree.parseData=function(_116){ +$.fn.tree.parseData=function(_11a){ var data=[]; -_117(data,$(_116)); +_11b(data,$(_11a)); return data; -function _117(aa,tree){ +function _11b(aa,tree){ tree.children("li").each(function(){ var node=$(this); var item=$.extend({},$.parser.parseOptions(this,["id","iconCls","state"]),{checked:(node.attr("checked")?true:undefined)}); @@ -1077,35 +1095,37 @@ item.text=node.children("span").html(); if(!item.text){ item.text=node.html(); } -var _118=node.children("ul"); -if(_118.length){ +var _11c=node.children("ul"); +if(_11c.length){ item.children=[]; -_117(item.children,_118); +_11b(item.children,_11c); } aa.push(item); }); }; }; -var _119=1; -var _11a={render:function(_11b,ul,data){ -var opts=$.data(_11b,"tree").options; -var _11c=$(ul).prev("div.tree-node").find("span.tree-indent, span.tree-hit").length; -var cc=_11d(_11c,data); +var _11d=1; +var _11e={render:function(_11f,ul,data){ +var _120=$.data(_11f,"tree"); +var opts=_120.options; +var _121=$(ul).prev(".tree-node"); +var _122=_121.length?$(_11f).tree("getNode",_121[0]):null; +var _123=_121.find("span.tree-indent, span.tree-hit").length; +var cc=_124.call(this,_123,data); $(ul).append(cc.join("")); -function _11d(_11e,_11f){ +function _124(_125,_126){ var cc=[]; -for(var i=0;i<_11f.length;i++){ -var item=_11f[i]; +for(var i=0;i<_126.length;i++){ +var item=_126[i]; if(item.state!="open"&&item.state!="closed"){ item.state="open"; } -item.domId="_easyui_tree_"+_119++; +item.domId="_easyui_tree_"+_11d++; cc.push("
                            • "); cc.push("
                              "); -for(var j=0;j<_11e;j++){ +for(var j=0;j<_125;j++){ cc.push(""); } -var _120=false; if(item.state=="closed"){ cc.push(""); cc.push(""); @@ -1116,18 +1136,28 @@ cc.push(""); cc.push(""); -_120=true; } } -if(opts.checkbox){ -if((!opts.onlyLeafCheck)||_120){ -cc.push(""); +if(this.hasCheckbox(_11f,item)){ +var flag=0; +if(_122&&_122.checkState=="checked"&&opts.cascadeCheck){ +flag=1; +item.checked=true; +}else{ +if(item.checked){ +$.easyui.addArrayItem(_120.tmpIds,item.domId); } } -cc.push(""+opts.formatter.call(_11b,item)+""); +item.checkState=flag?"checked":"unchecked"; +cc.push(""); +}else{ +item.checkState=undefined; +item.checked=undefined; +} +cc.push(""+opts.formatter.call(_11f,item)+""); cc.push("
                              "); if(item.children&&item.children.length){ -var tmp=_11d(_11e+1,item.children); +var tmp=_124.call(this,_125+1,item.children); cc.push("
                                "); cc=cc.concat(tmp); cc.push("
                              "); @@ -1136,22 +1166,58 @@ cc.push("
                            • "); } return cc; }; +},hasCheckbox:function(_127,item){ +var _128=$.data(_127,"tree"); +var opts=_128.options; +if(opts.checkbox){ +if($.isFunction(opts.checkbox)){ +if(opts.checkbox.call(_127,item)){ +return true; +}else{ +return false; +} +}else{ +if(opts.onlyLeafCheck){ +if(item.state=="open"&&!(item.children&&item.children.length)){ +return true; +} +}else{ +return true; +} +} +} +return false; }}; $.fn.tree.defaults={url:null,method:"post",animate:false,checkbox:false,cascadeCheck:true,onlyLeafCheck:false,lines:false,dnd:false,data:null,queryParams:{},formatter:function(node){ return node.text; -},loader:function(_121,_122,_123){ +},filter:function(q,node){ +var qq=[]; +$.map($.isArray(q)?q:[q],function(q){ +q=$.trim(q); +if(q){ +qq.push(q); +} +}); +for(var i=0;i=0){ +return true; +} +} +return !qq.length; +},loader:function(_12a,_12b,_12c){ var opts=$(this).tree("options"); if(!opts.url){ return false; } -$.ajax({type:opts.method,url:opts.url,data:_121,dataType:"json",success:function(data){ -_122(data); +$.ajax({type:opts.method,url:opts.url,data:_12a,dataType:"json",success:function(data){ +_12b(data); },error:function(){ -_123.apply(this,arguments); +_12c.apply(this,arguments); }}); -},loadFilter:function(data,_124){ +},loadFilter:function(data,_12d){ return data; -},view:_11a,onBeforeLoad:function(node,_125){ +},view:_11e,onBeforeLoad:function(node,_12e){ },onLoadSuccess:function(node,data){ },onLoadError:function(){ },onClick:function(node){ @@ -1160,19 +1226,19 @@ return data; },onExpand:function(node){ },onBeforeCollapse:function(node){ },onCollapse:function(node){ -},onBeforeCheck:function(node,_126){ -},onCheck:function(node,_127){ +},onBeforeCheck:function(node,_12f){ +},onCheck:function(node,_130){ },onBeforeSelect:function(node){ },onSelect:function(node){ },onContextMenu:function(e,node){ },onBeforeDrag:function(node){ },onStartDrag:function(node){ },onStopDrag:function(node){ -},onDragEnter:function(_128,_129){ -},onDragOver:function(_12a,_12b){ -},onDragLeave:function(_12c,_12d){ -},onBeforeDrop:function(_12e,_12f,_130){ -},onDrop:function(_131,_132,_133){ +},onDragEnter:function(_131,_132){ +},onDragOver:function(_133,_134){ +},onDragLeave:function(_135,_136){ +},onBeforeDrop:function(_137,_138,_139){ +},onDrop:function(_13a,_13b,_13c){ },onBeforeEdit:function(node){ },onAfterEdit:function(node){ },onCancelEdit:function(node){ diff --git a/assets/js/easy-ui/plugins/jquery.treegrid.js b/assets/js/easy-ui/plugins/jquery.treegrid.js old mode 100755 new mode 100644 index f9cd79ad40..1f51ea73de --- a/assets/js/easy-ui/plugins/jquery.treegrid.js +++ b/assets/js/easy-ui/plugins/jquery.treegrid.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -17,7 +17,7 @@ return false; return false; },onLoadSuccess:function(){ },onResizeColumn:function(_5,_6){ -_26(_2); +_16(_2); _4.onResizeColumn.call(_2,_5,_6); },onBeforeSortColumn:function(_7,_8){ if(_4.onBeforeSortColumn.call(_2,_7,_8)==false){ @@ -27,302 +27,429 @@ return false; _4.sortName=_9; _4.sortOrder=_a; if(_4.remoteSort){ -_25(_2); +_15(_2); }else{ var _b=$(_2).treegrid("getData"); -_3f(_2,0,_b); +_56(_2,null,_b); } _4.onSortColumn.call(_2,_9,_a); -},onBeforeEdit:function(_c,_d){ -if(_4.onBeforeEdit.call(_2,_d)==false){ -return false; -} -},onAfterEdit:function(_e,_f,_10){ -_4.onAfterEdit.call(_2,_f,_10); -},onCancelEdit:function(_11,row){ -_4.onCancelEdit.call(_2,row); -},onBeforeSelect:function(_12){ -if(_4.onBeforeSelect.call(_2,_47(_2,_12))==false){ -return false; -} -},onSelect:function(_13){ -_4.onSelect.call(_2,_47(_2,_13)); -},onBeforeUnselect:function(_14){ -if(_4.onBeforeUnselect.call(_2,_47(_2,_14))==false){ -return false; -} -},onUnselect:function(_15){ -_4.onUnselect.call(_2,_47(_2,_15)); -},onBeforeCheck:function(_16){ -if(_4.onBeforeCheck.call(_2,_47(_2,_16))==false){ -return false; -} -},onCheck:function(_17){ -_4.onCheck.call(_2,_47(_2,_17)); -},onBeforeUncheck:function(_18){ -if(_4.onBeforeUncheck.call(_2,_47(_2,_18))==false){ -return false; -} -},onUncheck:function(_19){ -_4.onUncheck.call(_2,_47(_2,_19)); -},onClickRow:function(_1a){ -_4.onClickRow.call(_2,_47(_2,_1a)); -},onDblClickRow:function(_1b){ -_4.onDblClickRow.call(_2,_47(_2,_1b)); -},onClickCell:function(_1c,_1d){ -_4.onClickCell.call(_2,_1d,_47(_2,_1c)); -},onDblClickCell:function(_1e,_1f){ -_4.onDblClickCell.call(_2,_1f,_47(_2,_1e)); -},onRowContextMenu:function(e,_20){ -_4.onContextMenu.call(_2,e,_47(_2,_20)); +},onClickCell:function(_c,_d){ +_4.onClickCell.call(_2,_d,_37(_2,_c)); +},onDblClickCell:function(_e,_f){ +_4.onDblClickCell.call(_2,_f,_37(_2,_e)); +},onRowContextMenu:function(e,_10){ +_4.onContextMenu.call(_2,e,_37(_2,_10)); }})); -if(!_4.columns){ -var _21=$.data(_2,"datagrid").options; -_4.columns=_21.columns; -_4.frozenColumns=_21.frozenColumns; -} +var _11=$.data(_2,"datagrid").options; +_4.columns=_11.columns; +_4.frozenColumns=_11.frozenColumns; _3.dc=$.data(_2,"datagrid").dc; if(_4.pagination){ -var _22=$(_2).datagrid("getPager"); -_22.pagination({pageNumber:_4.pageNumber,pageSize:_4.pageSize,pageList:_4.pageList,onSelectPage:function(_23,_24){ -_4.pageNumber=_23; -_4.pageSize=_24; -_25(_2); +var _12=$(_2).datagrid("getPager"); +_12.pagination({pageNumber:_4.pageNumber,pageSize:_4.pageSize,pageList:_4.pageList,onSelectPage:function(_13,_14){ +_4.pageNumber=_13; +_4.pageSize=_14; +_15(_2); }}); -_4.pageSize=_22.pagination("options").pageSize; +_4.pageSize=_12.pagination("options").pageSize; } }; -function _26(_27,_28){ -var _29=$.data(_27,"datagrid").options; -var dc=$.data(_27,"datagrid").dc; -if(!dc.body1.is(":empty")&&(!_29.nowrap||_29.autoRowHeight)){ -if(_28!=undefined){ -var _2a=_2b(_27,_28); -for(var i=0;i<_2a.length;i++){ -_2c(_2a[i][_29.idField]); +function _16(_17,_18){ +var _19=$.data(_17,"datagrid").options; +var dc=$.data(_17,"datagrid").dc; +if(!dc.body1.is(":empty")&&(!_19.nowrap||_19.autoRowHeight)){ +if(_18!=undefined){ +var _1a=_1b(_17,_18); +for(var i=0;i<_1a.length;i++){ +_1c(_1a[i][_19.idField]); } } } -$(_27).datagrid("fixRowHeight",_28); -function _2c(_2d){ -var tr1=_29.finder.getTr(_27,_2d,"body",1); -var tr2=_29.finder.getTr(_27,_2d,"body",2); +$(_17).datagrid("fixRowHeight",_18); +function _1c(_1d){ +var tr1=_19.finder.getTr(_17,_1d,"body",1); +var tr2=_19.finder.getTr(_17,_1d,"body",2); tr1.css("height",""); tr2.css("height",""); -var _2e=Math.max(tr1.height(),tr2.height()); -tr1.css("height",_2e); -tr2.css("height",_2e); +var _1e=Math.max(tr1.height(),tr2.height()); +tr1.css("height",_1e); +tr2.css("height",_1e); }; }; -function _2f(_30){ -var dc=$.data(_30,"datagrid").dc; -var _31=$.data(_30,"treegrid").options; -if(!_31.rownumbers){ +function _1f(_20){ +var dc=$.data(_20,"datagrid").dc; +var _21=$.data(_20,"treegrid").options; +if(!_21.rownumbers){ return; } dc.body1.find("div.datagrid-cell-rownumber").each(function(i){ $(this).html(i+1); }); }; -function _32(_33){ +function _22(_23){ return function(e){ -$.fn.datagrid.defaults.rowEvents[_33?"mouseover":"mouseout"](e); +$.fn.datagrid.defaults.rowEvents[_23?"mouseover":"mouseout"](e); var tt=$(e.target); -var fn=_33?"addClass":"removeClass"; +var fn=_23?"addClass":"removeClass"; if(tt.hasClass("tree-hit")){ tt.hasClass("tree-expanded")?tt[fn]("tree-expanded-hover"):tt[fn]("tree-collapsed-hover"); } }; }; -function _34(e){ +function _24(e){ var tt=$(e.target); -if(tt.hasClass("tree-hit")){ var tr=tt.closest("tr.datagrid-row"); -var _35=tr.closest("div.datagrid-view").children(".datagrid-f")[0]; -_36(_35,tr.attr("node-id")); +if(!tr.length||!tr.parent().length){ +return; +} +var _25=tr.attr("node-id"); +var _26=_27(tr); +if(tt.hasClass("tree-hit")){ +_28(_26,_25); +}else{ +if(tt.hasClass("tree-checkbox")){ +_29(_26,_25); +}else{ +var _2a=$(_26).datagrid("options"); +if(!tt.parent().hasClass("datagrid-cell-check")&&!_2a.singleSelect&&e.shiftKey){ +var _2b=$(_26).treegrid("getChildren"); +var _2c=$.easyui.indexOfArray(_2b,_2a.idField,_2a.lastSelectedIndex); +var _2d=$.easyui.indexOfArray(_2b,_2a.idField,_25); +var _2e=Math.min(Math.max(_2c,0),_2d); +var to=Math.max(_2c,_2d); +var row=_2b[_2d]; +var td=tt.closest("td[field]",tr); +if(td.length){ +var _2f=td.attr("field"); +_2a.onClickCell.call(_26,_25,_2f,row[_2f]); +} +$(_26).treegrid("clearSelections"); +for(var i=_2e;i<=to;i++){ +$(_26).treegrid("selectRow",_2b[i][_2a.idField]); +} +_2a.onClickRow.call(_26,row); }else{ $.fn.datagrid.defaults.rowEvents.click(e); } +} +} }; -function _37(_38,_39){ -var _3a=$.data(_38,"treegrid").options; -var tr1=_3a.finder.getTr(_38,_39,"body",1); -var tr2=_3a.finder.getTr(_38,_39,"body",2); -var _3b=$(_38).datagrid("getColumnFields",true).length+(_3a.rownumbers?1:0); -var _3c=$(_38).datagrid("getColumnFields",false).length; -_3d(tr1,_3b); -_3d(tr2,_3c); -function _3d(tr,_3e){ -$(""+""+"
                              "+""+"").insertAfter(tr); -}; +function _27(t){ +return $(t).closest("div.datagrid-view").children(".datagrid-f")[0]; }; -function _3f(_40,_41,_42,_43){ -var _44=$.data(_40,"treegrid"); -var _45=_44.options; -var dc=_44.dc; -_42=_45.loadFilter.call(_40,_42,_41); -var _46=_47(_40,_41); -if(_46){ -var _48=_45.finder.getTr(_40,_41,"body",1); -var _49=_45.finder.getTr(_40,_41,"body",2); -var cc1=_48.next("tr.treegrid-tr-tree").children("td").children("div"); -var cc2=_49.next("tr.treegrid-tr-tree").children("td").children("div"); -if(!_43){ -_46.children=[]; +function _29(_30,_31,_32,_33){ +var _34=$.data(_30,"treegrid"); +var _35=_34.checkedRows; +var _36=_34.options; +if(!_36.checkbox){ +return; } +var row=_37(_30,_31); +if(!row.checkState){ +return; +} +var tr=_36.finder.getTr(_30,_31); +var ck=tr.find(".tree-checkbox"); +if(_32==undefined){ +if(ck.hasClass("tree-checkbox1")){ +_32=false; }else{ -var cc1=dc.body1; -var cc2=dc.body2; -if(!_43){ -_44.data=[]; +if(ck.hasClass("tree-checkbox0")){ +_32=true; +}else{ +if(row._checked==undefined){ +row._checked=ck.hasClass("tree-checkbox1"); } +_32=!row._checked; } -if(!_43){ -cc1.empty(); -cc2.empty(); } -if(_45.view.onBeforeRender){ -_45.view.onBeforeRender.call(_45.view,_40,_41,_42); } -_45.view.render.call(_45.view,_40,cc1,true); -_45.view.render.call(_45.view,_40,cc2,false); -if(_45.showFooter){ -_45.view.renderFooter.call(_45.view,_40,dc.footer1,true); -_45.view.renderFooter.call(_45.view,_40,dc.footer2,false); +row._checked=_32; +if(_32){ +if(ck.hasClass("tree-checkbox1")){ +return; } -if(_45.view.onAfterRender){ -_45.view.onAfterRender.call(_45.view,_40); +}else{ +if(ck.hasClass("tree-checkbox0")){ +return; } -if(!_41&&_45.pagination){ -var _4a=$.data(_40,"treegrid").total; -var _4b=$(_40).datagrid("getPager"); -if(_4b.pagination("options").total!=_4a){ -_4b.pagination({total:_4a}); } +if(!_33){ +if(_36.onBeforeCheckNode.call(_30,row,_32)==false){ +return; } -_26(_40); -_2f(_40); -$(_40).treegrid("showLines"); -$(_40).treegrid("setSelectionState"); -$(_40).treegrid("autoSizeColumn"); -_45.onLoadSuccess.call(_40,_46,_42); -}; -function _25(_4c,_4d,_4e,_4f,_50){ -var _51=$.data(_4c,"treegrid").options; -var _52=$(_4c).datagrid("getPanel").find("div.datagrid-body"); -if(_4e){ -_51.queryParams=_4e; } -var _53=$.extend({},_51.queryParams); -if(_51.pagination){ -$.extend(_53,{page:_51.pageNumber,rows:_51.pageSize}); +if(_36.cascadeCheck){ +_38(_30,row,_32); +_39(_30,row); +}else{ +_3a(_30,row,_32?"1":"0"); } -if(_51.sortName){ -$.extend(_53,{sort:_51.sortName,order:_51.sortOrder}); +if(!_33){ +_36.onCheckNode.call(_30,row,_32); } -var row=_47(_4c,_4d); -if(_51.onBeforeLoad.call(_4c,row,_53)==false){ +}; +function _3a(_3b,row,_3c){ +var _3d=$.data(_3b,"treegrid"); +var _3e=_3d.checkedRows; +var _3f=_3d.options; +if(!row.checkState||_3c==undefined){ return; } -var _54=_52.find("tr[node-id=\""+_4d+"\"] span.tree-folder"); -_54.addClass("tree-loading"); -$(_4c).treegrid("loading"); -var _55=_51.loader.call(_4c,_53,function(_56){ -_54.removeClass("tree-loading"); -$(_4c).treegrid("loaded"); -_3f(_4c,_4d,_56,_4f); -if(_50){ -_50(); +var tr=_3f.finder.getTr(_3b,row[_3f.idField]); +var ck=tr.find(".tree-checkbox"); +if(!ck.length){ +return; } -},function(){ -_54.removeClass("tree-loading"); -$(_4c).treegrid("loaded"); -_51.onLoadError.apply(_4c,arguments); -if(_50){ -_50(); +row.checkState=["unchecked","checked","indeterminate"][_3c]; +row.checked=(row.checkState=="checked"); +ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); +ck.addClass("tree-checkbox"+_3c); +if(_3c==0){ +$.easyui.removeArrayItem(_3e,_3f.idField,row[_3f.idField]); +}else{ +$.easyui.addArrayItem(_3e,_3f.idField,row); } +}; +function _38(_40,row,_41){ +var _42=_41?1:0; +_3a(_40,row,_42); +$.easyui.forEach(row.children||[],true,function(r){ +_3a(_40,r,_42); }); -if(_55==false){ -_54.removeClass("tree-loading"); -$(_4c).treegrid("loaded"); +}; +function _39(_43,row){ +var _44=$.data(_43,"treegrid").options; +var _45=_46(_43,row[_44.idField]); +if(_45){ +_3a(_43,_45,_47(_45)); +_39(_43,_45); } }; -function _57(_58){ -var _59=_5a(_58); -if(_59.length){ -return _59[0]; +function _47(row){ +var len=0; +var c0=0; +var c1=0; +$.easyui.forEach(row.children||[],false,function(r){ +if(r.checkState){ +len++; +if(r.checkState=="checked"){ +c1++; }else{ -return null; +if(r.checkState=="unchecked"){ +c0++; } -}; -function _5a(_5b){ -return $.data(_5b,"treegrid").data; -}; -function _5c(_5d,_5e){ -var row=_47(_5d,_5e); -if(row._parentId){ -return _47(_5d,row._parentId); +} +} +}); +if(len==0){ +return undefined; +} +var _48=0; +if(c0==len){ +_48=0; }else{ -return null; +if(c1==len){ +_48=1; +}else{ +_48=2; } +} +return _48; }; -function _2b(_5f,_60){ -var _61=$.data(_5f,"treegrid").options; -var _62=$(_5f).datagrid("getPanel").find("div.datagrid-view2 div.datagrid-body"); -var _63=[]; -if(_60){ -_64(_60); +function _49(_4a,_4b){ +var _4c=$.data(_4a,"treegrid").options; +if(!_4c.checkbox){ +return; +} +var row=_37(_4a,_4b); +var tr=_4c.finder.getTr(_4a,_4b); +var ck=tr.find(".tree-checkbox"); +if(_4c.view.hasCheckbox(_4a,row)){ +if(!ck.length){ +row.checkState=row.checkState||"unchecked"; +$("").insertBefore(tr.find(".tree-title")); +} +if(row.checkState=="checked"){ +_29(_4a,_4b,true,true); +}else{ +if(row.checkState=="unchecked"){ +_29(_4a,_4b,false,true); }else{ -var _65=_5a(_5f); -for(var i=0;i<_65.length;i++){ -_63.push(_65[i]); -_64(_65[i][_61.idField]); +var _4d=_47(row); +if(_4d===0){ +_29(_4a,_4b,false,true); +}else{ +if(_4d===1){ +_29(_4a,_4b,true,true); +} } } -function _64(_66){ -var _67=_47(_5f,_66); -if(_67&&_67.children){ -for(var i=0,len=_67.children.length;i"+""+"
                              "+""+"").insertAfter(tr); }; -function _69(_6a,_6b){ -if(!_6b){ -return 0; -} -var _6c=$.data(_6a,"treegrid").options; -var _6d=$(_6a).datagrid("getPanel").children("div.datagrid-view"); -var _6e=_6d.find("div.datagrid-body tr[node-id=\""+_6b+"\"]").children("td[field=\""+_6c.treeField+"\"]"); -return _6e.find("span.tree-indent,span.tree-hit").length; }; -function _47(_6f,_70){ -var _71=$.data(_6f,"treegrid").options; -var _72=$.data(_6f,"treegrid").data; -var cc=[_72]; -while(cc.length){ -var c=cc.shift(); -for(var i=0;i").insertBefore(_95); +var _a7=tr.children("td[field=\""+_a6.treeField+"\"]").children("div.datagrid-cell"); +var _a8=_a7.children("span.tree-icon"); +if(_a8.hasClass("tree-file")){ +_a8.removeClass("tree-file").addClass("tree-folder tree-folder-open"); +var hit=$("").insertBefore(_a8); if(hit.prev().length){ hit.prev().remove(); } } } -_3f(_91,_92.parent,_92.data,true); +_56(_a3,_a4.parent,_a4.data,_a5.data.length>0,true); }; -function _96(_97,_98){ -var ref=_98.before||_98.after; -var _99=$.data(_97,"treegrid").options; -var _9a=_5c(_97,ref); -_90(_97,{parent:(_9a?_9a[_99.idField]:null),data:[_98.data]}); -var _9b=_9a?_9a.children:$(_97).treegrid("getRoots"); -for(var i=0;i<_9b.length;i++){ -if(_9b[i][_99.idField]==ref){ -var _9c=_9b[_9b.length-1]; -_9b.splice(_98.before?i:(i+1),0,_9c); -_9b.splice(_9b.length-1,1); +function _a9(_aa,_ab){ +var ref=_ab.before||_ab.after; +var _ac=$.data(_aa,"treegrid").options; +var _ad=_46(_aa,ref); +_a2(_aa,{parent:(_ad?_ad[_ac.idField]:null),data:[_ab.data]}); +var _ae=_ad?_ad.children:$(_aa).treegrid("getRoots"); +for(var i=0;i<_ae.length;i++){ +if(_ae[i][_ac.idField]==ref){ +var _af=_ae[_ae.length-1]; +_ae.splice(_ab.before?i:(i+1),0,_af); +_ae.splice(_ae.length-1,1); break; } } -_9d(true); -_9d(false); -_2f(_97); -$(_97).treegrid("showLines"); -function _9d(_9e){ -var _9f=_9e?1:2; -var tr=_99.finder.getTr(_97,_98.data[_99.idField],"body",_9f); -var _a0=tr.closest("table.datagrid-btable"); +_b0(true); +_b0(false); +_1f(_aa); +$(_aa).treegrid("showLines"); +function _b0(_b1){ +var _b2=_b1?1:2; +var tr=_ac.finder.getTr(_aa,_ab.data[_ac.idField],"body",_b2); +var _b3=tr.closest("table.datagrid-btable"); tr=tr.parent().children(); -var _a1=_99.finder.getTr(_97,ref,"body",_9f); -if(_98.before){ -tr.insertBefore(_a1); +var _b4=_ac.finder.getTr(_aa,ref,"body",_b2); +if(_ab.before){ +tr.insertBefore(_b4); }else{ -var sub=_a1.next("tr.treegrid-tr-tree"); -tr.insertAfter(sub.length?sub:_a1); +var sub=_b4.next("tr.treegrid-tr-tree"); +tr.insertAfter(sub.length?sub:_b4); } -_a0.remove(); +_b3.remove(); }; }; -function _a2(_a3,_a4){ -var _a5=$.data(_a3,"treegrid"); -$(_a3).datagrid("deleteRow",_a4); -_2f(_a3); -_a5.total-=1; -$(_a3).datagrid("getPager").pagination("refresh",{total:_a5.total}); -$(_a3).treegrid("showLines"); +function _b5(_b6,_b7){ +var _b8=$.data(_b6,"treegrid"); +var _b9=_b8.options; +var _ba=_46(_b6,_b7); +$(_b6).datagrid("deleteRow",_b7); +$.easyui.removeArrayItem(_b8.checkedRows,_b9.idField,_b7); +_1f(_b6); +if(_ba){ +_49(_b6,_ba[_b9.idField]); +} +_b8.total-=1; +$(_b6).datagrid("getPager").pagination("refresh",{total:_b8.total}); +$(_b6).treegrid("showLines"); }; -function _a6(_a7){ -var t=$(_a7); -var _a8=t.treegrid("options"); -if(_a8.lines){ +function _bb(_bc){ +var t=$(_bc); +var _bd=t.treegrid("options"); +if(_bd.lines){ t.treegrid("getPanel").addClass("tree-lines"); }else{ t.treegrid("getPanel").removeClass("tree-lines"); @@ -516,131 +650,131 @@ return; } t.treegrid("getPanel").find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); t.treegrid("getPanel").find("div.datagrid-cell").removeClass("tree-node-last tree-root-first tree-root-one"); -var _a9=t.treegrid("getRoots"); -if(_a9.length>1){ -_aa(_a9[0]).addClass("tree-root-first"); +var _be=t.treegrid("getRoots"); +if(_be.length>1){ +_bf(_be[0]).addClass("tree-root-first"); }else{ -if(_a9.length==1){ -_aa(_a9[0]).addClass("tree-root-one"); +if(_be.length==1){ +_bf(_be[0]).addClass("tree-root-one"); } } -_ab(_a9); -_ac(_a9); -function _ab(_ad){ -$.map(_ad,function(_ae){ -if(_ae.children&&_ae.children.length){ -_ab(_ae.children); +_c0(_be); +_c1(_be); +function _c0(_c2){ +$.map(_c2,function(_c3){ +if(_c3.children&&_c3.children.length){ +_c0(_c3.children); }else{ -var _af=_aa(_ae); -_af.find(".tree-icon").prev().addClass("tree-join"); +var _c4=_bf(_c3); +_c4.find(".tree-icon").prev().addClass("tree-join"); } }); -if(_ad.length){ -var _b0=_aa(_ad[_ad.length-1]); -_b0.addClass("tree-node-last"); -_b0.find(".tree-join").removeClass("tree-join").addClass("tree-joinbottom"); +if(_c2.length){ +var _c5=_bf(_c2[_c2.length-1]); +_c5.addClass("tree-node-last"); +_c5.find(".tree-join").removeClass("tree-join").addClass("tree-joinbottom"); } }; -function _ac(_b1){ -$.map(_b1,function(_b2){ -if(_b2.children&&_b2.children.length){ -_ac(_b2.children); +function _c1(_c6){ +$.map(_c6,function(_c7){ +if(_c7.children&&_c7.children.length){ +_c1(_c7.children); } }); -for(var i=0;i<_b1.length-1;i++){ -var _b3=_b1[i]; -var _b4=t.treegrid("getLevel",_b3[_a8.idField]); -var tr=_a8.finder.getTr(_a7,_b3[_a8.idField]); -var cc=tr.next().find("tr.datagrid-row td[field=\""+_a8.treeField+"\"] div.datagrid-cell"); -cc.find("span:eq("+(_b4-1)+")").addClass("tree-line"); +for(var i=0;i<_c6.length-1;i++){ +var _c8=_c6[i]; +var _c9=t.treegrid("getLevel",_c8[_bd.idField]); +var tr=_bd.finder.getTr(_bc,_c8[_bd.idField]); +var cc=tr.next().find("tr.datagrid-row td[field=\""+_bd.treeField+"\"] div.datagrid-cell"); +cc.find("span:eq("+(_c9-1)+")").addClass("tree-line"); } }; -function _aa(_b5){ -var tr=_a8.finder.getTr(_a7,_b5[_a8.idField]); -var _b6=tr.find("td[field=\""+_a8.treeField+"\"] div.datagrid-cell"); -return _b6; +function _bf(_ca){ +var tr=_bd.finder.getTr(_bc,_ca[_bd.idField]); +var _cb=tr.find("td[field=\""+_bd.treeField+"\"] div.datagrid-cell"); +return _cb; }; }; -$.fn.treegrid=function(_b7,_b8){ -if(typeof _b7=="string"){ -var _b9=$.fn.treegrid.methods[_b7]; -if(_b9){ -return _b9(this,_b8); +$.fn.treegrid=function(_cc,_cd){ +if(typeof _cc=="string"){ +var _ce=$.fn.treegrid.methods[_cc]; +if(_ce){ +return _ce(this,_cd); }else{ -return this.datagrid(_b7,_b8); +return this.datagrid(_cc,_cd); } } -_b7=_b7||{}; +_cc=_cc||{}; return this.each(function(){ -var _ba=$.data(this,"treegrid"); -if(_ba){ -$.extend(_ba.options,_b7); +var _cf=$.data(this,"treegrid"); +if(_cf){ +$.extend(_cf.options,_cc); }else{ -_ba=$.data(this,"treegrid",{options:$.extend({},$.fn.treegrid.defaults,$.fn.treegrid.parseOptions(this),_b7),data:[]}); +_cf=$.data(this,"treegrid",{options:$.extend({},$.fn.treegrid.defaults,$.fn.treegrid.parseOptions(this),_cc),data:[],checkedRows:[],tmpIds:[]}); } _1(this); -if(_ba.options.data){ -$(this).treegrid("loadData",_ba.options.data); +if(_cf.options.data){ +$(this).treegrid("loadData",_cf.options.data); } -_25(this); +_15(this); }); }; $.fn.treegrid.methods={options:function(jq){ return $.data(jq[0],"treegrid").options; -},resize:function(jq,_bb){ +},resize:function(jq,_d0){ return jq.each(function(){ -$(this).datagrid("resize",_bb); +$(this).datagrid("resize",_d0); }); -},fixRowHeight:function(jq,_bc){ +},fixRowHeight:function(jq,_d1){ return jq.each(function(){ -_26(this,_bc); +_16(this,_d1); }); -},loadData:function(jq,_bd){ +},loadData:function(jq,_d2){ return jq.each(function(){ -_3f(this,_bd.parent,_bd); +_56(this,_d2.parent,_d2); }); -},load:function(jq,_be){ +},load:function(jq,_d3){ return jq.each(function(){ $(this).treegrid("options").pageNumber=1; $(this).treegrid("getPager").pagination({pageNumber:1}); -$(this).treegrid("reload",_be); +$(this).treegrid("reload",_d3); }); },reload:function(jq,id){ return jq.each(function(){ -var _bf=$(this).treegrid("options"); -var _c0={}; +var _d4=$(this).treegrid("options"); +var _d5={}; if(typeof id=="object"){ -_c0=id; +_d5=id; }else{ -_c0=$.extend({},_bf.queryParams); -_c0.id=id; +_d5=$.extend({},_d4.queryParams); +_d5.id=id; } -if(_c0.id){ -var _c1=$(this).treegrid("find",_c0.id); -if(_c1.children){ -_c1.children.splice(0,_c1.children.length); +if(_d5.id){ +var _d6=$(this).treegrid("find",_d5.id); +if(_d6.children){ +_d6.children.splice(0,_d6.children.length); } -_bf.queryParams=_c0; -var tr=_bf.finder.getTr(this,_c0.id); +_d4.queryParams=_d5; +var tr=_d4.finder.getTr(this,_d5.id); tr.next("tr.treegrid-tr-tree").remove(); tr.find("span.tree-hit").removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); -_78(this,_c0.id); +_8a(this,_d5.id); }else{ -_25(this,null,_c0); +_15(this,null,_d5); } }); -},reloadFooter:function(jq,_c2){ +},reloadFooter:function(jq,_d7){ return jq.each(function(){ -var _c3=$.data(this,"treegrid").options; +var _d8=$.data(this,"treegrid").options; var dc=$.data(this,"datagrid").dc; -if(_c2){ -$.data(this,"treegrid").footer=_c2; +if(_d7){ +$.data(this,"treegrid").footer=_d7; } -if(_c3.showFooter){ -_c3.view.renderFooter.call(_c3.view,this,dc.footer1,true); -_c3.view.renderFooter.call(_c3.view,this,dc.footer2,false); -if(_c3.view.onAfterRender){ -_c3.view.onAfterRender.call(_c3.view,this); +if(_d8.showFooter){ +_d8.view.renderFooter.call(_d8.view,this,dc.footer1,true); +_d8.view.renderFooter.call(_d8.view,this,dc.footer2,false); +if(_d8.view.onAfterRender){ +_d8.view.onAfterRender.call(_d8.view,this); } $(this).treegrid("fixRowHeight"); } @@ -650,20 +784,20 @@ return $.data(jq[0],"treegrid").data; },getFooterRows:function(jq){ return $.data(jq[0],"treegrid").footer; },getRoot:function(jq){ -return _57(jq[0]); +return _6e(jq[0]); },getRoots:function(jq){ -return _5a(jq[0]); +return _71(jq[0]); },getParent:function(jq,id){ -return _5c(jq[0],id); +return _46(jq[0],id); },getChildren:function(jq,id){ -return _2b(jq[0],id); +return _1b(jq[0],id); },getLevel:function(jq,id){ -return _69(jq[0],id); +return _7b(jq[0],id); },find:function(jq,id){ -return _47(jq[0],id); +return _37(jq[0],id); },isLeaf:function(jq,id){ -var _c4=$.data(jq[0],"treegrid").options; -var tr=_c4.finder.getTr(jq[0],id); +var _d9=$.data(jq[0],"treegrid").options; +var tr=_d9.finder.getTr(jq[0],id); var hit=tr.find("span.tree-hit"); return hit.length==0; },select:function(jq,id){ @@ -676,39 +810,39 @@ $(this).datagrid("unselectRow",id); }); },collapse:function(jq,id){ return jq.each(function(){ -_74(this,id); +_86(this,id); }); },expand:function(jq,id){ return jq.each(function(){ -_78(this,id); +_8a(this,id); }); },toggle:function(jq,id){ return jq.each(function(){ -_36(this,id); +_28(this,id); }); },collapseAll:function(jq,id){ return jq.each(function(){ -_82(this,id); +_94(this,id); }); },expandAll:function(jq,id){ return jq.each(function(){ -_87(this,id); +_99(this,id); }); },expandTo:function(jq,id){ return jq.each(function(){ -_8c(this,id); +_9e(this,id); }); -},append:function(jq,_c5){ +},append:function(jq,_da){ return jq.each(function(){ -_90(this,_c5); +_a2(this,_da); }); -},insert:function(jq,_c6){ +},insert:function(jq,_db){ return jq.each(function(){ -_96(this,_c6); +_a9(this,_db); }); },remove:function(jq,id){ return jq.each(function(){ -_a2(this,id); +_b5(this,id); }); },pop:function(jq,id){ var row=jq.treegrid("find",id); @@ -716,13 +850,19 @@ jq.treegrid("remove",id); return row; },refresh:function(jq,id){ return jq.each(function(){ -var _c7=$.data(this,"treegrid").options; -_c7.view.refreshRow.call(_c7.view,this,id); +var _dc=$.data(this,"treegrid").options; +_dc.view.refreshRow.call(_dc.view,this,id); }); -},update:function(jq,_c8){ +},update:function(jq,_dd){ return jq.each(function(){ -var _c9=$.data(this,"treegrid").options; -_c9.view.updateRow.call(_c9.view,this,_c8.id,_c8.row); +var _de=$.data(this,"treegrid").options; +var row=_dd.row; +_de.view.updateRow.call(_de.view,this,_dd.id,row); +if(row.checked!=undefined){ +row=_37(this,_dd.id); +$.extend(row,{checkState:row.checked?"checked":(row.checked===false?"unchecked":undefined)}); +_49(this,_dd.id); +} }); },beginEdit:function(jq,id){ return jq.each(function(){ @@ -739,115 +879,133 @@ $(this).datagrid("cancelEdit",id); }); },showLines:function(jq){ return jq.each(function(){ -_a6(this); +_bb(this); +}); +},setSelectionState:function(jq){ +return jq.each(function(){ +$(this).datagrid("setSelectionState"); +var _df=$(this).data("treegrid"); +for(var i=0;i<_df.tmpIds.length;i++){ +_29(this,_df.tmpIds[i],true,true); +} +_df.tmpIds=[]; +}); +},getCheckedNodes:function(jq,_e0){ +_e0=_e0||"checked"; +var _e1=[]; +$.easyui.forEach(jq.data("treegrid").checkedRows,false,function(row){ +if(row.checkState==_e0){ +_e1.push(row); +} +}); +return _e1; +},checkNode:function(jq,id){ +return jq.each(function(){ +_29(this,id,true); +}); +},uncheckNode:function(jq,id){ +return jq.each(function(){ +_29(this,id,false); +}); +},clearChecked:function(jq){ +return jq.each(function(){ +var _e2=this; +var _e3=$(_e2).treegrid("options"); +$(_e2).datagrid("clearChecked"); +$.map($(_e2).treegrid("getCheckedNodes"),function(row){ +_29(_e2,row[_e3.idField],false,true); +}); }); }}; -$.fn.treegrid.parseOptions=function(_ca){ -return $.extend({},$.fn.datagrid.parseOptions(_ca),$.parser.parseOptions(_ca,["treeField",{animate:"boolean"}])); +$.fn.treegrid.parseOptions=function(_e4){ +return $.extend({},$.fn.datagrid.parseOptions(_e4),$.parser.parseOptions(_e4,["treeField",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean"}])); }; -var _cb=$.extend({},$.fn.datagrid.defaults.view,{render:function(_cc,_cd,_ce){ -var _cf=$.data(_cc,"treegrid").options; -var _d0=$(_cc).datagrid("getColumnFields",_ce); -var _d1=$.data(_cc,"datagrid").rowIdPrefix; -if(_ce){ -if(!(_cf.rownumbers||(_cf.frozenColumns&&_cf.frozenColumns.length))){ +var _e5=$.extend({},$.fn.datagrid.defaults.view,{render:function(_e6,_e7,_e8){ +var _e9=$.data(_e6,"treegrid").options; +var _ea=$(_e6).datagrid("getColumnFields",_e8); +var _eb=$.data(_e6,"datagrid").rowIdPrefix; +if(_e8){ +if(!(_e9.rownumbers||(_e9.frozenColumns&&_e9.frozenColumns.length))){ return; } } -var _d2=this; +var _ec=this; if(this.treeNodes&&this.treeNodes.length){ -var _d3=_d4(_ce,this.treeLevel,this.treeNodes); -$(_cd).append(_d3.join("")); -} -function _d4(_d5,_d6,_d7){ -var _d8=$(_cc).treegrid("getParent",_d7[0][_cf.idField]); -var _d9=(_d8?_d8.children.length:$(_cc).treegrid("getRoots").length)-_d7.length; -var _da=[""]; -for(var i=0;i<_d7.length;i++){ -var row=_d7[i]; +var _ed=_ee.call(this,_e8,this.treeLevel,this.treeNodes); +$(_e7).append(_ed.join("")); +} +function _ee(_ef,_f0,_f1){ +var _f2=$(_e6).treegrid("getParent",_f1[0][_e9.idField]); +var _f3=(_f2?_f2.children.length:$(_e6).treegrid("getRoots").length)-_f1.length; +var _f4=["
                              "]; +for(var i=0;i<_f1.length;i++){ +var row=_f1[i]; if(row.state!="open"&&row.state!="closed"){ row.state="open"; } -var css=_cf.rowStyler?_cf.rowStyler.call(_cc,row):""; -var _db=""; -var _dc=""; -if(typeof css=="string"){ -_dc=css; -}else{ -if(css){ -_db=css["class"]||""; -_dc=css["style"]||""; -} -} -var cls="class=\"datagrid-row "+(_d9++%2&&_cf.striped?"datagrid-row-alt ":" ")+_db+"\""; -var _dd=_dc?"style=\""+_dc+"\"":""; -var _de=_d1+"-"+(_d5?1:2)+"-"+row[_cf.idField]; -_da.push(""); -_da=_da.concat(_d2.renderRow.call(_d2,_cc,_d0,_d5,_d6,row)); -_da.push(""); +var css=_e9.rowStyler?_e9.rowStyler.call(_e6,row):""; +var cs=this.getStyleValue(css); +var cls="class=\"datagrid-row "+(_f3++%2&&_e9.striped?"datagrid-row-alt ":" ")+cs.c+"\""; +var _f5=cs.s?"style=\""+cs.s+"\"":""; +var _f6=_eb+"-"+(_ef?1:2)+"-"+row[_e9.idField]; +_f4.push(""); +_f4=_f4.concat(_ec.renderRow.call(_ec,_e6,_ea,_ef,_f0,row)); +_f4.push(""); if(row.children&&row.children.length){ -var tt=_d4(_d5,_d6+1,row.children); +var tt=_ee.call(this,_ef,_f0+1,row.children); var v=row.state=="closed"?"none":"block"; -_da.push(""); +_f4.push(""); } } -_da.push("
                              "); -_da=_da.concat(tt); -_da.push("
                              "); +_f4=_f4.concat(tt); +_f4.push("
                              "); -return _da; +_f4.push(""); +return _f4; }; -},renderFooter:function(_df,_e0,_e1){ -var _e2=$.data(_df,"treegrid").options; -var _e3=$.data(_df,"treegrid").footer||[]; -var _e4=$(_df).datagrid("getColumnFields",_e1); -var _e5=[""]; -for(var i=0;i<_e3.length;i++){ -var row=_e3[i]; -row[_e2.idField]=row[_e2.idField]||("foot-row-id"+i); -_e5.push(""); -_e5.push(this.renderRow.call(this,_df,_e4,_e1,0,row)); -_e5.push(""); -} -_e5.push("
                              "); -$(_e0).html(_e5.join("")); -},renderRow:function(_e6,_e7,_e8,_e9,row){ -var _ea=$.data(_e6,"treegrid").options; +},renderFooter:function(_f7,_f8,_f9){ +var _fa=$.data(_f7,"treegrid").options; +var _fb=$.data(_f7,"treegrid").footer||[]; +var _fc=$(_f7).datagrid("getColumnFields",_f9); +var _fd=[""]; +for(var i=0;i<_fb.length;i++){ +var row=_fb[i]; +row[_fa.idField]=row[_fa.idField]||("foot-row-id"+i); +_fd.push(""); +_fd.push(this.renderRow.call(this,_f7,_fc,_f9,0,row)); +_fd.push(""); +} +_fd.push("
                              "); +$(_f8).html(_fd.join("")); +},renderRow:function(_fe,_ff,_100,_101,row){ +var _102=$.data(_fe,"treegrid"); +var opts=_102.options; var cc=[]; -if(_e8&&_ea.rownumbers){ +if(_100&&opts.rownumbers){ cc.push("
                              0
                              "); } -for(var i=0;i<_e7.length;i++){ -var _eb=_e7[i]; -var col=$(_e6).datagrid("getColumnOption",_eb); +for(var i=0;i<_ff.length;i++){ +var _103=_ff[i]; +var col=$(_fe).datagrid("getColumnOption",_103); if(col){ -var css=col.styler?(col.styler(row[_eb],row)||""):""; -var _ec=""; -var _ed=""; -if(typeof css=="string"){ -_ed=css; -}else{ -if(cc){ -_ec=css["class"]||""; -_ed=css["style"]||""; -} -} -var cls=_ec?"class=\""+_ec+"\"":""; -var _ee=col.hidden?"style=\"display:none;"+_ed+"\"":(_ed?"style=\""+_ed+"\"":""); -cc.push(""); -var _ee=""; +var css=col.styler?(col.styler(row[_103],row)||""):""; +var cs=this.getStyleValue(css); +var cls=cs.c?"class=\""+cs.c+"\"":""; +var _104=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":""); +cc.push(""); +var _104=""; if(!col.checkbox){ if(col.align){ -_ee+="text-align:"+col.align+";"; +_104+="text-align:"+col.align+";"; } -if(!_ea.nowrap){ -_ee+="white-space:normal;height:auto;"; +if(!opts.nowrap){ +_104+="white-space:normal;height:auto;"; }else{ -if(_ea.autoRowHeight){ -_ee+="height:auto;"; +if(opts.autoRowHeight){ +_104+="height:auto;"; } } } -cc.push("
                              "); +cc.push(" name=\""+_103+"\" value=\""+(row[_103]!=undefined?row[_103]:"")+"\">"); }else{ var val=null; if(col.formatter){ -val=col.formatter(row[_eb],row); +val=col.formatter(row[_103],row); }else{ -val=row[_eb]; +val=row[_103]; } -if(_eb==_ea.treeField){ -for(var j=0;j<_e9;j++){ +if(_103==opts.treeField){ +for(var j=0;j<_101;j++){ cc.push(""); } if(row.state=="closed"){ @@ -884,6 +1042,32 @@ cc.push(""); cc.push(""); } } +if(this.hasCheckbox(_fe,row)){ +var flag=0; +var crow=$.easyui.getArrayItem(_102.checkedRows,opts.idField,row[opts.idField]); +if(crow){ +flag=crow.checkState=="checked"?1:2; +row.checkState=crow.checkState; +row.checked=crow.checked; +$.easyui.addArrayItem(_102.checkedRows,opts.idField,row); +}else{ +var prow=$.easyui.getArrayItem(_102.checkedRows,opts.idField,row._parentId); +if(prow&&prow.checkState=="checked"&&opts.cascadeCheck){ +flag=1; +row.checked=true; +$.easyui.addArrayItem(_102.checkedRows,opts.idField,row); +}else{ +if(row.checked){ +$.easyui.addArrayItem(_102.tmpIds,row[opts.idField]); +} +} +row.checkState=flag?"checked":"unchecked"; +} +cc.push(""); +}else{ +row.checkState=undefined; +row.checked=undefined; +} cc.push(""+val+""); }else{ cc.push(val); @@ -894,98 +1078,122 @@ cc.push(""); } } return cc.join(""); -},refreshRow:function(_ef,id){ -this.updateRow.call(this,_ef,id,{}); -},updateRow:function(_f0,id,row){ -var _f1=$.data(_f0,"treegrid").options; -var _f2=$(_f0).treegrid("find",id); -$.extend(_f2,row); -var _f3=$(_f0).treegrid("getLevel",id)-1; -var _f4=_f1.rowStyler?_f1.rowStyler.call(_f0,_f2):""; -var _f5=$.data(_f0,"datagrid").rowIdPrefix; -var _f6=_f2[_f1.idField]; -function _f7(_f8){ -var _f9=$(_f0).treegrid("getColumnFields",_f8); -var tr=_f1.finder.getTr(_f0,id,"body",(_f8?1:2)); -var _fa=tr.find("div.datagrid-cell-rownumber").html(); -var _fb=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); -tr.html(this.renderRow(_f0,_f9,_f8,_f3,_f2)); -tr.attr("style",_f4||""); -tr.find("div.datagrid-cell-rownumber").html(_fa); -if(_fb){ +},hasCheckbox:function(_105,row){ +var opts=$.data(_105,"treegrid").options; +if(opts.checkbox){ +if($.isFunction(opts.checkbox)){ +if(opts.checkbox.call(_105,row)){ +return true; +}else{ +return false; +} +}else{ +if(opts.onlyLeafCheck){ +if(row.state=="open"&&!(row.children&&row.children.length)){ +return true; +} +}else{ +return true; +} +} +} +return false; +},refreshRow:function(_106,id){ +this.updateRow.call(this,_106,id,{}); +},updateRow:function(_107,id,row){ +var opts=$.data(_107,"treegrid").options; +var _108=$(_107).treegrid("find",id); +$.extend(_108,row); +var _109=$(_107).treegrid("getLevel",id)-1; +var _10a=opts.rowStyler?opts.rowStyler.call(_107,_108):""; +var _10b=$.data(_107,"datagrid").rowIdPrefix; +var _10c=_108[opts.idField]; +function _10d(_10e){ +var _10f=$(_107).treegrid("getColumnFields",_10e); +var tr=opts.finder.getTr(_107,id,"body",(_10e?1:2)); +var _110=tr.find("div.datagrid-cell-rownumber").html(); +var _111=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); +tr.html(this.renderRow(_107,_10f,_10e,_109,_108)); +tr.attr("style",_10a||""); +tr.find("div.datagrid-cell-rownumber").html(_110); +if(_111){ tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true); } -if(_f6!=id){ -tr.attr("id",_f5+"-"+(_f8?1:2)+"-"+_f6); -tr.attr("node-id",_f6); +if(_10c!=id){ +tr.attr("id",_10b+"-"+(_10e?1:2)+"-"+_10c); +tr.attr("node-id",_10c); } }; -_f7.call(this,true); -_f7.call(this,false); -$(_f0).treegrid("fixRowHeight",id); -},deleteRow:function(_fc,id){ -var _fd=$.data(_fc,"treegrid").options; -var tr=_fd.finder.getTr(_fc,id); +_10d.call(this,true); +_10d.call(this,false); +$(_107).treegrid("fixRowHeight",id); +},deleteRow:function(_112,id){ +var opts=$.data(_112,"treegrid").options; +var tr=opts.finder.getTr(_112,id); tr.next("tr.treegrid-tr-tree").remove(); tr.remove(); -var _fe=del(id); -if(_fe){ -if(_fe.children.length==0){ -tr=_fd.finder.getTr(_fc,_fe[_fd.idField]); +var _113=del(id); +if(_113){ +if(_113.children.length==0){ +tr=opts.finder.getTr(_112,_113[opts.idField]); tr.next("tr.treegrid-tr-tree").remove(); -var _ff=tr.children("td[field=\""+_fd.treeField+"\"]").children("div.datagrid-cell"); -_ff.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); -_ff.find(".tree-hit").remove(); -$("").prependTo(_ff); +var cell=tr.children("td[field=\""+opts.treeField+"\"]").children("div.datagrid-cell"); +cell.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); +cell.find(".tree-hit").remove(); +$("").prependTo(cell); } } +this.setEmptyMsg(_112); function del(id){ var cc; -var _100=$(_fc).treegrid("getParent",id); -if(_100){ -cc=_100.children; +var _114=$(_112).treegrid("getParent",id); +if(_114){ +cc=_114.children; }else{ -cc=$(_fc).treegrid("getData"); +cc=$(_112).treegrid("getData"); } for(var i=0;ib?1:-1); }; -r=_10b(r1[sn],r2[sn])*(so=="asc"?1:-1); +r=_11f(r1[sn],r2[sn])*(so=="asc"?1:-1); if(r!=0){ return r; } @@ -1023,106 +1228,92 @@ return r; return r; }); for(var i=0;i=_3d[0]&&len<=_3d[1]; -},message:"Please enter a value between {0} and {1}."},remote:{validator:function(_3e,_3f){ -var _40={}; -_40[_3f[1]]=_3e; -var _41=$.ajax({url:_3f[0],dataType:"json",data:_40,async:false,cache:false,type:"post"}).responseText; -return _41=="true"; +}},rules:{email:{validator:function(_42){ +return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(_42); +},message:"Please enter a valid email address."},url:{validator:function(_43){ +return /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(_43); +},message:"Please enter a valid URL."},length:{validator:function(_44,_45){ +var len=$.trim(_44).length; +return len>=_45[0]&&len<=_45[1]; +},message:"Please enter a value between {0} and {1}."},remote:{validator:function(_46,_47){ +var _48={}; +_48[_47[1]]=_46; +var _49=$.ajax({url:_47[0],dataType:"json",data:_48,async:false,cache:false,type:"post"}).responseText; +return _49=="true"; },message:"Please fix this field."}},onBeforeValidate:function(){ -},onValidate:function(_42){ +},onValidate:function(_4a){ }}; })(jQuery); diff --git a/assets/js/easy-ui/plugins/jquery.window.js b/assets/js/easy-ui/plugins/jquery.window.js old mode 100755 new mode 100644 index e3f28e9f3d..dc179ec82b --- a/assets/js/easy-ui/plugins/jquery.window.js +++ b/assets/js/easy-ui/plugins/jquery.window.js @@ -1,10 +1,10 @@ /** - * jQuery EasyUI 1.4.1 + * jQuery EasyUI 1.5.2 * - * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved. + * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved. * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com + * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php + * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ @@ -54,7 +54,7 @@ _1(_c); function _11(_12){ var _13=$.data(_12,"window"); var _14=_13.options; -var win=$(_12).panel($.extend({},_13.options,{border:false,doSize:true,closed:true,cls:"window",headerCls:"window-header",bodyCls:"window-body "+(_14.noheader?"window-body-noheader":""),onBeforeDestroy:function(){ +var win=$(_12).panel($.extend({},_13.options,{border:false,doSize:true,closed:true,cls:"window "+(!_14.border?"window-thinborder window-noborder ":(_14.border=="thin"?"window-thinborder ":""))+(_14.cls||""),headerCls:"window-header "+(_14.headerCls||""),bodyCls:"window-body "+(_14.noheader?"window-body-noheader ":" ")+(_14.bodyCls||""),onBeforeDestroy:function(){ if(_14.onBeforeDestroy.call(_12)==false){ return false; } @@ -74,7 +74,7 @@ _13.mask.hide(); _14.onClose.call(_12); },onOpen:function(){ if(_13.mask){ -_13.mask.css({display:"block",zIndex:$.fn.window.defaults.zIndex++}); +_13.mask.css($.extend({display:"block",zIndex:$.fn.window.defaults.zIndex++},$.fn.window.getMaskSize(_12))); } if(_13.shadow){ _13.shadow.css({display:"block",zIndex:$.fn.window.defaults.zIndex++,left:_14.left,top:_14.top,width:_13.window._outerWidth(),height:_13.window._outerHeight()}); @@ -113,17 +113,16 @@ _13.window=win.panel("panel"); if(_13.mask){ _13.mask.remove(); } -if(_14.modal==true){ -_13.mask=$("
                              ").insertAfter(_13.window); -_13.mask.css({width:(_14.inline?_13.mask.parent().width():_18().width),height:(_14.inline?_13.mask.parent().height():_18().height),display:"none"}); +if(_14.modal){ +_13.mask=$("
                              ").insertAfter(_13.window); } if(_13.shadow){ _13.shadow.remove(); } -if(_14.shadow==true){ -_13.shadow=$("
                              ").insertAfter(_13.window); -_13.shadow.css({display:"none"}); +if(_14.shadow){ +_13.shadow=$("
                              ").insertAfter(_13.window); } +var _18=_14.closed; if(_14.left==null){ _5(_12); } @@ -131,112 +130,151 @@ if(_14.top==null){ _b(_12); } _1(_12); -if(!_14.closed){ +if(!_18){ win.window("open"); } }; -function _19(_1a){ -var _1b=$.data(_1a,"window"); -_1b.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_1b.options.draggable==false,onStartDrag:function(e){ -if(_1b.mask){ -_1b.mask.css("z-index",$.fn.window.defaults.zIndex++); -} -if(_1b.shadow){ -_1b.shadow.css("z-index",$.fn.window.defaults.zIndex++); -} -_1b.window.css("z-index",$.fn.window.defaults.zIndex++); -if(!_1b.proxy){ -_1b.proxy=$("
                              ").insertAfter(_1b.window); -} -_1b.proxy.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); -_1b.proxy._outerWidth(_1b.window._outerWidth()); -_1b.proxy._outerHeight(_1b.window._outerHeight()); -setTimeout(function(){ -if(_1b.proxy){ -_1b.proxy.show(); +function _19(_1a,top,_1b,_1c){ +var _1d=this; +var _1e=$.data(_1d,"window"); +var _1f=_1e.options; +if(!_1f.constrain){ +return {}; +} +if($.isFunction(_1f.constrain)){ +return _1f.constrain.call(_1d,_1a,top,_1b,_1c); +} +var win=$(_1d).window("window"); +var _20=_1f.inline?win.parent():$(window); +if(_1a<0){ +_1a=0; +} +if(top<_20.scrollTop()){ +top=_20.scrollTop(); +} +if(_1a+_1b>_20.width()){ +if(_1b==win.outerWidth()){ +_1a=_20.width()-_1b; +}else{ +_1b=_20.width()-_1a; } -},500); +} +if(top-_20.scrollTop()+_1c>_20.height()){ +if(_1c==win.outerHeight()){ +top=_20.height()-_1c+_20.scrollTop(); +}else{ +_1c=_20.height()-top+_20.scrollTop(); +} +} +return {left:_1a,top:top,width:_1b,height:_1c}; +}; +function _21(_22){ +var _23=$.data(_22,"window"); +_23.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_23.options.draggable==false,onBeforeDrag:function(e){ +if(_23.mask){ +_23.mask.css("z-index",$.fn.window.defaults.zIndex++); +} +if(_23.shadow){ +_23.shadow.css("z-index",$.fn.window.defaults.zIndex++); +} +_23.window.css("z-index",$.fn.window.defaults.zIndex++); +},onStartDrag:function(e){ +_24(e); },onDrag:function(e){ -_1b.proxy.css({display:"block",left:e.data.left,top:e.data.top}); +_25(e); return false; },onStopDrag:function(e){ -_1b.options.left=e.data.left; -_1b.options.top=e.data.top; -$(_1a).window("move"); -_1b.proxy.remove(); -_1b.proxy=null; +_26(e,"move"); }}); -_1b.window.resizable({disabled:_1b.options.resizable==false,onStartResize:function(e){ -if(_1b.pmask){ -_1b.pmask.remove(); -} -_1b.pmask=$("
                              ").insertAfter(_1b.window); -_1b.pmask.css({zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_1b.window._outerWidth(),height:_1b.window._outerHeight()}); -if(_1b.proxy){ -_1b.proxy.remove(); -} -_1b.proxy=$("
                              ").insertAfter(_1b.window); -_1b.proxy.css({zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); -_1b.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); +_23.window.resizable({disabled:_23.options.resizable==false,onStartResize:function(e){ +_24(e); },onResize:function(e){ -_1b.proxy.css({left:e.data.left,top:e.data.top}); -_1b.proxy._outerWidth(e.data.width); -_1b.proxy._outerHeight(e.data.height); +_25(e); return false; },onStopResize:function(e){ -$(_1a).window("resize",e.data); -_1b.pmask.remove(); -_1b.pmask=null; -_1b.proxy.remove(); -_1b.proxy=null; +_26(e,"resize"); }}); -}; -function _18(){ -if(document.compatMode=="BackCompat"){ -return {width:Math.max(document.body.scrollWidth,document.body.clientWidth),height:Math.max(document.body.scrollHeight,document.body.clientHeight)}; -}else{ -return {width:Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth),height:Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)}; +function _24(e){ +if(_23.pmask){ +_23.pmask.remove(); +} +_23.pmask=$("
                              ").insertAfter(_23.window); +_23.pmask.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_23.window._outerWidth(),height:_23.window._outerHeight()}); +if(_23.proxy){ +_23.proxy.remove(); +} +_23.proxy=$("
                              ").insertAfter(_23.window); +_23.proxy.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); +_23.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); +_23.proxy.hide(); +setTimeout(function(){ +if(_23.pmask){ +_23.pmask.show(); +} +if(_23.proxy){ +_23.proxy.show(); } +},500); +}; +function _25(e){ +$.extend(e.data,_19.call(_22,e.data.left,e.data.top,e.data.width,e.data.height)); +_23.pmask.show(); +_23.proxy.css({display:"block",left:e.data.left,top:e.data.top}); +_23.proxy._outerWidth(e.data.width); +_23.proxy._outerHeight(e.data.height); +}; +function _26(e,_27){ +$.extend(e.data,_19.call(_22,e.data.left,e.data.top,e.data.width+0.1,e.data.height+0.1)); +$(_22).window(_27,e.data); +_23.pmask.remove(); +_23.pmask=null; +_23.proxy.remove(); +_23.proxy=null; }; +}; +$(function(){ +if(!$._positionFixed){ $(window).resize(function(){ -$("body>div.window-mask").css({width:$(window)._outerWidth(),height:$(window)._outerHeight()}); +$("body>div.window-mask:visible").css({width:"",height:""}); setTimeout(function(){ -$("body>div.window-mask").css({width:_18().width,height:_18().height}); +$("body>div.window-mask:visible").css($.fn.window.getMaskSize()); },50); }); -$.fn.window=function(_1c,_1d){ -if(typeof _1c=="string"){ -var _1e=$.fn.window.methods[_1c]; -if(_1e){ -return _1e(this,_1d); +} +}); +$.fn.window=function(_28,_29){ +if(typeof _28=="string"){ +var _2a=$.fn.window.methods[_28]; +if(_2a){ +return _2a(this,_29); }else{ -return this.panel(_1c,_1d); +return this.panel(_28,_29); } } -_1c=_1c||{}; +_28=_28||{}; return this.each(function(){ -var _1f=$.data(this,"window"); -if(_1f){ -$.extend(_1f.options,_1c); +var _2b=$.data(this,"window"); +if(_2b){ +$.extend(_2b.options,_28); }else{ -_1f=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_1c)}); -if(!_1f.options.inline){ +_2b=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_28)}); +if(!_2b.options.inline){ document.body.appendChild(this); } } _11(this); -_19(this); +_21(this); }); }; $.fn.window.methods={options:function(jq){ -var _20=jq.panel("options"); -var _21=$.data(jq[0],"window").options; -return $.extend(_21,{closed:_20.closed,collapsed:_20.collapsed,minimized:_20.minimized,maximized:_20.maximized}); +var _2c=jq.panel("options"); +var _2d=$.data(jq[0],"window").options; +return $.extend(_2d,{closed:_2c.closed,collapsed:_2c.collapsed,minimized:_2c.minimized,maximized:_2c.maximized}); },window:function(jq){ return $.data(jq[0],"window").window; -},move:function(jq,_22){ +},move:function(jq,_2e){ return jq.each(function(){ -_1(this,_22); +_1(this,_2e); }); },hcenter:function(jq){ return jq.each(function(){ @@ -253,9 +291,21 @@ _b(this); _1(this); }); }}; -$.fn.window.parseOptions=function(_23){ -return $.extend({},$.fn.panel.parseOptions(_23),$.parser.parseOptions(_23,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}])); +$.fn.window.getMaskSize=function(_2f){ +var _30=$(_2f).data("window"); +if(_30&&_30.options.inline){ +return {}; +}else{ +if($._positionFixed){ +return {position:"fixed"}; +}else{ +return {width:$(document).width(),height:$(document).height()}; +} +} +}; +$.fn.window.parseOptions=function(_31){ +return $.extend({},$.fn.panel.parseOptions(_31),$.parser.parseOptions(_31,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}])); }; -$.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false}); +$.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,border:true,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false,constrain:false}); })(jQuery); diff --git a/assets/js/easy-ui/themes/black/accordion.css b/assets/js/easy-ui/themes/black/accordion.css old mode 100755 new mode 100644 index a0f6ddc3d2..b2dba5200b --- a/assets/js/easy-ui/themes/black/accordion.css +++ b/assets/js/easy-ui/themes/black/accordion.css @@ -39,3 +39,51 @@ .accordion .accordion-header-selected .panel-title { color: #fff; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #3d3d3d; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #666; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #000; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #3d3d3d; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #666; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #000; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #3d3d3d; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #666; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #000; +} diff --git a/assets/js/easy-ui/themes/black/calendar.css b/assets/js/easy-ui/themes/black/calendar.css old mode 100755 new mode 100644 index e862e22e58..5e71d3eb1e --- a/assets/js/easy-ui/themes/black/calendar.css +++ b/assets/js/easy-ui/themes/black/calendar.css @@ -110,14 +110,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { diff --git a/assets/js/easy-ui/themes/black/combo.css b/assets/js/easy-ui/themes/black/combo.css old mode 100755 new mode 100644 index ca0e46181d..0798ce198b --- a/assets/js/easy-ui/themes/black/combo.css +++ b/assets/js/easy-ui/themes/black/combo.css @@ -1,20 +1,3 @@ -.combo { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; -} .combo-arrow { width: 18px; height: 20px; @@ -38,10 +21,6 @@ .combo-panel { background-color: #666; } -.combo { - border-color: #000; - background-color: #fff; -} .combo-arrow { background-color: #3d3d3d; } @@ -54,7 +33,3 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/black/combobox.css b/assets/js/easy-ui/themes/black/combobox.css old mode 100755 new mode 100644 index 284332e003..27b4096ffe --- a/assets/js/easy-ui/themes/black/combobox.css +++ b/assets/js/easy-ui/themes/black/combobox.css @@ -1,8 +1,8 @@ .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -11,9 +11,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #777; color: #fff; @@ -22,3 +30,10 @@ background-color: #0052A3; color: #fff; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} diff --git a/assets/js/easy-ui/themes/black/datagrid.css b/assets/js/easy-ui/themes/black/datagrid.css old mode 100755 new mode 100644 index 3f11ae20a0..3559be75df --- a/assets/js/easy-ui/themes/black/datagrid.css +++ b/assets/js/easy-ui/themes/black/datagrid.css @@ -39,8 +39,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -107,10 +117,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -186,11 +197,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } diff --git a/assets/js/easy-ui/themes/black/datalist.css b/assets/js/easy-ui/themes/black/datalist.css new file mode 100644 index 0000000000..94dd67e5f4 --- /dev/null +++ b/assets/js/easy-ui/themes/black/datalist.css @@ -0,0 +1,95 @@ +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #444; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #222; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #fff; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #222; +} +.m-list li>a:hover { + background: #777; + color: #fff; +} +.m-list .m-list-group { + padding: 0 4px; +} diff --git a/assets/js/easy-ui/themes/black/datebox.css b/assets/js/easy-ui/themes/black/datebox.css old mode 100755 new mode 100644 index e368f64052..f5b6bb78bf --- a/assets/js/easy-ui/themes/black/datebox.css +++ b/assets/js/easy-ui/themes/black/datebox.css @@ -2,11 +2,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; diff --git a/assets/js/easy-ui/themes/black/dialog.css b/assets/js/easy-ui/themes/black/dialog.css old mode 100755 new mode 100644 index ed832df727..4a6f36eb2a --- a/assets/js/easy-ui/themes/black/dialog.css +++ b/assets/js/easy-ui/themes/black/dialog.css @@ -2,6 +2,7 @@ overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -12,6 +13,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -30,3 +33,15 @@ .dialog-button { border-color: #222 #000 #000 #000; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #555; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} diff --git a/assets/js/easy-ui/themes/black/easyui.css b/assets/js/easy-ui/themes/black/easyui.css old mode 100755 new mode 100644 index e0a5522338..91149e3966 --- a/assets/js/easy-ui/themes/black/easyui.css +++ b/assets/js/easy-ui/themes/black/easyui.css @@ -140,6 +140,129 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} .accordion { overflow: hidden; border-width: 1px; @@ -181,6 +304,54 @@ .accordion .accordion-header-selected .panel-title { color: #fff; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #3d3d3d; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #666; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #000; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #3d3d3d; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #666; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #000; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #3d3d3d; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #666; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #000; +} .window { overflow: hidden; padding: 5px; @@ -275,10 +446,100 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} .dialog-content { overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -289,6 +550,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -307,6 +570,18 @@ .dialog-button { border-color: #222 #000 #000 #000; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #555; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} .l-btn { text-decoration: none; display: inline-block; @@ -317,9 +592,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -462,9 +738,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #555; + padding: 0; +} .l-btn-plain:hover { background: #777; color: #fff; @@ -531,12 +812,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -545,18 +837,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -583,6 +915,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #000000; -moz-box-shadow: 0 0 3px 0 #000; -webkit-box-shadow: 0 0 3px 0 #000; box-shadow: 0 0 3px 0 #000; @@ -591,28 +924,31 @@ border-color: #ffa8a8; background-color: #fff3f3; } +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } -.combo { +.filebox-label { display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; } -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; +.l-btn-disabled .filebox-label { + cursor: default; } .combo-arrow { width: 18px; @@ -637,10 +973,6 @@ .combo-panel { background-color: #666; } -.combo { - border-color: #000; - background-color: #fff; -} .combo-arrow { background-color: #3d3d3d; } @@ -653,15 +985,11 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -670,9 +998,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #777; color: #fff; @@ -681,6 +1017,57 @@ background-color: #0052A3; color: #fff; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #777; + color: #fff; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} .layout { position: relative; overflow: hidden; @@ -692,6 +1079,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -716,6 +1107,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; @@ -784,10 +1230,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -977,12 +1419,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -1003,9 +1445,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -1013,6 +1461,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -1033,6 +1483,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #3d3d3d url('images/tabs_icons.png') no-repeat 1px center; } @@ -1128,6 +1625,12 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #666; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #0052A3; + color: #fff; + filter: none; + border-color: #000; +} .datagrid .panel-body { overflow: hidden; position: relative; @@ -1169,8 +1672,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -1237,10 +1750,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -1316,11 +1830,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } @@ -1423,6 +1947,101 @@ .propertygrid .datagrid-view1 .datagrid-row-selected { background: #3d3d3d; } +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #444; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #222; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #fff; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #222; +} +.m-list li>a:hover { + background: #777; + color: #fff; +} +.m-list .m-list-group { + padding: 0 4px; +} .pagination { zoom: 1; } @@ -1458,7 +2077,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; @@ -1606,14 +2225,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { @@ -1695,11 +2319,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; @@ -1727,32 +2351,6 @@ .datebox-button a { color: #fff; } -.numberbox { - border: 1px solid #000; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #3d3d3d; display: inline-block; @@ -1774,6 +2372,7 @@ height: 10px; width: 100%; height: 50%; + color: #fff; outline-style: none; } .spinner-arrow-hover { @@ -1804,8 +2403,11 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #000; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; @@ -1839,27 +2441,6 @@ background-color: #0052A3; color: #fff; } -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -1913,10 +2494,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #000; - background-color: #fff; -} .searchbox .l-btn-plain { background: #3d3d3d; } @@ -1925,10 +2502,6 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); @@ -2038,6 +2611,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -2081,6 +2657,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; @@ -2246,12 +2829,12 @@ border-width: 0 0 0 1px; } .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -2282,9 +2865,13 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #000; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} .tree { margin: 0; padding: 0; @@ -2419,13 +3006,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #000; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -2442,6 +3030,9 @@ background: #0052A3; color: #fff; } +.tree-node-hidden { + display: none; +} .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; @@ -2478,6 +3069,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; @@ -2547,3 +3141,80 @@ .tooltip-bottom .tooltip-arrow { border-bottom-color: #666; } +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #555; + border: 1px solid #555; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #0052A3; + color: #fff; +} +.switchbutton-off { + background-color: #666; + color: #fff; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #666; + color: #fff; + border: 1px solid #555; + -moz-box-shadow: 0 0 3px 0 #555; + -webkit-box-shadow: 0 0 3px 0 #555; + box-shadow: 0 0 3px 0 #555; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/black/filebox.css b/assets/js/easy-ui/themes/black/filebox.css old mode 100755 new mode 100644 index 6077ebdc13..c6bac66315 --- a/assets/js/easy-ui/themes/black/filebox.css +++ b/assets/js/easy-ui/themes/black/filebox.css @@ -4,3 +4,17 @@ top: 0; left: -5000px; } +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/black/images/datagrid_icons.png b/assets/js/easy-ui/themes/black/images/datagrid_icons.png old mode 100755 new mode 100644 index bdf87e38cc..7f19b93074 Binary files a/assets/js/easy-ui/themes/black/images/datagrid_icons.png and b/assets/js/easy-ui/themes/black/images/datagrid_icons.png differ diff --git a/assets/js/easy-ui/themes/black/images/passwordbox_close.png b/assets/js/easy-ui/themes/black/images/passwordbox_close.png new file mode 100644 index 0000000000..276b579742 Binary files /dev/null and b/assets/js/easy-ui/themes/black/images/passwordbox_close.png differ diff --git a/assets/js/easy-ui/themes/black/images/passwordbox_open.png b/assets/js/easy-ui/themes/black/images/passwordbox_open.png new file mode 100644 index 0000000000..0f25d535e0 Binary files /dev/null and b/assets/js/easy-ui/themes/black/images/passwordbox_open.png differ diff --git a/assets/js/easy-ui/themes/black/images/spinner_arrows.png b/assets/js/easy-ui/themes/black/images/spinner_arrows.png old mode 100755 new mode 100644 index 25ee848d77..349d7d9d1d Binary files a/assets/js/easy-ui/themes/black/images/spinner_arrows.png and b/assets/js/easy-ui/themes/black/images/spinner_arrows.png differ diff --git a/assets/js/easy-ui/themes/black/images/tagbox_icons.png b/assets/js/easy-ui/themes/black/images/tagbox_icons.png new file mode 100644 index 0000000000..faddd10cab Binary files /dev/null and b/assets/js/easy-ui/themes/black/images/tagbox_icons.png differ diff --git a/assets/js/easy-ui/themes/black/layout.css b/assets/js/easy-ui/themes/black/layout.css old mode 100755 new mode 100644 index 31190da27b..d1f9184266 --- a/assets/js/easy-ui/themes/black/layout.css +++ b/assets/js/easy-ui/themes/black/layout.css @@ -9,6 +9,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -33,6 +37,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; diff --git a/assets/js/easy-ui/themes/black/linkbutton.css b/assets/js/easy-ui/themes/black/linkbutton.css old mode 100755 new mode 100644 index e3b5eb647d..18a7f0eabb --- a/assets/js/easy-ui/themes/black/linkbutton.css +++ b/assets/js/easy-ui/themes/black/linkbutton.css @@ -8,9 +8,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -153,9 +154,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #555; + padding: 0; +} .l-btn-plain:hover { background: #777; color: #fff; diff --git a/assets/js/easy-ui/themes/black/menu.css b/assets/js/easy-ui/themes/black/menu.css old mode 100755 new mode 100644 index 9e89ea5a43..430d0d8dea --- a/assets/js/easy-ui/themes/black/menu.css +++ b/assets/js/easy-ui/themes/black/menu.css @@ -6,6 +6,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -49,6 +52,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; diff --git a/assets/js/easy-ui/themes/black/messager.css b/assets/js/easy-ui/themes/black/messager.css old mode 100755 new mode 100644 index 8fc275f21c..ca6438b0ba --- a/assets/js/easy-ui/themes/black/messager.css +++ b/assets/js/easy-ui/themes/black/messager.css @@ -1,10 +1,10 @@ .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -35,6 +35,10 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #000; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} diff --git a/assets/js/easy-ui/themes/black/numberbox.css b/assets/js/easy-ui/themes/black/numberbox.css old mode 100755 new mode 100644 index 3ee54c36b5..e69de29bb2 --- a/assets/js/easy-ui/themes/black/numberbox.css +++ b/assets/js/easy-ui/themes/black/numberbox.css @@ -1,9 +0,0 @@ -.numberbox { - border: 1px solid #000; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} diff --git a/assets/js/easy-ui/themes/black/pagination.css b/assets/js/easy-ui/themes/black/pagination.css old mode 100755 new mode 100644 index 0431a22099..9e506a4163 --- a/assets/js/easy-ui/themes/black/pagination.css +++ b/assets/js/easy-ui/themes/black/pagination.css @@ -33,7 +33,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; diff --git a/assets/js/easy-ui/themes/black/panel.css b/assets/js/easy-ui/themes/black/panel.css old mode 100755 new mode 100644 index 07845d2ca3..a300aacb1f --- a/assets/js/easy-ui/themes/black/panel.css +++ b/assets/js/easy-ui/themes/black/panel.css @@ -140,3 +140,126 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} diff --git a/assets/js/easy-ui/themes/black/passwordbox.css b/assets/js/easy-ui/themes/black/passwordbox.css new file mode 100644 index 0000000000..92c9ce586b --- /dev/null +++ b/assets/js/easy-ui/themes/black/passwordbox.css @@ -0,0 +1,6 @@ +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} diff --git a/assets/js/easy-ui/themes/black/searchbox.css b/assets/js/easy-ui/themes/black/searchbox.css old mode 100755 new mode 100644 index 4260efbc20..01f6697429 --- a/assets/js/easy-ui/themes/black/searchbox.css +++ b/assets/js/easy-ui/themes/black/searchbox.css @@ -1,24 +1,3 @@ -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -72,10 +51,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #000; - background-color: #fff; -} .searchbox .l-btn-plain { background: #3d3d3d; } @@ -84,7 +59,3 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/black/spinner.css b/assets/js/easy-ui/themes/black/spinner.css old mode 100755 new mode 100644 index 6b618ba69d..6686ca03fa --- a/assets/js/easy-ui/themes/black/spinner.css +++ b/assets/js/easy-ui/themes/black/spinner.css @@ -1,20 +1,3 @@ -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #3d3d3d; display: inline-block; @@ -36,6 +19,7 @@ height: 10px; width: 100%; height: 50%; + color: #fff; outline-style: none; } .spinner-arrow-hover { @@ -66,6 +50,9 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #000; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } diff --git a/assets/js/easy-ui/themes/black/switchbutton.css b/assets/js/easy-ui/themes/black/switchbutton.css new file mode 100644 index 0000000000..b1b5714e94 --- /dev/null +++ b/assets/js/easy-ui/themes/black/switchbutton.css @@ -0,0 +1,77 @@ +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #555; + border: 1px solid #555; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #0052A3; + color: #fff; +} +.switchbutton-off { + background-color: #666; + color: #fff; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #666; + color: #fff; + border: 1px solid #555; + -moz-box-shadow: 0 0 3px 0 #555; + -webkit-box-shadow: 0 0 3px 0 #555; + box-shadow: 0 0 3px 0 #555; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/black/tabs.css b/assets/js/easy-ui/themes/black/tabs.css old mode 100755 new mode 100644 index 0949ad2b15..4ab73de61d --- a/assets/js/easy-ui/themes/black/tabs.css +++ b/assets/js/easy-ui/themes/black/tabs.css @@ -10,10 +10,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -203,12 +199,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -229,9 +225,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -239,6 +241,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -259,6 +263,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #3d3d3d url('images/tabs_icons.png') no-repeat 1px center; } @@ -354,3 +405,9 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #666; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #0052A3; + color: #fff; + filter: none; + border-color: #000; +} diff --git a/assets/js/easy-ui/themes/black/tagbox.css b/assets/js/easy-ui/themes/black/tagbox.css new file mode 100644 index 0000000000..e08ec87b4e --- /dev/null +++ b/assets/js/easy-ui/themes/black/tagbox.css @@ -0,0 +1,44 @@ +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #777; + color: #fff; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} diff --git a/assets/js/easy-ui/themes/black/textbox.css b/assets/js/easy-ui/themes/black/textbox.css old mode 100755 new mode 100644 index b8fe05838e..f93ad88ff3 --- a/assets/js/easy-ui/themes/black/textbox.css +++ b/assets/js/easy-ui/themes/black/textbox.css @@ -25,12 +25,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -39,18 +50,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -77,6 +128,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #000000; -moz-box-shadow: 0 0 3px 0 #000; -webkit-box-shadow: 0 0 3px 0 #000; box-shadow: 0 0 3px 0 #000; diff --git a/assets/js/easy-ui/themes/black/tooltip.css b/assets/js/easy-ui/themes/black/tooltip.css old mode 100755 new mode 100644 index 8dfbfed667..391fd95aa3 --- a/assets/js/easy-ui/themes/black/tooltip.css +++ b/assets/js/easy-ui/themes/black/tooltip.css @@ -29,6 +29,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; diff --git a/assets/js/easy-ui/themes/black/tree.css b/assets/js/easy-ui/themes/black/tree.css old mode 100755 new mode 100644 index ea955cb30c..88dfe0bded --- a/assets/js/easy-ui/themes/black/tree.css +++ b/assets/js/easy-ui/themes/black/tree.css @@ -132,13 +132,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #000; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -155,3 +156,6 @@ background: #0052A3; color: #fff; } +.tree-node-hidden { + display: none; +} diff --git a/assets/js/easy-ui/themes/black/window.css b/assets/js/easy-ui/themes/black/window.css old mode 100755 new mode 100644 index 01942abd6d..37de72d24f --- a/assets/js/easy-ui/themes/black/window.css +++ b/assets/js/easy-ui/themes/black/window.css @@ -92,3 +92,92 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} diff --git a/assets/js/easy-ui/themes/bootstrap/accordion.css b/assets/js/easy-ui/themes/bootstrap/accordion.css old mode 100755 new mode 100644 index 26db0fa706..9d268c023f --- a/assets/js/easy-ui/themes/bootstrap/accordion.css +++ b/assets/js/easy-ui/themes/bootstrap/accordion.css @@ -39,3 +39,51 @@ .accordion .accordion-header-selected .panel-title { color: #fff; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #F2F2F2; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #D4D4D4; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #F2F2F2; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #D4D4D4; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #F2F2F2; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #D4D4D4; +} diff --git a/assets/js/easy-ui/themes/bootstrap/calendar.css b/assets/js/easy-ui/themes/bootstrap/calendar.css old mode 100755 new mode 100644 index 5eb1efff2f..ae1a8aca6d --- a/assets/js/easy-ui/themes/bootstrap/calendar.css +++ b/assets/js/easy-ui/themes/bootstrap/calendar.css @@ -110,14 +110,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { diff --git a/assets/js/easy-ui/themes/bootstrap/combo.css b/assets/js/easy-ui/themes/bootstrap/combo.css old mode 100755 new mode 100644 index e3ee8e1723..fc9030d8b5 --- a/assets/js/easy-ui/themes/bootstrap/combo.css +++ b/assets/js/easy-ui/themes/bootstrap/combo.css @@ -1,20 +1,3 @@ -.combo { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; -} .combo-arrow { width: 18px; height: 20px; @@ -38,10 +21,6 @@ .combo-panel { background-color: #ffffff; } -.combo { - border-color: #D4D4D4; - background-color: #fff; -} .combo-arrow { background-color: #F2F2F2; } @@ -54,7 +33,3 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/bootstrap/combobox.css b/assets/js/easy-ui/themes/bootstrap/combobox.css old mode 100755 new mode 100644 index 82abe63028..fe74425c50 --- a/assets/js/easy-ui/themes/bootstrap/combobox.css +++ b/assets/js/easy-ui/themes/bootstrap/combobox.css @@ -1,8 +1,8 @@ .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -11,9 +11,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #e6e6e6; color: #00438a; @@ -22,3 +30,10 @@ background-color: #0081c2; color: #fff; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} diff --git a/assets/js/easy-ui/themes/bootstrap/datagrid.css b/assets/js/easy-ui/themes/bootstrap/datagrid.css old mode 100755 new mode 100644 index e3d9c6237d..806bd6a2a3 --- a/assets/js/easy-ui/themes/bootstrap/datagrid.css +++ b/assets/js/easy-ui/themes/bootstrap/datagrid.css @@ -39,8 +39,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -107,10 +117,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -186,11 +197,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } diff --git a/assets/js/easy-ui/themes/bootstrap/datalist.css b/assets/js/easy-ui/themes/bootstrap/datalist.css new file mode 100644 index 0000000000..68e8df6f49 --- /dev/null +++ b/assets/js/easy-ui/themes/bootstrap/datalist.css @@ -0,0 +1,95 @@ +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #F2F2F2; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #333; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.m-list li>a:hover { + background: #e6e6e6; + color: #00438a; +} +.m-list .m-list-group { + padding: 0 4px; +} diff --git a/assets/js/easy-ui/themes/bootstrap/datebox.css b/assets/js/easy-ui/themes/bootstrap/datebox.css old mode 100755 new mode 100644 index b9d2bcb863..97e20dd365 --- a/assets/js/easy-ui/themes/bootstrap/datebox.css +++ b/assets/js/easy-ui/themes/bootstrap/datebox.css @@ -2,11 +2,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; diff --git a/assets/js/easy-ui/themes/bootstrap/dialog.css b/assets/js/easy-ui/themes/bootstrap/dialog.css old mode 100755 new mode 100644 index 5fdaec3914..b44497f82e --- a/assets/js/easy-ui/themes/bootstrap/dialog.css +++ b/assets/js/easy-ui/themes/bootstrap/dialog.css @@ -2,6 +2,7 @@ overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -12,6 +13,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -30,3 +33,15 @@ .dialog-button { border-color: #e6e6e6 #D4D4D4 #D4D4D4 #D4D4D4; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #F5F5F5; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} diff --git a/assets/js/easy-ui/themes/bootstrap/easyui.css b/assets/js/easy-ui/themes/bootstrap/easyui.css old mode 100755 new mode 100644 index 73e51f3665..1e6b255161 --- a/assets/js/easy-ui/themes/bootstrap/easyui.css +++ b/assets/js/easy-ui/themes/bootstrap/easyui.css @@ -140,6 +140,129 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} .accordion { overflow: hidden; border-width: 1px; @@ -181,6 +304,54 @@ .accordion .accordion-header-selected .panel-title { color: #fff; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #F2F2F2; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #D4D4D4; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #F2F2F2; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #D4D4D4; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #F2F2F2; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #D4D4D4; +} .window { overflow: hidden; padding: 5px; @@ -275,10 +446,100 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} .dialog-content { overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -289,6 +550,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -307,6 +570,18 @@ .dialog-button { border-color: #e6e6e6 #D4D4D4 #D4D4D4 #D4D4D4; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #F5F5F5; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} .l-btn { text-decoration: none; display: inline-block; @@ -317,9 +592,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -462,9 +738,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #ddd; + padding: 0; +} .l-btn-plain:hover { background: #e6e6e6; color: #00438a; @@ -531,12 +812,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -545,18 +837,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -583,6 +915,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #bbbbbb; -moz-box-shadow: 0 0 3px 0 #D4D4D4; -webkit-box-shadow: 0 0 3px 0 #D4D4D4; box-shadow: 0 0 3px 0 #D4D4D4; @@ -591,28 +924,31 @@ border-color: #ffa8a8; background-color: #fff3f3; } +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } -.combo { +.filebox-label { display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; } -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; +.l-btn-disabled .filebox-label { + cursor: default; } .combo-arrow { width: 18px; @@ -637,10 +973,6 @@ .combo-panel { background-color: #ffffff; } -.combo { - border-color: #D4D4D4; - background-color: #fff; -} .combo-arrow { background-color: #F2F2F2; } @@ -653,15 +985,11 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -670,9 +998,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #e6e6e6; color: #00438a; @@ -681,6 +1017,57 @@ background-color: #0081c2; color: #fff; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #e6e6e6; + color: #00438a; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} .layout { position: relative; overflow: hidden; @@ -692,6 +1079,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -716,6 +1107,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; @@ -784,10 +1230,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -977,12 +1419,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -1003,9 +1445,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -1013,6 +1461,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -1033,6 +1483,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #F2F2F2 url('images/tabs_icons.png') no-repeat 1px center; } @@ -1128,6 +1625,12 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #0081c2; + color: #fff; + filter: none; + border-color: #D4D4D4; +} .datagrid .panel-body { overflow: hidden; position: relative; @@ -1169,8 +1672,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -1237,10 +1750,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -1316,11 +1830,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } @@ -1423,6 +1947,101 @@ .propertygrid .datagrid-view1 .datagrid-row-selected { background: #F2F2F2; } +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #F2F2F2; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #333; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.m-list li>a:hover { + background: #e6e6e6; + color: #00438a; +} +.m-list .m-list-group { + padding: 0 4px; +} .pagination { zoom: 1; } @@ -1458,7 +2077,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; @@ -1606,14 +2225,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { @@ -1695,11 +2319,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; @@ -1727,32 +2351,6 @@ .datebox-button a { color: #444; } -.numberbox { - border: 1px solid #D4D4D4; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #F2F2F2; display: inline-block; @@ -1774,6 +2372,7 @@ height: 10px; width: 100%; height: 50%; + color: #444; outline-style: none; } .spinner-arrow-hover { @@ -1804,8 +2403,11 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #D4D4D4; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; @@ -1839,27 +2441,6 @@ background-color: #0081c2; color: #fff; } -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -1913,10 +2494,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #D4D4D4; - background-color: #fff; -} .searchbox .l-btn-plain { background: #F2F2F2; } @@ -1925,10 +2502,6 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); @@ -2038,6 +2611,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -2081,6 +2657,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; @@ -2246,12 +2829,12 @@ border-width: 0 0 0 1px; } .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -2282,9 +2865,13 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #D4D4D4; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} .tree { margin: 0; padding: 0; @@ -2419,13 +3006,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #D4D4D4; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -2442,6 +3030,9 @@ background: #0081c2; color: #fff; } +.tree-node-hidden { + display: none; +} .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; @@ -2478,6 +3069,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; @@ -2547,6 +3141,83 @@ .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #bbb; + border: 1px solid #bbb; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #0081c2; + color: #fff; +} +.switchbutton-off { + background-color: #ffffff; + color: #333; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #333; + border: 1px solid #bbb; + -moz-box-shadow: 0 0 3px 0 #bbb; + -webkit-box-shadow: 0 0 3px 0 #bbb; + box-shadow: 0 0 3px 0 #bbb; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} .tabs-panels { border-color: transparent; } diff --git a/assets/js/easy-ui/themes/bootstrap/filebox.css b/assets/js/easy-ui/themes/bootstrap/filebox.css old mode 100755 new mode 100644 index 6077ebdc13..c6bac66315 --- a/assets/js/easy-ui/themes/bootstrap/filebox.css +++ b/assets/js/easy-ui/themes/bootstrap/filebox.css @@ -4,3 +4,17 @@ top: 0; left: -5000px; } +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/bootstrap/images/datagrid_icons.png b/assets/js/easy-ui/themes/bootstrap/images/datagrid_icons.png old mode 100755 new mode 100644 index 747ac4d1b8..762d0ce0f7 Binary files a/assets/js/easy-ui/themes/bootstrap/images/datagrid_icons.png and b/assets/js/easy-ui/themes/bootstrap/images/datagrid_icons.png differ diff --git a/assets/js/easy-ui/themes/bootstrap/images/passwordbox_close.png b/assets/js/easy-ui/themes/bootstrap/images/passwordbox_close.png new file mode 100644 index 0000000000..643c09da9a Binary files /dev/null and b/assets/js/easy-ui/themes/bootstrap/images/passwordbox_close.png differ diff --git a/assets/js/easy-ui/themes/bootstrap/images/passwordbox_open.png b/assets/js/easy-ui/themes/bootstrap/images/passwordbox_open.png new file mode 100644 index 0000000000..d328891f6a Binary files /dev/null and b/assets/js/easy-ui/themes/bootstrap/images/passwordbox_open.png differ diff --git a/assets/js/easy-ui/themes/bootstrap/images/spinner_arrows.png b/assets/js/easy-ui/themes/bootstrap/images/spinner_arrows.png old mode 100755 new mode 100644 index b68592de32..7c2df483db Binary files a/assets/js/easy-ui/themes/bootstrap/images/spinner_arrows.png and b/assets/js/easy-ui/themes/bootstrap/images/spinner_arrows.png differ diff --git a/assets/js/easy-ui/themes/bootstrap/images/tagbox_icons.png b/assets/js/easy-ui/themes/bootstrap/images/tagbox_icons.png new file mode 100644 index 0000000000..bd02e2d817 Binary files /dev/null and b/assets/js/easy-ui/themes/bootstrap/images/tagbox_icons.png differ diff --git a/assets/js/easy-ui/themes/bootstrap/layout.css b/assets/js/easy-ui/themes/bootstrap/layout.css old mode 100755 new mode 100644 index 33e172dca0..f447246640 --- a/assets/js/easy-ui/themes/bootstrap/layout.css +++ b/assets/js/easy-ui/themes/bootstrap/layout.css @@ -9,6 +9,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -33,6 +37,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; diff --git a/assets/js/easy-ui/themes/bootstrap/linkbutton.css b/assets/js/easy-ui/themes/bootstrap/linkbutton.css old mode 100755 new mode 100644 index 6066dea703..35ccfae56d --- a/assets/js/easy-ui/themes/bootstrap/linkbutton.css +++ b/assets/js/easy-ui/themes/bootstrap/linkbutton.css @@ -8,9 +8,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -153,9 +154,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #ddd; + padding: 0; +} .l-btn-plain:hover { background: #e6e6e6; color: #00438a; diff --git a/assets/js/easy-ui/themes/bootstrap/menu.css b/assets/js/easy-ui/themes/bootstrap/menu.css old mode 100755 new mode 100644 index 559596853d..d74908f1f4 --- a/assets/js/easy-ui/themes/bootstrap/menu.css +++ b/assets/js/easy-ui/themes/bootstrap/menu.css @@ -6,6 +6,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -49,6 +52,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; diff --git a/assets/js/easy-ui/themes/bootstrap/messager.css b/assets/js/easy-ui/themes/bootstrap/messager.css old mode 100755 new mode 100644 index ea1c911c07..60bc491ef2 --- a/assets/js/easy-ui/themes/bootstrap/messager.css +++ b/assets/js/easy-ui/themes/bootstrap/messager.css @@ -1,10 +1,10 @@ .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -35,6 +35,10 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #D4D4D4; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} diff --git a/assets/js/easy-ui/themes/bootstrap/numberbox.css b/assets/js/easy-ui/themes/bootstrap/numberbox.css old mode 100755 new mode 100644 index f3023a7b9a..e69de29bb2 --- a/assets/js/easy-ui/themes/bootstrap/numberbox.css +++ b/assets/js/easy-ui/themes/bootstrap/numberbox.css @@ -1,9 +0,0 @@ -.numberbox { - border: 1px solid #D4D4D4; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} diff --git a/assets/js/easy-ui/themes/bootstrap/pagination.css b/assets/js/easy-ui/themes/bootstrap/pagination.css old mode 100755 new mode 100644 index 02c2d7ecf0..e0a7c89a36 --- a/assets/js/easy-ui/themes/bootstrap/pagination.css +++ b/assets/js/easy-ui/themes/bootstrap/pagination.css @@ -33,7 +33,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; diff --git a/assets/js/easy-ui/themes/bootstrap/panel.css b/assets/js/easy-ui/themes/bootstrap/panel.css old mode 100755 new mode 100644 index a200052c04..270b50fa2b --- a/assets/js/easy-ui/themes/bootstrap/panel.css +++ b/assets/js/easy-ui/themes/bootstrap/panel.css @@ -140,3 +140,126 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} diff --git a/assets/js/easy-ui/themes/bootstrap/passwordbox.css b/assets/js/easy-ui/themes/bootstrap/passwordbox.css new file mode 100644 index 0000000000..92c9ce586b --- /dev/null +++ b/assets/js/easy-ui/themes/bootstrap/passwordbox.css @@ -0,0 +1,6 @@ +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} diff --git a/assets/js/easy-ui/themes/bootstrap/searchbox.css b/assets/js/easy-ui/themes/bootstrap/searchbox.css old mode 100755 new mode 100644 index a56a088dab..bf615de037 --- a/assets/js/easy-ui/themes/bootstrap/searchbox.css +++ b/assets/js/easy-ui/themes/bootstrap/searchbox.css @@ -1,24 +1,3 @@ -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -72,10 +51,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #D4D4D4; - background-color: #fff; -} .searchbox .l-btn-plain { background: #F2F2F2; } @@ -84,7 +59,3 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/bootstrap/spinner.css b/assets/js/easy-ui/themes/bootstrap/spinner.css old mode 100755 new mode 100644 index 1c523ca8de..bc153fc441 --- a/assets/js/easy-ui/themes/bootstrap/spinner.css +++ b/assets/js/easy-ui/themes/bootstrap/spinner.css @@ -1,20 +1,3 @@ -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #F2F2F2; display: inline-block; @@ -36,6 +19,7 @@ height: 10px; width: 100%; height: 50%; + color: #444; outline-style: none; } .spinner-arrow-hover { @@ -66,6 +50,9 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #D4D4D4; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } diff --git a/assets/js/easy-ui/themes/bootstrap/switchbutton.css b/assets/js/easy-ui/themes/bootstrap/switchbutton.css new file mode 100644 index 0000000000..38803aa0db --- /dev/null +++ b/assets/js/easy-ui/themes/bootstrap/switchbutton.css @@ -0,0 +1,77 @@ +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #bbb; + border: 1px solid #bbb; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #0081c2; + color: #fff; +} +.switchbutton-off { + background-color: #ffffff; + color: #333; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #333; + border: 1px solid #bbb; + -moz-box-shadow: 0 0 3px 0 #bbb; + -webkit-box-shadow: 0 0 3px 0 #bbb; + box-shadow: 0 0 3px 0 #bbb; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/bootstrap/tabs.css b/assets/js/easy-ui/themes/bootstrap/tabs.css old mode 100755 new mode 100644 index 8aef1137fe..c06a4aab4e --- a/assets/js/easy-ui/themes/bootstrap/tabs.css +++ b/assets/js/easy-ui/themes/bootstrap/tabs.css @@ -10,10 +10,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -203,12 +199,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -229,9 +225,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -239,6 +241,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -259,6 +263,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #F2F2F2 url('images/tabs_icons.png') no-repeat 1px center; } @@ -354,3 +405,9 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #0081c2; + color: #fff; + filter: none; + border-color: #D4D4D4; +} diff --git a/assets/js/easy-ui/themes/bootstrap/tagbox.css b/assets/js/easy-ui/themes/bootstrap/tagbox.css new file mode 100644 index 0000000000..7e98a0a313 --- /dev/null +++ b/assets/js/easy-ui/themes/bootstrap/tagbox.css @@ -0,0 +1,44 @@ +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #e6e6e6; + color: #00438a; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} diff --git a/assets/js/easy-ui/themes/bootstrap/textbox.css b/assets/js/easy-ui/themes/bootstrap/textbox.css old mode 100755 new mode 100644 index 8df6b56a41..dc2dfa8a88 --- a/assets/js/easy-ui/themes/bootstrap/textbox.css +++ b/assets/js/easy-ui/themes/bootstrap/textbox.css @@ -25,12 +25,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -39,18 +50,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -77,6 +128,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #bbbbbb; -moz-box-shadow: 0 0 3px 0 #D4D4D4; -webkit-box-shadow: 0 0 3px 0 #D4D4D4; box-shadow: 0 0 3px 0 #D4D4D4; diff --git a/assets/js/easy-ui/themes/bootstrap/tooltip.css b/assets/js/easy-ui/themes/bootstrap/tooltip.css old mode 100755 new mode 100644 index fa06fc3323..ed9fe1c250 --- a/assets/js/easy-ui/themes/bootstrap/tooltip.css +++ b/assets/js/easy-ui/themes/bootstrap/tooltip.css @@ -29,6 +29,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; diff --git a/assets/js/easy-ui/themes/bootstrap/tree.css b/assets/js/easy-ui/themes/bootstrap/tree.css old mode 100755 new mode 100644 index 017832b5a5..3fd3583a47 --- a/assets/js/easy-ui/themes/bootstrap/tree.css +++ b/assets/js/easy-ui/themes/bootstrap/tree.css @@ -132,13 +132,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #D4D4D4; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -155,3 +156,6 @@ background: #0081c2; color: #fff; } +.tree-node-hidden { + display: none; +} diff --git a/assets/js/easy-ui/themes/bootstrap/window.css b/assets/js/easy-ui/themes/bootstrap/window.css old mode 100755 new mode 100644 index dcbd624360..b216f37d9b --- a/assets/js/easy-ui/themes/bootstrap/window.css +++ b/assets/js/easy-ui/themes/bootstrap/window.css @@ -92,3 +92,92 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} diff --git a/assets/js/easy-ui/themes/color.css b/assets/js/easy-ui/themes/color.css old mode 100755 new mode 100644 index 9f811596e2..bfb8ecb062 --- a/assets/js/easy-ui/themes/color.css +++ b/assets/js/easy-ui/themes/color.css @@ -1,4 +1,4 @@ -.c1,.c1:hover{ +.c1,.c1:hover,.c1>.panel-header{ color: #fff; border-color: #3c8b3c; background: #4cae4c; @@ -12,7 +12,17 @@ a.c1:hover{ background: #449d44; filter: none; } -.c2,.c2:hover{ +.c1>.panel-body{ + border-color: #3c8b3c; +} +.c1>.dialog-toolbar,.c1>.dialog-button{ + border-left-color: #3c8b3c; + border-right-color: #3c8b3c; +} +.c1>.dialog-button{ + border-bottom-color: #3c8b3c; +} +.c2,.c2:hover,.c2>.panel-header{ color: #fff; border-color: #5f5f5f; background: #747474; @@ -26,7 +36,17 @@ a.c2:hover{ background: #676767; filter: none; } -.c3,.c3:hover{ +.c2>.panel-body{ + border-color: #5f5f5f; +} +.c2>.dialog-toolbar,.c2>.dialog-button{ + border-left-color: #5f5f5f; + border-right-color: #5f5f5f; +} +.c2>.dialog-button{ + border-bottom-color: #5f5f5f; +} +.c3,.c3:hover,.c3>.panel-header{ color: #333; border-color: #ff8080; background: #ffb3b3; @@ -40,7 +60,17 @@ a.c3:hover{ background: #ff9999; filter: none; } -.c4,.c4:hover{ +.c3>.panel-body{ + border-color: #ff8080; +} +.c3>.dialog-toolbar,.c3>.dialog-button{ + border-left-color: #ff8080; + border-right-color: #ff8080; +} +.c3>.dialog-button{ + border-bottom-color: #ff8080; +} +.c4,.c4:hover,.c4>.panel-header{ color: #333; border-color: #52d689; background: #b8eecf; @@ -54,7 +84,17 @@ a.c4:hover{ background: #a4e9c1; filter: none; } -.c5,.c5:hover{ +.c4>.panel-body{ + border-color: #52d689; +} +.c4>.dialog-toolbar,.c4>.dialog-button{ + border-left-color: #52d689; + border-right-color: #52d689; +} +.c4>.dialog-button{ + border-bottom-color: #52d689; +} +.c5,.c5:hover,.c5>.panel-header{ color: #fff; border-color: #b52b27; background: #d84f4b; @@ -68,7 +108,17 @@ a.c5:hover{ background: #c9302c; filter: none; } -.c6,.c6:hover{ +.c5>.panel-body{ + border-color: #b52b27; +} +.c5>.dialog-toolbar,.c5>.dialog-button{ + border-left-color: #b52b27; + border-right-color: #b52b27; +} +.c5>.dialog-button{ + border-bottom-color: #b52b27; +} +.c6,.c6:hover,.c6>.panel-header{ color: #fff; border-color: #1f637b; background: #2984a4; @@ -82,7 +132,17 @@ a.c6:hover{ background: #24748f; filter: none; } -.c7,.c7:hover{ +.c6>.panel-body{ + border-color: #1f637b; +} +.c6>.dialog-toolbar,.c6>.dialog-button{ + border-left-color: #1f637b; + border-right-color: #1f637b; +} +.c6>.dialog-button{ + border-bottom-color: #1f637b; +} +.c7,.c7:hover,.c7>.panel-header{ color: #333; border-color: #e68900; background: #ffab2e; @@ -96,7 +156,17 @@ a.c7:hover{ background: #ff9900; filter: none; } -.c8,.c8:hover{ +.c7>.panel-body{ + border-color: #e68900; +} +.c7>.dialog-toolbar,.c7>.dialog-button{ + border-left-color: #e68900; + border-right-color: #e68900; +} +.c7>.dialog-button{ + border-bottom-color: #e68900; +} +.c8,.c8:hover,.c8>.panel-header{ color: #fff; border-color: #4b72a4; background: #698cba; @@ -110,3 +180,31 @@ a.c8:hover{ background: #577eb2; filter: none; } +.c8>.panel-body{ + border-color: #4b72a4; +} +.c8>.dialog-toolbar,.c8>.dialog-button{ + border-left-color: #4b72a4; + border-right-color: #4b72a4; +} +.c8>.dialog-button{ + border-bottom-color: #4b72a4; +} +.c1>.panel-header>.panel-title,.c2>.panel-header>.panel-title, +.c5>.panel-header>.panel-title,.c6>.panel-header>.panel-title,.c8>.panel-header>.panel-title{ + color: #fff; +} +.c-plain{ + border-color: #fff; + background: #fff; +} +.c-plain>.panel-header, +.c-plain>.panel-body, +.c-plain>.dialog-button, +.c-plain>.dialog-toolbar{ + border-color: transparent; + background: transparent; +} +.c-raised{ + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); +} diff --git a/assets/js/easy-ui/themes/default/accordion.css b/assets/js/easy-ui/themes/default/accordion.css old mode 100755 new mode 100644 index 40696c7100..9d60531f61 --- a/assets/js/easy-ui/themes/default/accordion.css +++ b/assets/js/easy-ui/themes/default/accordion.css @@ -39,3 +39,51 @@ .accordion .accordion-header-selected .panel-title { color: #000000; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #E0ECFF; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #95B8E7; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #E0ECFF; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #95B8E7; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #E0ECFF; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #95B8E7; +} diff --git a/assets/js/easy-ui/themes/default/calendar.css b/assets/js/easy-ui/themes/default/calendar.css old mode 100755 new mode 100644 index 6334627055..a3b953de04 --- a/assets/js/easy-ui/themes/default/calendar.css +++ b/assets/js/easy-ui/themes/default/calendar.css @@ -110,14 +110,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { diff --git a/assets/js/easy-ui/themes/default/combo.css b/assets/js/easy-ui/themes/default/combo.css old mode 100755 new mode 100644 index a4937aab16..a516386526 --- a/assets/js/easy-ui/themes/default/combo.css +++ b/assets/js/easy-ui/themes/default/combo.css @@ -1,20 +1,3 @@ -.combo { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; -} .combo-arrow { width: 18px; height: 20px; @@ -38,10 +21,6 @@ .combo-panel { background-color: #ffffff; } -.combo { - border-color: #95B8E7; - background-color: #fff; -} .combo-arrow { background-color: #E0ECFF; } @@ -54,7 +33,3 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/default/combobox.css b/assets/js/easy-ui/themes/default/combobox.css old mode 100755 new mode 100644 index 72eb42301d..67ae3c6c9a --- a/assets/js/easy-ui/themes/default/combobox.css +++ b/assets/js/easy-ui/themes/default/combobox.css @@ -1,8 +1,8 @@ .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -11,9 +11,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #eaf2ff; color: #000000; @@ -22,3 +30,10 @@ background-color: #ffe48d; color: #000000; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} diff --git a/assets/js/easy-ui/themes/default/datagrid.css b/assets/js/easy-ui/themes/default/datagrid.css old mode 100755 new mode 100644 index b167a217d7..bf557afc86 --- a/assets/js/easy-ui/themes/default/datagrid.css +++ b/assets/js/easy-ui/themes/default/datagrid.css @@ -39,8 +39,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -107,10 +117,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -186,11 +197,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } diff --git a/assets/js/easy-ui/themes/default/datalist.css b/assets/js/easy-ui/themes/default/datalist.css new file mode 100644 index 0000000000..eedd25bc05 --- /dev/null +++ b/assets/js/easy-ui/themes/default/datalist.css @@ -0,0 +1,95 @@ +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #efefef; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #000000; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.m-list li>a:hover { + background: #eaf2ff; + color: #000000; +} +.m-list .m-list-group { + padding: 0 4px; +} diff --git a/assets/js/easy-ui/themes/default/datebox.css b/assets/js/easy-ui/themes/default/datebox.css old mode 100755 new mode 100644 index 6225a0d2bb..25c05fda30 --- a/assets/js/easy-ui/themes/default/datebox.css +++ b/assets/js/easy-ui/themes/default/datebox.css @@ -2,11 +2,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; diff --git a/assets/js/easy-ui/themes/default/dialog.css b/assets/js/easy-ui/themes/default/dialog.css old mode 100755 new mode 100644 index c3510e66f6..ff55387749 --- a/assets/js/easy-ui/themes/default/dialog.css +++ b/assets/js/easy-ui/themes/default/dialog.css @@ -2,6 +2,7 @@ overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -12,6 +13,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -30,3 +33,15 @@ .dialog-button { border-color: #dddddd #95B8E7 #95B8E7 #95B8E7; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #F4F4F4; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} diff --git a/assets/js/easy-ui/themes/default/easyui.css b/assets/js/easy-ui/themes/default/easyui.css old mode 100755 new mode 100644 index 71041260f9..cd6b081b2f --- a/assets/js/easy-ui/themes/default/easyui.css +++ b/assets/js/easy-ui/themes/default/easyui.css @@ -140,6 +140,129 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} .accordion { overflow: hidden; border-width: 1px; @@ -181,6 +304,54 @@ .accordion .accordion-header-selected .panel-title { color: #000000; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #E0ECFF; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #95B8E7; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #E0ECFF; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #95B8E7; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #E0ECFF; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #95B8E7; +} .window { overflow: hidden; padding: 5px; @@ -275,10 +446,100 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} .dialog-content { overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -289,6 +550,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -307,6 +570,18 @@ .dialog-button { border-color: #dddddd #95B8E7 #95B8E7 #95B8E7; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #F4F4F4; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} .l-btn { text-decoration: none; display: inline-block; @@ -317,9 +592,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -462,9 +738,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #b7d2ff; + padding: 0; +} .l-btn-plain:hover { background: #eaf2ff; color: #000000; @@ -531,12 +812,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -545,18 +837,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -583,6 +915,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #6b9cde; -moz-box-shadow: 0 0 3px 0 #95B8E7; -webkit-box-shadow: 0 0 3px 0 #95B8E7; box-shadow: 0 0 3px 0 #95B8E7; @@ -591,28 +924,31 @@ border-color: #ffa8a8; background-color: #fff3f3; } +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } -.combo { +.filebox-label { display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; } -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; +.l-btn-disabled .filebox-label { + cursor: default; } .combo-arrow { width: 18px; @@ -637,10 +973,6 @@ .combo-panel { background-color: #ffffff; } -.combo { - border-color: #95B8E7; - background-color: #fff; -} .combo-arrow { background-color: #E0ECFF; } @@ -653,15 +985,11 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -670,9 +998,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #eaf2ff; color: #000000; @@ -681,6 +1017,57 @@ background-color: #ffe48d; color: #000000; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #eaf2ff; + color: #000000; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} .layout { position: relative; overflow: hidden; @@ -692,6 +1079,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -716,6 +1107,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; @@ -784,10 +1230,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -977,12 +1419,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -1003,9 +1445,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -1013,6 +1461,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -1033,6 +1483,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #E0ECFF url('images/tabs_icons.png') no-repeat 1px center; } @@ -1128,6 +1625,12 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #ffe48d; + color: #000000; + filter: none; + border-color: #95B8E7; +} .datagrid .panel-body { overflow: hidden; position: relative; @@ -1169,8 +1672,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -1237,10 +1750,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -1316,11 +1830,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } @@ -1423,6 +1947,101 @@ .propertygrid .datagrid-view1 .datagrid-row-selected { background: #E0ECFF; } +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #efefef; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #000000; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.m-list li>a:hover { + background: #eaf2ff; + color: #000000; +} +.m-list .m-list-group { + padding: 0 4px; +} .pagination { zoom: 1; } @@ -1458,7 +2077,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; @@ -1606,14 +2225,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { @@ -1695,11 +2319,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; @@ -1727,32 +2351,6 @@ .datebox-button a { color: #444; } -.numberbox { - border: 1px solid #95B8E7; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #E0ECFF; display: inline-block; @@ -1774,6 +2372,7 @@ height: 10px; width: 100%; height: 50%; + color: #444; outline-style: none; } .spinner-arrow-hover { @@ -1804,8 +2403,11 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #95B8E7; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; @@ -1839,27 +2441,6 @@ background-color: #ffe48d; color: #000000; } -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -1913,10 +2494,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #95B8E7; - background-color: #fff; -} .searchbox .l-btn-plain { background: #E0ECFF; } @@ -1925,10 +2502,6 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); @@ -2038,6 +2611,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -2081,6 +2657,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; @@ -2246,12 +2829,12 @@ border-width: 0 0 0 1px; } .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -2282,9 +2865,13 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #95B8E7; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} .tree { margin: 0; padding: 0; @@ -2419,13 +3006,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #95B8E7; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -2442,6 +3030,9 @@ background: #ffe48d; color: #000000; } +.tree-node-hidden { + display: none; +} .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; @@ -2478,6 +3069,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; @@ -2547,3 +3141,80 @@ .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #bbb; + border: 1px solid #bbb; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #ffe48d; + color: #000000; +} +.switchbutton-off { + background-color: #ffffff; + color: #000000; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #000000; + border: 1px solid #bbb; + -moz-box-shadow: 0 0 3px 0 #bbb; + -webkit-box-shadow: 0 0 3px 0 #bbb; + box-shadow: 0 0 3px 0 #bbb; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/default/filebox.css b/assets/js/easy-ui/themes/default/filebox.css old mode 100755 new mode 100644 index 6077ebdc13..c6bac66315 --- a/assets/js/easy-ui/themes/default/filebox.css +++ b/assets/js/easy-ui/themes/default/filebox.css @@ -4,3 +4,17 @@ top: 0; left: -5000px; } +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/default/images/datagrid_icons.png b/assets/js/easy-ui/themes/default/images/datagrid_icons.png old mode 100755 new mode 100644 index 747ac4d1b8..762d0ce0f7 Binary files a/assets/js/easy-ui/themes/default/images/datagrid_icons.png and b/assets/js/easy-ui/themes/default/images/datagrid_icons.png differ diff --git a/assets/js/easy-ui/themes/default/images/passwordbox_close.png b/assets/js/easy-ui/themes/default/images/passwordbox_close.png new file mode 100644 index 0000000000..643c09da9a Binary files /dev/null and b/assets/js/easy-ui/themes/default/images/passwordbox_close.png differ diff --git a/assets/js/easy-ui/themes/default/images/passwordbox_open.png b/assets/js/easy-ui/themes/default/images/passwordbox_open.png new file mode 100644 index 0000000000..d328891f6a Binary files /dev/null and b/assets/js/easy-ui/themes/default/images/passwordbox_open.png differ diff --git a/assets/js/easy-ui/themes/default/images/spinner_arrows.png b/assets/js/easy-ui/themes/default/images/spinner_arrows.png old mode 100755 new mode 100644 index b68592de32..7c2df483db Binary files a/assets/js/easy-ui/themes/default/images/spinner_arrows.png and b/assets/js/easy-ui/themes/default/images/spinner_arrows.png differ diff --git a/assets/js/easy-ui/themes/default/images/tagbox_icons.png b/assets/js/easy-ui/themes/default/images/tagbox_icons.png new file mode 100644 index 0000000000..bd02e2d817 Binary files /dev/null and b/assets/js/easy-ui/themes/default/images/tagbox_icons.png differ diff --git a/assets/js/easy-ui/themes/default/layout.css b/assets/js/easy-ui/themes/default/layout.css old mode 100755 new mode 100644 index 0292cf591a..6d5c3f5d78 --- a/assets/js/easy-ui/themes/default/layout.css +++ b/assets/js/easy-ui/themes/default/layout.css @@ -9,6 +9,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -33,6 +37,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; diff --git a/assets/js/easy-ui/themes/default/linkbutton.css b/assets/js/easy-ui/themes/default/linkbutton.css old mode 100755 new mode 100644 index 09f522068e..a3e21223e9 --- a/assets/js/easy-ui/themes/default/linkbutton.css +++ b/assets/js/easy-ui/themes/default/linkbutton.css @@ -8,9 +8,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -153,9 +154,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #b7d2ff; + padding: 0; +} .l-btn-plain:hover { background: #eaf2ff; color: #000000; diff --git a/assets/js/easy-ui/themes/default/menu.css b/assets/js/easy-ui/themes/default/menu.css old mode 100755 new mode 100644 index c6089d5fc0..552e25c910 --- a/assets/js/easy-ui/themes/default/menu.css +++ b/assets/js/easy-ui/themes/default/menu.css @@ -6,6 +6,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -49,6 +52,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; diff --git a/assets/js/easy-ui/themes/default/messager.css b/assets/js/easy-ui/themes/default/messager.css old mode 100755 new mode 100644 index f7195816bf..4794cedc11 --- a/assets/js/easy-ui/themes/default/messager.css +++ b/assets/js/easy-ui/themes/default/messager.css @@ -1,10 +1,10 @@ .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -35,6 +35,10 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #95B8E7; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} diff --git a/assets/js/easy-ui/themes/default/numberbox.css b/assets/js/easy-ui/themes/default/numberbox.css old mode 100755 new mode 100644 index 03c7ea2acb..e69de29bb2 --- a/assets/js/easy-ui/themes/default/numberbox.css +++ b/assets/js/easy-ui/themes/default/numberbox.css @@ -1,9 +0,0 @@ -.numberbox { - border: 1px solid #95B8E7; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} diff --git a/assets/js/easy-ui/themes/default/pagination.css b/assets/js/easy-ui/themes/default/pagination.css old mode 100755 new mode 100644 index 1f8783c138..995c8a8999 --- a/assets/js/easy-ui/themes/default/pagination.css +++ b/assets/js/easy-ui/themes/default/pagination.css @@ -33,7 +33,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; diff --git a/assets/js/easy-ui/themes/default/panel.css b/assets/js/easy-ui/themes/default/panel.css old mode 100755 new mode 100644 index c32f3a0eae..675e02ee94 --- a/assets/js/easy-ui/themes/default/panel.css +++ b/assets/js/easy-ui/themes/default/panel.css @@ -140,3 +140,126 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} diff --git a/assets/js/easy-ui/themes/default/passwordbox.css b/assets/js/easy-ui/themes/default/passwordbox.css new file mode 100644 index 0000000000..92c9ce586b --- /dev/null +++ b/assets/js/easy-ui/themes/default/passwordbox.css @@ -0,0 +1,6 @@ +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} diff --git a/assets/js/easy-ui/themes/default/searchbox.css b/assets/js/easy-ui/themes/default/searchbox.css old mode 100755 new mode 100644 index 5f5e01184f..ada5ce39aa --- a/assets/js/easy-ui/themes/default/searchbox.css +++ b/assets/js/easy-ui/themes/default/searchbox.css @@ -1,24 +1,3 @@ -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -72,10 +51,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #95B8E7; - background-color: #fff; -} .searchbox .l-btn-plain { background: #E0ECFF; } @@ -84,7 +59,3 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/default/spinner.css b/assets/js/easy-ui/themes/default/spinner.css old mode 100755 new mode 100644 index 18dc32e905..e2df29b8ec --- a/assets/js/easy-ui/themes/default/spinner.css +++ b/assets/js/easy-ui/themes/default/spinner.css @@ -1,20 +1,3 @@ -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #E0ECFF; display: inline-block; @@ -36,6 +19,7 @@ height: 10px; width: 100%; height: 50%; + color: #444; outline-style: none; } .spinner-arrow-hover { @@ -66,6 +50,9 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #95B8E7; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } diff --git a/assets/js/easy-ui/themes/default/switchbutton.css b/assets/js/easy-ui/themes/default/switchbutton.css new file mode 100644 index 0000000000..20818ab4cb --- /dev/null +++ b/assets/js/easy-ui/themes/default/switchbutton.css @@ -0,0 +1,77 @@ +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #bbb; + border: 1px solid #bbb; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #ffe48d; + color: #000000; +} +.switchbutton-off { + background-color: #ffffff; + color: #000000; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #000000; + border: 1px solid #bbb; + -moz-box-shadow: 0 0 3px 0 #bbb; + -webkit-box-shadow: 0 0 3px 0 #bbb; + box-shadow: 0 0 3px 0 #bbb; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/default/tabs.css b/assets/js/easy-ui/themes/default/tabs.css old mode 100755 new mode 100644 index 0cc95e57fe..d5d84e849b --- a/assets/js/easy-ui/themes/default/tabs.css +++ b/assets/js/easy-ui/themes/default/tabs.css @@ -10,10 +10,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -203,12 +199,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -229,9 +225,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -239,6 +241,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -259,6 +263,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #E0ECFF url('images/tabs_icons.png') no-repeat 1px center; } @@ -354,3 +405,9 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #ffe48d; + color: #000000; + filter: none; + border-color: #95B8E7; +} diff --git a/assets/js/easy-ui/themes/default/tagbox.css b/assets/js/easy-ui/themes/default/tagbox.css new file mode 100644 index 0000000000..67d51a3672 --- /dev/null +++ b/assets/js/easy-ui/themes/default/tagbox.css @@ -0,0 +1,44 @@ +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #eaf2ff; + color: #000000; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} diff --git a/assets/js/easy-ui/themes/default/textbox.css b/assets/js/easy-ui/themes/default/textbox.css old mode 100755 new mode 100644 index 0bcd51ca4f..ae2d963ed7 --- a/assets/js/easy-ui/themes/default/textbox.css +++ b/assets/js/easy-ui/themes/default/textbox.css @@ -25,12 +25,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -39,18 +50,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -77,6 +128,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #6b9cde; -moz-box-shadow: 0 0 3px 0 #95B8E7; -webkit-box-shadow: 0 0 3px 0 #95B8E7; box-shadow: 0 0 3px 0 #95B8E7; diff --git a/assets/js/easy-ui/themes/default/tooltip.css b/assets/js/easy-ui/themes/default/tooltip.css old mode 100755 new mode 100644 index 2881b7050f..9294d9da8f --- a/assets/js/easy-ui/themes/default/tooltip.css +++ b/assets/js/easy-ui/themes/default/tooltip.css @@ -29,6 +29,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; diff --git a/assets/js/easy-ui/themes/default/tree.css b/assets/js/easy-ui/themes/default/tree.css old mode 100755 new mode 100644 index bdbcd01c1a..d6f5e16499 --- a/assets/js/easy-ui/themes/default/tree.css +++ b/assets/js/easy-ui/themes/default/tree.css @@ -132,13 +132,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #95B8E7; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -155,3 +156,6 @@ background: #ffe48d; color: #000000; } +.tree-node-hidden { + display: none; +} diff --git a/assets/js/easy-ui/themes/default/window.css b/assets/js/easy-ui/themes/default/window.css old mode 100755 new mode 100644 index 06f77db207..ee7e8bdd82 --- a/assets/js/easy-ui/themes/default/window.css +++ b/assets/js/easy-ui/themes/default/window.css @@ -92,3 +92,92 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} diff --git a/assets/js/easy-ui/themes/gray/accordion.css b/assets/js/easy-ui/themes/gray/accordion.css old mode 100755 new mode 100644 index 3cb451b167..3226cb381a --- a/assets/js/easy-ui/themes/gray/accordion.css +++ b/assets/js/easy-ui/themes/gray/accordion.css @@ -39,3 +39,51 @@ .accordion .accordion-header-selected .panel-title { color: #fff; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #f3f3f3; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #D3D3D3; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #f3f3f3; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #D3D3D3; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #f3f3f3; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #D3D3D3; +} diff --git a/assets/js/easy-ui/themes/gray/calendar.css b/assets/js/easy-ui/themes/gray/calendar.css old mode 100755 new mode 100644 index 335310d6da..a0204720e2 --- a/assets/js/easy-ui/themes/gray/calendar.css +++ b/assets/js/easy-ui/themes/gray/calendar.css @@ -110,14 +110,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { diff --git a/assets/js/easy-ui/themes/gray/combo.css b/assets/js/easy-ui/themes/gray/combo.css old mode 100755 new mode 100644 index 3c76f2cc06..6ebdf5ee79 --- a/assets/js/easy-ui/themes/gray/combo.css +++ b/assets/js/easy-ui/themes/gray/combo.css @@ -1,20 +1,3 @@ -.combo { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; -} .combo-arrow { width: 18px; height: 20px; @@ -38,10 +21,6 @@ .combo-panel { background-color: #ffffff; } -.combo { - border-color: #D3D3D3; - background-color: #fff; -} .combo-arrow { background-color: #f3f3f3; } @@ -54,7 +33,3 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/gray/combobox.css b/assets/js/easy-ui/themes/gray/combobox.css old mode 100755 new mode 100644 index 68b626239f..0f7b5afab7 --- a/assets/js/easy-ui/themes/gray/combobox.css +++ b/assets/js/easy-ui/themes/gray/combobox.css @@ -1,8 +1,8 @@ .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -11,9 +11,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #e2e2e2; color: #000000; @@ -22,3 +30,10 @@ background-color: #0092DC; color: #fff; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} diff --git a/assets/js/easy-ui/themes/gray/datagrid.css b/assets/js/easy-ui/themes/gray/datagrid.css old mode 100755 new mode 100644 index 90bcee3a1a..737faf7376 --- a/assets/js/easy-ui/themes/gray/datagrid.css +++ b/assets/js/easy-ui/themes/gray/datagrid.css @@ -39,8 +39,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -107,10 +117,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -186,11 +197,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } diff --git a/assets/js/easy-ui/themes/gray/datalist.css b/assets/js/easy-ui/themes/gray/datalist.css new file mode 100644 index 0000000000..de149ef051 --- /dev/null +++ b/assets/js/easy-ui/themes/gray/datalist.css @@ -0,0 +1,95 @@ +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #fafafa; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #000000; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.m-list li>a:hover { + background: #e2e2e2; + color: #000000; +} +.m-list .m-list-group { + padding: 0 4px; +} diff --git a/assets/js/easy-ui/themes/gray/datebox.css b/assets/js/easy-ui/themes/gray/datebox.css old mode 100755 new mode 100644 index 8c41350345..f6163757d2 --- a/assets/js/easy-ui/themes/gray/datebox.css +++ b/assets/js/easy-ui/themes/gray/datebox.css @@ -2,11 +2,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; diff --git a/assets/js/easy-ui/themes/gray/dialog.css b/assets/js/easy-ui/themes/gray/dialog.css old mode 100755 new mode 100644 index b1ff52fa17..2850ca1dc6 --- a/assets/js/easy-ui/themes/gray/dialog.css +++ b/assets/js/easy-ui/themes/gray/dialog.css @@ -2,6 +2,7 @@ overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -12,6 +13,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -30,3 +33,15 @@ .dialog-button { border-color: #ddd #D3D3D3 #D3D3D3 #D3D3D3; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #fafafa; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} diff --git a/assets/js/easy-ui/themes/gray/easyui.css b/assets/js/easy-ui/themes/gray/easyui.css old mode 100755 new mode 100644 index 8098225876..0779449352 --- a/assets/js/easy-ui/themes/gray/easyui.css +++ b/assets/js/easy-ui/themes/gray/easyui.css @@ -140,6 +140,129 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} .accordion { overflow: hidden; border-width: 1px; @@ -181,6 +304,54 @@ .accordion .accordion-header-selected .panel-title { color: #fff; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #f3f3f3; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #D3D3D3; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #f3f3f3; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #D3D3D3; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #f3f3f3; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #D3D3D3; +} .window { overflow: hidden; padding: 5px; @@ -275,10 +446,100 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} .dialog-content { overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -289,6 +550,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -307,6 +570,18 @@ .dialog-button { border-color: #ddd #D3D3D3 #D3D3D3 #D3D3D3; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #fafafa; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} .l-btn { text-decoration: none; display: inline-block; @@ -317,9 +592,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -462,9 +738,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #ccc; + padding: 0; +} .l-btn-plain:hover { background: #e2e2e2; color: #000000; @@ -531,12 +812,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -545,18 +837,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -583,6 +915,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #bababa; -moz-box-shadow: 0 0 3px 0 #D3D3D3; -webkit-box-shadow: 0 0 3px 0 #D3D3D3; box-shadow: 0 0 3px 0 #D3D3D3; @@ -591,28 +924,31 @@ border-color: #ffa8a8; background-color: #fff3f3; } +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } -.combo { +.filebox-label { display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; } -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; +.l-btn-disabled .filebox-label { + cursor: default; } .combo-arrow { width: 18px; @@ -637,10 +973,6 @@ .combo-panel { background-color: #ffffff; } -.combo { - border-color: #D3D3D3; - background-color: #fff; -} .combo-arrow { background-color: #f3f3f3; } @@ -653,15 +985,11 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -670,9 +998,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #e2e2e2; color: #000000; @@ -681,6 +1017,57 @@ background-color: #0092DC; color: #fff; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #e2e2e2; + color: #000000; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} .layout { position: relative; overflow: hidden; @@ -692,6 +1079,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -716,6 +1107,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; @@ -784,10 +1230,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -977,12 +1419,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -1003,9 +1445,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -1013,6 +1461,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -1033,6 +1483,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #f3f3f3 url('images/tabs_icons.png') no-repeat 1px center; } @@ -1128,6 +1625,12 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #0092DC; + color: #fff; + filter: none; + border-color: #D3D3D3; +} .datagrid .panel-body { overflow: hidden; position: relative; @@ -1169,8 +1672,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -1237,10 +1750,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -1316,11 +1830,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } @@ -1423,6 +1947,101 @@ .propertygrid .datagrid-view1 .datagrid-row-selected { background: #f3f3f3; } +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #fafafa; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #000000; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ccc; +} +.m-list li>a:hover { + background: #e2e2e2; + color: #000000; +} +.m-list .m-list-group { + padding: 0 4px; +} .pagination { zoom: 1; } @@ -1458,7 +2077,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; @@ -1606,14 +2225,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { @@ -1695,11 +2319,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; @@ -1727,32 +2351,6 @@ .datebox-button a { color: #444; } -.numberbox { - border: 1px solid #D3D3D3; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #f3f3f3; display: inline-block; @@ -1774,6 +2372,7 @@ height: 10px; width: 100%; height: 50%; + color: #444; outline-style: none; } .spinner-arrow-hover { @@ -1804,8 +2403,11 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #D3D3D3; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; @@ -1839,27 +2441,6 @@ background-color: #0092DC; color: #fff; } -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -1913,10 +2494,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #D3D3D3; - background-color: #fff; -} .searchbox .l-btn-plain { background: #f3f3f3; } @@ -1925,10 +2502,6 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); @@ -2038,6 +2611,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -2081,6 +2657,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; @@ -2246,12 +2829,12 @@ border-width: 0 0 0 1px; } .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -2282,9 +2865,13 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #D3D3D3; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} .tree { margin: 0; padding: 0; @@ -2419,13 +3006,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #D3D3D3; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -2442,6 +3030,9 @@ background: #0092DC; color: #fff; } +.tree-node-hidden { + display: none; +} .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; @@ -2478,6 +3069,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; @@ -2547,3 +3141,80 @@ .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #bbb; + border: 1px solid #bbb; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #0092DC; + color: #fff; +} +.switchbutton-off { + background-color: #ffffff; + color: #000000; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #000000; + border: 1px solid #bbb; + -moz-box-shadow: 0 0 3px 0 #bbb; + -webkit-box-shadow: 0 0 3px 0 #bbb; + box-shadow: 0 0 3px 0 #bbb; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/gray/filebox.css b/assets/js/easy-ui/themes/gray/filebox.css old mode 100755 new mode 100644 index 6077ebdc13..c6bac66315 --- a/assets/js/easy-ui/themes/gray/filebox.css +++ b/assets/js/easy-ui/themes/gray/filebox.css @@ -4,3 +4,17 @@ top: 0; left: -5000px; } +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/gray/images/datagrid_icons.png b/assets/js/easy-ui/themes/gray/images/datagrid_icons.png old mode 100755 new mode 100644 index 73c4e88893..66b83435f8 Binary files a/assets/js/easy-ui/themes/gray/images/datagrid_icons.png and b/assets/js/easy-ui/themes/gray/images/datagrid_icons.png differ diff --git a/assets/js/easy-ui/themes/gray/images/passwordbox_close.png b/assets/js/easy-ui/themes/gray/images/passwordbox_close.png new file mode 100644 index 0000000000..276b579742 Binary files /dev/null and b/assets/js/easy-ui/themes/gray/images/passwordbox_close.png differ diff --git a/assets/js/easy-ui/themes/gray/images/passwordbox_open.png b/assets/js/easy-ui/themes/gray/images/passwordbox_open.png new file mode 100644 index 0000000000..0f25d535e0 Binary files /dev/null and b/assets/js/easy-ui/themes/gray/images/passwordbox_open.png differ diff --git a/assets/js/easy-ui/themes/gray/images/spinner_arrows.png b/assets/js/easy-ui/themes/gray/images/spinner_arrows.png old mode 100755 new mode 100644 index dba62bb723..b1773c24b2 Binary files a/assets/js/easy-ui/themes/gray/images/spinner_arrows.png and b/assets/js/easy-ui/themes/gray/images/spinner_arrows.png differ diff --git a/assets/js/easy-ui/themes/gray/images/tagbox_icons.png b/assets/js/easy-ui/themes/gray/images/tagbox_icons.png new file mode 100644 index 0000000000..8ec6436088 Binary files /dev/null and b/assets/js/easy-ui/themes/gray/images/tagbox_icons.png differ diff --git a/assets/js/easy-ui/themes/gray/layout.css b/assets/js/easy-ui/themes/gray/layout.css old mode 100755 new mode 100644 index d26772e565..2321dfc230 --- a/assets/js/easy-ui/themes/gray/layout.css +++ b/assets/js/easy-ui/themes/gray/layout.css @@ -9,6 +9,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -33,6 +37,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; diff --git a/assets/js/easy-ui/themes/gray/linkbutton.css b/assets/js/easy-ui/themes/gray/linkbutton.css old mode 100755 new mode 100644 index 79aceec6f1..53280e6891 --- a/assets/js/easy-ui/themes/gray/linkbutton.css +++ b/assets/js/easy-ui/themes/gray/linkbutton.css @@ -8,9 +8,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -153,9 +154,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #ccc; + padding: 0; +} .l-btn-plain:hover { background: #e2e2e2; color: #000000; diff --git a/assets/js/easy-ui/themes/gray/menu.css b/assets/js/easy-ui/themes/gray/menu.css old mode 100755 new mode 100644 index 51c2cff322..72ca0804d6 --- a/assets/js/easy-ui/themes/gray/menu.css +++ b/assets/js/easy-ui/themes/gray/menu.css @@ -6,6 +6,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -49,6 +52,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; diff --git a/assets/js/easy-ui/themes/gray/messager.css b/assets/js/easy-ui/themes/gray/messager.css old mode 100755 new mode 100644 index 1e5df2a777..1f20816cbb --- a/assets/js/easy-ui/themes/gray/messager.css +++ b/assets/js/easy-ui/themes/gray/messager.css @@ -1,10 +1,10 @@ .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -35,6 +35,10 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #D3D3D3; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} diff --git a/assets/js/easy-ui/themes/gray/numberbox.css b/assets/js/easy-ui/themes/gray/numberbox.css old mode 100755 new mode 100644 index ef92d174e6..e69de29bb2 --- a/assets/js/easy-ui/themes/gray/numberbox.css +++ b/assets/js/easy-ui/themes/gray/numberbox.css @@ -1,9 +0,0 @@ -.numberbox { - border: 1px solid #D3D3D3; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} diff --git a/assets/js/easy-ui/themes/gray/pagination.css b/assets/js/easy-ui/themes/gray/pagination.css old mode 100755 new mode 100644 index ac691ed664..11df655ede --- a/assets/js/easy-ui/themes/gray/pagination.css +++ b/assets/js/easy-ui/themes/gray/pagination.css @@ -33,7 +33,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; diff --git a/assets/js/easy-ui/themes/gray/panel.css b/assets/js/easy-ui/themes/gray/panel.css old mode 100755 new mode 100644 index fa41aaadc9..36e873e9da --- a/assets/js/easy-ui/themes/gray/panel.css +++ b/assets/js/easy-ui/themes/gray/panel.css @@ -140,3 +140,126 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} diff --git a/assets/js/easy-ui/themes/gray/passwordbox.css b/assets/js/easy-ui/themes/gray/passwordbox.css new file mode 100644 index 0000000000..92c9ce586b --- /dev/null +++ b/assets/js/easy-ui/themes/gray/passwordbox.css @@ -0,0 +1,6 @@ +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} diff --git a/assets/js/easy-ui/themes/gray/searchbox.css b/assets/js/easy-ui/themes/gray/searchbox.css old mode 100755 new mode 100644 index ed01d43518..7b15815d23 --- a/assets/js/easy-ui/themes/gray/searchbox.css +++ b/assets/js/easy-ui/themes/gray/searchbox.css @@ -1,24 +1,3 @@ -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -72,10 +51,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #D3D3D3; - background-color: #fff; -} .searchbox .l-btn-plain { background: #f3f3f3; } @@ -84,7 +59,3 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/gray/spinner.css b/assets/js/easy-ui/themes/gray/spinner.css old mode 100755 new mode 100644 index c90578842d..a61944d791 --- a/assets/js/easy-ui/themes/gray/spinner.css +++ b/assets/js/easy-ui/themes/gray/spinner.css @@ -1,20 +1,3 @@ -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #f3f3f3; display: inline-block; @@ -36,6 +19,7 @@ height: 10px; width: 100%; height: 50%; + color: #444; outline-style: none; } .spinner-arrow-hover { @@ -66,6 +50,9 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #D3D3D3; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } diff --git a/assets/js/easy-ui/themes/gray/switchbutton.css b/assets/js/easy-ui/themes/gray/switchbutton.css new file mode 100644 index 0000000000..a33305c775 --- /dev/null +++ b/assets/js/easy-ui/themes/gray/switchbutton.css @@ -0,0 +1,77 @@ +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #bbb; + border: 1px solid #bbb; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.switchbutton-on { + background: #0092DC; + color: #fff; +} +.switchbutton-off { + background-color: #ffffff; + color: #000000; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; + border-radius: 5px 0 0 5px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #000000; + border: 1px solid #bbb; + -moz-box-shadow: 0 0 3px 0 #bbb; + -webkit-box-shadow: 0 0 3px 0 #bbb; + box-shadow: 0 0 3px 0 #bbb; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/gray/tabs.css b/assets/js/easy-ui/themes/gray/tabs.css old mode 100755 new mode 100644 index 0a5845328a..bbdd989a70 --- a/assets/js/easy-ui/themes/gray/tabs.css +++ b/assets/js/easy-ui/themes/gray/tabs.css @@ -10,10 +10,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -203,12 +199,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -229,9 +225,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; @@ -239,6 +241,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; @@ -259,6 +263,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #f3f3f3 url('images/tabs_icons.png') no-repeat 1px center; } @@ -354,3 +405,9 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #0092DC; + color: #fff; + filter: none; + border-color: #D3D3D3; +} diff --git a/assets/js/easy-ui/themes/gray/tagbox.css b/assets/js/easy-ui/themes/gray/tagbox.css new file mode 100644 index 0000000000..46cbd333d8 --- /dev/null +++ b/assets/js/easy-ui/themes/gray/tagbox.css @@ -0,0 +1,44 @@ +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + background: #e2e2e2; + color: #000000; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} diff --git a/assets/js/easy-ui/themes/gray/textbox.css b/assets/js/easy-ui/themes/gray/textbox.css old mode 100755 new mode 100644 index 2101352c88..d86f4b3f6e --- a/assets/js/easy-ui/themes/gray/textbox.css +++ b/assets/js/easy-ui/themes/gray/textbox.css @@ -25,12 +25,23 @@ -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -39,18 +50,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -77,6 +128,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #bababa; -moz-box-shadow: 0 0 3px 0 #D3D3D3; -webkit-box-shadow: 0 0 3px 0 #D3D3D3; box-shadow: 0 0 3px 0 #D3D3D3; diff --git a/assets/js/easy-ui/themes/gray/tooltip.css b/assets/js/easy-ui/themes/gray/tooltip.css old mode 100755 new mode 100644 index 51c5b83427..e2ba0c5d3a --- a/assets/js/easy-ui/themes/gray/tooltip.css +++ b/assets/js/easy-ui/themes/gray/tooltip.css @@ -29,6 +29,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; diff --git a/assets/js/easy-ui/themes/gray/tree.css b/assets/js/easy-ui/themes/gray/tree.css old mode 100755 new mode 100644 index c705f39ce3..a39504fc19 --- a/assets/js/easy-ui/themes/gray/tree.css +++ b/assets/js/easy-ui/themes/gray/tree.css @@ -132,13 +132,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #D3D3D3; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -155,3 +156,6 @@ background: #0092DC; color: #fff; } +.tree-node-hidden { + display: none; +} diff --git a/assets/js/easy-ui/themes/gray/window.css b/assets/js/easy-ui/themes/gray/window.css old mode 100755 new mode 100644 index dfe8954681..bd69fdbd91 --- a/assets/js/easy-ui/themes/gray/window.css +++ b/assets/js/easy-ui/themes/gray/window.css @@ -92,3 +92,92 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} diff --git a/assets/js/easy-ui/themes/icon.css b/assets/js/easy-ui/themes/icon.css old mode 100755 new mode 100644 index 5501abbe11..c2d3b2161e --- a/assets/js/easy-ui/themes/icon.css +++ b/assets/js/easy-ui/themes/icon.css @@ -64,6 +64,9 @@ .icon-lock{ background:url('icons/lock.png') no-repeat center center; } +.icon-more{ + background:url('icons/more.png') no-repeat center center; +} .icon-mini-add{ diff --git a/assets/js/easy-ui/themes/icons/more.png b/assets/js/easy-ui/themes/icons/more.png new file mode 100644 index 0000000000..94922a2c86 Binary files /dev/null and b/assets/js/easy-ui/themes/icons/more.png differ diff --git a/assets/js/easy-ui/themes/material/accordion.css b/assets/js/easy-ui/themes/material/accordion.css new file mode 100644 index 0000000000..51d0c7010b --- /dev/null +++ b/assets/js/easy-ui/themes/material/accordion.css @@ -0,0 +1,89 @@ +.accordion { + overflow: hidden; + border-width: 1px; + border-style: solid; +} +.accordion .accordion-header { + border-width: 0 0 1px; + cursor: pointer; +} +.accordion .accordion-body { + border-width: 0 0 1px; +} +.accordion-noborder { + border-width: 0; +} +.accordion-noborder .accordion-header { + border-width: 0 0 1px; +} +.accordion-noborder .accordion-body { + border-width: 0 0 1px; +} +.accordion-collapse { + background: url('images/accordion_arrows.png') no-repeat 0 0; +} +.accordion-expand { + background: url('images/accordion_arrows.png') no-repeat -16px 0; +} +.accordion { + background: #ffffff; + border-color: #ddd; +} +.accordion .accordion-header { + background: #f5f5f5; + filter: none; +} +.accordion .accordion-header-selected { + background: #00bbee; +} +.accordion .accordion-header-selected .panel-title { + color: #fff; +} +.accordion .panel-last > .accordion-header { + border-bottom-color: #f5f5f5; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #ddd; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #f5f5f5; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #ddd; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #f5f5f5; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #ddd; +} diff --git a/assets/js/easy-ui/themes/material/calendar.css b/assets/js/easy-ui/themes/material/calendar.css new file mode 100644 index 0000000000..47ba4b19a0 --- /dev/null +++ b/assets/js/easy-ui/themes/material/calendar.css @@ -0,0 +1,202 @@ +.calendar { + border-width: 1px; + border-style: solid; + padding: 1px; + overflow: hidden; +} +.calendar table { + table-layout: fixed; + border-collapse: separate; + font-size: 12px; + width: 100%; + height: 100%; +} +.calendar table td, +.calendar table th { + font-size: 12px; +} +.calendar-noborder { + border: 0; +} +.calendar-header { + position: relative; + height: 22px; +} +.calendar-title { + text-align: center; + height: 22px; +} +.calendar-title span { + position: relative; + display: inline-block; + top: 2px; + padding: 0 3px; + height: 18px; + line-height: 18px; + font-size: 12px; + cursor: pointer; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-prevmonth, +.calendar-nextmonth, +.calendar-prevyear, +.calendar-nextyear { + position: absolute; + top: 50%; + margin-top: -7px; + width: 14px; + height: 14px; + cursor: pointer; + font-size: 1px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-prevmonth { + left: 20px; + background: url('images/calendar_arrows.png') no-repeat -18px -2px; +} +.calendar-nextmonth { + right: 20px; + background: url('images/calendar_arrows.png') no-repeat -34px -2px; +} +.calendar-prevyear { + left: 3px; + background: url('images/calendar_arrows.png') no-repeat -1px -2px; +} +.calendar-nextyear { + right: 3px; + background: url('images/calendar_arrows.png') no-repeat -49px -2px; +} +.calendar-body { + position: relative; +} +.calendar-body th, +.calendar-body td { + text-align: center; +} +.calendar-day { + border: 0; + padding: 1px; + cursor: pointer; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-other-month { + opacity: 0.3; + filter: alpha(opacity=30); +} +.calendar-disabled { + opacity: 0.6; + filter: alpha(opacity=60); + cursor: default; +} +.calendar-menu { + position: absolute; + top: 0; + left: 0; + width: 180px; + height: 150px; + padding: 5px; + font-size: 12px; + display: none; + overflow: hidden; +} +.calendar-menu-year-inner { + text-align: center; + padding-bottom: 5px; +} +.calendar-menu-year { + width: 50px; + text-align: center; + border-width: 1px; + border-style: solid; + outline-style: none; + resize: none; + margin: 0; + padding: 2px; + font-weight: bold; + font-size: 12px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-menu-prev, +.calendar-menu-next { + display: inline-block; + width: 21px; + height: 21px; + vertical-align: top; + cursor: pointer; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-menu-prev { + margin-right: 10px; + background: url('images/calendar_arrows.png') no-repeat 2px 2px; +} +.calendar-menu-next { + margin-left: 10px; + background: url('images/calendar_arrows.png') no-repeat -45px 2px; +} +.calendar-menu-month { + text-align: center; + cursor: pointer; + font-weight: bold; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-body th, +.calendar-menu-month { + color: #8d8d8d; +} +.calendar-day { + color: #404040; +} +.calendar-sunday { + color: #CC2222; +} +.calendar-saturday { + color: #00ee00; +} +.calendar-today { + color: #0000ff; +} +.calendar-menu-year { + border-color: #ddd; +} +.calendar { + border-color: #ddd; +} +.calendar-header { + background: #f5f5f5; +} +.calendar-body, +.calendar-menu { + background: #ffffff; +} +.calendar-body th { + background: #fafafa; + padding: 2px 0; +} +.calendar-hover, +.calendar-nav-hover, +.calendar-menu-hover { + background-color: #eee; + color: #404040; +} +.calendar-hover { + border: 1px solid #ccc; + padding: 0; +} +.calendar-selected { + background-color: #00bbee; + color: #fff; + border: 1px solid #9cc8f7; + padding: 0; +} diff --git a/assets/js/easy-ui/themes/material/combo.css b/assets/js/easy-ui/themes/material/combo.css new file mode 100644 index 0000000000..622d7c2db8 --- /dev/null +++ b/assets/js/easy-ui/themes/material/combo.css @@ -0,0 +1,35 @@ +.combo-arrow { + width: 18px; + height: 20px; + overflow: hidden; + display: inline-block; + vertical-align: top; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.combo-arrow-hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.combo-panel { + overflow: auto; +} +.combo-arrow { + background: url('images/combo_arrow.png') no-repeat center center; +} +.combo-panel { + background-color: #ffffff; +} +.combo-arrow { + background-color: #f5f5f5; +} +.combo-arrow-hover { + background-color: #eee; +} +.combo-arrow:hover { + background-color: #eee; +} +.combo .textbox-icon-disabled:hover { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/material/combobox.css b/assets/js/easy-ui/themes/material/combobox.css new file mode 100644 index 0000000000..8f97a2b905 --- /dev/null +++ b/assets/js/easy-ui/themes/material/combobox.css @@ -0,0 +1,39 @@ +.combobox-item, +.combobox-group, +.combobox-stick { + font-size: 12px; + padding: 3px; +} +.combobox-item-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.combobox-gitem { + padding-left: 10px; +} +.combobox-group, +.combobox-stick { + font-weight: bold; +} +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} +.combobox-item-hover { + background-color: #eee; + color: #404040; +} +.combobox-item-selected { + background-color: #00bbee; + color: #fff; +} +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} diff --git a/assets/js/easy-ui/themes/material/datagrid.css b/assets/js/easy-ui/themes/material/datagrid.css new file mode 100644 index 0000000000..7259808351 --- /dev/null +++ b/assets/js/easy-ui/themes/material/datagrid.css @@ -0,0 +1,282 @@ +.datagrid .panel-body { + overflow: hidden; + position: relative; +} +.datagrid-view { + position: relative; + overflow: hidden; +} +.datagrid-view1, +.datagrid-view2 { + position: absolute; + overflow: hidden; + top: 0; +} +.datagrid-view1 { + left: 0; +} +.datagrid-view2 { + right: 0; +} +.datagrid-mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0.3; + filter: alpha(opacity=30); + display: none; +} +.datagrid-mask-msg { + position: absolute; + top: 50%; + margin-top: -20px; + padding: 10px 5px 10px 30px; + width: auto; + height: 16px; + border-width: 2px; + border-style: solid; + display: none; +} +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} +.datagrid-sort-icon { + padding: 0; + display: none; +} +.datagrid-toolbar { + height: auto; + padding: 1px 2px; + border-width: 0 0 1px 0; + border-style: solid; +} +.datagrid-btn-separator { + float: left; + height: 24px; + border-left: 1px solid #ddd; + border-right: 1px solid #fff; + margin: 2px 1px; +} +.datagrid .datagrid-pager { + display: block; + margin: 0; + border-width: 1px 0 0 0; + border-style: solid; +} +.datagrid .datagrid-pager-top { + border-width: 0 0 1px 0; +} +.datagrid-header { + overflow: hidden; + cursor: default; + border-width: 0 0 1px 0; + border-style: solid; +} +.datagrid-header-inner { + float: left; + width: 10000px; +} +.datagrid-header-row, +.datagrid-row { + height: 25px; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-width: 0 1px 1px 0; + border-style: dotted; + margin: 0; + padding: 0; +} +.datagrid-cell, +.datagrid-cell-group, +.datagrid-header-rownumber, +.datagrid-cell-rownumber { + margin: 0; + padding: 0 4px; + white-space: nowrap; + word-wrap: normal; + overflow: hidden; + height: 18px; + line-height: 18px; + font-size: 12px; +} +.datagrid-header .datagrid-cell { + height: auto; +} +.datagrid-header .datagrid-cell span { + font-size: 12px; +} +.datagrid-cell-group { + text-align: center; + text-overflow: ellipsis; +} +.datagrid-header-rownumber, +.datagrid-cell-rownumber { + width: 30px; + text-align: center; + margin: 0; + padding: 0; +} +.datagrid-body { + margin: 0; + padding: 0; + overflow: auto; + zoom: 1; +} +.datagrid-view1 .datagrid-body-inner { + padding-bottom: 20px; +} +.datagrid-view1 .datagrid-body { + overflow: hidden; +} +.datagrid-footer { + overflow: hidden; +} +.datagrid-footer-inner { + border-width: 1px 0 0 0; + border-style: solid; + width: 10000px; + float: left; +} +.datagrid-row-editing .datagrid-cell { + height: auto; +} +.datagrid-header-check, +.datagrid-cell-check { + padding: 0; + width: 27px; + height: 18px; + font-size: 1px; + text-align: center; + overflow: hidden; +} +.datagrid-header-check input, +.datagrid-cell-check input { + margin: 0; + padding: 0; + width: 15px; + height: 18px; +} +.datagrid-resize-proxy { + position: absolute; + width: 1px; + height: 10000px; + top: 0; + cursor: e-resize; + display: none; +} +.datagrid-body .datagrid-editable { + margin: 0; + padding: 0; +} +.datagrid-body .datagrid-editable table { + width: 100%; + height: 100%; +} +.datagrid-body .datagrid-editable td { + border: 0; + margin: 0; + padding: 0; +} +.datagrid-view .datagrid-editable-input { + margin: 0; + padding: 2px 4px; + border: 1px solid #ddd; + font-size: 12px; + outline-style: none; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} +.datagrid-sort-desc .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -16px center; +} +.datagrid-sort-asc .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat 0px center; +} +.datagrid-row-collapse { + background: url('images/datagrid_icons.png') no-repeat -48px center; +} +.datagrid-row-expand { + background: url('images/datagrid_icons.png') no-repeat -32px center; +} +.datagrid-mask-msg { + background: #ffffff url('images/loading.gif') no-repeat scroll 5px center; +} +.datagrid-header, +.datagrid-td-rownumber { + background-color: #fafafa; +} +.datagrid-cell-rownumber { + color: #404040; +} +.datagrid-resize-proxy { + background: #ccc; +} +.datagrid-mask { + background: #eee; +} +.datagrid-mask-msg { + border-color: #ddd; +} +.datagrid-toolbar, +.datagrid-pager { + background: #fafafa; +} +.datagrid-header, +.datagrid-toolbar, +.datagrid-pager, +.datagrid-footer-inner { + border-color: #eee; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-color: #ebebeb; +} +.datagrid-htable, +.datagrid-btable, +.datagrid-ftable { + color: #404040; + border-collapse: separate; +} +.datagrid-row-alt { + background: #f9f9f9; +} +.datagrid-row-over, +.datagrid-header td.datagrid-header-over { + background: #eee; + color: #404040; + cursor: default; +} +.datagrid-row-selected { + background: #00bbee; + color: #fff; +} +.datagrid-row-editing .textbox, +.datagrid-row-editing .textbox-text { + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} diff --git a/assets/js/easy-ui/themes/material/datalist.css b/assets/js/easy-ui/themes/material/datalist.css new file mode 100644 index 0000000000..27617f0b59 --- /dev/null +++ b/assets/js/easy-ui/themes/material/datalist.css @@ -0,0 +1,95 @@ +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #fafafa; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ebebeb; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #404040; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ebebeb; +} +.m-list li>a:hover { + background: #eee; + color: #404040; +} +.m-list .m-list-group { + padding: 0 4px; +} diff --git a/assets/js/easy-ui/themes/material/datebox.css b/assets/js/easy-ui/themes/material/datebox.css new file mode 100644 index 0000000000..e2874e820b --- /dev/null +++ b/assets/js/easy-ui/themes/material/datebox.css @@ -0,0 +1,36 @@ +.datebox-calendar-inner { + height: 180px; +} +.datebox-button { + padding: 0 5px; + text-align: center; +} +.datebox-button a { + line-height: 22px; + font-size: 12px; + font-weight: bold; + text-decoration: none; + opacity: 0.6; + filter: alpha(opacity=60); +} +.datebox-button a:hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.datebox-current, +.datebox-close { + float: left; +} +.datebox-close { + float: right; +} +.datebox .combo-arrow { + background-image: url('images/datebox_arrow.png'); + background-position: center center; +} +.datebox-button { + background-color: #fafafa; +} +.datebox-button a { + color: #404040; +} diff --git a/assets/js/easy-ui/themes/material/dialog.css b/assets/js/easy-ui/themes/material/dialog.css new file mode 100644 index 0000000000..82a1bb8815 --- /dev/null +++ b/assets/js/easy-ui/themes/material/dialog.css @@ -0,0 +1,47 @@ +.dialog-content { + overflow: auto; +} +.dialog-toolbar { + position: relative; + padding: 2px 5px; +} +.dialog-tool-separator { + float: left; + height: 24px; + border-left: 1px solid #ddd; + border-right: 1px solid #fff; + margin: 2px 1px; +} +.dialog-button { + position: relative; + top: -1px; + padding: 5px; + text-align: right; +} +.dialog-button .l-btn { + margin-left: 5px; +} +.dialog-toolbar, +.dialog-button { + background: #fafafa; + border-width: 1px; + border-style: solid; +} +.dialog-toolbar { + border-color: #ddd #ddd #eee #ddd; +} +.dialog-button { + border-color: #eee #ddd #ddd #ddd; +} +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #fafafa; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} diff --git a/assets/js/easy-ui/themes/material/easyui.css b/assets/js/easy-ui/themes/material/easyui.css new file mode 100644 index 0000000000..3b79252191 --- /dev/null +++ b/assets/js/easy-ui/themes/material/easyui.css @@ -0,0 +1,3229 @@ +.panel { + overflow: hidden; + text-align: left; + margin: 0; + border: 0; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.panel-header, +.panel-body { + border-width: 1px; + border-style: solid; +} +.panel-header { + padding: 5px; + position: relative; +} +.panel-title { + background: url('images/blank.gif') no-repeat; +} +.panel-header-noborder { + border-width: 0 0 1px 0; +} +.panel-body { + overflow: auto; + border-top-width: 0; + padding: 0; +} +.panel-body-noheader { + border-top-width: 1px; +} +.panel-body-noborder { + border-width: 0px; +} +.panel-body-nobottom { + border-bottom-width: 0; +} +.panel-with-icon { + padding-left: 18px; +} +.panel-icon, +.panel-tool { + position: absolute; + top: 50%; + margin-top: -8px; + height: 16px; + overflow: hidden; +} +.panel-icon { + left: 5px; + width: 16px; +} +.panel-tool { + right: 5px; + width: auto; +} +.panel-tool a { + display: inline-block; + width: 16px; + height: 16px; + opacity: 0.6; + filter: alpha(opacity=60); + margin: 0 0 0 2px; + vertical-align: top; +} +.panel-tool a:hover { + opacity: 1; + filter: alpha(opacity=100); + background-color: #eee; + -moz-border-radius: 2px 2px 2px 2px; + -webkit-border-radius: 2px 2px 2px 2px; + border-radius: 2px 2px 2px 2px; +} +.panel-loading { + padding: 11px 0px 10px 30px; +} +.panel-noscroll { + overflow: hidden; +} +.panel-fit, +.panel-fit body { + height: 100%; + margin: 0; + padding: 0; + border: 0; + overflow: hidden; +} +.panel-loading { + background: url('images/loading.gif') no-repeat 10px 10px; +} +.panel-tool-close { + background: url('images/panel_tools.png') no-repeat -16px 0px; +} +.panel-tool-min { + background: url('images/panel_tools.png') no-repeat 0px 0px; +} +.panel-tool-max { + background: url('images/panel_tools.png') no-repeat 0px -16px; +} +.panel-tool-restore { + background: url('images/panel_tools.png') no-repeat -16px -16px; +} +.panel-tool-collapse { + background: url('images/panel_tools.png') no-repeat -32px 0; +} +.panel-tool-expand { + background: url('images/panel_tools.png') no-repeat -32px -16px; +} +.panel-header, +.panel-body { + border-color: #ddd; +} +.panel-header { + background-color: #f5f5f5; +} +.panel-body { + background-color: #ffffff; + color: #404040; + font-size: 12px; +} +.panel-title { + font-size: 12px; + font-weight: bold; + color: #000000; + height: 16px; + line-height: 16px; +} +.panel-footer { + border: 1px solid #ddd; + overflow: hidden; + background: #fafafa; +} +.panel-footer-noborder { + border-width: 1px 0 0 0; +} +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} +.accordion { + overflow: hidden; + border-width: 1px; + border-style: solid; +} +.accordion .accordion-header { + border-width: 0 0 1px; + cursor: pointer; +} +.accordion .accordion-body { + border-width: 0 0 1px; +} +.accordion-noborder { + border-width: 0; +} +.accordion-noborder .accordion-header { + border-width: 0 0 1px; +} +.accordion-noborder .accordion-body { + border-width: 0 0 1px; +} +.accordion-collapse { + background: url('images/accordion_arrows.png') no-repeat 0 0; +} +.accordion-expand { + background: url('images/accordion_arrows.png') no-repeat -16px 0; +} +.accordion { + background: #ffffff; + border-color: #ddd; +} +.accordion .accordion-header { + background: #f5f5f5; + filter: none; +} +.accordion .accordion-header-selected { + background: #00bbee; +} +.accordion .accordion-header-selected .panel-title { + color: #fff; +} +.accordion .panel-last > .accordion-header { + border-bottom-color: #f5f5f5; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #ddd; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #f5f5f5; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #ddd; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #f5f5f5; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #ddd; +} +.window { + overflow: hidden; + padding: 5px; + border-width: 1px; + border-style: solid; +} +.window .window-header { + background: transparent; + padding: 0px 0px 6px 0px; +} +.window .window-body { + border-width: 1px; + border-style: solid; + border-top-width: 0px; +} +.window .window-body-noheader { + border-top-width: 1px; +} +.window .panel-body-nobottom { + border-bottom-width: 0; +} +.window .window-header .panel-icon, +.window .window-header .panel-tool { + top: 50%; + margin-top: -11px; +} +.window .window-header .panel-icon { + left: 1px; +} +.window .window-header .panel-tool { + right: 1px; +} +.window .window-header .panel-with-icon { + padding-left: 18px; +} +.window-proxy { + position: absolute; + overflow: hidden; +} +.window-proxy-mask { + position: absolute; + filter: alpha(opacity=5); + opacity: 0.05; +} +.window-mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + filter: alpha(opacity=40); + opacity: 0.40; + font-size: 1px; + overflow: hidden; +} +.window, +.window-shadow { + position: absolute; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.window-shadow { + background: #fafafa; + -moz-box-shadow: 2px 2px 3px #fafafa; + -webkit-box-shadow: 2px 2px 3px #fafafa; + box-shadow: 2px 2px 3px #fafafa; + filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); +} +.window, +.window .window-body { + border-color: #ddd; +} +.window { + background-color: #f5f5f5; +} +.window-proxy { + border: 1px dashed #ddd; +} +.window-proxy-mask, +.window-mask { + background: #eee; +} +.window .panel-footer { + border: 1px solid #ddd; + position: relative; + top: -1px; +} +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} +.dialog-content { + overflow: auto; +} +.dialog-toolbar { + position: relative; + padding: 2px 5px; +} +.dialog-tool-separator { + float: left; + height: 24px; + border-left: 1px solid #ddd; + border-right: 1px solid #fff; + margin: 2px 1px; +} +.dialog-button { + position: relative; + top: -1px; + padding: 5px; + text-align: right; +} +.dialog-button .l-btn { + margin-left: 5px; +} +.dialog-toolbar, +.dialog-button { + background: #fafafa; + border-width: 1px; + border-style: solid; +} +.dialog-toolbar { + border-color: #ddd #ddd #eee #ddd; +} +.dialog-button { + border-color: #eee #ddd #ddd #ddd; +} +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #fafafa; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} +.l-btn { + text-decoration: none; + display: inline-block; + overflow: hidden; + margin: 0; + padding: 0; + cursor: pointer; + outline: none; + text-align: center; + vertical-align: middle; + line-height: normal; +} +.l-btn-plain { + border-width: 0; + padding: 1px; +} +.l-btn-left { + display: inline-block; + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + vertical-align: top; +} +.l-btn-text { + display: inline-block; + vertical-align: top; + width: auto; + line-height: 24px; + font-size: 12px; + padding: 0; + margin: 0 4px; +} +.l-btn-icon { + display: inline-block; + width: 16px; + height: 16px; + line-height: 16px; + position: absolute; + top: 50%; + margin-top: -8px; + font-size: 1px; +} +.l-btn span span .l-btn-empty { + display: inline-block; + margin: 0; + width: 16px; + height: 24px; + font-size: 1px; + vertical-align: top; +} +.l-btn span .l-btn-icon-left { + padding: 0 0 0 20px; + background-position: left center; +} +.l-btn span .l-btn-icon-right { + padding: 0 20px 0 0; + background-position: right center; +} +.l-btn-icon-left .l-btn-text { + margin: 0 4px 0 24px; +} +.l-btn-icon-left .l-btn-icon { + left: 4px; +} +.l-btn-icon-right .l-btn-text { + margin: 0 24px 0 4px; +} +.l-btn-icon-right .l-btn-icon { + right: 4px; +} +.l-btn-icon-top .l-btn-text { + margin: 20px 4px 0 4px; +} +.l-btn-icon-top .l-btn-icon { + top: 4px; + left: 50%; + margin: 0 0 0 -8px; +} +.l-btn-icon-bottom .l-btn-text { + margin: 0 4px 20px 4px; +} +.l-btn-icon-bottom .l-btn-icon { + top: auto; + bottom: 4px; + left: 50%; + margin: 0 0 0 -8px; +} +.l-btn-left .l-btn-empty { + margin: 0 4px; + width: 16px; +} +.l-btn-plain:hover { + padding: 0; +} +.l-btn-focus { + outline: #0000FF dotted thin; +} +.l-btn-large .l-btn-text { + line-height: 40px; +} +.l-btn-large .l-btn-icon { + width: 32px; + height: 32px; + line-height: 32px; + margin-top: -16px; +} +.l-btn-large .l-btn-icon-left .l-btn-text { + margin-left: 40px; +} +.l-btn-large .l-btn-icon-right .l-btn-text { + margin-right: 40px; +} +.l-btn-large .l-btn-icon-top .l-btn-text { + margin-top: 36px; + line-height: 24px; + min-width: 32px; +} +.l-btn-large .l-btn-icon-top .l-btn-icon { + margin: 0 0 0 -16px; +} +.l-btn-large .l-btn-icon-bottom .l-btn-text { + margin-bottom: 36px; + line-height: 24px; + min-width: 32px; +} +.l-btn-large .l-btn-icon-bottom .l-btn-icon { + margin: 0 0 0 -16px; +} +.l-btn-large .l-btn-left .l-btn-empty { + margin: 0 4px; + width: 32px; +} +.l-btn { + color: #404040; + background: #fafafa; + background-repeat: repeat-x; + border: 1px solid #d9d9d9; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.l-btn:hover { + background: #eee; + color: #404040; + border: 1px solid #ccc; + filter: none; +} +.l-btn-plain { + background: transparent; + border-width: 0; + filter: none; +} +.l-btn-outline { + border-width: 1px; + border-color: #ccc; + padding: 0; +} +.l-btn-plain:hover { + background: #eee; + color: #404040; + border: 1px solid #ccc; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.l-btn-disabled, +.l-btn-disabled:hover { + opacity: 0.5; + cursor: default; + background: #fafafa; + color: #404040; +} +.l-btn-disabled .l-btn-text, +.l-btn-disabled .l-btn-icon { + filter: alpha(opacity=50); +} +.l-btn-plain-disabled, +.l-btn-plain-disabled:hover { + background: transparent; + filter: alpha(opacity=50); +} +.l-btn-selected, +.l-btn-selected:hover { + background: #00bbee; + filter: none; +} +.l-btn-plain-selected, +.l-btn-plain-selected:hover { + background: #00bbee; +} +.textbox { + position: relative; + border: 1px solid #ddd; + background-color: #fff; + vertical-align: middle; + display: inline-block; + overflow: hidden; + white-space: nowrap; + margin: 0; + padding: 0; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.textbox .textbox-text { + font-size: 12px; + border: 0; + margin: 0; + padding: 4px; + white-space: normal; + vertical-align: top; + outline-style: none; + resize: none; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} +.textbox .textbox-prompt { + font-size: 12px; + color: #aaa; +} +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { + position: absolute; + top: 0; + padding: 0; + vertical-align: top; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; + border-width: 0 0 0 1px; +} +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; + border-width: 0 1px 0 0; +} +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} +.textbox-addon { + position: absolute; + top: 0; +} +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} +.textbox-icon { + display: inline-block; + width: 18px; + height: 20px; + overflow: hidden; + vertical-align: top; + background-position: center center; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); + text-decoration: none; + outline-style: none; +} +.textbox-icon-disabled, +.textbox-icon-readonly { + cursor: default; +} +.textbox-icon:hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.textbox-icon-disabled:hover { + opacity: 0.6; + filter: alpha(opacity=60); +} +.textbox-focused { + border-color: #c4c4c4; + -moz-box-shadow: 0 0 3px 0 #ddd; + -webkit-box-shadow: 0 0 3px 0 #ddd; + box-shadow: 0 0 3px 0 #ddd; +} +.textbox-invalid { + border-color: #ffa8a8; + background-color: #fff; +} +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} +.filebox .textbox-value { + vertical-align: top; + position: absolute; + top: 0; + left: -5000px; +} +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} +.combo-arrow { + width: 18px; + height: 20px; + overflow: hidden; + display: inline-block; + vertical-align: top; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.combo-arrow-hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.combo-panel { + overflow: auto; +} +.combo-arrow { + background: url('images/combo_arrow.png') no-repeat center center; +} +.combo-panel { + background-color: #ffffff; +} +.combo-arrow { + background-color: #f5f5f5; +} +.combo-arrow-hover { + background-color: #eee; +} +.combo-arrow:hover { + background-color: #eee; +} +.combo .textbox-icon-disabled:hover { + cursor: default; +} +.combobox-item, +.combobox-group, +.combobox-stick { + font-size: 12px; + padding: 3px; +} +.combobox-item-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.combobox-gitem { + padding-left: 10px; +} +.combobox-group, +.combobox-stick { + font-weight: bold; +} +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} +.combobox-item-hover { + background-color: #eee; + color: #404040; +} +.combobox-item-selected { + background-color: #00bbee; + color: #fff; +} +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; + background: #eee; + color: #404040; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} +.layout { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + z-index: 0; +} +.layout-panel { + position: absolute; + overflow: hidden; +} +.layout-body { + min-width: 1px; + min-height: 1px; +} +.layout-panel-east, +.layout-panel-west { + z-index: 2; +} +.layout-panel-north, +.layout-panel-south { + z-index: 3; +} +.layout-expand { + position: absolute; + padding: 0px; + font-size: 1px; + cursor: pointer; + z-index: 1; +} +.layout-expand .panel-header, +.layout-expand .panel-body { + background: transparent; + filter: none; + overflow: hidden; +} +.layout-expand .panel-header { + border-bottom-width: 0px; +} +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} +.layout-split-proxy-h, +.layout-split-proxy-v { + position: absolute; + font-size: 1px; + display: none; + z-index: 5; +} +.layout-split-proxy-h { + width: 5px; + cursor: e-resize; +} +.layout-split-proxy-v { + height: 5px; + cursor: n-resize; +} +.layout-mask { + position: absolute; + background: #fafafa; + filter: alpha(opacity=10); + opacity: 0.10; + z-index: 4; +} +.layout-button-up { + background: url('images/layout_arrows.png') no-repeat -16px -16px; +} +.layout-button-down { + background: url('images/layout_arrows.png') no-repeat -16px 0; +} +.layout-button-left { + background: url('images/layout_arrows.png') no-repeat 0 0; +} +.layout-button-right { + background: url('images/layout_arrows.png') no-repeat 0 -16px; +} +.layout-split-proxy-h, +.layout-split-proxy-v { + background-color: #ccc; +} +.layout-split-north { + border-bottom: 5px solid #ffffff; +} +.layout-split-south { + border-top: 5px solid #ffffff; +} +.layout-split-east { + border-left: 5px solid #ffffff; +} +.layout-split-west { + border-right: 5px solid #ffffff; +} +.layout-expand { + background-color: #f5f5f5; +} +.layout-expand-over { + background-color: #f5f5f5; +} +.tabs-container { + overflow: hidden; +} +.tabs-header { + border-width: 1px; + border-style: solid; + border-bottom-width: 0; + position: relative; + padding: 0; + padding-top: 2px; + overflow: hidden; +} +.tabs-scroller-left, +.tabs-scroller-right { + position: absolute; + top: auto; + bottom: 0; + width: 18px; + font-size: 1px; + display: none; + cursor: pointer; + border-width: 1px; + border-style: solid; +} +.tabs-scroller-left { + left: 0; +} +.tabs-scroller-right { + right: 0; +} +.tabs-tool { + position: absolute; + bottom: 0; + padding: 1px; + overflow: hidden; + border-width: 1px; + border-style: solid; +} +.tabs-header-plain .tabs-tool { + padding: 0 1px; +} +.tabs-wrap { + position: relative; + left: 0; + overflow: hidden; + width: 100%; + margin: 0; + padding: 0; +} +.tabs-scrolling { + margin-left: 18px; + margin-right: 18px; +} +.tabs-disabled { + opacity: 0.3; + filter: alpha(opacity=30); +} +.tabs { + list-style-type: none; + height: 26px; + margin: 0px; + padding: 0px; + padding-left: 4px; + width: 50000px; + border-style: solid; + border-width: 0 0 1px 0; +} +.tabs li { + float: left; + display: inline-block; + margin: 0 4px -1px 0; + padding: 0; + position: relative; + border: 0; +} +.tabs li a.tabs-inner { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0 10px; + height: 25px; + line-height: 25px; + text-align: center; + white-space: nowrap; + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.tabs li.tabs-selected a.tabs-inner { + font-weight: bold; + outline: none; +} +.tabs li.tabs-selected a:hover.tabs-inner { + cursor: default; + pointer: default; +} +.tabs li a.tabs-close, +.tabs-p-tool { + position: absolute; + font-size: 1px; + display: block; + height: 12px; + padding: 0; + top: 50%; + margin-top: -6px; + overflow: hidden; +} +.tabs li a.tabs-close { + width: 12px; + right: 5px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tabs-p-tool { + right: 16px; +} +.tabs-p-tool a { + display: inline-block; + font-size: 1px; + width: 12px; + height: 12px; + margin: 0; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tabs li a:hover.tabs-close, +.tabs-p-tool a:hover { + opacity: 1; + filter: alpha(opacity=100); + cursor: hand; + cursor: pointer; +} +.tabs-with-icon { + padding-left: 18px; +} +.tabs-icon { + position: absolute; + width: 16px; + height: 16px; + left: 10px; + top: 50%; + margin-top: -8px; +} +.tabs-title { + font-size: 12px; +} +.tabs-closable { + padding-right: 8px; +} +.tabs-panels { + margin: 0px; + padding: 0px; + border-width: 1px; + border-style: solid; + border-top-width: 0; + overflow: hidden; +} +.tabs-header-bottom { + border-width: 0 1px 1px 1px; + padding: 0 0 2px 0; +} +.tabs-header-bottom .tabs { + border-width: 1px 0 0 0; +} +.tabs-header-bottom .tabs li { + margin: -1px 4px 0 0; +} +.tabs-header-bottom .tabs li a.tabs-inner { + -moz-border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.tabs-header-bottom .tabs-tool { + top: 0; +} +.tabs-header-bottom .tabs-scroller-left, +.tabs-header-bottom .tabs-scroller-right { + top: 0; + bottom: auto; +} +.tabs-panels-top { + border-width: 1px 1px 0 1px; +} +.tabs-header-left { + float: left; + border-width: 1px 0 1px 1px; + padding: 0; +} +.tabs-header-right { + float: right; + border-width: 1px 1px 1px 0; + padding: 0; +} +.tabs-header-left .tabs-wrap, +.tabs-header-right .tabs-wrap { + height: 100%; +} +.tabs-header-left .tabs { + height: 100%; + padding: 4px 0 0 2px; + border-width: 0 1px 0 0; +} +.tabs-header-right .tabs { + height: 100%; + padding: 4px 2px 0 0; + border-width: 0 0 0 1px; +} +.tabs-header-left .tabs li, +.tabs-header-right .tabs li { + display: block; + width: 100%; + position: relative; +} +.tabs-header-left .tabs li { + left: auto; + right: 0; + margin: 0 -1px 4px 0; + float: right; +} +.tabs-header-right .tabs li { + left: 0; + right: auto; + margin: 0 0 4px -1px; + float: left; +} +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} +.tabs-header-left .tabs li a.tabs-inner { + display: block; + text-align: left; + padding-left: 10px; + padding-right: 10px; + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.tabs-header-right .tabs li a.tabs-inner { + display: block; + text-align: left; + padding-left: 10px; + padding-right: 10px; + -moz-border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.tabs-panels-right { + float: right; + border-width: 1px 1px 1px 0; +} +.tabs-panels-left { + float: left; + border-width: 1px 0 1px 1px; +} +.tabs-header-noborder, +.tabs-panels-noborder { + border: 0px; +} +.tabs-header-plain { + border: 0px; + background: transparent; +} +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} +.tabs-scroller-left { + background: #f5f5f5 url('images/tabs_icons.png') no-repeat 1px center; +} +.tabs-scroller-right { + background: #f5f5f5 url('images/tabs_icons.png') no-repeat -15px center; +} +.tabs li a.tabs-close { + background: url('images/tabs_icons.png') no-repeat -34px center; +} +.tabs li a.tabs-inner:hover { + background: #eee; + color: #404040; + filter: none; +} +.tabs li.tabs-selected a.tabs-inner { + background-color: #ffffff; + color: #000000; +} +.tabs li a.tabs-inner { + color: #000000; + background-color: #f5f5f5; +} +.tabs-header, +.tabs-tool { + background-color: #f5f5f5; +} +.tabs-header-plain { + background: transparent; +} +.tabs-header, +.tabs-scroller-left, +.tabs-scroller-right, +.tabs-tool, +.tabs, +.tabs-panels, +.tabs li a.tabs-inner, +.tabs li.tabs-selected a.tabs-inner, +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, +.tabs-header-left .tabs li.tabs-selected a.tabs-inner, +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + border-color: #ddd; +} +.tabs-p-tool a:hover, +.tabs li a:hover.tabs-close, +.tabs-scroller-over { + background-color: #eee; +} +.tabs li.tabs-selected a.tabs-inner { + border-bottom: 1px solid #ffffff; +} +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { + border-top: 1px solid #ffffff; +} +.tabs-header-left .tabs li.tabs-selected a.tabs-inner { + border-right: 1px solid #ffffff; +} +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + border-left: 1px solid #ffffff; +} +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #00bbee; + color: #fff; + filter: none; + border-color: #ddd; +} +.datagrid .panel-body { + overflow: hidden; + position: relative; +} +.datagrid-view { + position: relative; + overflow: hidden; +} +.datagrid-view1, +.datagrid-view2 { + position: absolute; + overflow: hidden; + top: 0; +} +.datagrid-view1 { + left: 0; +} +.datagrid-view2 { + right: 0; +} +.datagrid-mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0.3; + filter: alpha(opacity=30); + display: none; +} +.datagrid-mask-msg { + position: absolute; + top: 50%; + margin-top: -20px; + padding: 10px 5px 10px 30px; + width: auto; + height: 16px; + border-width: 2px; + border-style: solid; + display: none; +} +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} +.datagrid-sort-icon { + padding: 0; + display: none; +} +.datagrid-toolbar { + height: auto; + padding: 1px 2px; + border-width: 0 0 1px 0; + border-style: solid; +} +.datagrid-btn-separator { + float: left; + height: 24px; + border-left: 1px solid #ddd; + border-right: 1px solid #fff; + margin: 2px 1px; +} +.datagrid .datagrid-pager { + display: block; + margin: 0; + border-width: 1px 0 0 0; + border-style: solid; +} +.datagrid .datagrid-pager-top { + border-width: 0 0 1px 0; +} +.datagrid-header { + overflow: hidden; + cursor: default; + border-width: 0 0 1px 0; + border-style: solid; +} +.datagrid-header-inner { + float: left; + width: 10000px; +} +.datagrid-header-row, +.datagrid-row { + height: 25px; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-width: 0 1px 1px 0; + border-style: dotted; + margin: 0; + padding: 0; +} +.datagrid-cell, +.datagrid-cell-group, +.datagrid-header-rownumber, +.datagrid-cell-rownumber { + margin: 0; + padding: 0 4px; + white-space: nowrap; + word-wrap: normal; + overflow: hidden; + height: 18px; + line-height: 18px; + font-size: 12px; +} +.datagrid-header .datagrid-cell { + height: auto; +} +.datagrid-header .datagrid-cell span { + font-size: 12px; +} +.datagrid-cell-group { + text-align: center; + text-overflow: ellipsis; +} +.datagrid-header-rownumber, +.datagrid-cell-rownumber { + width: 30px; + text-align: center; + margin: 0; + padding: 0; +} +.datagrid-body { + margin: 0; + padding: 0; + overflow: auto; + zoom: 1; +} +.datagrid-view1 .datagrid-body-inner { + padding-bottom: 20px; +} +.datagrid-view1 .datagrid-body { + overflow: hidden; +} +.datagrid-footer { + overflow: hidden; +} +.datagrid-footer-inner { + border-width: 1px 0 0 0; + border-style: solid; + width: 10000px; + float: left; +} +.datagrid-row-editing .datagrid-cell { + height: auto; +} +.datagrid-header-check, +.datagrid-cell-check { + padding: 0; + width: 27px; + height: 18px; + font-size: 1px; + text-align: center; + overflow: hidden; +} +.datagrid-header-check input, +.datagrid-cell-check input { + margin: 0; + padding: 0; + width: 15px; + height: 18px; +} +.datagrid-resize-proxy { + position: absolute; + width: 1px; + height: 10000px; + top: 0; + cursor: e-resize; + display: none; +} +.datagrid-body .datagrid-editable { + margin: 0; + padding: 0; +} +.datagrid-body .datagrid-editable table { + width: 100%; + height: 100%; +} +.datagrid-body .datagrid-editable td { + border: 0; + margin: 0; + padding: 0; +} +.datagrid-view .datagrid-editable-input { + margin: 0; + padding: 2px 4px; + border: 1px solid #ddd; + font-size: 12px; + outline-style: none; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} +.datagrid-sort-desc .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -16px center; +} +.datagrid-sort-asc .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat 0px center; +} +.datagrid-row-collapse { + background: url('images/datagrid_icons.png') no-repeat -48px center; +} +.datagrid-row-expand { + background: url('images/datagrid_icons.png') no-repeat -32px center; +} +.datagrid-mask-msg { + background: #ffffff url('images/loading.gif') no-repeat scroll 5px center; +} +.datagrid-header, +.datagrid-td-rownumber { + background-color: #fafafa; +} +.datagrid-cell-rownumber { + color: #404040; +} +.datagrid-resize-proxy { + background: #ccc; +} +.datagrid-mask { + background: #eee; +} +.datagrid-mask-msg { + border-color: #ddd; +} +.datagrid-toolbar, +.datagrid-pager { + background: #fafafa; +} +.datagrid-header, +.datagrid-toolbar, +.datagrid-pager, +.datagrid-footer-inner { + border-color: #eee; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-color: #ebebeb; +} +.datagrid-htable, +.datagrid-btable, +.datagrid-ftable { + color: #404040; + border-collapse: separate; +} +.datagrid-row-alt { + background: #f9f9f9; +} +.datagrid-row-over, +.datagrid-header td.datagrid-header-over { + background: #eee; + color: #404040; + cursor: default; +} +.datagrid-row-selected { + background: #00bbee; + color: #fff; +} +.datagrid-row-editing .textbox, +.datagrid-row-editing .textbox-text { + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.propertygrid .datagrid-view1 .datagrid-body td { + padding-bottom: 1px; + border-width: 0 1px 0 0; +} +.propertygrid .datagrid-group { + height: 21px; + overflow: hidden; + border-width: 0 0 1px 0; + border-style: solid; +} +.propertygrid .datagrid-group span { + font-weight: bold; +} +.propertygrid .datagrid-view1 .datagrid-body td { + border-color: #eee; +} +.propertygrid .datagrid-view1 .datagrid-group { + border-color: #f5f5f5; +} +.propertygrid .datagrid-view2 .datagrid-group { + border-color: #eee; +} +.propertygrid .datagrid-group, +.propertygrid .datagrid-view1 .datagrid-body, +.propertygrid .datagrid-view1 .datagrid-row-over, +.propertygrid .datagrid-view1 .datagrid-row-selected { + background: #f5f5f5; +} +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #fafafa; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ebebeb; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #404040; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ebebeb; +} +.m-list li>a:hover { + background: #eee; + color: #404040; +} +.m-list .m-list-group { + padding: 0 4px; +} +.pagination { + zoom: 1; +} +.pagination table { + float: left; + height: 30px; +} +.pagination td { + border: 0; +} +.pagination-btn-separator { + float: left; + height: 24px; + border-left: 1px solid #ddd; + border-right: 1px solid #fff; + margin: 3px 1px; +} +.pagination .pagination-num { + border-width: 1px; + border-style: solid; + margin: 0 2px; + padding: 2px; + width: 2em; + height: auto; +} +.pagination-page-list { + margin: 0px 6px; + padding: 1px 2px; + width: auto; + height: auto; + border-width: 1px; + border-style: solid; +} +.pagination-info { + float: right; + margin: 0 6px; + padding: 0; + height: 30px; + line-height: 30px; + font-size: 12px; +} +.pagination span { + font-size: 12px; +} +.pagination-link .l-btn-text { + width: 24px; + text-align: center; + margin: 0; +} +.pagination-first { + background: url('images/pagination_icons.png') no-repeat 0 center; +} +.pagination-prev { + background: url('images/pagination_icons.png') no-repeat -16px center; +} +.pagination-next { + background: url('images/pagination_icons.png') no-repeat -32px center; +} +.pagination-last { + background: url('images/pagination_icons.png') no-repeat -48px center; +} +.pagination-load { + background: url('images/pagination_icons.png') no-repeat -64px center; +} +.pagination-loading { + background: url('images/loading.gif') no-repeat center center; +} +.pagination-page-list, +.pagination .pagination-num { + border-color: #ddd; +} +.calendar { + border-width: 1px; + border-style: solid; + padding: 1px; + overflow: hidden; +} +.calendar table { + table-layout: fixed; + border-collapse: separate; + font-size: 12px; + width: 100%; + height: 100%; +} +.calendar table td, +.calendar table th { + font-size: 12px; +} +.calendar-noborder { + border: 0; +} +.calendar-header { + position: relative; + height: 22px; +} +.calendar-title { + text-align: center; + height: 22px; +} +.calendar-title span { + position: relative; + display: inline-block; + top: 2px; + padding: 0 3px; + height: 18px; + line-height: 18px; + font-size: 12px; + cursor: pointer; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-prevmonth, +.calendar-nextmonth, +.calendar-prevyear, +.calendar-nextyear { + position: absolute; + top: 50%; + margin-top: -7px; + width: 14px; + height: 14px; + cursor: pointer; + font-size: 1px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-prevmonth { + left: 20px; + background: url('images/calendar_arrows.png') no-repeat -18px -2px; +} +.calendar-nextmonth { + right: 20px; + background: url('images/calendar_arrows.png') no-repeat -34px -2px; +} +.calendar-prevyear { + left: 3px; + background: url('images/calendar_arrows.png') no-repeat -1px -2px; +} +.calendar-nextyear { + right: 3px; + background: url('images/calendar_arrows.png') no-repeat -49px -2px; +} +.calendar-body { + position: relative; +} +.calendar-body th, +.calendar-body td { + text-align: center; +} +.calendar-day { + border: 0; + padding: 1px; + cursor: pointer; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-other-month { + opacity: 0.3; + filter: alpha(opacity=30); +} +.calendar-disabled { + opacity: 0.6; + filter: alpha(opacity=60); + cursor: default; +} +.calendar-menu { + position: absolute; + top: 0; + left: 0; + width: 180px; + height: 150px; + padding: 5px; + font-size: 12px; + display: none; + overflow: hidden; +} +.calendar-menu-year-inner { + text-align: center; + padding-bottom: 5px; +} +.calendar-menu-year { + width: 50px; + text-align: center; + border-width: 1px; + border-style: solid; + outline-style: none; + resize: none; + margin: 0; + padding: 2px; + font-weight: bold; + font-size: 12px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-menu-prev, +.calendar-menu-next { + display: inline-block; + width: 21px; + height: 21px; + vertical-align: top; + cursor: pointer; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-menu-prev { + margin-right: 10px; + background: url('images/calendar_arrows.png') no-repeat 2px 2px; +} +.calendar-menu-next { + margin-left: 10px; + background: url('images/calendar_arrows.png') no-repeat -45px 2px; +} +.calendar-menu-month { + text-align: center; + cursor: pointer; + font-weight: bold; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.calendar-body th, +.calendar-menu-month { + color: #8d8d8d; +} +.calendar-day { + color: #404040; +} +.calendar-sunday { + color: #CC2222; +} +.calendar-saturday { + color: #00ee00; +} +.calendar-today { + color: #0000ff; +} +.calendar-menu-year { + border-color: #ddd; +} +.calendar { + border-color: #ddd; +} +.calendar-header { + background: #f5f5f5; +} +.calendar-body, +.calendar-menu { + background: #ffffff; +} +.calendar-body th { + background: #fafafa; + padding: 2px 0; +} +.calendar-hover, +.calendar-nav-hover, +.calendar-menu-hover { + background-color: #eee; + color: #404040; +} +.calendar-hover { + border: 1px solid #ccc; + padding: 0; +} +.calendar-selected { + background-color: #00bbee; + color: #fff; + border: 1px solid #9cc8f7; + padding: 0; +} +.datebox-calendar-inner { + height: 180px; +} +.datebox-button { + padding: 0 5px; + text-align: center; +} +.datebox-button a { + line-height: 22px; + font-size: 12px; + font-weight: bold; + text-decoration: none; + opacity: 0.6; + filter: alpha(opacity=60); +} +.datebox-button a:hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.datebox-current, +.datebox-close { + float: left; +} +.datebox-close { + float: right; +} +.datebox .combo-arrow { + background-image: url('images/datebox_arrow.png'); + background-position: center center; +} +.datebox-button { + background-color: #fafafa; +} +.datebox-button a { + color: #404040; +} +.spinner-arrow { + background-color: #f5f5f5; + display: inline-block; + overflow: hidden; + vertical-align: top; + margin: 0; + padding: 0; + opacity: 1.0; + filter: alpha(opacity=100); + width: 18px; +} +.spinner-arrow-up, +.spinner-arrow-down { + opacity: 0.6; + filter: alpha(opacity=60); + display: block; + font-size: 1px; + width: 18px; + height: 10px; + width: 100%; + height: 50%; + color: #404040; + outline-style: none; +} +.spinner-arrow-hover { + background-color: #eee; + opacity: 1.0; + filter: alpha(opacity=100); +} +.spinner-arrow-up:hover, +.spinner-arrow-down:hover { + opacity: 1.0; + filter: alpha(opacity=100); + background-color: #eee; +} +.textbox-icon-disabled .spinner-arrow-up:hover, +.textbox-icon-disabled .spinner-arrow-down:hover { + opacity: 0.6; + filter: alpha(opacity=60); + background-color: #f5f5f5; + cursor: default; +} +.spinner .textbox-icon-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} +.spinner-arrow-up { + background: url('images/spinner_arrows.png') no-repeat 1px center; +} +.spinner-arrow-down { + background: url('images/spinner_arrows.png') no-repeat -15px center; +} +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; +} +.progressbar { + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; + overflow: hidden; + position: relative; +} +.progressbar-text { + text-align: center; + position: absolute; +} +.progressbar-value { + position: relative; + overflow: hidden; + width: 0; + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.progressbar { + border-color: #ddd; +} +.progressbar-text { + color: #404040; + font-size: 12px; +} +.progressbar-value .progressbar-text { + background-color: #00bbee; + color: #fff; +} +.searchbox-button { + width: 18px; + height: 20px; + overflow: hidden; + display: inline-block; + vertical-align: top; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.searchbox-button-hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.searchbox .l-btn-plain { + border: 0; + padding: 0; + vertical-align: top; + opacity: 0.6; + filter: alpha(opacity=60); + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox .l-btn-plain:hover { + border: 0; + padding: 0; + opacity: 1.0; + filter: alpha(opacity=100); + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox a.m-btn-plain-active { + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox .m-btn-active { + border-width: 0 1px 0 0; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox .textbox-button-right { + border-width: 0 0 0 1px; +} +.searchbox .textbox-button-left { + border-width: 0 1px 0 0; +} +.searchbox-button { + background: url('images/searchbox_button.png') no-repeat center center; +} +.searchbox .l-btn-plain { + background: #f5f5f5; +} +.searchbox .l-btn-plain-disabled, +.searchbox .l-btn-plain-disabled:hover { + opacity: 0.5; + filter: alpha(opacity=50); +} +.slider-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.slider-h { + height: 22px; +} +.slider-v { + width: 22px; +} +.slider-inner { + position: relative; + height: 6px; + top: 7px; + border-width: 1px; + border-style: solid; + border-radius: 4px; +} +.slider-handle { + position: absolute; + display: block; + outline: none; + width: 20px; + height: 20px; + top: 50%; + margin-top: -10px; + margin-left: -10px; +} +.slider-tip { + position: absolute; + display: inline-block; + line-height: 12px; + font-size: 12px; + white-space: nowrap; + top: -22px; +} +.slider-rule { + position: relative; + top: 15px; +} +.slider-rule span { + position: absolute; + display: inline-block; + font-size: 0; + height: 5px; + border-width: 0 0 0 1px; + border-style: solid; +} +.slider-rulelabel { + position: relative; + top: 20px; +} +.slider-rulelabel span { + position: absolute; + display: inline-block; + font-size: 12px; +} +.slider-v .slider-inner { + width: 6px; + left: 7px; + top: 0; + float: left; +} +.slider-v .slider-handle { + left: 50%; + margin-top: -10px; +} +.slider-v .slider-tip { + left: -10px; + margin-top: -6px; +} +.slider-v .slider-rule { + float: left; + top: 0; + left: 16px; +} +.slider-v .slider-rule span { + width: 5px; + height: 'auto'; + border-left: 0; + border-width: 1px 0 0 0; + border-style: solid; +} +.slider-v .slider-rulelabel { + float: left; + top: 0; + left: 23px; +} +.slider-handle { + background: url('images/slider_handle.png') no-repeat; +} +.slider-inner { + border-color: #ddd; + background: #f5f5f5; +} +.slider-rule span { + border-color: #ddd; +} +.slider-rulelabel span { + color: #404040; +} +.menu { + position: absolute; + margin: 0; + padding: 2px; + border-width: 1px; + border-style: solid; + overflow: hidden; +} +.menu-inline { + position: relative; +} +.menu-item { + position: relative; + margin: 0; + padding: 0; + overflow: hidden; + white-space: nowrap; + cursor: pointer; + border-width: 1px; + border-style: solid; +} +.menu-text { + height: 20px; + line-height: 20px; + float: left; + padding-left: 28px; +} +.menu-icon { + position: absolute; + width: 16px; + height: 16px; + left: 2px; + top: 50%; + margin-top: -8px; +} +.menu-rightarrow { + position: absolute; + width: 16px; + height: 16px; + right: 0; + top: 50%; + margin-top: -8px; +} +.menu-line { + position: absolute; + left: 26px; + top: 0; + height: 2000px; + font-size: 1px; +} +.menu-sep { + margin: 3px 0px 3px 25px; + font-size: 1px; +} +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} +.menu-active { + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.menu-item-disabled { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default; +} +.menu-text, +.menu-text span { + font-size: 12px; +} +.menu-shadow { + position: absolute; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; + background: #fafafa; + -moz-box-shadow: 2px 2px 3px #fafafa; + -webkit-box-shadow: 2px 2px 3px #fafafa; + box-shadow: 2px 2px 3px #fafafa; + filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); +} +.menu-rightarrow { + background: url('images/menu_arrows.png') no-repeat -32px center; +} +.menu-line { + border-left: 1px solid #ddd; + border-right: 1px solid #fff; +} +.menu-sep { + border-top: 1px solid #ddd; + border-bottom: 1px solid #fff; +} +.menu { + background-color: #fff; + border-color: #eee; + color: #404040; +} +.menu-content { + background: #ffffff; +} +.menu-item { + border-color: transparent; + _border-color: #fff; +} +.menu-active { + border-color: #ccc; + color: #404040; + background: #eee; +} +.menu-active-disabled { + border-color: transparent; + background: transparent; + color: #404040; +} +.m-btn-downarrow, +.s-btn-downarrow { + display: inline-block; + position: absolute; + width: 16px; + height: 16px; + font-size: 1px; + right: 0; + top: 50%; + margin-top: -8px; +} +.m-btn-active, +.s-btn-active { + background: #eee; + color: #404040; + border: 1px solid #ccc; + filter: none; +} +.m-btn-plain-active, +.s-btn-plain-active { + background: transparent; + padding: 0; + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.m-btn .l-btn-left .l-btn-text { + margin-right: 20px; +} +.m-btn .l-btn-icon-right .l-btn-text { + margin-right: 40px; +} +.m-btn .l-btn-icon-right .l-btn-icon { + right: 20px; +} +.m-btn .l-btn-icon-top .l-btn-text { + margin-right: 4px; + margin-bottom: 14px; +} +.m-btn .l-btn-icon-bottom .l-btn-text { + margin-right: 4px; + margin-bottom: 34px; +} +.m-btn .l-btn-icon-bottom .l-btn-icon { + top: auto; + bottom: 20px; +} +.m-btn .l-btn-icon-top .m-btn-downarrow, +.m-btn .l-btn-icon-bottom .m-btn-downarrow { + top: auto; + bottom: 0px; + left: 50%; + margin-left: -8px; +} +.m-btn-line { + display: inline-block; + position: absolute; + font-size: 1px; + display: none; +} +.m-btn .l-btn-left .m-btn-line { + right: 0; + width: 16px; + height: 500px; + border-style: solid; + border-color: #ccc; + border-width: 0 0 0 1px; +} +.m-btn .l-btn-icon-top .m-btn-line, +.m-btn .l-btn-icon-bottom .m-btn-line { + left: 0; + bottom: 0; + width: 500px; + height: 16px; + border-width: 1px 0 0 0; +} +.m-btn-large .l-btn-icon-right .l-btn-text { + margin-right: 56px; +} +.m-btn-large .l-btn-icon-bottom .l-btn-text { + margin-bottom: 50px; +} +.m-btn-downarrow, +.s-btn-downarrow { + background: url('images/menu_arrows.png') no-repeat 0 center; +} +.m-btn-plain-active, +.s-btn-plain-active { + border-color: #ccc; + background-color: #eee; + color: #404040; +} +.s-btn:hover .m-btn-line, +.s-btn-active .m-btn-line, +.s-btn-plain-active .m-btn-line { + display: inline-block; +} +.l-btn:hover .s-btn-downarrow, +.s-btn-active .s-btn-downarrow, +.s-btn-plain-active .s-btn-downarrow { + border-style: solid; + border-color: #ccc; + border-width: 0 0 0 1px; +} +.messager-body { + padding: 10px 10px 30px 10px; + overflow: auto; +} +.messager-button { + text-align: center; + padding: 5px; +} +.messager-button .l-btn { + width: 70px; +} +.messager-icon { + float: left; + width: 32px; + height: 32px; + margin: 0 10px 10px 0; +} +.messager-error { + background: url('images/messager_icons.png') no-repeat scroll -64px 0; +} +.messager-info { + background: url('images/messager_icons.png') no-repeat scroll 0 0; +} +.messager-question { + background: url('images/messager_icons.png') no-repeat scroll -32px 0; +} +.messager-warning { + background: url('images/messager_icons.png') no-repeat scroll -96px 0; +} +.messager-progress { + padding: 10px; +} +.messager-p-msg { + margin-bottom: 5px; +} +.messager-body .messager-input { + width: 100%; + padding: 4px 0; + outline-style: none; + border: 1px solid #ddd; +} +.window-thinborder .messager-button { + padding-bottom: 8px; +} +.tree { + margin: 0; + padding: 0; + list-style-type: none; +} +.tree li { + white-space: nowrap; +} +.tree li ul { + list-style-type: none; + margin: 0; + padding: 0; +} +.tree-node { + height: 18px; + white-space: nowrap; + cursor: pointer; +} +.tree-hit { + cursor: pointer; +} +.tree-expanded, +.tree-collapsed, +.tree-folder, +.tree-file, +.tree-checkbox, +.tree-indent { + display: inline-block; + width: 16px; + height: 18px; + vertical-align: top; + overflow: hidden; +} +.tree-expanded { + background: url('images/tree_icons.png') no-repeat -18px 0px; +} +.tree-expanded-hover { + background: url('images/tree_icons.png') no-repeat -50px 0px; +} +.tree-collapsed { + background: url('images/tree_icons.png') no-repeat 0px 0px; +} +.tree-collapsed-hover { + background: url('images/tree_icons.png') no-repeat -32px 0px; +} +.tree-lines .tree-expanded, +.tree-lines .tree-root-first .tree-expanded { + background: url('images/tree_icons.png') no-repeat -144px 0; +} +.tree-lines .tree-collapsed, +.tree-lines .tree-root-first .tree-collapsed { + background: url('images/tree_icons.png') no-repeat -128px 0; +} +.tree-lines .tree-node-last .tree-expanded, +.tree-lines .tree-root-one .tree-expanded { + background: url('images/tree_icons.png') no-repeat -80px 0; +} +.tree-lines .tree-node-last .tree-collapsed, +.tree-lines .tree-root-one .tree-collapsed { + background: url('images/tree_icons.png') no-repeat -64px 0; +} +.tree-line { + background: url('images/tree_icons.png') no-repeat -176px 0; +} +.tree-join { + background: url('images/tree_icons.png') no-repeat -192px 0; +} +.tree-joinbottom { + background: url('images/tree_icons.png') no-repeat -160px 0; +} +.tree-folder { + background: url('images/tree_icons.png') no-repeat -208px 0; +} +.tree-folder-open { + background: url('images/tree_icons.png') no-repeat -224px 0; +} +.tree-file { + background: url('images/tree_icons.png') no-repeat -240px 0; +} +.tree-loading { + background: url('images/loading.gif') no-repeat center center; +} +.tree-checkbox0 { + background: url('images/tree_icons.png') no-repeat -208px -18px; +} +.tree-checkbox1 { + background: url('images/tree_icons.png') no-repeat -224px -18px; +} +.tree-checkbox2 { + background: url('images/tree_icons.png') no-repeat -240px -18px; +} +.tree-title { + font-size: 12px; + display: inline-block; + text-decoration: none; + vertical-align: top; + white-space: nowrap; + padding: 0 2px; + height: 18px; + line-height: 18px; +} +.tree-node-proxy { + font-size: 12px; + line-height: 20px; + padding: 0 2px 0 20px; + border-width: 1px; + border-style: solid; + z-index: 9900000; +} +.tree-dnd-icon { + display: inline-block; + position: absolute; + width: 16px; + height: 18px; + left: 2px; + top: 50%; + margin-top: -9px; +} +.tree-dnd-yes { + background: url('images/tree_icons.png') no-repeat -256px 0; +} +.tree-dnd-no { + background: url('images/tree_icons.png') no-repeat -256px -18px; +} +.tree-node-top { + border-top: 1px dotted red; +} +.tree-node-bottom { + border-bottom: 1px dotted red; +} +.tree-node-append .tree-title { + border: 1px dotted red; +} +.tree-editor { + border: 1px solid #ddd; + font-size: 12px; + line-height: 16px; + padding: 0 4px; + margin: 0; + width: 80px; + outline-style: none; + vertical-align: top; + position: absolute; + top: 0; +} +.tree-node-proxy { + background-color: #ffffff; + color: #404040; + border-color: #ddd; +} +.tree-node-hover { + background: #eee; + color: #404040; +} +.tree-node-selected { + background: #00bbee; + color: #fff; +} +.tree-node-hidden { + display: none; +} +.validatebox-invalid { + border-color: #ffa8a8; + background-color: #fff; + color: #404040; +} +.tooltip { + position: absolute; + display: none; + z-index: 9900000; + outline: none; + opacity: 1; + filter: alpha(opacity=100); + padding: 5px; + border-width: 1px; + border-style: solid; + border-radius: 5px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.tooltip-content { + font-size: 12px; +} +.tooltip-arrow-outer, +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + line-height: 0; + font-size: 0; + border-style: solid; + border-width: 6px; + border-color: transparent; + _border-color: tomato; + _filter: chroma(color=tomato); +} +.tooltip-arrow { + display: none \9; +} +.tooltip-right .tooltip-arrow-outer { + left: 0; + top: 50%; + margin: -6px 0 0 -13px; +} +.tooltip-right .tooltip-arrow { + left: 0; + top: 50%; + margin: -6px 0 0 -12px; +} +.tooltip-left .tooltip-arrow-outer { + right: 0; + top: 50%; + margin: -6px -13px 0 0; +} +.tooltip-left .tooltip-arrow { + right: 0; + top: 50%; + margin: -6px -12px 0 0; +} +.tooltip-top .tooltip-arrow-outer { + bottom: 0; + left: 50%; + margin: 0 0 -13px -6px; +} +.tooltip-top .tooltip-arrow { + bottom: 0; + left: 50%; + margin: 0 0 -12px -6px; +} +.tooltip-bottom .tooltip-arrow-outer { + top: 0; + left: 50%; + margin: -13px 0 0 -6px; +} +.tooltip-bottom .tooltip-arrow { + top: 0; + left: 50%; + margin: -12px 0 0 -6px; +} +.tooltip { + background-color: #ffffff; + border-color: #ddd; + color: #404040; +} +.tooltip-right .tooltip-arrow-outer { + border-right-color: #ddd; +} +.tooltip-right .tooltip-arrow { + border-right-color: #ffffff; +} +.tooltip-left .tooltip-arrow-outer { + border-left-color: #ddd; +} +.tooltip-left .tooltip-arrow { + border-left-color: #ffffff; +} +.tooltip-top .tooltip-arrow-outer { + border-top-color: #ddd; +} +.tooltip-top .tooltip-arrow { + border-top-color: #ffffff; +} +.tooltip-bottom .tooltip-arrow-outer { + border-bottom-color: #ddd; +} +.tooltip-bottom .tooltip-arrow { + border-bottom-color: #ffffff; +} +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #d9d9d9; + border: 1px solid #d9d9d9; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.switchbutton-on { + background: #00bbee; + color: #fff; +} +.switchbutton-off { + background-color: #ffffff; + color: #404040; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #404040; + border: 1px solid #d9d9d9; + -moz-box-shadow: 0 0 3px 0 #d9d9d9; + -webkit-box-shadow: 0 0 3px 0 #d9d9d9; + box-shadow: 0 0 3px 0 #d9d9d9; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} +.l-btn { + box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 1px 1px rgba(0,0,0,0.05); +} +.l-btn:active { + box-shadow: 0 6px 17px 0 rgba(235,235,235,0.3); +} +.l-btn-selected { + box-shadow: 0 1px 2px rgba(89,205,226,0.2), 0 1px 1px rgba(89,205,226,0.05); +} +.l-btn-plain, +.l-btn-disabled, +.l-btn-disabled:active, +.textbox-button { + box-shadow: none; +} +.l-btn-selected, +.l-btn-selected:hover { + background: #00bbee; + color: #fff; +} +.l-btn-plain-selected, +.l-btn-plain-selected:hover { + background: #00bbee; +} +.m-btn-active, +.m-btn-plain-active, +.s-btn-active, +.s-btn-plain-active { + background: #00bbee; + color: #fff; +} +.menu-shadow, +.combo-p { + -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + filter: none; +} +.menu-active { + border-color: transparent; + color: #fff; + background: #00bbee; +} +.menu-active-disabled { + border-color: transparent; + background: transparent; + color: #404040; +} +.window { + background-color: #fff; +} +.window-proxy { + border-color: #ccc; +} +.window-shadow { + -moz-box-shadow: 0 7px 8px -4px rgba(0,0,0,0.2), 0 13px 19px 2px rgba(0,0,0,0.14), 0 5px 24px 4px rgba(0,0,0,0.12); + -webkit-box-shadow: 0 7px 8px -4px rgba(0,0,0,0.2), 0 13px 19px 2px rgba(0,0,0,0.14), 0 5px 24px 4px rgba(0,0,0,0.12); + box-shadow: 0 7px 8px -4px rgba(0,0,0,0.2), 0 13px 19px 2px rgba(0,0,0,0.14), 0 5px 24px 4px rgba(0,0,0,0.12); + filter: none; +} +.window-mask { + background: #000; +} +.datagrid-header .datagrid-cell, +.datagrid-header .datagrid-cell-group { + color: #666; + font-weight: bold; + filter: alpha(opacity=80); + opacity: 0.80; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-style: solid; +} diff --git a/assets/js/easy-ui/themes/material/filebox.css b/assets/js/easy-ui/themes/material/filebox.css new file mode 100644 index 0000000000..c6bac66315 --- /dev/null +++ b/assets/js/easy-ui/themes/material/filebox.css @@ -0,0 +1,20 @@ +.filebox .textbox-value { + vertical-align: top; + position: absolute; + top: 0; + left: -5000px; +} +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/material/images/Thumbs.db b/assets/js/easy-ui/themes/material/images/Thumbs.db new file mode 100644 index 0000000000..5f257a2a49 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/Thumbs.db differ diff --git a/assets/js/easy-ui/themes/material/images/accordion_arrows.png b/assets/js/easy-ui/themes/material/images/accordion_arrows.png new file mode 100644 index 0000000000..a0b8769cc5 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/accordion_arrows.png differ diff --git a/assets/js/easy-ui/themes/material/images/blank.gif b/assets/js/easy-ui/themes/material/images/blank.gif new file mode 100644 index 0000000000..1d11fa9ada Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/blank.gif differ diff --git a/assets/js/easy-ui/themes/material/images/calendar_arrows.png b/assets/js/easy-ui/themes/material/images/calendar_arrows.png new file mode 100644 index 0000000000..430c4ad685 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/calendar_arrows.png differ diff --git a/assets/js/easy-ui/themes/material/images/combo_arrow.png b/assets/js/easy-ui/themes/material/images/combo_arrow.png new file mode 100644 index 0000000000..04f4ba0cd5 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/combo_arrow.png differ diff --git a/assets/js/easy-ui/themes/material/images/datagrid_icons.png b/assets/js/easy-ui/themes/material/images/datagrid_icons.png new file mode 100644 index 0000000000..66b83435f8 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/datagrid_icons.png differ diff --git a/assets/js/easy-ui/themes/material/images/datebox_arrow.png b/assets/js/easy-ui/themes/material/images/datebox_arrow.png new file mode 100644 index 0000000000..783c83357f Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/datebox_arrow.png differ diff --git a/assets/js/easy-ui/themes/material/images/layout_arrows.png b/assets/js/easy-ui/themes/material/images/layout_arrows.png new file mode 100644 index 0000000000..bf7929f547 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/layout_arrows.png differ diff --git a/assets/js/easy-ui/themes/material/images/linkbutton_bg.png b/assets/js/easy-ui/themes/material/images/linkbutton_bg.png new file mode 100644 index 0000000000..fc66bd2cd2 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/linkbutton_bg.png differ diff --git a/assets/js/easy-ui/themes/material/images/loading.gif b/assets/js/easy-ui/themes/material/images/loading.gif new file mode 100644 index 0000000000..68f01d0481 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/loading.gif differ diff --git a/assets/js/easy-ui/themes/material/images/menu_arrows.png b/assets/js/easy-ui/themes/material/images/menu_arrows.png new file mode 100644 index 0000000000..b986842e7e Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/menu_arrows.png differ diff --git a/assets/js/easy-ui/themes/material/images/messager_icons.png b/assets/js/easy-ui/themes/material/images/messager_icons.png new file mode 100644 index 0000000000..62c18c1358 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/messager_icons.png differ diff --git a/assets/js/easy-ui/themes/material/images/pagination_icons.png b/assets/js/easy-ui/themes/material/images/pagination_icons.png new file mode 100644 index 0000000000..e0f1b07b05 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/pagination_icons.png differ diff --git a/assets/js/easy-ui/themes/material/images/panel_tools.png b/assets/js/easy-ui/themes/material/images/panel_tools.png new file mode 100644 index 0000000000..f33f8c9707 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/panel_tools.png differ diff --git a/assets/js/easy-ui/themes/material/images/passwordbox_close.png b/assets/js/easy-ui/themes/material/images/passwordbox_close.png new file mode 100644 index 0000000000..276b579742 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/passwordbox_close.png differ diff --git a/assets/js/easy-ui/themes/material/images/passwordbox_open.png b/assets/js/easy-ui/themes/material/images/passwordbox_open.png new file mode 100644 index 0000000000..0f25d535e0 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/passwordbox_open.png differ diff --git a/assets/js/easy-ui/themes/material/images/searchbox_button.png b/assets/js/easy-ui/themes/material/images/searchbox_button.png new file mode 100644 index 0000000000..6dd1931589 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/searchbox_button.png differ diff --git a/assets/js/easy-ui/themes/material/images/slider_handle.png b/assets/js/easy-ui/themes/material/images/slider_handle.png new file mode 100644 index 0000000000..b9802bae14 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/slider_handle.png differ diff --git a/assets/js/easy-ui/themes/material/images/spinner_arrows.png b/assets/js/easy-ui/themes/material/images/spinner_arrows.png new file mode 100644 index 0000000000..b1773c24b2 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/spinner_arrows.png differ diff --git a/assets/js/easy-ui/themes/material/images/tabs_icons.png b/assets/js/easy-ui/themes/material/images/tabs_icons.png new file mode 100644 index 0000000000..dfa10f7d78 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/tabs_icons.png differ diff --git a/assets/js/easy-ui/themes/material/images/tagbox_icons.png b/assets/js/easy-ui/themes/material/images/tagbox_icons.png new file mode 100644 index 0000000000..8ec6436088 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/tagbox_icons.png differ diff --git a/assets/js/easy-ui/themes/material/images/tree_icons.png b/assets/js/easy-ui/themes/material/images/tree_icons.png new file mode 100644 index 0000000000..e9be4f3a99 Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/tree_icons.png differ diff --git a/assets/js/easy-ui/themes/material/images/validatebox_warning.png b/assets/js/easy-ui/themes/material/images/validatebox_warning.png new file mode 100644 index 0000000000..2b3d4f05ba Binary files /dev/null and b/assets/js/easy-ui/themes/material/images/validatebox_warning.png differ diff --git a/assets/js/easy-ui/themes/material/layout.css b/assets/js/easy-ui/themes/material/layout.css new file mode 100644 index 0000000000..41ff29d55d --- /dev/null +++ b/assets/js/easy-ui/themes/material/layout.css @@ -0,0 +1,150 @@ +.layout { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + z-index: 0; +} +.layout-panel { + position: absolute; + overflow: hidden; +} +.layout-body { + min-width: 1px; + min-height: 1px; +} +.layout-panel-east, +.layout-panel-west { + z-index: 2; +} +.layout-panel-north, +.layout-panel-south { + z-index: 3; +} +.layout-expand { + position: absolute; + padding: 0px; + font-size: 1px; + cursor: pointer; + z-index: 1; +} +.layout-expand .panel-header, +.layout-expand .panel-body { + background: transparent; + filter: none; + overflow: hidden; +} +.layout-expand .panel-header { + border-bottom-width: 0px; +} +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} +.layout-split-proxy-h, +.layout-split-proxy-v { + position: absolute; + font-size: 1px; + display: none; + z-index: 5; +} +.layout-split-proxy-h { + width: 5px; + cursor: e-resize; +} +.layout-split-proxy-v { + height: 5px; + cursor: n-resize; +} +.layout-mask { + position: absolute; + background: #fafafa; + filter: alpha(opacity=10); + opacity: 0.10; + z-index: 4; +} +.layout-button-up { + background: url('images/layout_arrows.png') no-repeat -16px -16px; +} +.layout-button-down { + background: url('images/layout_arrows.png') no-repeat -16px 0; +} +.layout-button-left { + background: url('images/layout_arrows.png') no-repeat 0 0; +} +.layout-button-right { + background: url('images/layout_arrows.png') no-repeat 0 -16px; +} +.layout-split-proxy-h, +.layout-split-proxy-v { + background-color: #ccc; +} +.layout-split-north { + border-bottom: 5px solid #ffffff; +} +.layout-split-south { + border-top: 5px solid #ffffff; +} +.layout-split-east { + border-left: 5px solid #ffffff; +} +.layout-split-west { + border-right: 5px solid #ffffff; +} +.layout-expand { + background-color: #f5f5f5; +} +.layout-expand-over { + background-color: #f5f5f5; +} diff --git a/assets/js/easy-ui/themes/material/linkbutton.css b/assets/js/easy-ui/themes/material/linkbutton.css new file mode 100644 index 0000000000..c334090bae --- /dev/null +++ b/assets/js/easy-ui/themes/material/linkbutton.css @@ -0,0 +1,191 @@ +.l-btn { + text-decoration: none; + display: inline-block; + overflow: hidden; + margin: 0; + padding: 0; + cursor: pointer; + outline: none; + text-align: center; + vertical-align: middle; + line-height: normal; +} +.l-btn-plain { + border-width: 0; + padding: 1px; +} +.l-btn-left { + display: inline-block; + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + vertical-align: top; +} +.l-btn-text { + display: inline-block; + vertical-align: top; + width: auto; + line-height: 24px; + font-size: 12px; + padding: 0; + margin: 0 4px; +} +.l-btn-icon { + display: inline-block; + width: 16px; + height: 16px; + line-height: 16px; + position: absolute; + top: 50%; + margin-top: -8px; + font-size: 1px; +} +.l-btn span span .l-btn-empty { + display: inline-block; + margin: 0; + width: 16px; + height: 24px; + font-size: 1px; + vertical-align: top; +} +.l-btn span .l-btn-icon-left { + padding: 0 0 0 20px; + background-position: left center; +} +.l-btn span .l-btn-icon-right { + padding: 0 20px 0 0; + background-position: right center; +} +.l-btn-icon-left .l-btn-text { + margin: 0 4px 0 24px; +} +.l-btn-icon-left .l-btn-icon { + left: 4px; +} +.l-btn-icon-right .l-btn-text { + margin: 0 24px 0 4px; +} +.l-btn-icon-right .l-btn-icon { + right: 4px; +} +.l-btn-icon-top .l-btn-text { + margin: 20px 4px 0 4px; +} +.l-btn-icon-top .l-btn-icon { + top: 4px; + left: 50%; + margin: 0 0 0 -8px; +} +.l-btn-icon-bottom .l-btn-text { + margin: 0 4px 20px 4px; +} +.l-btn-icon-bottom .l-btn-icon { + top: auto; + bottom: 4px; + left: 50%; + margin: 0 0 0 -8px; +} +.l-btn-left .l-btn-empty { + margin: 0 4px; + width: 16px; +} +.l-btn-plain:hover { + padding: 0; +} +.l-btn-focus { + outline: #0000FF dotted thin; +} +.l-btn-large .l-btn-text { + line-height: 40px; +} +.l-btn-large .l-btn-icon { + width: 32px; + height: 32px; + line-height: 32px; + margin-top: -16px; +} +.l-btn-large .l-btn-icon-left .l-btn-text { + margin-left: 40px; +} +.l-btn-large .l-btn-icon-right .l-btn-text { + margin-right: 40px; +} +.l-btn-large .l-btn-icon-top .l-btn-text { + margin-top: 36px; + line-height: 24px; + min-width: 32px; +} +.l-btn-large .l-btn-icon-top .l-btn-icon { + margin: 0 0 0 -16px; +} +.l-btn-large .l-btn-icon-bottom .l-btn-text { + margin-bottom: 36px; + line-height: 24px; + min-width: 32px; +} +.l-btn-large .l-btn-icon-bottom .l-btn-icon { + margin: 0 0 0 -16px; +} +.l-btn-large .l-btn-left .l-btn-empty { + margin: 0 4px; + width: 32px; +} +.l-btn { + color: #404040; + background: #fafafa; + background-repeat: repeat-x; + border: 1px solid #d9d9d9; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.l-btn:hover { + background: #eee; + color: #404040; + border: 1px solid #ccc; + filter: none; +} +.l-btn-plain { + background: transparent; + border-width: 0; + filter: none; +} +.l-btn-outline { + border-width: 1px; + border-color: #ccc; + padding: 0; +} +.l-btn-plain:hover { + background: #eee; + color: #404040; + border: 1px solid #ccc; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.l-btn-disabled, +.l-btn-disabled:hover { + opacity: 0.5; + cursor: default; + background: #fafafa; + color: #404040; +} +.l-btn-disabled .l-btn-text, +.l-btn-disabled .l-btn-icon { + filter: alpha(opacity=50); +} +.l-btn-plain-disabled, +.l-btn-plain-disabled:hover { + background: transparent; + filter: alpha(opacity=50); +} +.l-btn-selected, +.l-btn-selected:hover { + background: #00bbee; + filter: none; +} +.l-btn-plain-selected, +.l-btn-plain-selected:hover { + background: #00bbee; +} diff --git a/assets/js/easy-ui/themes/material/menu.css b/assets/js/easy-ui/themes/material/menu.css new file mode 100644 index 0000000000..69f530ee22 --- /dev/null +++ b/assets/js/easy-ui/themes/material/menu.css @@ -0,0 +1,119 @@ +.menu { + position: absolute; + margin: 0; + padding: 2px; + border-width: 1px; + border-style: solid; + overflow: hidden; +} +.menu-inline { + position: relative; +} +.menu-item { + position: relative; + margin: 0; + padding: 0; + overflow: hidden; + white-space: nowrap; + cursor: pointer; + border-width: 1px; + border-style: solid; +} +.menu-text { + height: 20px; + line-height: 20px; + float: left; + padding-left: 28px; +} +.menu-icon { + position: absolute; + width: 16px; + height: 16px; + left: 2px; + top: 50%; + margin-top: -8px; +} +.menu-rightarrow { + position: absolute; + width: 16px; + height: 16px; + right: 0; + top: 50%; + margin-top: -8px; +} +.menu-line { + position: absolute; + left: 26px; + top: 0; + height: 2000px; + font-size: 1px; +} +.menu-sep { + margin: 3px 0px 3px 25px; + font-size: 1px; +} +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} +.menu-active { + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.menu-item-disabled { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default; +} +.menu-text, +.menu-text span { + font-size: 12px; +} +.menu-shadow { + position: absolute; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; + background: #fafafa; + -moz-box-shadow: 2px 2px 3px #fafafa; + -webkit-box-shadow: 2px 2px 3px #fafafa; + box-shadow: 2px 2px 3px #fafafa; + filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); +} +.menu-rightarrow { + background: url('images/menu_arrows.png') no-repeat -32px center; +} +.menu-line { + border-left: 1px solid #ddd; + border-right: 1px solid #fff; +} +.menu-sep { + border-top: 1px solid #ddd; + border-bottom: 1px solid #fff; +} +.menu { + background-color: #fff; + border-color: #eee; + color: #404040; +} +.menu-content { + background: #ffffff; +} +.menu-item { + border-color: transparent; + _border-color: #fff; +} +.menu-active { + border-color: #ccc; + color: #404040; + background: #eee; +} +.menu-active-disabled { + border-color: transparent; + background: transparent; + color: #404040; +} diff --git a/assets/js/easy-ui/themes/material/menubutton.css b/assets/js/easy-ui/themes/material/menubutton.css new file mode 100644 index 0000000000..fee358ba59 --- /dev/null +++ b/assets/js/easy-ui/themes/material/menubutton.css @@ -0,0 +1,94 @@ +.m-btn-downarrow, +.s-btn-downarrow { + display: inline-block; + position: absolute; + width: 16px; + height: 16px; + font-size: 1px; + right: 0; + top: 50%; + margin-top: -8px; +} +.m-btn-active, +.s-btn-active { + background: #eee; + color: #404040; + border: 1px solid #ccc; + filter: none; +} +.m-btn-plain-active, +.s-btn-plain-active { + background: transparent; + padding: 0; + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.m-btn .l-btn-left .l-btn-text { + margin-right: 20px; +} +.m-btn .l-btn-icon-right .l-btn-text { + margin-right: 40px; +} +.m-btn .l-btn-icon-right .l-btn-icon { + right: 20px; +} +.m-btn .l-btn-icon-top .l-btn-text { + margin-right: 4px; + margin-bottom: 14px; +} +.m-btn .l-btn-icon-bottom .l-btn-text { + margin-right: 4px; + margin-bottom: 34px; +} +.m-btn .l-btn-icon-bottom .l-btn-icon { + top: auto; + bottom: 20px; +} +.m-btn .l-btn-icon-top .m-btn-downarrow, +.m-btn .l-btn-icon-bottom .m-btn-downarrow { + top: auto; + bottom: 0px; + left: 50%; + margin-left: -8px; +} +.m-btn-line { + display: inline-block; + position: absolute; + font-size: 1px; + display: none; +} +.m-btn .l-btn-left .m-btn-line { + right: 0; + width: 16px; + height: 500px; + border-style: solid; + border-color: #ccc; + border-width: 0 0 0 1px; +} +.m-btn .l-btn-icon-top .m-btn-line, +.m-btn .l-btn-icon-bottom .m-btn-line { + left: 0; + bottom: 0; + width: 500px; + height: 16px; + border-width: 1px 0 0 0; +} +.m-btn-large .l-btn-icon-right .l-btn-text { + margin-right: 56px; +} +.m-btn-large .l-btn-icon-bottom .l-btn-text { + margin-bottom: 50px; +} +.m-btn-downarrow, +.s-btn-downarrow { + background: url('images/menu_arrows.png') no-repeat 0 center; +} +.m-btn-plain-active, +.s-btn-plain-active { + border-color: #ccc; + background-color: #eee; + color: #404040; +} diff --git a/assets/js/easy-ui/themes/material/messager.css b/assets/js/easy-ui/themes/material/messager.css new file mode 100644 index 0000000000..f8e29afd3a --- /dev/null +++ b/assets/js/easy-ui/themes/material/messager.css @@ -0,0 +1,44 @@ +.messager-body { + padding: 10px 10px 30px 10px; + overflow: auto; +} +.messager-button { + text-align: center; + padding: 5px; +} +.messager-button .l-btn { + width: 70px; +} +.messager-icon { + float: left; + width: 32px; + height: 32px; + margin: 0 10px 10px 0; +} +.messager-error { + background: url('images/messager_icons.png') no-repeat scroll -64px 0; +} +.messager-info { + background: url('images/messager_icons.png') no-repeat scroll 0 0; +} +.messager-question { + background: url('images/messager_icons.png') no-repeat scroll -32px 0; +} +.messager-warning { + background: url('images/messager_icons.png') no-repeat scroll -96px 0; +} +.messager-progress { + padding: 10px; +} +.messager-p-msg { + margin-bottom: 5px; +} +.messager-body .messager-input { + width: 100%; + padding: 4px 0; + outline-style: none; + border: 1px solid #ddd; +} +.window-thinborder .messager-button { + padding-bottom: 8px; +} diff --git a/assets/js/easy-ui/themes/material/numberbox.css b/assets/js/easy-ui/themes/material/numberbox.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/assets/js/easy-ui/themes/material/pagination.css b/assets/js/easy-ui/themes/material/pagination.css new file mode 100644 index 0000000000..c0f74243c3 --- /dev/null +++ b/assets/js/easy-ui/themes/material/pagination.css @@ -0,0 +1,71 @@ +.pagination { + zoom: 1; +} +.pagination table { + float: left; + height: 30px; +} +.pagination td { + border: 0; +} +.pagination-btn-separator { + float: left; + height: 24px; + border-left: 1px solid #ddd; + border-right: 1px solid #fff; + margin: 3px 1px; +} +.pagination .pagination-num { + border-width: 1px; + border-style: solid; + margin: 0 2px; + padding: 2px; + width: 2em; + height: auto; +} +.pagination-page-list { + margin: 0px 6px; + padding: 1px 2px; + width: auto; + height: auto; + border-width: 1px; + border-style: solid; +} +.pagination-info { + float: right; + margin: 0 6px; + padding: 0; + height: 30px; + line-height: 30px; + font-size: 12px; +} +.pagination span { + font-size: 12px; +} +.pagination-link .l-btn-text { + width: 24px; + text-align: center; + margin: 0; +} +.pagination-first { + background: url('images/pagination_icons.png') no-repeat 0 center; +} +.pagination-prev { + background: url('images/pagination_icons.png') no-repeat -16px center; +} +.pagination-next { + background: url('images/pagination_icons.png') no-repeat -32px center; +} +.pagination-last { + background: url('images/pagination_icons.png') no-repeat -48px center; +} +.pagination-load { + background: url('images/pagination_icons.png') no-repeat -64px center; +} +.pagination-loading { + background: url('images/loading.gif') no-repeat center center; +} +.pagination-page-list, +.pagination .pagination-num { + border-color: #ddd; +} diff --git a/assets/js/easy-ui/themes/material/panel.css b/assets/js/easy-ui/themes/material/panel.css new file mode 100644 index 0000000000..0003fd054e --- /dev/null +++ b/assets/js/easy-ui/themes/material/panel.css @@ -0,0 +1,259 @@ +.panel { + overflow: hidden; + text-align: left; + margin: 0; + border: 0; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.panel-header, +.panel-body { + border-width: 1px; + border-style: solid; +} +.panel-header { + padding: 5px; + position: relative; +} +.panel-title { + background: url('images/blank.gif') no-repeat; +} +.panel-header-noborder { + border-width: 0 0 1px 0; +} +.panel-body { + overflow: auto; + border-top-width: 0; + padding: 0; +} +.panel-body-noheader { + border-top-width: 1px; +} +.panel-body-noborder { + border-width: 0px; +} +.panel-body-nobottom { + border-bottom-width: 0; +} +.panel-with-icon { + padding-left: 18px; +} +.panel-icon, +.panel-tool { + position: absolute; + top: 50%; + margin-top: -8px; + height: 16px; + overflow: hidden; +} +.panel-icon { + left: 5px; + width: 16px; +} +.panel-tool { + right: 5px; + width: auto; +} +.panel-tool a { + display: inline-block; + width: 16px; + height: 16px; + opacity: 0.6; + filter: alpha(opacity=60); + margin: 0 0 0 2px; + vertical-align: top; +} +.panel-tool a:hover { + opacity: 1; + filter: alpha(opacity=100); + background-color: #eee; + -moz-border-radius: 2px 2px 2px 2px; + -webkit-border-radius: 2px 2px 2px 2px; + border-radius: 2px 2px 2px 2px; +} +.panel-loading { + padding: 11px 0px 10px 30px; +} +.panel-noscroll { + overflow: hidden; +} +.panel-fit, +.panel-fit body { + height: 100%; + margin: 0; + padding: 0; + border: 0; + overflow: hidden; +} +.panel-loading { + background: url('images/loading.gif') no-repeat 10px 10px; +} +.panel-tool-close { + background: url('images/panel_tools.png') no-repeat -16px 0px; +} +.panel-tool-min { + background: url('images/panel_tools.png') no-repeat 0px 0px; +} +.panel-tool-max { + background: url('images/panel_tools.png') no-repeat 0px -16px; +} +.panel-tool-restore { + background: url('images/panel_tools.png') no-repeat -16px -16px; +} +.panel-tool-collapse { + background: url('images/panel_tools.png') no-repeat -32px 0; +} +.panel-tool-expand { + background: url('images/panel_tools.png') no-repeat -32px -16px; +} +.panel-header, +.panel-body { + border-color: #ddd; +} +.panel-header { + background-color: #f5f5f5; +} +.panel-body { + background-color: #ffffff; + color: #404040; + font-size: 12px; +} +.panel-title { + font-size: 12px; + font-weight: bold; + color: #000000; + height: 16px; + line-height: 16px; +} +.panel-footer { + border: 1px solid #ddd; + overflow: hidden; + background: #fafafa; +} +.panel-footer-noborder { + border-width: 1px 0 0 0; +} +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} diff --git a/assets/js/easy-ui/themes/material/passwordbox.css b/assets/js/easy-ui/themes/material/passwordbox.css new file mode 100644 index 0000000000..92c9ce586b --- /dev/null +++ b/assets/js/easy-ui/themes/material/passwordbox.css @@ -0,0 +1,6 @@ +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} diff --git a/assets/js/easy-ui/themes/material/progressbar.css b/assets/js/easy-ui/themes/material/progressbar.css new file mode 100644 index 0000000000..1690673028 --- /dev/null +++ b/assets/js/easy-ui/themes/material/progressbar.css @@ -0,0 +1,32 @@ +.progressbar { + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; + overflow: hidden; + position: relative; +} +.progressbar-text { + text-align: center; + position: absolute; +} +.progressbar-value { + position: relative; + overflow: hidden; + width: 0; + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.progressbar { + border-color: #ddd; +} +.progressbar-text { + color: #404040; + font-size: 12px; +} +.progressbar-value .progressbar-text { + background-color: #00bbee; + color: #fff; +} diff --git a/assets/js/easy-ui/themes/material/propertygrid.css b/assets/js/easy-ui/themes/material/propertygrid.css new file mode 100644 index 0000000000..fbd2c7c083 --- /dev/null +++ b/assets/js/easy-ui/themes/material/propertygrid.css @@ -0,0 +1,28 @@ +.propertygrid .datagrid-view1 .datagrid-body td { + padding-bottom: 1px; + border-width: 0 1px 0 0; +} +.propertygrid .datagrid-group { + height: 21px; + overflow: hidden; + border-width: 0 0 1px 0; + border-style: solid; +} +.propertygrid .datagrid-group span { + font-weight: bold; +} +.propertygrid .datagrid-view1 .datagrid-body td { + border-color: #eee; +} +.propertygrid .datagrid-view1 .datagrid-group { + border-color: #f5f5f5; +} +.propertygrid .datagrid-view2 .datagrid-group { + border-color: #eee; +} +.propertygrid .datagrid-group, +.propertygrid .datagrid-view1 .datagrid-body, +.propertygrid .datagrid-view1 .datagrid-row-over, +.propertygrid .datagrid-view1 .datagrid-row-selected { + background: #f5f5f5; +} diff --git a/assets/js/easy-ui/themes/material/searchbox.css b/assets/js/easy-ui/themes/material/searchbox.css new file mode 100644 index 0000000000..54ad88517a --- /dev/null +++ b/assets/js/easy-ui/themes/material/searchbox.css @@ -0,0 +1,61 @@ +.searchbox-button { + width: 18px; + height: 20px; + overflow: hidden; + display: inline-block; + vertical-align: top; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.searchbox-button-hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.searchbox .l-btn-plain { + border: 0; + padding: 0; + vertical-align: top; + opacity: 0.6; + filter: alpha(opacity=60); + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox .l-btn-plain:hover { + border: 0; + padding: 0; + opacity: 1.0; + filter: alpha(opacity=100); + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox a.m-btn-plain-active { + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox .m-btn-active { + border-width: 0 1px 0 0; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.searchbox .textbox-button-right { + border-width: 0 0 0 1px; +} +.searchbox .textbox-button-left { + border-width: 0 1px 0 0; +} +.searchbox-button { + background: url('images/searchbox_button.png') no-repeat center center; +} +.searchbox .l-btn-plain { + background: #f5f5f5; +} +.searchbox .l-btn-plain-disabled, +.searchbox .l-btn-plain-disabled:hover { + opacity: 0.5; + filter: alpha(opacity=50); +} diff --git a/assets/js/easy-ui/themes/material/slider.css b/assets/js/easy-ui/themes/material/slider.css new file mode 100644 index 0000000000..1e471efc68 --- /dev/null +++ b/assets/js/easy-ui/themes/material/slider.css @@ -0,0 +1,101 @@ +.slider-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.slider-h { + height: 22px; +} +.slider-v { + width: 22px; +} +.slider-inner { + position: relative; + height: 6px; + top: 7px; + border-width: 1px; + border-style: solid; + border-radius: 4px; +} +.slider-handle { + position: absolute; + display: block; + outline: none; + width: 20px; + height: 20px; + top: 50%; + margin-top: -10px; + margin-left: -10px; +} +.slider-tip { + position: absolute; + display: inline-block; + line-height: 12px; + font-size: 12px; + white-space: nowrap; + top: -22px; +} +.slider-rule { + position: relative; + top: 15px; +} +.slider-rule span { + position: absolute; + display: inline-block; + font-size: 0; + height: 5px; + border-width: 0 0 0 1px; + border-style: solid; +} +.slider-rulelabel { + position: relative; + top: 20px; +} +.slider-rulelabel span { + position: absolute; + display: inline-block; + font-size: 12px; +} +.slider-v .slider-inner { + width: 6px; + left: 7px; + top: 0; + float: left; +} +.slider-v .slider-handle { + left: 50%; + margin-top: -10px; +} +.slider-v .slider-tip { + left: -10px; + margin-top: -6px; +} +.slider-v .slider-rule { + float: left; + top: 0; + left: 16px; +} +.slider-v .slider-rule span { + width: 5px; + height: 'auto'; + border-left: 0; + border-width: 1px 0 0 0; + border-style: solid; +} +.slider-v .slider-rulelabel { + float: left; + top: 0; + left: 23px; +} +.slider-handle { + background: url('images/slider_handle.png') no-repeat; +} +.slider-inner { + border-color: #ddd; + background: #f5f5f5; +} +.slider-rule span { + border-color: #ddd; +} +.slider-rulelabel span { + color: #404040; +} diff --git a/assets/js/easy-ui/themes/material/spinner.css b/assets/js/easy-ui/themes/material/spinner.css new file mode 100644 index 0000000000..15098d1004 --- /dev/null +++ b/assets/js/easy-ui/themes/material/spinner.css @@ -0,0 +1,58 @@ +.spinner-arrow { + background-color: #f5f5f5; + display: inline-block; + overflow: hidden; + vertical-align: top; + margin: 0; + padding: 0; + opacity: 1.0; + filter: alpha(opacity=100); + width: 18px; +} +.spinner-arrow-up, +.spinner-arrow-down { + opacity: 0.6; + filter: alpha(opacity=60); + display: block; + font-size: 1px; + width: 18px; + height: 10px; + width: 100%; + height: 50%; + color: #404040; + outline-style: none; +} +.spinner-arrow-hover { + background-color: #eee; + opacity: 1.0; + filter: alpha(opacity=100); +} +.spinner-arrow-up:hover, +.spinner-arrow-down:hover { + opacity: 1.0; + filter: alpha(opacity=100); + background-color: #eee; +} +.textbox-icon-disabled .spinner-arrow-up:hover, +.textbox-icon-disabled .spinner-arrow-down:hover { + opacity: 0.6; + filter: alpha(opacity=60); + background-color: #f5f5f5; + cursor: default; +} +.spinner .textbox-icon-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} +.spinner-arrow-up { + background: url('images/spinner_arrows.png') no-repeat 1px center; +} +.spinner-arrow-down { + background: url('images/spinner_arrows.png') no-repeat -15px center; +} +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; +} diff --git a/assets/js/easy-ui/themes/material/splitbutton.css b/assets/js/easy-ui/themes/material/splitbutton.css new file mode 100644 index 0000000000..2ad86f7749 --- /dev/null +++ b/assets/js/easy-ui/themes/material/splitbutton.css @@ -0,0 +1,12 @@ +.s-btn:hover .m-btn-line, +.s-btn-active .m-btn-line, +.s-btn-plain-active .m-btn-line { + display: inline-block; +} +.l-btn:hover .s-btn-downarrow, +.s-btn-active .s-btn-downarrow, +.s-btn-plain-active .s-btn-downarrow { + border-style: solid; + border-color: #ccc; + border-width: 0 0 0 1px; +} diff --git a/assets/js/easy-ui/themes/material/switchbutton.css b/assets/js/easy-ui/themes/material/switchbutton.css new file mode 100644 index 0000000000..8e3ddb7dd2 --- /dev/null +++ b/assets/js/easy-ui/themes/material/switchbutton.css @@ -0,0 +1,77 @@ +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #d9d9d9; + border: 1px solid #d9d9d9; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.switchbutton-on { + background: #00bbee; + color: #fff; +} +.switchbutton-off { + background-color: #ffffff; + color: #404040; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #ffffff; + color: #404040; + border: 1px solid #d9d9d9; + -moz-box-shadow: 0 0 3px 0 #d9d9d9; + -webkit-box-shadow: 0 0 3px 0 #d9d9d9; + box-shadow: 0 0 3px 0 #d9d9d9; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/material/tabs.css b/assets/js/easy-ui/themes/material/tabs.css new file mode 100644 index 0000000000..2ea78d209c --- /dev/null +++ b/assets/js/easy-ui/themes/material/tabs.css @@ -0,0 +1,377 @@ +.tabs-container { + overflow: hidden; +} +.tabs-header { + border-width: 1px; + border-style: solid; + border-bottom-width: 0; + position: relative; + padding: 0; + padding-top: 2px; + overflow: hidden; +} +.tabs-scroller-left, +.tabs-scroller-right { + position: absolute; + top: auto; + bottom: 0; + width: 18px; + font-size: 1px; + display: none; + cursor: pointer; + border-width: 1px; + border-style: solid; +} +.tabs-scroller-left { + left: 0; +} +.tabs-scroller-right { + right: 0; +} +.tabs-tool { + position: absolute; + bottom: 0; + padding: 1px; + overflow: hidden; + border-width: 1px; + border-style: solid; +} +.tabs-header-plain .tabs-tool { + padding: 0 1px; +} +.tabs-wrap { + position: relative; + left: 0; + overflow: hidden; + width: 100%; + margin: 0; + padding: 0; +} +.tabs-scrolling { + margin-left: 18px; + margin-right: 18px; +} +.tabs-disabled { + opacity: 0.3; + filter: alpha(opacity=30); +} +.tabs { + list-style-type: none; + height: 26px; + margin: 0px; + padding: 0px; + padding-left: 4px; + width: 50000px; + border-style: solid; + border-width: 0 0 1px 0; +} +.tabs li { + float: left; + display: inline-block; + margin: 0 4px -1px 0; + padding: 0; + position: relative; + border: 0; +} +.tabs li a.tabs-inner { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0 10px; + height: 25px; + line-height: 25px; + text-align: center; + white-space: nowrap; + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.tabs li.tabs-selected a.tabs-inner { + font-weight: bold; + outline: none; +} +.tabs li.tabs-selected a:hover.tabs-inner { + cursor: default; + pointer: default; +} +.tabs li a.tabs-close, +.tabs-p-tool { + position: absolute; + font-size: 1px; + display: block; + height: 12px; + padding: 0; + top: 50%; + margin-top: -6px; + overflow: hidden; +} +.tabs li a.tabs-close { + width: 12px; + right: 5px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tabs-p-tool { + right: 16px; +} +.tabs-p-tool a { + display: inline-block; + font-size: 1px; + width: 12px; + height: 12px; + margin: 0; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tabs li a:hover.tabs-close, +.tabs-p-tool a:hover { + opacity: 1; + filter: alpha(opacity=100); + cursor: hand; + cursor: pointer; +} +.tabs-with-icon { + padding-left: 18px; +} +.tabs-icon { + position: absolute; + width: 16px; + height: 16px; + left: 10px; + top: 50%; + margin-top: -8px; +} +.tabs-title { + font-size: 12px; +} +.tabs-closable { + padding-right: 8px; +} +.tabs-panels { + margin: 0px; + padding: 0px; + border-width: 1px; + border-style: solid; + border-top-width: 0; + overflow: hidden; +} +.tabs-header-bottom { + border-width: 0 1px 1px 1px; + padding: 0 0 2px 0; +} +.tabs-header-bottom .tabs { + border-width: 1px 0 0 0; +} +.tabs-header-bottom .tabs li { + margin: -1px 4px 0 0; +} +.tabs-header-bottom .tabs li a.tabs-inner { + -moz-border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.tabs-header-bottom .tabs-tool { + top: 0; +} +.tabs-header-bottom .tabs-scroller-left, +.tabs-header-bottom .tabs-scroller-right { + top: 0; + bottom: auto; +} +.tabs-panels-top { + border-width: 1px 1px 0 1px; +} +.tabs-header-left { + float: left; + border-width: 1px 0 1px 1px; + padding: 0; +} +.tabs-header-right { + float: right; + border-width: 1px 1px 1px 0; + padding: 0; +} +.tabs-header-left .tabs-wrap, +.tabs-header-right .tabs-wrap { + height: 100%; +} +.tabs-header-left .tabs { + height: 100%; + padding: 4px 0 0 2px; + border-width: 0 1px 0 0; +} +.tabs-header-right .tabs { + height: 100%; + padding: 4px 2px 0 0; + border-width: 0 0 0 1px; +} +.tabs-header-left .tabs li, +.tabs-header-right .tabs li { + display: block; + width: 100%; + position: relative; +} +.tabs-header-left .tabs li { + left: auto; + right: 0; + margin: 0 -1px 4px 0; + float: right; +} +.tabs-header-right .tabs li { + left: 0; + right: auto; + margin: 0 0 4px -1px; + float: left; +} +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} +.tabs-header-left .tabs li a.tabs-inner { + display: block; + text-align: left; + padding-left: 10px; + padding-right: 10px; + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.tabs-header-right .tabs li a.tabs-inner { + display: block; + text-align: left; + padding-left: 10px; + padding-right: 10px; + -moz-border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.tabs-panels-right { + float: right; + border-width: 1px 1px 1px 0; +} +.tabs-panels-left { + float: left; + border-width: 1px 0 1px 1px; +} +.tabs-header-noborder, +.tabs-panels-noborder { + border: 0px; +} +.tabs-header-plain { + border: 0px; + background: transparent; +} +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} +.tabs-scroller-left { + background: #f5f5f5 url('images/tabs_icons.png') no-repeat 1px center; +} +.tabs-scroller-right { + background: #f5f5f5 url('images/tabs_icons.png') no-repeat -15px center; +} +.tabs li a.tabs-close { + background: url('images/tabs_icons.png') no-repeat -34px center; +} +.tabs li a.tabs-inner:hover { + background: #eee; + color: #404040; + filter: none; +} +.tabs li.tabs-selected a.tabs-inner { + background-color: #ffffff; + color: #000000; +} +.tabs li a.tabs-inner { + color: #000000; + background-color: #f5f5f5; +} +.tabs-header, +.tabs-tool { + background-color: #f5f5f5; +} +.tabs-header-plain { + background: transparent; +} +.tabs-header, +.tabs-scroller-left, +.tabs-scroller-right, +.tabs-tool, +.tabs, +.tabs-panels, +.tabs li a.tabs-inner, +.tabs li.tabs-selected a.tabs-inner, +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, +.tabs-header-left .tabs li.tabs-selected a.tabs-inner, +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + border-color: #ddd; +} +.tabs-p-tool a:hover, +.tabs li a:hover.tabs-close, +.tabs-scroller-over { + background-color: #eee; +} +.tabs li.tabs-selected a.tabs-inner { + border-bottom: 1px solid #ffffff; +} +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { + border-top: 1px solid #ffffff; +} +.tabs-header-left .tabs li.tabs-selected a.tabs-inner { + border-right: 1px solid #ffffff; +} +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + border-left: 1px solid #ffffff; +} +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #00bbee; + color: #fff; + filter: none; + border-color: #ddd; +} diff --git a/assets/js/easy-ui/themes/material/tagbox.css b/assets/js/easy-ui/themes/material/tagbox.css new file mode 100644 index 0000000000..16ff41475e --- /dev/null +++ b/assets/js/easy-ui/themes/material/tagbox.css @@ -0,0 +1,44 @@ +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; + background: #eee; + color: #404040; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} diff --git a/assets/js/easy-ui/themes/material/textbox.css b/assets/js/easy-ui/themes/material/textbox.css new file mode 100644 index 0000000000..48bd54de43 --- /dev/null +++ b/assets/js/easy-ui/themes/material/textbox.css @@ -0,0 +1,139 @@ +.textbox { + position: relative; + border: 1px solid #ddd; + background-color: #fff; + vertical-align: middle; + display: inline-block; + overflow: hidden; + white-space: nowrap; + margin: 0; + padding: 0; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.textbox .textbox-text { + font-size: 12px; + border: 0; + margin: 0; + padding: 4px; + white-space: normal; + vertical-align: top; + outline-style: none; + resize: none; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} +.textbox .textbox-prompt { + font-size: 12px; + color: #aaa; +} +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { + position: absolute; + top: 0; + padding: 0; + vertical-align: top; + -moz-border-radius: 0 0 0 0; + -webkit-border-radius: 0 0 0 0; + border-radius: 0 0 0 0; +} +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; + border-width: 0 0 0 1px; +} +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; + border-width: 0 1px 0 0; +} +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} +.textbox-addon { + position: absolute; + top: 0; +} +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} +.textbox-icon { + display: inline-block; + width: 18px; + height: 20px; + overflow: hidden; + vertical-align: top; + background-position: center center; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); + text-decoration: none; + outline-style: none; +} +.textbox-icon-disabled, +.textbox-icon-readonly { + cursor: default; +} +.textbox-icon:hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.textbox-icon-disabled:hover { + opacity: 0.6; + filter: alpha(opacity=60); +} +.textbox-focused { + border-color: #c4c4c4; + -moz-box-shadow: 0 0 3px 0 #ddd; + -webkit-box-shadow: 0 0 3px 0 #ddd; + box-shadow: 0 0 3px 0 #ddd; +} +.textbox-invalid { + border-color: #ffa8a8; + background-color: #fff; +} diff --git a/assets/js/easy-ui/themes/material/tooltip.css b/assets/js/easy-ui/themes/material/tooltip.css new file mode 100644 index 0000000000..18aa87c146 --- /dev/null +++ b/assets/js/easy-ui/themes/material/tooltip.css @@ -0,0 +1,103 @@ +.tooltip { + position: absolute; + display: none; + z-index: 9900000; + outline: none; + opacity: 1; + filter: alpha(opacity=100); + padding: 5px; + border-width: 1px; + border-style: solid; + border-radius: 5px; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.tooltip-content { + font-size: 12px; +} +.tooltip-arrow-outer, +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + line-height: 0; + font-size: 0; + border-style: solid; + border-width: 6px; + border-color: transparent; + _border-color: tomato; + _filter: chroma(color=tomato); +} +.tooltip-arrow { + display: none \9; +} +.tooltip-right .tooltip-arrow-outer { + left: 0; + top: 50%; + margin: -6px 0 0 -13px; +} +.tooltip-right .tooltip-arrow { + left: 0; + top: 50%; + margin: -6px 0 0 -12px; +} +.tooltip-left .tooltip-arrow-outer { + right: 0; + top: 50%; + margin: -6px -13px 0 0; +} +.tooltip-left .tooltip-arrow { + right: 0; + top: 50%; + margin: -6px -12px 0 0; +} +.tooltip-top .tooltip-arrow-outer { + bottom: 0; + left: 50%; + margin: 0 0 -13px -6px; +} +.tooltip-top .tooltip-arrow { + bottom: 0; + left: 50%; + margin: 0 0 -12px -6px; +} +.tooltip-bottom .tooltip-arrow-outer { + top: 0; + left: 50%; + margin: -13px 0 0 -6px; +} +.tooltip-bottom .tooltip-arrow { + top: 0; + left: 50%; + margin: -12px 0 0 -6px; +} +.tooltip { + background-color: #ffffff; + border-color: #ddd; + color: #404040; +} +.tooltip-right .tooltip-arrow-outer { + border-right-color: #ddd; +} +.tooltip-right .tooltip-arrow { + border-right-color: #ffffff; +} +.tooltip-left .tooltip-arrow-outer { + border-left-color: #ddd; +} +.tooltip-left .tooltip-arrow { + border-left-color: #ffffff; +} +.tooltip-top .tooltip-arrow-outer { + border-top-color: #ddd; +} +.tooltip-top .tooltip-arrow { + border-top-color: #ffffff; +} +.tooltip-bottom .tooltip-arrow-outer { + border-bottom-color: #ddd; +} +.tooltip-bottom .tooltip-arrow { + border-bottom-color: #ffffff; +} diff --git a/assets/js/easy-ui/themes/material/tree.css b/assets/js/easy-ui/themes/material/tree.css new file mode 100644 index 0000000000..aa3457160d --- /dev/null +++ b/assets/js/easy-ui/themes/material/tree.css @@ -0,0 +1,161 @@ +.tree { + margin: 0; + padding: 0; + list-style-type: none; +} +.tree li { + white-space: nowrap; +} +.tree li ul { + list-style-type: none; + margin: 0; + padding: 0; +} +.tree-node { + height: 18px; + white-space: nowrap; + cursor: pointer; +} +.tree-hit { + cursor: pointer; +} +.tree-expanded, +.tree-collapsed, +.tree-folder, +.tree-file, +.tree-checkbox, +.tree-indent { + display: inline-block; + width: 16px; + height: 18px; + vertical-align: top; + overflow: hidden; +} +.tree-expanded { + background: url('images/tree_icons.png') no-repeat -18px 0px; +} +.tree-expanded-hover { + background: url('images/tree_icons.png') no-repeat -50px 0px; +} +.tree-collapsed { + background: url('images/tree_icons.png') no-repeat 0px 0px; +} +.tree-collapsed-hover { + background: url('images/tree_icons.png') no-repeat -32px 0px; +} +.tree-lines .tree-expanded, +.tree-lines .tree-root-first .tree-expanded { + background: url('images/tree_icons.png') no-repeat -144px 0; +} +.tree-lines .tree-collapsed, +.tree-lines .tree-root-first .tree-collapsed { + background: url('images/tree_icons.png') no-repeat -128px 0; +} +.tree-lines .tree-node-last .tree-expanded, +.tree-lines .tree-root-one .tree-expanded { + background: url('images/tree_icons.png') no-repeat -80px 0; +} +.tree-lines .tree-node-last .tree-collapsed, +.tree-lines .tree-root-one .tree-collapsed { + background: url('images/tree_icons.png') no-repeat -64px 0; +} +.tree-line { + background: url('images/tree_icons.png') no-repeat -176px 0; +} +.tree-join { + background: url('images/tree_icons.png') no-repeat -192px 0; +} +.tree-joinbottom { + background: url('images/tree_icons.png') no-repeat -160px 0; +} +.tree-folder { + background: url('images/tree_icons.png') no-repeat -208px 0; +} +.tree-folder-open { + background: url('images/tree_icons.png') no-repeat -224px 0; +} +.tree-file { + background: url('images/tree_icons.png') no-repeat -240px 0; +} +.tree-loading { + background: url('images/loading.gif') no-repeat center center; +} +.tree-checkbox0 { + background: url('images/tree_icons.png') no-repeat -208px -18px; +} +.tree-checkbox1 { + background: url('images/tree_icons.png') no-repeat -224px -18px; +} +.tree-checkbox2 { + background: url('images/tree_icons.png') no-repeat -240px -18px; +} +.tree-title { + font-size: 12px; + display: inline-block; + text-decoration: none; + vertical-align: top; + white-space: nowrap; + padding: 0 2px; + height: 18px; + line-height: 18px; +} +.tree-node-proxy { + font-size: 12px; + line-height: 20px; + padding: 0 2px 0 20px; + border-width: 1px; + border-style: solid; + z-index: 9900000; +} +.tree-dnd-icon { + display: inline-block; + position: absolute; + width: 16px; + height: 18px; + left: 2px; + top: 50%; + margin-top: -9px; +} +.tree-dnd-yes { + background: url('images/tree_icons.png') no-repeat -256px 0; +} +.tree-dnd-no { + background: url('images/tree_icons.png') no-repeat -256px -18px; +} +.tree-node-top { + border-top: 1px dotted red; +} +.tree-node-bottom { + border-bottom: 1px dotted red; +} +.tree-node-append .tree-title { + border: 1px dotted red; +} +.tree-editor { + border: 1px solid #ddd; + font-size: 12px; + line-height: 16px; + padding: 0 4px; + margin: 0; + width: 80px; + outline-style: none; + vertical-align: top; + position: absolute; + top: 0; +} +.tree-node-proxy { + background-color: #ffffff; + color: #404040; + border-color: #ddd; +} +.tree-node-hover { + background: #eee; + color: #404040; +} +.tree-node-selected { + background: #00bbee; + color: #fff; +} +.tree-node-hidden { + display: none; +} diff --git a/assets/js/easy-ui/themes/material/validatebox.css b/assets/js/easy-ui/themes/material/validatebox.css new file mode 100644 index 0000000000..5911752fea --- /dev/null +++ b/assets/js/easy-ui/themes/material/validatebox.css @@ -0,0 +1,5 @@ +.validatebox-invalid { + border-color: #ffa8a8; + background-color: #fff; + color: #404040; +} diff --git a/assets/js/easy-ui/themes/material/window.css b/assets/js/easy-ui/themes/material/window.css new file mode 100644 index 0000000000..5bd6c465fe --- /dev/null +++ b/assets/js/easy-ui/themes/material/window.css @@ -0,0 +1,177 @@ +.window { + overflow: hidden; + padding: 5px; + border-width: 1px; + border-style: solid; +} +.window .window-header { + background: transparent; + padding: 0px 0px 6px 0px; +} +.window .window-body { + border-width: 1px; + border-style: solid; + border-top-width: 0px; +} +.window .window-body-noheader { + border-top-width: 1px; +} +.window .panel-body-nobottom { + border-bottom-width: 0; +} +.window .window-header .panel-icon, +.window .window-header .panel-tool { + top: 50%; + margin-top: -11px; +} +.window .window-header .panel-icon { + left: 1px; +} +.window .window-header .panel-tool { + right: 1px; +} +.window .window-header .panel-with-icon { + padding-left: 18px; +} +.window-proxy { + position: absolute; + overflow: hidden; +} +.window-proxy-mask { + position: absolute; + filter: alpha(opacity=5); + opacity: 0.05; +} +.window-mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + filter: alpha(opacity=40); + opacity: 0.40; + font-size: 1px; + overflow: hidden; +} +.window, +.window-shadow { + position: absolute; + -moz-border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + border-radius: 4px 4px 4px 4px; +} +.window-shadow { + background: #fafafa; + -moz-box-shadow: 2px 2px 3px #fafafa; + -webkit-box-shadow: 2px 2px 3px #fafafa; + box-shadow: 2px 2px 3px #fafafa; + filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); +} +.window, +.window .window-body { + border-color: #ddd; +} +.window { + background-color: #f5f5f5; +} +.window-proxy { + border: 1px dashed #ddd; +} +.window-proxy-mask, +.window-mask { + background: #eee; +} +.window .panel-footer { + border: 1px solid #ddd; + position: relative; + top: -1px; +} +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} diff --git a/assets/js/easy-ui/themes/metro/accordion.css b/assets/js/easy-ui/themes/metro/accordion.css old mode 100755 new mode 100644 index 31d6079ec3..fb9f85e463 --- a/assets/js/easy-ui/themes/metro/accordion.css +++ b/assets/js/easy-ui/themes/metro/accordion.css @@ -39,3 +39,51 @@ .accordion .accordion-header-selected .panel-title { color: #000; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #fff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #ddd; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #fff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #ddd; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #fff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #ddd; +} diff --git a/assets/js/easy-ui/themes/metro/calendar.css b/assets/js/easy-ui/themes/metro/calendar.css old mode 100755 new mode 100644 index 6af24ac4cd..42f7366132 --- a/assets/js/easy-ui/themes/metro/calendar.css +++ b/assets/js/easy-ui/themes/metro/calendar.css @@ -110,14 +110,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; } .calendar-menu-prev, .calendar-menu-next { diff --git a/assets/js/easy-ui/themes/metro/combo.css b/assets/js/easy-ui/themes/metro/combo.css old mode 100755 new mode 100644 index 39fac282f4..2e89071835 --- a/assets/js/easy-ui/themes/metro/combo.css +++ b/assets/js/easy-ui/themes/metro/combo.css @@ -1,20 +1,3 @@ -.combo { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; -} .combo-arrow { width: 18px; height: 20px; @@ -38,10 +21,6 @@ .combo-panel { background-color: #fff; } -.combo { - border-color: #ddd; - background-color: #fff; -} .combo-arrow { background-color: #ffffff; } @@ -54,7 +33,3 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/metro/combobox.css b/assets/js/easy-ui/themes/metro/combobox.css old mode 100755 new mode 100644 index 0e058b1f90..eaabb31c0e --- a/assets/js/easy-ui/themes/metro/combobox.css +++ b/assets/js/easy-ui/themes/metro/combobox.css @@ -1,8 +1,8 @@ .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -11,9 +11,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #E6E6E6; color: #444; @@ -22,3 +30,10 @@ background-color: #CCE6FF; color: #000; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} diff --git a/assets/js/easy-ui/themes/metro/datagrid.css b/assets/js/easy-ui/themes/metro/datagrid.css old mode 100755 new mode 100644 index 94880f0929..95d409f296 --- a/assets/js/easy-ui/themes/metro/datagrid.css +++ b/assets/js/easy-ui/themes/metro/datagrid.css @@ -39,8 +39,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -107,10 +117,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -186,11 +197,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } diff --git a/assets/js/easy-ui/themes/metro/datalist.css b/assets/js/easy-ui/themes/metro/datalist.css new file mode 100644 index 0000000000..8a7f94989e --- /dev/null +++ b/assets/js/easy-ui/themes/metro/datalist.css @@ -0,0 +1,95 @@ +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #ffffff; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ddd; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #444; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ddd; +} +.m-list li>a:hover { + background: #E6E6E6; + color: #444; +} +.m-list .m-list-group { + padding: 0 4px; +} diff --git a/assets/js/easy-ui/themes/metro/datebox.css b/assets/js/easy-ui/themes/metro/datebox.css old mode 100755 new mode 100644 index b0f71e24d9..0a235958b0 --- a/assets/js/easy-ui/themes/metro/datebox.css +++ b/assets/js/easy-ui/themes/metro/datebox.css @@ -2,11 +2,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; diff --git a/assets/js/easy-ui/themes/metro/dialog.css b/assets/js/easy-ui/themes/metro/dialog.css old mode 100755 new mode 100644 index ea1a9e8511..373747925e --- a/assets/js/easy-ui/themes/metro/dialog.css +++ b/assets/js/easy-ui/themes/metro/dialog.css @@ -2,6 +2,7 @@ overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -12,6 +13,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -30,3 +33,15 @@ .dialog-button { border-color: #ddd #ddd #ddd #ddd; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #fff; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} diff --git a/assets/js/easy-ui/themes/metro/easyui.css b/assets/js/easy-ui/themes/metro/easyui.css old mode 100755 new mode 100644 index 7522107590..9f31359c98 --- a/assets/js/easy-ui/themes/metro/easyui.css +++ b/assets/js/easy-ui/themes/metro/easyui.css @@ -134,6 +134,129 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} .accordion { overflow: hidden; border-width: 1px; @@ -175,6 +298,54 @@ .accordion .accordion-header-selected .panel-title { color: #000; } +.accordion .panel-last > .accordion-header { + border-bottom-color: #ffffff; +} +.accordion .panel-last > .accordion-body { + border-bottom-color: #fff; +} +.accordion .panel-last > .accordion-header-selected, +.accordion .panel-last > .accordion-header-border { + border-bottom-color: #ddd; +} +.accordion> .panel-hleft { + float: left; +} +.accordion> .panel-hleft>.panel-header { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft> .panel-body { + border-width: 0 1px 0 0; +} +.accordion> .panel-hleft.panel-last > .accordion-header { + border-right-color: #ffffff; +} +.accordion> .panel-hleft.panel-last > .accordion-body { + border-right-color: #fff; +} +.accordion> .panel-hleft.panel-last > .accordion-header-selected, +.accordion> .panel-hleft.panel-last > .accordion-header-border { + border-right-color: #ddd; +} +.accordion> .panel-hright { + float: right; +} +.accordion> .panel-hright>.panel-header { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright> .panel-body { + border-width: 0 0 0 1px; +} +.accordion> .panel-hright.panel-last > .accordion-header { + border-left-color: #ffffff; +} +.accordion> .panel-hright.panel-last > .accordion-body { + border-left-color: #fff; +} +.accordion> .panel-hright.panel-last > .accordion-header-selected, +.accordion> .panel-hright.panel-last > .accordion-header-border { + border-left-color: #ddd; +} .window { overflow: hidden; padding: 5px; @@ -263,10 +434,100 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} .dialog-content { overflow: auto; } .dialog-toolbar { + position: relative; padding: 2px 5px; } .dialog-tool-separator { @@ -277,6 +538,8 @@ margin: 2px 1px; } .dialog-button { + position: relative; + top: -1px; padding: 5px; text-align: right; } @@ -295,6 +558,18 @@ .dialog-button { border-color: #ddd #ddd #ddd #ddd; } +.window-thinborder .dialog-toolbar { + border-left: transparent; + border-right: transparent; + border-top-color: #fff; +} +.window-thinborder .dialog-button { + top: 0px; + padding: 5px 8px 8px 8px; + border-left: transparent; + border-right: transparent; + border-bottom: transparent; +} .l-btn { text-decoration: none; display: inline-block; @@ -305,9 +580,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -450,9 +726,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #ddd; + padding: 0; +} .l-btn-plain:hover { background: #E6E6E6; color: #444; @@ -519,12 +800,23 @@ -webkit-border-radius: 0px 0px 0px 0px; border-radius: 0px 0px 0px 0px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -533,18 +825,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -571,6 +903,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #c4c4c4; -moz-box-shadow: 0 0 3px 0 #ddd; -webkit-box-shadow: 0 0 3px 0 #ddd; box-shadow: 0 0 3px 0 #ddd; @@ -579,28 +912,31 @@ border-color: #ffa8a8; background-color: #fff3f3; } +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } -.combo { +.filebox-label { display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; } -.combo .combo-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0px 2px; - vertical-align: baseline; +.l-btn-disabled .filebox-label { + cursor: default; } .combo-arrow { width: 18px; @@ -625,10 +961,6 @@ .combo-panel { background-color: #fff; } -.combo { - border-color: #ddd; - background-color: #fff; -} .combo-arrow { background-color: #ffffff; } @@ -641,15 +973,11 @@ .combo .textbox-icon-disabled:hover { cursor: default; } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .combobox-item, -.combobox-group { +.combobox-group, +.combobox-stick { font-size: 12px; padding: 3px; - padding-right: 0px; } .combobox-item-disabled { opacity: 0.5; @@ -658,9 +986,17 @@ .combobox-gitem { padding-left: 10px; } -.combobox-group { +.combobox-group, +.combobox-stick { font-weight: bold; } +.combobox-stick { + position: absolute; + top: 1px; + left: 1px; + right: 1px; + background: inherit; +} .combobox-item-hover { background-color: #E6E6E6; color: #444; @@ -669,6 +1005,57 @@ background-color: #CCE6FF; color: #000; } +.combobox-icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 2px; +} +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; + background: #E6E6E6; + color: #444; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} .layout { position: relative; overflow: hidden; @@ -680,6 +1067,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -704,6 +1095,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; @@ -772,10 +1218,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -965,12 +1407,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -991,9 +1433,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0px 0 0 0px; -webkit-border-radius: 0px 0 0 0px; border-radius: 0px 0 0 0px; @@ -1001,6 +1449,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 0px 0px 0; -webkit-border-radius: 0 0px 0px 0; border-radius: 0 0px 0px 0; @@ -1021,6 +1471,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #ffffff url('images/tabs_icons.png') no-repeat 1px center; } @@ -1080,6 +1577,12 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #fff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #CCE6FF; + color: #000; + filter: none; + border-color: #ddd; +} .datagrid .panel-body { overflow: hidden; position: relative; @@ -1121,8 +1624,18 @@ border-style: solid; display: none; } +.datagrid-empty { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 25px; + line-height: 25px; + text-align: center; +} .datagrid-sort-icon { padding: 0; + display: none; } .datagrid-toolbar { height: auto; @@ -1189,10 +1702,11 @@ } .datagrid-cell-group { text-align: center; + text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { - width: 25px; + width: 30px; text-align: center; margin: 0; padding: 0; @@ -1268,11 +1782,21 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } +.datagrid-view .validatebox-invalid { + border-color: #ffa8a8; +} +.datagrid-sort .datagrid-sort-icon { + display: inline; + padding: 0 13px 0 0; + background: url('images/datagrid_icons.png') no-repeat -64px center; +} .datagrid-sort-desc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { + display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } @@ -1369,6 +1893,101 @@ .propertygrid .datagrid-view1 .datagrid-row-selected { background: #ffffff; } +.datalist .datagrid-header { + border-width: 0; +} +.datalist .datagrid-group, +.m-list .m-list-group { + height: 25px; + line-height: 25px; + font-weight: bold; + overflow: hidden; + background-color: #ffffff; + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ddd; +} +.datalist .datagrid-group-expander { + display: none; +} +.datalist .datagrid-group-title { + padding: 0 4px; +} +.datalist .datagrid-btable { + width: 100%; + table-layout: fixed; +} +.datalist .datagrid-row td { + border-style: solid; + border-left-color: transparent; + border-right-color: transparent; + border-bottom-width: 0; +} +.datalist-lines .datagrid-row td { + border-bottom-width: 1px; +} +.datalist .datagrid-cell, +.m-list li { + width: auto; + height: auto; + padding: 2px 4px; + line-height: 18px; + position: relative; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link, +.m-list li>a { + display: block; + position: relative; + cursor: pointer; + color: #444; + text-decoration: none; + overflow: hidden; + margin: -2px -4px; + padding: 2px 4px; + padding-right: 16px; + line-height: 18px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.datalist-link::after, +.m-list li>a::after { + position: absolute; + display: block; + width: 8px; + height: 8px; + content: ''; + right: 6px; + top: 50%; + margin-top: -4px; + border-style: solid; + border-width: 1px 1px 0 0; + -ms-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.m-list { + margin: 0; + padding: 0; + list-style: none; +} +.m-list li { + border-style: solid; + border-width: 0 0 1px 0; + border-color: #ddd; +} +.m-list li>a:hover { + background: #E6E6E6; + color: #444; +} +.m-list .m-list-group { + padding: 0 4px; +} .pagination { zoom: 1; } @@ -1404,7 +2023,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; @@ -1552,14 +2171,19 @@ padding-bottom: 5px; } .calendar-menu-year { - width: 40px; + width: 50px; text-align: center; border-width: 1px; border-style: solid; + outline-style: none; + resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; } .calendar-menu-prev, .calendar-menu-next { @@ -1641,11 +2265,11 @@ height: 180px; } .datebox-button { - height: 18px; - padding: 2px 5px; + padding: 0 5px; text-align: center; } .datebox-button a { + line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; @@ -1673,32 +2297,6 @@ .datebox-button a { color: #777; } -.numberbox { - border: 1px solid #ddd; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #ffffff; display: inline-block; @@ -1720,6 +2318,7 @@ height: 10px; width: 100%; height: 50%; + color: #777; outline-style: none; } .spinner-arrow-hover { @@ -1750,8 +2349,11 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #ddd; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; @@ -1785,27 +2387,6 @@ background-color: #CCE6FF; color: #000; } -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -1859,10 +2440,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #ddd; - background-color: #fff; -} .searchbox .l-btn-plain { background: #ffffff; } @@ -1871,10 +2448,6 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); @@ -1984,6 +2557,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -2027,6 +2603,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 0px 0px 0px 0px; -webkit-border-radius: 0px 0px 0px 0px; @@ -2192,12 +2775,12 @@ border-width: 0 0 0 1px; } .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -2228,9 +2811,13 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #ddd; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} .tree { margin: 0; padding: 0; @@ -2365,13 +2952,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #ddd; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -2388,6 +2976,9 @@ background: #CCE6FF; color: #000; } +.tree-node-hidden { + display: none; +} .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; @@ -2424,6 +3015,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; @@ -2493,3 +3087,80 @@ .tooltip-bottom .tooltip-arrow { border-bottom-color: #fff; } +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #dddddd; + border: 1px solid #dddddd; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; +} +.switchbutton-on { + background: #CCE6FF; + color: #000; +} +.switchbutton-off { + background-color: #fff; + color: #444; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 0px 0 0 0px; + -webkit-border-radius: 0px 0 0 0px; + border-radius: 0px 0 0 0px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 0px 0px 0; + -webkit-border-radius: 0 0px 0px 0; + border-radius: 0 0px 0px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #fff; + color: #444; + border: 1px solid #dddddd; + -moz-box-shadow: 0 0 3px 0 #dddddd; + -webkit-box-shadow: 0 0 3px 0 #dddddd; + box-shadow: 0 0 3px 0 #dddddd; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/metro/filebox.css b/assets/js/easy-ui/themes/metro/filebox.css old mode 100755 new mode 100644 index 6077ebdc13..c6bac66315 --- a/assets/js/easy-ui/themes/metro/filebox.css +++ b/assets/js/easy-ui/themes/metro/filebox.css @@ -4,3 +4,17 @@ top: 0; left: -5000px; } +.filebox-label { + display: inline-block; + position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + left: 0; + top: 0; + z-index: 10; + background: url('images/blank.gif') no-repeat; +} +.l-btn-disabled .filebox-label { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/metro/images/datagrid_icons.png b/assets/js/easy-ui/themes/metro/images/datagrid_icons.png old mode 100755 new mode 100644 index 747ac4d1b8..762d0ce0f7 Binary files a/assets/js/easy-ui/themes/metro/images/datagrid_icons.png and b/assets/js/easy-ui/themes/metro/images/datagrid_icons.png differ diff --git a/assets/js/easy-ui/themes/metro/images/passwordbox_close.png b/assets/js/easy-ui/themes/metro/images/passwordbox_close.png new file mode 100644 index 0000000000..643c09da9a Binary files /dev/null and b/assets/js/easy-ui/themes/metro/images/passwordbox_close.png differ diff --git a/assets/js/easy-ui/themes/metro/images/passwordbox_open.png b/assets/js/easy-ui/themes/metro/images/passwordbox_open.png new file mode 100644 index 0000000000..d328891f6a Binary files /dev/null and b/assets/js/easy-ui/themes/metro/images/passwordbox_open.png differ diff --git a/assets/js/easy-ui/themes/metro/images/spinner_arrows.png b/assets/js/easy-ui/themes/metro/images/spinner_arrows.png old mode 100755 new mode 100644 index b68592de32..7c2df483db Binary files a/assets/js/easy-ui/themes/metro/images/spinner_arrows.png and b/assets/js/easy-ui/themes/metro/images/spinner_arrows.png differ diff --git a/assets/js/easy-ui/themes/metro/images/tagbox_icons.png b/assets/js/easy-ui/themes/metro/images/tagbox_icons.png new file mode 100644 index 0000000000..bd02e2d817 Binary files /dev/null and b/assets/js/easy-ui/themes/metro/images/tagbox_icons.png differ diff --git a/assets/js/easy-ui/themes/metro/layout.css b/assets/js/easy-ui/themes/metro/layout.css old mode 100755 new mode 100644 index 7057fb2b0d..53ba16bfc3 --- a/assets/js/easy-ui/themes/metro/layout.css +++ b/assets/js/easy-ui/themes/metro/layout.css @@ -9,6 +9,10 @@ position: absolute; overflow: hidden; } +.layout-body { + min-width: 1px; + min-height: 1px; +} .layout-panel-east, .layout-panel-west { z-index: 2; @@ -33,6 +37,61 @@ .layout-expand .panel-header { border-bottom-width: 0px; } +.layout-expand .panel-body { + position: relative; +} +.layout-expand .panel-body .panel-icon { + margin-top: 0; + top: 0; + left: 50%; + margin-left: -8px; +} +.layout-expand-west .panel-header .panel-icon, +.layout-expand-east .panel-header .panel-icon { + display: none; +} +.layout-expand-title { + position: absolute; + top: 0; + left: 21px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.layout-expand-title-up { + position: absolute; + top: 0; + left: 0; + text-align: right; + padding-left: 5px; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 0; +} +.layout-expand-with-icon { + top: 18px; +} +.layout-expand .panel-body-noheader .layout-expand-title, +.layout-expand .panel-body-noheader .panel-icon { + top: 5px; +} +.layout-expand .panel-body-noheader .layout-expand-with-icon { + top: 23px; +} .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; diff --git a/assets/js/easy-ui/themes/metro/linkbutton.css b/assets/js/easy-ui/themes/metro/linkbutton.css old mode 100755 new mode 100644 index c871c4f081..b0c578f4df --- a/assets/js/easy-ui/themes/metro/linkbutton.css +++ b/assets/js/easy-ui/themes/metro/linkbutton.css @@ -8,9 +8,10 @@ outline: none; text-align: center; vertical-align: middle; + line-height: normal; } .l-btn-plain { - border: 0; + border-width: 0; padding: 1px; } .l-btn-left { @@ -153,9 +154,14 @@ } .l-btn-plain { background: transparent; - border: 0; + border-width: 0; filter: none; } +.l-btn-outline { + border-width: 1px; + border-color: #ddd; + padding: 0; +} .l-btn-plain:hover { background: #E6E6E6; color: #444; diff --git a/assets/js/easy-ui/themes/metro/menu.css b/assets/js/easy-ui/themes/metro/menu.css old mode 100755 new mode 100644 index 5012a506ca..26933a6e8b --- a/assets/js/easy-ui/themes/metro/menu.css +++ b/assets/js/easy-ui/themes/metro/menu.css @@ -6,6 +6,9 @@ border-style: solid; overflow: hidden; } +.menu-inline { + position: relative; +} .menu-item { position: relative; margin: 0; @@ -49,6 +52,13 @@ margin: 3px 0px 3px 25px; font-size: 1px; } +.menu-noline .menu-line { + display: none; +} +.menu-noline .menu-sep { + margin-left: 0; + margin-right: 0; +} .menu-active { -moz-border-radius: 0px 0px 0px 0px; -webkit-border-radius: 0px 0px 0px 0px; diff --git a/assets/js/easy-ui/themes/metro/messager.css b/assets/js/easy-ui/themes/metro/messager.css old mode 100755 new mode 100644 index 1efbe7ced9..f8e29afd3a --- a/assets/js/easy-ui/themes/metro/messager.css +++ b/assets/js/easy-ui/themes/metro/messager.css @@ -1,10 +1,10 @@ .messager-body { - padding: 10px; - overflow: hidden; + padding: 10px 10px 30px 10px; + overflow: auto; } .messager-button { text-align: center; - padding-top: 10px; + padding: 5px; } .messager-button .l-btn { width: 70px; @@ -35,6 +35,10 @@ } .messager-body .messager-input { width: 100%; - padding: 1px 0; + padding: 4px 0; + outline-style: none; border: 1px solid #ddd; } +.window-thinborder .messager-button { + padding-bottom: 8px; +} diff --git a/assets/js/easy-ui/themes/metro/numberbox.css b/assets/js/easy-ui/themes/metro/numberbox.css old mode 100755 new mode 100644 index 3d5a506d44..e69de29bb2 --- a/assets/js/easy-ui/themes/metro/numberbox.css +++ b/assets/js/easy-ui/themes/metro/numberbox.css @@ -1,9 +0,0 @@ -.numberbox { - border: 1px solid #ddd; - margin: 0; - padding: 0 2px; - vertical-align: middle; -} -.textbox { - padding: 0; -} diff --git a/assets/js/easy-ui/themes/metro/pagination.css b/assets/js/easy-ui/themes/metro/pagination.css old mode 100755 new mode 100644 index e3110673c5..c0f74243c3 --- a/assets/js/easy-ui/themes/metro/pagination.css +++ b/assets/js/easy-ui/themes/metro/pagination.css @@ -33,7 +33,7 @@ } .pagination-info { float: right; - margin: 0 6px 0 0; + margin: 0 6px; padding: 0; height: 30px; line-height: 30px; diff --git a/assets/js/easy-ui/themes/metro/panel.css b/assets/js/easy-ui/themes/metro/panel.css old mode 100755 new mode 100644 index 6273ac396e..4af47fad92 --- a/assets/js/easy-ui/themes/metro/panel.css +++ b/assets/js/easy-ui/themes/metro/panel.css @@ -134,3 +134,126 @@ .panel-footer-noborder { border-width: 1px 0 0 0; } +.panel-hleft, +.panel-hright { + position: relative; +} +.panel-hleft>.panel-body, +.panel-hright>.panel-body { + position: absolute; +} +.panel-hleft>.panel-header { + float: left; +} +.panel-hright>.panel-header { + float: right; +} +.panel-hleft>.panel-body { + border-top-width: 1px; + border-left-width: 0; +} +.panel-hright>.panel-body { + border-top-width: 1px; + border-right-width: 0; +} +.panel-hleft>.panel-body-nobottom { + border-bottom-width: 1px; + border-right-width: 0; +} +.panel-hright>.panel-body-nobottom { + border-bottom-width: 1px; + border-left-width: 0; +} +.panel-hleft>.panel-footer { + position: absolute; + right: 0; +} +.panel-hright>.panel-footer { + position: absolute; + left: 0; +} +.panel-hleft>.panel-header-noborder { + border-width: 0 1px 0 0; +} +.panel-hright>.panel-header-noborder { + border-width: 0 0 0 1px; +} +.panel-hleft>.panel-body-noborder { + border-width: 0; +} +.panel-hright>.panel-body-noborder { + border-width: 0; +} +.panel-hleft>.panel-body-noheader { + border-left-width: 1px; +} +.panel-hright>.panel-body-noheader { + border-right-width: 1px; +} +.panel-hleft>.panel-footer-noborder { + border-width: 0 0 0 1px; +} +.panel-hright>.panel-footer-noborder { + border-width: 0 1px 0 0; +} +.panel-hleft>.panel-header .panel-icon, +.panel-hright>.panel-header .panel-icon { + margin-top: 0; + top: 5px; +} +.panel-hleft>.panel-header .panel-title, +.panel-hright>.panel-header .panel-title { + position: absolute; + min-width: 16px; + left: 21px; + top: 5px; + bottom: auto; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(90deg); + -o-transform-origin: 0 0; + transform: rotate(90deg); + transform-origin: 0 0; +} +.panel-hleft>.panel-header .panel-title-up, +.panel-hright>.panel-header .panel-title-up { + position: absolute; + min-width: 16px; + left: 21px; + top: auto; + bottom: 5px; + text-align: right; + white-space: nowrap; + word-wrap: normal; + -webkit-transform: rotate(-90deg); + -webkit-transform-origin: 0 0; + -moz-transform: rotate(-90deg); + -moz-transform-origin: 0 0; + -o-transform: rotate(-90deg); + -o-transform-origin: 0 0; + transform: rotate(-90deg); + transform-origin: 0 16px; +} +.panel-hleft>.panel-header .panel-with-icon.panel-title-up, +.panel-hright>.panel-header .panel-with-icon.panel-title-up { + padding-left: 0; + padding-right: 18px; +} +.panel-hleft>.panel-header .panel-tool, +.panel-hright>.panel-header .panel-tool { + top: auto; + bottom: 5px; + width: 16px; + height: auto; + left: 50%; + margin-left: -8px; + margin-top: 0; +} +.panel-hleft>.panel-header .panel-tool a, +.panel-hright>.panel-header .panel-tool a { + margin: 2px 0 0 0; +} diff --git a/assets/js/easy-ui/themes/metro/passwordbox.css b/assets/js/easy-ui/themes/metro/passwordbox.css new file mode 100644 index 0000000000..92c9ce586b --- /dev/null +++ b/assets/js/easy-ui/themes/metro/passwordbox.css @@ -0,0 +1,6 @@ +.passwordbox-open { + background: url('images/passwordbox_open.png') no-repeat center center; +} +.passwordbox-close { + background: url('images/passwordbox_close.png') no-repeat center center; +} diff --git a/assets/js/easy-ui/themes/metro/searchbox.css b/assets/js/easy-ui/themes/metro/searchbox.css old mode 100755 new mode 100644 index 25a4a7e7c8..2d3af1c153 --- a/assets/js/easy-ui/themes/metro/searchbox.css +++ b/assets/js/easy-ui/themes/metro/searchbox.css @@ -1,24 +1,3 @@ -.searchbox { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.searchbox .searchbox-text { - font-size: 12px; - border: 0; - margin: 0; - padding: 0 2px; - vertical-align: top; -} -.searchbox .searchbox-prompt { - font-size: 12px; - color: #ccc; -} .searchbox-button { width: 18px; height: 20px; @@ -72,10 +51,6 @@ .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } -.searchbox { - border-color: #ddd; - background-color: #fff; -} .searchbox .l-btn-plain { background: #ffffff; } @@ -84,7 +59,3 @@ opacity: 0.5; filter: alpha(opacity=50); } -.textbox-invalid { - border-color: #ffa8a8; - background-color: #fff3f3; -} diff --git a/assets/js/easy-ui/themes/metro/spinner.css b/assets/js/easy-ui/themes/metro/spinner.css old mode 100755 new mode 100644 index 00e15888ba..9179f9b070 --- a/assets/js/easy-ui/themes/metro/spinner.css +++ b/assets/js/easy-ui/themes/metro/spinner.css @@ -1,20 +1,3 @@ -.spinner { - display: inline-block; - white-space: nowrap; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - overflow: hidden; - vertical-align: middle; -} -.spinner .spinner-text { - font-size: 12px; - border: 0px; - margin: 0; - padding: 0 2px; - vertical-align: baseline; -} .spinner-arrow { background-color: #ffffff; display: inline-block; @@ -36,6 +19,7 @@ height: 10px; width: 100%; height: 50%; + color: #777; outline-style: none; } .spinner-arrow-hover { @@ -66,6 +50,9 @@ .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } -.spinner { - border-color: #ddd; +.spinner-button-up { + background: url('images/spinner_arrows.png') no-repeat -32px center; +} +.spinner-button-down { + background: url('images/spinner_arrows.png') no-repeat -48px center; } diff --git a/assets/js/easy-ui/themes/metro/switchbutton.css b/assets/js/easy-ui/themes/metro/switchbutton.css new file mode 100644 index 0000000000..351083eb9f --- /dev/null +++ b/assets/js/easy-ui/themes/metro/switchbutton.css @@ -0,0 +1,77 @@ +.switchbutton { + text-decoration: none; + display: inline-block; + overflow: hidden; + vertical-align: middle; + margin: 0; + padding: 0; + cursor: pointer; + background: #dddddd; + border: 1px solid #dddddd; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; +} +.switchbutton-inner { + display: inline-block; + overflow: hidden; + position: relative; + top: -1px; + left: -1px; +} +.switchbutton-on, +.switchbutton-off, +.switchbutton-handle { + display: inline-block; + text-align: center; + height: 100%; + float: left; + font-size: 12px; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; +} +.switchbutton-on { + background: #CCE6FF; + color: #000; +} +.switchbutton-off { + background-color: #fff; + color: #444; +} +.switchbutton-on, +.switchbutton-reversed .switchbutton-off { + -moz-border-radius: 0px 0 0 0px; + -webkit-border-radius: 0px 0 0 0px; + border-radius: 0px 0 0 0px; +} +.switchbutton-off, +.switchbutton-reversed .switchbutton-on { + -moz-border-radius: 0 0px 0px 0; + -webkit-border-radius: 0 0px 0px 0; + border-radius: 0 0px 0px 0; +} +.switchbutton-handle { + position: absolute; + top: 0; + left: 50%; + background-color: #fff; + color: #444; + border: 1px solid #dddddd; + -moz-box-shadow: 0 0 3px 0 #dddddd; + -webkit-box-shadow: 0 0 3px 0 #dddddd; + box-shadow: 0 0 3px 0 #dddddd; +} +.switchbutton-value { + position: absolute; + top: 0; + left: -5000px; +} +.switchbutton-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.switchbutton-disabled, +.switchbutton-readonly { + cursor: default; +} diff --git a/assets/js/easy-ui/themes/metro/tabs.css b/assets/js/easy-ui/themes/metro/tabs.css old mode 100755 new mode 100644 index 7a354ae27c..e42fd50a14 --- a/assets/js/easy-ui/themes/metro/tabs.css +++ b/assets/js/easy-ui/themes/metro/tabs.css @@ -10,10 +10,6 @@ padding-top: 2px; overflow: hidden; } -.tabs-header-plain { - border: 0; - background: transparent; -} .tabs-scroller-left, .tabs-scroller-right { position: absolute; @@ -203,12 +199,12 @@ } .tabs-header-left .tabs { height: 100%; - padding: 4px 0 0 4px; + padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; - padding: 4px 4px 0 0; + padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, @@ -229,9 +225,15 @@ margin: 0 0 4px -1px; float: left; } +.tabs-justified li a.tabs-inner { + padding-left: 0; + padding-right: 0; +} .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0px 0 0 0px; -webkit-border-radius: 0px 0 0 0px; border-radius: 0px 0 0 0px; @@ -239,6 +241,8 @@ .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; + padding-left: 10px; + padding-right: 10px; -moz-border-radius: 0 0px 0px 0; -webkit-border-radius: 0 0px 0px 0; border-radius: 0 0px 0px 0; @@ -259,6 +263,53 @@ border: 0px; background: transparent; } +.tabs-pill { + padding-bottom: 3px; +} +.tabs-header-bottom .tabs-pill { + padding-top: 3px; + padding-bottom: 0; +} +.tabs-header-left .tabs-pill { + padding-right: 3px; +} +.tabs-header-right .tabs-pill { + padding-left: 3px; +} +.tabs-header .tabs-pill li a.tabs-inner { + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; +} +.tabs-header-narrow, +.tabs-header-narrow .tabs-narrow { + padding: 0; +} +.tabs-narrow li, +.tabs-header-bottom .tabs-narrow li { + margin-left: 0; + margin-right: -1px; +} +.tabs-narrow li.tabs-last, +.tabs-header-bottom .tabs-narrow li.tabs-last { + margin-right: 0; +} +.tabs-header-left .tabs-narrow, +.tabs-header-right .tabs-narrow { + padding-top: 0; +} +.tabs-header-left .tabs-narrow li { + margin-bottom: -1px; + margin-right: -1px; +} +.tabs-header-left .tabs-narrow li.tabs-last, +.tabs-header-right .tabs-narrow li.tabs-last { + margin-bottom: 0; +} +.tabs-header-right .tabs-narrow li { + margin-bottom: -1px; + margin-left: -1px; +} .tabs-scroller-left { background: #ffffff url('images/tabs_icons.png') no-repeat 1px center; } @@ -318,3 +369,9 @@ .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #fff; } +.tabs-header .tabs-pill li.tabs-selected a.tabs-inner { + background: #CCE6FF; + color: #000; + filter: none; + border-color: #ddd; +} diff --git a/assets/js/easy-ui/themes/metro/tagbox.css b/assets/js/easy-ui/themes/metro/tagbox.css new file mode 100644 index 0000000000..7c6fd15f89 --- /dev/null +++ b/assets/js/easy-ui/themes/metro/tagbox.css @@ -0,0 +1,44 @@ +.tagbox { + cursor: text; +} +.tagbox .textbox-text { + float: left; +} +.tagbox-label { + position: relative; + display: block; + margin: 4px 0 0 4px; + padding: 0 20px 0 4px; + float: left; + vertical-align: top; + text-decoration: none; + -moz-border-radius: 0px 0px 0px 0px; + -webkit-border-radius: 0px 0px 0px 0px; + border-radius: 0px 0px 0px 0px; + background: #E6E6E6; + color: #444; +} +.tagbox-remove { + background: url('images/tagbox_icons.png') no-repeat -16px center; + position: absolute; + display: block; + width: 16px; + height: 16px; + right: 2px; + top: 50%; + margin-top: -8px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tagbox-remove:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.textbox-disabled .tagbox-label { + cursor: default; +} +.textbox-disabled .tagbox-remove:hover { + cursor: default; + opacity: 0.6; + filter: alpha(opacity=60); +} diff --git a/assets/js/easy-ui/themes/metro/textbox.css b/assets/js/easy-ui/themes/metro/textbox.css old mode 100755 new mode 100644 index cdbab2a811..53f08dd8fd --- a/assets/js/easy-ui/themes/metro/textbox.css +++ b/assets/js/easy-ui/themes/metro/textbox.css @@ -25,12 +25,23 @@ -webkit-border-radius: 0px 0px 0px 0px; border-radius: 0px 0px 0px 0px; } +.textbox .textbox-text::-ms-clear, +.textbox .textbox-text::-ms-reveal { + display: none; +} +.textbox textarea.textbox-text { + white-space: pre-wrap; +} .textbox .textbox-prompt { font-size: 12px; color: #aaa; } -.textbox-button, -.textbox-button:hover { +.textbox .textbox-bgicon { + background-position: 3px center; + padding-left: 21px; +} +.textbox .textbox-button, +.textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; @@ -39,18 +50,58 @@ -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } -.textbox-button-right, -.textbox-button-right:hover { +.textbox .textbox-button-right, +.textbox .textbox-button-right:hover { + right: 0; border-width: 0 0 0 1px; } -.textbox-button-left, -.textbox-button-left:hover { +.textbox .textbox-button-left, +.textbox .textbox-button-left:hover { + left: 0; border-width: 0 1px 0 0; } +.textbox .textbox-button-top, +.textbox .textbox-button-top:hover { + left: 0; + border-width: 0 0 1px 0; +} +.textbox .textbox-button-bottom, +.textbox .textbox-button-bottom:hover { + top: auto; + bottom: 0; + left: 0; + border-width: 1px 0 0 0; +} .textbox-addon { position: absolute; top: 0; } +.textbox-label { + display: inline-block; + width: 80px; + height: 22px; + line-height: 22px; + vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding-right: 5px; +} +.textbox-label-after { + padding-left: 5px; + padding-right: 0; +} +.textbox-label-top { + display: block; + width: auto; + padding: 0; +} +.textbox-disabled, +.textbox-label-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} .textbox-icon { display: inline-block; width: 18px; @@ -77,6 +128,7 @@ filter: alpha(opacity=60); } .textbox-focused { + border-color: #c4c4c4; -moz-box-shadow: 0 0 3px 0 #ddd; -webkit-box-shadow: 0 0 3px 0 #ddd; box-shadow: 0 0 3px 0 #ddd; diff --git a/assets/js/easy-ui/themes/metro/tooltip.css b/assets/js/easy-ui/themes/metro/tooltip.css old mode 100755 new mode 100644 index 8382539e70..b8f955c2b1 --- a/assets/js/easy-ui/themes/metro/tooltip.css +++ b/assets/js/easy-ui/themes/metro/tooltip.css @@ -29,6 +29,9 @@ _border-color: tomato; _filter: chroma(color=tomato); } +.tooltip-arrow { + display: none \9; +} .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; diff --git a/assets/js/easy-ui/themes/metro/tree.css b/assets/js/easy-ui/themes/metro/tree.css old mode 100755 new mode 100644 index a2ec6931ca..52892a1362 --- a/assets/js/easy-ui/themes/metro/tree.css +++ b/assets/js/easy-ui/themes/metro/tree.css @@ -132,13 +132,14 @@ border: 1px dotted red; } .tree-editor { - border: 1px solid #ccc; + border: 1px solid #ddd; font-size: 12px; - height: 14px !important; - height: 18px; - line-height: 14px; - padding: 1px 2px; + line-height: 16px; + padding: 0 4px; + margin: 0; width: 80px; + outline-style: none; + vertical-align: top; position: absolute; top: 0; } @@ -155,3 +156,6 @@ background: #CCE6FF; color: #000; } +.tree-node-hidden { + display: none; +} diff --git a/assets/js/easy-ui/themes/metro/window.css b/assets/js/easy-ui/themes/metro/window.css old mode 100755 new mode 100644 index de84433f27..7ec192ee64 --- a/assets/js/easy-ui/themes/metro/window.css +++ b/assets/js/easy-ui/themes/metro/window.css @@ -86,3 +86,92 @@ position: relative; top: -1px; } +.window-thinborder { + padding: 0; +} +.window-thinborder .window-header { + padding: 5px 5px 6px 5px; +} +.window-thinborder .window-body { + border-width: 0px; +} +.window-thinborder .window-header .panel-icon, +.window-thinborder .window-header .panel-tool { + margin-top: -9px; + margin-left: 5px; + margin-right: 5px; +} +.window-noborder { + border: 0; +} +.window.panel-hleft .window-header { + padding: 0 6px 0 0; +} +.window.panel-hright .window-header { + padding: 0 0 0 6px; +} +.window.panel-hleft>.panel-header .panel-title { + top: auto; + left: 16px; +} +.window.panel-hright>.panel-header .panel-title { + top: auto; + right: 16px; +} +.window.panel-hleft>.panel-header .panel-title-up, +.window.panel-hright>.panel-header .panel-title-up { + bottom: 0; +} +.window.panel-hleft .window-body { + border-width: 1px 1px 1px 0; +} +.window.panel-hright .window-body { + border-width: 1px 0 1px 1px; +} +.window.panel-hleft .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: 0; +} +.window.panel-hright .window-header .panel-icon { + top: 1px; + margin-top: 0; + left: auto; + right: 1px; +} +.window.panel-hleft .window-header .panel-tool, +.window.panel-hright .window-header .panel-tool { + margin-top: 0; + top: auto; + bottom: 1px; + right: auto; + margin-right: 0; + left: 50%; + margin-left: -11px; +} +.window.panel-hright .window-header .panel-tool { + left: auto; + right: 1px; +} +.window-thinborder.panel-hleft .window-header { + padding: 5px 6px 5px 5px; +} +.window-thinborder.panel-hright .window-header { + padding: 5px 5px 5px 6px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title { + left: 21px; +} +.window-thinborder.panel-hleft>.panel-header .panel-title-up, +.window-thinborder.panel-hright>.panel-header .panel-title-up { + bottom: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-icon, +.window-thinborder.panel-hright .window-header .panel-icon { + margin-top: 5px; +} +.window-thinborder.panel-hleft .window-header .panel-tool, +.window-thinborder.panel-hright .window-header .panel-tool { + left: 16px; + bottom: 5px; +} diff --git a/assets/js/easy-ui/themes/mobile.css b/assets/js/easy-ui/themes/mobile.css new file mode 100644 index 0000000000..b9f2f586b0 --- /dev/null +++ b/assets/js/easy-ui/themes/mobile.css @@ -0,0 +1,380 @@ +.m-toolbar{ + position: relative; + text-align: center; + min-height: 32px; +} +.m-toolbar .m-title{ + line-height: 32px; + font-size: 16px; + font-weight: bold; + text-align: center; +} +.m-left{ + position: absolute; + height: 100%; + vertical-align: middle; + top:0; + left:0; + z-index: 1; +} +.m-right{ + position: absolute; + height: 100%; + vertical-align: middle; + top:0; + right:0; + z-index: 1; +} +.m-left>.l-btn,.m-right>.l-btn, +.m-left>.switchbutton,.m-right>.switchbutton{ + position: relative; + vertical-align: top; + top: 50%; + margin-top: -13px; +} +.m-back::before,.m-next::after{ + position: relative; + display: inline-block; + box-sizing: border-box; + vertical-align: top; + border-style: solid; + -webkit-transform:rotate(45deg); + transform:rotate(45deg); + width: 10px; + height: 10px; + top: 7px; + content: ''; +} +.m-back::before{ + border-width: 0 0 1px 1px; + margin-left: 6px; + margin-right: -6px; +} +.m-next::after{ + border-width: 1px 1px 0 0; + margin-left: -6px; + margin-right: 6px; +} +.m-buttongroup{ + display: inline-block; + margin: 0; + padding: 0; + overflow: hidden; + vertical-align: middle; +} +.m-buttongroup .l-btn{ + float: left; + margin-left: -1px; +} +.m-buttongroup .l-btn:last-child::after{ + content: ''; + clear: both; +} +.m-buttongroup .l-btn:not(:first-child):not(:last-child){ + border-radius: 0; +} +.m-buttongroup .l-btn:first-child{ + border-top-right-radius: 0; + border-bottom-right-radius: 0; + margin-left: 0; +} +.m-buttongroup .l-btn:last-child{ + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.m-buttongroup-justified{ + display: table; + table-layout: fixed; +} +.m-buttongroup-justified .l-btn{ + float: none; + display: table-cell; +} +.m-badge:not(.l-btn), +.l-btn.m-badge::after{ + display: inline-block; + min-width: 10px; + line-height: 1; + font-size: 12px; + text-align: center; + white-space: nowrap; + border-radius: 10px; + padding: 2px 4px; + border-style: solid; + border-width: 0px; + background-color: #d9534f; + color: #fff; + z-index: 99999; +} +.l-btn.m-badge::after, +.l-btn .m-badge{ + position: absolute; + top: -10px; + right: -10px; +} +.tabs-inner .m-badge{ + position: absolute; + top: 1px; + right: -10px; +} +.tabs-inner>.tabs-title>.m-badge{ + top: 0; + right: 0; +} +.tabs-header-bottom .tabs-inner>.tabs-title>.m-badge{ + top: auto; + bottom: 0; + right: 0; +} +.panel-footer .l-btn .l-btn-icon-top .m-badge, +.panel-footer .l-btn .l-btn-icon-bottom .m-badge{ + top: 0; + right: -10px; +} +.l-btn.m-badge::after{ + content: attr(data-badge); +} +.l-btn,.l-btn-left{ + overflow: visible; + position: relative; +} + +.m-in{ + -webkit-animation-timing-function: ease-out; + -webkit-animation-duration: 250ms; +} +.m-out{ + -webkit-animation-timing-function: ease-in; + -webkit-animation-duration: 250ms; +} +.m-slide-left.m-in{ + -webkit-animation-name: slideLeftIn; +} +.m-slide-left.m-out{ + -webkit-animation-name: slideLeftOut; +} +.m-slide-right.m-in{ + -webkit-animation-name: slideRightIn; +} +.m-slide-right.m-out{ + -webkit-animation-name: slideRightOut; +} +.m-slide-up.m-in{ + -webkit-animation-name: slideUpIn; +} +.m-slide-up.m-out{ + -webkit-animation-name: slideUpOut; +} +.m-slide-down.m-in{ + -webkit-animation-name: slideDownIn; +} +.m-slide-down.m-out{ + -webkit-animation-name: slideDownOut; +} + +@-webkit-keyframes slideLeftIn{ + from {-webkit-transform: translateX(100%);} + to {-webkit-transform: translateX(0);} +} +@-webkit-keyframes slideLeftOut{ + from {-webkit-transform: translateX(0);} + to {-webkit-transform: translateX(-100%);} +} +@-webkit-keyframes slideRightIn{ + from {-webkit-transform: translateX(-100%);} + to {-webkit-transform: translateX(0);} +} +@-webkit-keyframes slideRightOut{ + from {-webkit-transform: translateX(0);} + to {-webkit-transform: translateX(100%);} +} +@-webkit-keyframes slideUpIn{ + from {-webkit-transform: translateY(100%);} + to {-webkit-transform: translateY(0);} +} +@-webkit-keyframes slideUpOut{ + from {-webkit-transform: translateY(0);} + to {-webkit-transform: translateY(-100%);} +} +@-webkit-keyframes slideDownIn{ + from {-webkit-transform: translateY(-100%);} + to {-webkit-transform: translateY(0);} +} +@-webkit-keyframes slideDownOut{ + from {-webkit-transform: translateY(0);} + to {-webkit-transform: translateY(100%);} +} + +.m-fade.m-in{ + -webkit-animation-name: fadeIn; +} +.m-fade.m-out{ + -webkit-animation-name: fadeOut; +} + +@-webkit-keyframes fadeIn{ + from {opacity: 0;} + to {opacity: 1} +} +@-webkit-keyframes fadeOut{ + from {opacity: 1;} + to {opacity: 0;} +} + +.m-pop.m-in{ + -webkit-animation-name: popIn; +} +.m-pop.m-out{ + -webkit-animation-name: popOut; +} +@-webkit-keyframes popIn{ + from { + opacity: 0; + -webkit-transform: scale(.2); + } + to { + opacity: 1; + -webkit-transform: scale(1); + } +} +@-webkit-keyframes popOut{ + from { + opacity: 1; + -webkit-transform: scale(1); + } + to { + opacity: 0; + -webkit-transform: scale(0); + } +} + +.navpanel{ + position: absolute; +} + +.textbox .textbox-text{ + padding: 8px 4px; +} +.calendar-header,.calendar-title{ + height: 30px; +} +.calendar-title span{ + height: 26px; + line-height: 26px +} +.datebox-button{ + height: 24px; +} +.datebox-button a{ + line-height: 24px; + display1: inline-block; +} +.tree-node{ + height:28px; + padding:5px 0; + box-sizing: border-box; +} + +.panel-title{ + height: 26px; + line-height: 26px; +} +.window{ + padding: 5px 0 0 0; +} +.window-shadow{ + -moz-box-shadow: 0 0 30px 0 #D3D3D3; + -webkit-box-shadow: 0 0 30px 0 #D3D3D3; + box-shadow: 0 0 30px 0 #D3D3D3; +} +.window-header .panel-title{ + height: 26px; + line-height: 26px; + text-align: center; +} +.window-header .panel-tool{ + display: none; +} +.window .window-body{ + border: 0; +} +.dialog-button{ + border-color: transparent; + overflow: hidden; +} +.dialog-button .l-btn{ + margin: 0; +} + +.tabs-justified, +.tabs-justified .l-btn, +.tabs-justified li a.tabs-inner, +.tabs-justified li.tabs-selected a.tabs-inner, +.tabs-header-bottom .tabs-justified li.tabs-selected a.tabs-inner, +.tabs-header-bottom .tabs-justified li a.tabs-inner{ + -moz-border-radius:0; + -webkit-border-radius:0; + border-radius:0; +} + +.datagrid-row,.datagrid-header-row{ + height: 35px; +} +.datalist .datagrid-group-title, +.m-list .m-list-group{ + padding: 0 10px; +} +.datalist .datagrid-cell, +.m-list li{ + padding: 10px; +} +.m-list li .m-right{ + right: 10px; +} +.datalist .datalist-link, +.m-list li>a{ + margin: -10px; + padding: 10px; + padding-right: 24px; +} +.m-list li>a .m-right{ + right: 24px; +} +.datalist .datalist-link::after, +.m-list li>a::after{ + right: 12px; +} + +.spinner-arrow-up,.spinner-arrow-down{ + position: relative; + display: inline-block; + width: 50%; + height: 100%; + background: none; + float: right; +} +.spinner-arrow-down{ + float: left; +} +.spinner-arrow-up::after, +.spinner-arrow-down::after{ + position: absolute; + display: inline-block; + box-sizing: border-box; + vertical-align: top; + border-style: solid; + border-width: 2px 2px 0 0; + -webkit-transform:rotate(-45deg); + transform:rotate(-45deg); + width: 10px; + height: 10px; + left: 50%; + top: 50%; + margin-left: -5px; + margin-top: -3px; + content: ''; +} +.spinner-arrow-down::after{ + border-width: 0 0 2px 2px; + margin-top: -8px; +} \ No newline at end of file diff --git a/assets/js/easy-ui/themes/modx/easyui.css b/assets/js/easy-ui/themes/modx/easyui.css new file mode 100644 index 0000000000..3bfd70c75d --- /dev/null +++ b/assets/js/easy-ui/themes/modx/easyui.css @@ -0,0 +1,2663 @@ +*, *:before, *:after {box-sizing: border-box;} +.panel { + overflow: hidden; + text-align: left; + margin: 0; + border: 0; + border-radius: 0 0 0 0; +} +.panel-header, +.panel-body { + border-width: 1px; + border-style: solid; +} +.panel-header { + padding: 5px; + position: relative; +} +.panel-title { + background: url('images/blank.gif') no-repeat; +} +.panel-header-noborder { + border-width: 0 0 1px 0; +} +.panel-body { + overflow: auto; + border-top-width: 0; + padding: 0; +} +.panel-body-noheader { + border-top-width: 1px; +} +.panel-body-noborder { + border-width: 0px; +} +.panel-body-nobottom { + border-bottom-width: 0; +} +.panel-with-icon { + padding-left: 18px; +} +.panel-icon, +.panel-tool { + position: absolute; + top: 50%; + margin-top: -8px; + height: 16px; + overflow: hidden; +} +.panel-icon { + left: 5px; + width: 16px; +} +.panel-tool { + right: 5px; + width: auto; +} +.panel-tool a { + display: inline-block; + width: 16px; + height: 16px; + opacity: 0.6; + filter: alpha(opacity=60); + margin: 0 0 0 2px; + vertical-align: top; + line-height:16px; + text-align:center; +} +.panel-tool a:hover { + opacity: 1; + filter: alpha(opacity=100); + background-color: #e6e6e6; + border-radius: 3px 3px 3px 3px; +} +.panel-loading { + padding: 11px 0px 10px 0px; +} +.panel-noscroll { + overflow: hidden; +} +.panel-fit, +.panel-fit body { + height: 100%; + margin: 0; + padding: 0; + border: 0; + overflow: hidden; +} +.panel-header, +.panel-body { + border-color: #D4D4D4; +} +.panel-header { + background-color: #F2F2F2; + background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); +} +.panel-body { + background-color: #ffffff; + color: #333; + font-size: 12px; +} +.panel-title { + font-size: 12px; + font-weight: bold; + color: #777; + height: 16px; + line-height: 16px; +} +.panel-footer { + border: 1px solid #D4D4D4; + overflow: hidden; + background: #F5F5F5; +} +.panel-footer-noborder { + border-width: 1px 0 0 0; +} +.accordion { + overflow: hidden; + border-width: 1px; + border-style: solid; +} +.accordion .accordion-header { + border-width: 0 0 1px; + cursor: pointer; +} +.accordion .accordion-body { + border-width: 0 0 1px; +} +.accordion-noborder { + border-width: 0; +} +.accordion-noborder .accordion-header { + border-width: 0 0 1px; +} +.accordion-noborder .accordion-body { + border-width: 0 0 1px; +} +.accordion { + background: #ffffff; + border-color: #D4D4D4; +} +.accordion .accordion-header { + background: #F2F2F2; + filter: none; +} +.accordion .accordion-header-selected { + background: #0081c2; +} +.accordion .accordion-header-selected .panel-title { + color: #fff; +} +.window { + overflow: hidden; + padding: 5px; + border-width: 1px; + border-style: solid; +} +.window .window-header { + background: transparent; + padding: 0px 0px 6px 0px; +} +.window .window-body { + border-width: 1px; + border-style: solid; + border-top-width: 0px; +} +.window .window-body-noheader { + border-top-width: 1px; +} +.window .panel-body-nobottom { + border-bottom-width: 0; +} +.window .window-header .panel-icon, +.window .window-header .panel-tool { + top: 50%; + margin-top: -11px; +} +.window .window-header .panel-icon { + left: 1px; +} +.window .window-header .panel-tool { + right: 1px; +} +.window .window-header .panel-with-icon { + padding-left: 18px; +} +.window-proxy { + position: absolute; + overflow: hidden; +} +.window-proxy-mask { + position: absolute; + filter: alpha(opacity=5); + opacity: 0.05; +} +.window-mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + filter: alpha(opacity=40); + opacity: 0.40; + font-size: 1px; + overflow: hidden; +} +.window, +.window-shadow { + position: absolute; + border-radius: 5px; +} +.window-shadow { + background: #ccc; + box-shadow: 2px 2px 3px #cccccc; + filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); +} +.window, +.window .window-body { + border-color: #D4D4D4; +} +.window { + background-color: #F2F2F2; + background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 20%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); +} +.window-proxy { + border: 1px dashed #D4D4D4; +} +.window-proxy-mask, +.window-mask { + background: #ccc; +} +.window .panel-footer { + border: 1px solid #D4D4D4; + position: relative; + top: -1px; +} +.dialog-content { + overflow: auto; +} +.dialog-toolbar { + padding: 2px 5px; +} +.dialog-tool-separator { + float: left; + height: 24px; + border-left: 1px solid #ccc; + border-right: 1px solid #fff; + margin: 2px 1px; +} +.dialog-button { + padding: 5px; + text-align: right; +} +.dialog-button .l-btn { + margin-left: 5px; +} +.dialog-toolbar, +.dialog-button { + background: #F5F5F5; + border-width: 1px; + border-style: solid; +} +.dialog-toolbar { + border-color: #D4D4D4 #D4D4D4 #e6e6e6 #D4D4D4; +} +.dialog-button { + border-color: #e6e6e6 #D4D4D4 #D4D4D4 #D4D4D4; +} +.l-btn { + text-decoration: none; + display: inline-block; + overflow: hidden; + margin: 0; + padding: 0; + cursor: pointer; + outline: none; + text-align: center; + vertical-align: middle; +} +.l-btn-plain { + border: 0; + padding: 1px; +} +.l-btn-left { + display: inline-block; + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + vertical-align: top; +} +.l-btn-text { + display: inline-block; + vertical-align: top; + width: auto; + line-height: 24px; + font-size: 12px; + padding: 0; + margin: 0 4px; + color:#333; +} +.l-btn-icon { + display: inline-block; + width: 16px; + height: 16px; + line-height: 16px; + position: absolute; + top: 50%; + margin-top: -8px; + font-size: 1px; +} +.l-btn span span .l-btn-empty { + display: inline-block; + margin: 0; + width: 16px; + height: 24px; + font-size: 1px; + vertical-align: top; +} +.l-btn span .l-btn-icon-left { + padding: 0 0 0 20px; + background-position: left center; +} +.l-btn span .l-btn-icon-right { + padding: 0 20px 0 0; + background-position: right center; +} +.l-btn-icon-left .l-btn-text { + margin: 0 4px 0 24px; +} +.l-btn-icon-left .l-btn-icon { + left: 4px; + font-size:16px; +} +.l-btn-icon-right .l-btn-text { + margin: 0 24px 0 4px; +} +.l-btn-icon-right .l-btn-icon { + right: 4px; + font-size:16px; +} +.l-btn-icon-top .l-btn-text { + margin: 20px 4px 0 4px; +} +.l-btn-icon-top .l-btn-icon { + top: 4px; + left: 50%; + margin: 0 0 0 -8px; + font-size:16px; +} +.l-btn-icon-bottom .l-btn-text { + margin: 0 4px 20px 4px; +} +.l-btn-icon-bottom .l-btn-icon { + top: auto; + bottom: 4px; + left: 50%; + margin: 0 0 0 -8px; + font-size:16px; +} +.l-btn-left .l-btn-empty { + margin: 0 4px; + width: 16px; +} +.l-btn-plain:hover { + padding: 0; +} +.l-btn-focus { + outline: #0000FF dotted thin; +} +.l-btn-large .l-btn-text { + line-height: 40px; +} +.l-btn-large .l-btn-icon { + width: 32px; + height: 32px; + line-height: 32px; + margin-top: -16px; +} +.l-btn-large .l-btn-icon-left .l-btn-text { + margin-left: 40px; +} +.l-btn-large .l-btn-icon-right .l-btn-text { + margin-right: 40px; +} +.l-btn-large .l-btn-icon-top .l-btn-text { + margin-top: 36px; + line-height: 24px; + min-width: 32px; +} +.l-btn-large .l-btn-icon-top .l-btn-icon { + margin: 0 0 0 -16px; +} +.l-btn-large .l-btn-icon-bottom .l-btn-text { + margin-bottom: 36px; + line-height: 24px; + min-width: 32px; +} +.l-btn-large .l-btn-icon-bottom .l-btn-icon { + margin: 0 0 0 -16px; +} +.l-btn-large .l-btn-left .l-btn-empty { + margin: 0 4px; + width: 32px; +} +.l-btn { + color: #444; + background: #f5f5f5; + background-repeat: repeat-x; + border: 1px solid #bbb; + background: linear-gradient(to bottom,#ffffff 0,#e6e6e6 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#e6e6e6,GradientType=0); + border-radius: 5px; +} +.l-btn:hover { + background: #e6e6e6; + color: #00438a; + border: 1px solid #ddd; + filter: none; +} +.l-btn-plain { + background: transparent; + border: 0; + filter: none; +} +.l-btn-plain:hover { + background: #e6e6e6; + color: #00438a; + border: 1px solid #ddd; + border-radius: 5px; +} +.l-btn-disabled, +.l-btn-disabled:hover { + opacity: 0.5; + cursor: default; + background: #f5f5f5; + color: #444; + background: linear-gradient(to bottom,#ffffff 0,#e6e6e6 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#e6e6e6,GradientType=0); +} +.l-btn-disabled .l-btn-text, +.l-btn-disabled .l-btn-icon { + filter: alpha(opacity=50); +} +.l-btn-plain-disabled, +.l-btn-plain-disabled:hover { + background: transparent; + filter: alpha(opacity=50); +} +.l-btn-selected, +.l-btn-selected:hover { + background: #ddd; + filter: none; +} +.l-btn-plain-selected, +.l-btn-plain-selected:hover { + background: #ddd; +} +.textbox { + position: relative; + border: 1px solid #D4D4D4; + background-color: #fff; + vertical-align: middle; + display: inline-block; + overflow: hidden; + white-space: nowrap; + margin: 0; + padding: 0; + border-radius: 5px; +} +.textbox .textbox-text { + font-size: 12px; + border: 0; + margin: 0; + padding: 4px; + white-space: normal; + vertical-align: top; + outline-style: none; + resize: none; + border-radius: 5px; +} +.textbox .textbox-prompt { + font-size: 12px; + color: #aaa; +} +.textbox-button, +.textbox-button:hover { + position: absolute; + top: 0; + padding: 0; + vertical-align: top; + border-radius: 0 0 0 0; +} +.textbox-button-right, +.textbox-button-right:hover { + border-width: 0 0 0 1px; +} +.textbox-button-left, +.textbox-button-left:hover { + border-width: 0 1px 0 0; +} +.textbox-addon { + position: absolute; + top: 0; +} +.textbox-icon { + display: inline-block; + width: 18px; + height: 20px; + overflow: hidden; + vertical-align: top; + background-position: center center; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); + text-decoration: none; + outline-style: none; +} +.textbox-icon-disabled, +.textbox-icon-readonly { + cursor: default; +} +.textbox-icon:hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.textbox-icon-disabled:hover { + opacity: 0.6; + filter: alpha(opacity=60); +} +.textbox-focused { + box-shadow: 0 0 3px 0 #D4D4D4; +} +.textbox-invalid { + border-color: #ffa8a8; + background-color: #fff3f3; +} +.filebox .textbox-value { + vertical-align: top; + position: absolute; + top: 0; + left: -5000px; +} +.combo { + display: inline-block; + white-space: nowrap; + margin: 0; + padding: 0; + border-width: 1px; + border-style: solid; + overflow: hidden; + vertical-align: middle; +} +.combo .combo-text { + font-size: 12px; + border: 0px; + margin: 0; + padding: 0px 2px; + vertical-align: baseline; +} +.combo-arrow { + width: 18px; + height: 20px; + overflow: hidden; + display: inline-block; + vertical-align: top; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.combo-arrow-hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.combo-panel { + overflow: auto; +} +.combo-panel { + background-color: #ffffff; +} +.combo { + border-color: #D4D4D4; + background-color: #fff; +} +.combo-arrow { + background-color: #F2F2F2; +} +.combo-arrow-hover { + background-color: #e6e6e6; +} +.combo-arrow:hover { + background-color: #e6e6e6; +} +.combo .textbox-icon-disabled:hover { + cursor: default; +} +.textbox-invalid { + border-color: #ffa8a8; + background-color: #fff3f3; +} +.combobox-item, +.combobox-group { + font-size: 12px; + padding: 3px; + padding-right: 0px; +} +.combobox-item-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.combobox-gitem { + padding-left: 10px; +} +.combobox-group { + font-weight: bold; +} +.combobox-item-hover { + background-color: #e6e6e6; + color: #00438a; +} +.combobox-item-selected { + background-color: #0081c2; + color: #fff; +} +.layout { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; + z-index: 0; +} +.layout-panel { + position: absolute; + overflow: hidden; +} +.layout-panel-east, +.layout-panel-west { + z-index: 2; +} +.layout-panel-north, +.layout-panel-south { + z-index: 3; +} +.layout-expand { + position: absolute; + padding: 0px; + font-size: 1px; + cursor: pointer; + z-index: 1; +} +.layout-expand .panel-header, +.layout-expand .panel-body { + background: transparent; + filter: none; + overflow: hidden; +} +.layout-expand .panel-header { + border-bottom-width: 0px; +} +.layout-split-proxy-h, +.layout-split-proxy-v { + position: absolute; + font-size: 1px; + display: none; + z-index: 5; +} +.layout-split-proxy-h { + width: 5px; + cursor: e-resize; +} +.layout-split-proxy-v { + height: 5px; + cursor: n-resize; +} +.layout-mask { + position: absolute; + background: #fafafa; + filter: alpha(opacity=10); + opacity: 0.10; + z-index: 4; +} +.layout-split-proxy-h, +.layout-split-proxy-v { + background-color: #bbb; +} +.layout-split-north { + border-bottom: 5px solid #eee; +} +.layout-split-south { + border-top: 5px solid #eee; +} +.layout-split-east { + border-left: 5px solid #eee; +} +.layout-split-west { + border-right: 5px solid #eee; +} +.layout-expand { + background-color: #F2F2F2; +} +.layout-expand-over { + background-color: #F2F2F2; +} +.tabs-container { + overflow: hidden; +} +.tabs-header { + border-width: 1px; + border-style: solid; + border-bottom-width: 0; + position: relative; + padding: 0; + padding-top: 2px; + overflow: hidden; +} +.tabs-header-plain { + border: 0; + background: transparent; +} +.tabs-scroller-left, +.tabs-scroller-right { + position: absolute; + top: auto; + bottom: 0; + width: 18px; + font-size: 1px; + display: none; + cursor: pointer; + border-width: 1px; + border-style: solid; +} +.tabs-scroller-left { + left: 0; +} +.tabs-scroller-right { + right: 0; +} +.tabs-tool { + position: absolute; + bottom: 0; + padding: 1px; + overflow: hidden; + border-width: 1px; + border-style: solid; +} +.tabs-header-plain .tabs-tool { + padding: 0 1px; +} +.tabs-wrap { + position: relative; + left: 0; + overflow: hidden; + width: 100%; + margin: 0; + padding: 0; +} +.tabs-scrolling { + margin-left: 18px; + margin-right: 18px; +} +.tabs-disabled { + opacity: 0.3; + filter: alpha(opacity=30); +} +.tabs { + list-style-type: none; + height: 26px; + margin: 0px; + padding: 0px; + padding-left: 4px; + width: 50000px; + border-style: solid; + border-width: 0 0 1px 0; +} +.tabs li { + float: left; + display: inline-block; + margin: 0 4px -1px 0; + padding: 0; + position: relative; + border: 0; +} +.tabs li a.tabs-inner { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0 10px; + height: 25px; + line-height: 25px; + text-align: center; + white-space: nowrap; + border-width: 1px; + border-style: solid; + border-radius: 5px 5px 0 0; +} +.tabs li.tabs-selected a.tabs-inner { + font-weight: bold; + outline: none; +} +.tabs li.tabs-selected a:hover.tabs-inner { + cursor: default; + pointer: default; +} +.tabs li a.tabs-close, +.tabs-p-tool { + position: absolute; + font-size: 1px; + display: block; + height: 12px; + padding: 0; + top: 50%; + margin-top: -6px; + overflow: hidden; +} +.tabs li a.tabs-close { + width: 12px; + right: 5px; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tabs-p-tool { + right: 16px; +} +.tabs-p-tool a { + display: inline-block; + font-size: 1px; + width: 12px; + height: 12px; + margin: 0; + opacity: 0.6; + filter: alpha(opacity=60); +} +.tabs li a:hover.tabs-close, +.tabs-p-tool a:hover { + opacity: 1; + filter: alpha(opacity=100); + cursor: hand; + cursor: pointer; +} +.tabs-with-icon { + padding-left: 18px; +} +.tabs-icon { + position: absolute; + width: 16px; + height: 16px; + left: 10px; + top: 50%; + margin-top: -8px; +} +.tabs-title { + font-size: 12px; +} +.tabs-closable { + padding-right: 8px; +} +.tabs-panels { + margin: 0px; + padding: 0px; + border-width: 1px; + border-style: solid; + border-top-width: 0; + overflow: hidden; +} +.tabs-header-bottom { + border-width: 0 1px 1px 1px; + padding: 0 0 2px 0; +} +.tabs-header-bottom .tabs { + border-width: 1px 0 0 0; +} +.tabs-header-bottom .tabs li { + margin: -1px 4px 0 0; +} +.tabs-header-bottom .tabs li a.tabs-inner { + border-radius: 0 0 5px 5px; +} +.tabs-header-bottom .tabs-tool { + top: 0; +} +.tabs-header-bottom .tabs-scroller-left, +.tabs-header-bottom .tabs-scroller-right { + top: 0; + bottom: auto; +} +.tabs-panels-top { + border-width: 1px 1px 0 1px; +} +.tabs-header-left { + float: left; + border-width: 1px 0 1px 1px; + padding: 0; +} +.tabs-header-right { + float: right; + border-width: 1px 1px 1px 0; + padding: 0; +} +.tabs-header-left .tabs-wrap, +.tabs-header-right .tabs-wrap { + height: 100%; +} +.tabs-header-left .tabs { + height: 100%; + padding: 4px 0 0 4px; + border-width: 0 1px 0 0; +} +.tabs-header-right .tabs { + height: 100%; + padding: 4px 4px 0 0; + border-width: 0 0 0 1px; +} +.tabs-header-left .tabs li, +.tabs-header-right .tabs li { + display: block; + width: 100%; + position: relative; +} +.tabs-header-left .tabs li { + left: auto; + right: 0; + margin: 0 -1px 4px 0; + float: right; +} +.tabs-header-right .tabs li { + left: 0; + right: auto; + margin: 0 0 4px -1px; + float: left; +} +.tabs-header-left .tabs li a.tabs-inner { + display: block; + text-align: left; + border-radius: 5px 0 0 5px; +} +.tabs-header-right .tabs li a.tabs-inner { + display: block; + text-align: left; + border-radius: 0 5px 5px 0; +} +.tabs-panels-right { + float: right; + border-width: 1px 1px 1px 0; +} +.tabs-panels-left { + float: left; + border-width: 1px 0 1px 1px; +} +.tabs-header-noborder, +.tabs-panels-noborder { + border: 0px; +} +.tabs-header-plain { + border: 0px; + background: transparent; +} +.tabs li a.tabs-inner:hover { + background: #e6e6e6; + color: #00438a; + filter: none; +} +.tabs li.tabs-selected a.tabs-inner { + background-color: #ffffff; + color: #777; + background: linear-gradient(to bottom,#ffffff 0,#ffffff 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=0); +} +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { + background: linear-gradient(to bottom,#ffffff 0,#ffffff 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=0); +} +.tabs-header-left .tabs li.tabs-selected a.tabs-inner { + background: linear-gradient(to right,#ffffff 0,#ffffff 100%); + background-repeat: repeat-y; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=1); +} +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + background: linear-gradient(to right,#ffffff 0,#ffffff 100%); + background-repeat: repeat-y; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=1); +} +.tabs li a.tabs-inner { + color: #777; + background-color: #F2F2F2; + background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); +} +.tabs-header, +.tabs-tool { + background-color: #F2F2F2; +} +.tabs-header-plain { + background: transparent; +} +.tabs-header, +.tabs-scroller-left, +.tabs-scroller-right, +.tabs-tool, +.tabs, +.tabs-panels, +.tabs li a.tabs-inner, +.tabs li.tabs-selected a.tabs-inner, +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, +.tabs-header-left .tabs li.tabs-selected a.tabs-inner, +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + border-color: #D4D4D4; +} +.tabs-p-tool a:hover, +.tabs li a:hover.tabs-close, +.tabs-scroller-over { + background-color: #e6e6e6; +} +.tabs li.tabs-selected a.tabs-inner { + border-bottom: 1px solid #ffffff; +} +.tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { + border-top: 1px solid #ffffff; +} +.tabs-header-left .tabs li.tabs-selected a.tabs-inner { + border-right: 1px solid #ffffff; +} +.tabs-header-right .tabs li.tabs-selected a.tabs-inner { + border-left: 1px solid #ffffff; +} +.datagrid .panel-body { + overflow: hidden; + position: relative; +} +.datagrid-view { + position: relative; + overflow: hidden; +} +.datagrid-view1, +.datagrid-view2 { + position: absolute; + overflow: hidden; + top: 0; +} +.datagrid-view1 { + left: 0; +} +.datagrid-view2 { + right: 0; +} +.datagrid-mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0.3; + filter: alpha(opacity=30); + display: none; +} +.datagrid-mask-msg { + position: absolute; + top: 50%; + margin-top: -20px; + padding: 10px 5px 10px 30px; + width: auto; + height: 16px; + border-width: 2px; + border-style: solid; + display: none; +} +.datagrid-sort-icon { + display:none; +} +.datagrid-toolbar { + height: auto; + padding: 1px 2px; + border-width: 0 0 1px 0; + border-style: solid; +} +.datagrid-btn-separator { + float: left; + height: 24px; + border-left: 1px solid #ccc; + border-right: 1px solid #fff; + margin: 2px 1px; +} +.datagrid .datagrid-pager { + display: block; + margin: 0; + border-width: 1px 0 0 0; + border-style: solid; +} +.datagrid .datagrid-pager-top { + border-width: 0 0 1px 0; +} +.datagrid-header { + overflow: hidden; + cursor: default; + border-width: 0 0 1px 0; + border-style: solid; +} +.datagrid-header-inner { + float: left; + width: 10000px; +} +.datagrid-header-row, +.datagrid-row { + height: 25px; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-width: 0 1px 1px 0; + border-style: dotted; + margin: 0; + padding: 0; +} +.datagrid-cell, +.datagrid-cell-group, +.datagrid-header-rownumber, +.datagrid-cell-rownumber { + margin: 0; + padding: 0 4px; + white-space: nowrap; + word-wrap: normal; + overflow: hidden; + height: 18px; + line-height: 18px; + font-size: 12px; +} +.datagrid-header .datagrid-cell { + height: auto; +} +.datagrid-header .datagrid-cell span { + font-size: 12px; +} +.datagrid-cell-group { + text-align: center; +} +.datagrid-header-rownumber, +.datagrid-cell-rownumber { + width: 25px; + text-align: center; + margin: 0; + padding: 0; +} +.datagrid-body { + margin: 0; + padding: 0; + overflow: auto; + zoom: 1; +} +.datagrid-view1 .datagrid-body-inner { + padding-bottom: 20px; +} +.datagrid-view1 .datagrid-body { + overflow: hidden; +} +.datagrid-footer { + overflow: hidden; +} +.datagrid-footer-inner { + border-width: 1px 0 0 0; + border-style: solid; + width: 10000px; + float: left; +} +.datagrid-row-editing .datagrid-cell { + height: auto; +} +.datagrid-header-check, +.datagrid-cell-check { + padding: 0; + width: 27px; + height: 18px; + line-height: 18px; + font-size: 1px; + text-align: center; + overflow: hidden; +} +.datagrid-header-check input, +.datagrid-cell-check input { + margin: 0; + padding: 0; + width: 15px; + height: 18px; + vertical-align: middle; +} +.datagrid-resize-proxy { + position: absolute; + width: 1px; + height: 10000px; + top: 0; + cursor: e-resize; + display: none; +} +.datagrid-body .datagrid-editable { + margin: 0; +} +.datagrid-body .datagrid-editable table { + width: 100%; + height: 100%; +} +.datagrid-body .datagrid-editable td { + border: 0; + margin: 0; + padding: 0; +} +.datagrid-view .datagrid-editable-input { + margin: 0; + padding: 2px 4px; + border: 1px solid #D4D4D4; + font-size: 12px; + outline-style: none; + border-radius: 0 0 0 0; +} +.datagrid-header, +.datagrid-td-rownumber { + background-color: #F2F2F2; + background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); +} +.datagrid-cell-rownumber { + color: #333; +} +.datagrid-resize-proxy { + background: #bbb; +} +.datagrid-mask { + background: #ccc; +} +.datagrid-mask-msg { + border-color: #D4D4D4; +} +.datagrid-toolbar, +.datagrid-pager { + background: #F5F5F5; +} +.datagrid-header, +.datagrid-toolbar, +.datagrid-pager, +.datagrid-footer-inner { + border-color: #e6e6e6; +} +.datagrid-header td, +.datagrid-body td, +.datagrid-footer td { + border-color: #ccc; +} +.datagrid-htable, +.datagrid-btable, +.datagrid-ftable { + color: #333; + border-collapse: separate; +} +.datagrid-row-alt { + background: #F5F5F5; +} +.datagrid-row-over, +.datagrid-header td.datagrid-header-over { + background: #e6e6e6; + color: #00438a; + cursor: default; +} +.datagrid-row-selected { + background: #0081c2; + color: #fff; +} +.datagrid-row-editing .textbox, +.datagrid-row-editing .textbox-text { + border-radius: 0 0 0 0; +} +.propertygrid .datagrid-view1 .datagrid-body td { + padding-bottom: 1px; + border-width: 0 1px 0 0; +} +.propertygrid .datagrid-group { + height: 21px; + overflow: hidden; + border-width: 0 0 1px 0; + border-style: solid; +} +.propertygrid .datagrid-group span { + font-weight: bold; +} +.propertygrid .datagrid-view1 .datagrid-body td { + border-color: #e6e6e6; +} +.propertygrid .datagrid-view1 .datagrid-group { + border-color: #F2F2F2; +} +.propertygrid .datagrid-view2 .datagrid-group { + border-color: #e6e6e6; +} +.propertygrid .datagrid-group, +.propertygrid .datagrid-view1 .datagrid-body, +.propertygrid .datagrid-view1 .datagrid-row-over, +.propertygrid .datagrid-view1 .datagrid-row-selected { + background: #F2F2F2; +} +.datagrid-row-top td { + border-top:1px solid red; + background:#fff; +} +.datagrid-row-bottom td{ + border-bottom:1px solid red; + background:#fff; +} +.pagination { + zoom: 1; +} +.pagination table { + float: left; + height: 30px; +} +.pagination td { + border: 0; + vertical-align: middle; +} +.pagination select, .pagination input { + width:auto!important; + height:auto; +} +.pagination-btn-separator { + float: left; + height: 24px; + border-left: 1px solid #ccc; + border-right: 1px solid #fff; + margin: 3px 1px; +} +.pagination .pagination-num { + border-width: 1px; + border-style: solid; + margin: 0 2px; + padding: 2px; + width: 2em; + height: auto; +} +.pagination-page-list { + margin: 0px 6px; + padding: 1px 2px; + width: auto; + height: auto; + border-width: 1px; + border-style: solid; +} +.pagination-info { + float: right; + margin: 0 6px 0 0; + padding: 0; + height: 36px; + line-height: 36px; + font-size: 12px; +} +.pagination-link .l-btn-text { + width: 24px; + text-align: center; + margin: 0; +} +.pagination-page-list, +.pagination .pagination-num { + border-color: #D4D4D4; +} +.calendar { + border-width: 1px; + border-style: solid; + padding: 1px; + overflow: hidden; +} +.calendar table { + table-layout: fixed; + border-collapse: separate; + font-size: 12px; + width: 100%; + height: 100%; +} +.calendar table td, +.calendar table th { + font-size: 12px; + border: 1px solid transparent; + padding:0; +} +.calendar-noborder { + border: 0; +} +.calendar-header { + position: relative; + height: 22px; +} +.calendar-title { + text-align: center; + height: 22px; +} +.calendar-title span { + position: relative; + display: inline-block; + top: 2px; + padding: 0 3px; + height: 18px; + line-height: 18px; + font-size: 12px; + cursor: pointer; + border-radius: 5px; +} +.calendar-prevmonth, +.calendar-nextmonth, +.calendar-prevyear, +.calendar-nextyear { + position: absolute; + top: 50%; + margin-top: -7px; + width: 14px; + height: 14px; + cursor: pointer; + font-size: 1px; + border-radius: 5px; +} +.calendar-body { + position: relative; +} +.calendar-body th, +.calendar-body td { + text-align: center; +} +.calendar-day { + border: 0; + padding: 1px; + cursor: pointer; + border-radius: 5px; +} +.calendar-other-month { + opacity: 0.3; + filter: alpha(opacity=30); +} +.calendar-disabled { + opacity: 0.6; + filter: alpha(opacity=60); + cursor: default; +} +.calendar-menu { + position: absolute; + top: 0; + left: 0; + width: 180px; + height: 150px; + padding: 5px; + font-size: 12px; + display: none; + overflow: hidden; +} +.calendar-menu-year-inner { + text-align: center; + padding-bottom: 5px; +} +.calendar-menu-year { + width: 40px; + text-align: center; + border-width: 1px; + border-style: solid; + margin: 0; + padding: 2px; + font-weight: bold; + font-size: 12px; +} +.calendar-menu-prev, +.calendar-menu-next { + display: inline-block; + width: 21px; + height: 28px; + line-height: 28px; + vertical-align: top; + cursor: pointer; + border-radius: 5px; +} +.calendar-menu-month { + text-align: center; + cursor: pointer; + font-weight: bold; + border-radius: 5px; +} +.calendar-body th, +.calendar-menu-month { + color: #808080; +} +.calendar-day { + color: #333; +} +.calendar-sunday { + color: #CC2222; +} +.calendar-saturday { + color: #00ee00; +} +.calendar-today { + color: #0000ff; +} +.calendar-menu-year { + border-color: #D4D4D4; +} +.calendar { + border-color: #D4D4D4; +} +.calendar-header { + background: #F2F2F2; +} +.calendar-body, +.calendar-menu { + background: #ffffff; +} +.calendar-body th { + background: #F5F5F5; + padding: 2px 0; +} +.calendar-hover, +.calendar-nav-hover, +.calendar-menu-hover { + background-color: #e6e6e6; + color: #00438a; +} +.calendar-hover { + border: 1px solid #ddd; + padding: 0; +} +.calendar-selected { + background-color: #0081c2; + color: #fff; + border: 1px solid #0070a9; + padding: 0; +} +.datebox-calendar-inner { + height: 180px; +} +.datebox-button { + height: 18px; + padding: 2px 5px; + text-align: center; +} +.datebox-button a { + font-size: 12px; + font-weight: bold; + text-decoration: none; + opacity: 0.6; + filter: alpha(opacity=60); +} +.datebox-button a:hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.datebox-current, +.datebox-close { + float: left; +} +.datebox-close { + float: right; +} +.datebox-button { + background-color: #F5F5F5; +} +.datebox-button a { + color: #444; +} +.numberbox { + border: 1px solid #D4D4D4; + margin: 0; + padding: 0 2px; + vertical-align: middle; +} +.textbox { + padding: 0; +} +.spinner { + display: inline-block; + white-space: nowrap; + margin: 0; + padding: 0; + border-width: 1px; + border-style: solid; + overflow: hidden; + vertical-align: middle; +} +.spinner .spinner-text { + font-size: 12px; + border: 0px; + margin: 0; + padding: 0 2px; + vertical-align: baseline; +} +.spinner-arrow { + background-color: #F2F2F2; + display: inline-block; + overflow: hidden; + vertical-align: top; + margin: 0; + padding: 0; + opacity: 1.0; + text-align:center; + filter: alpha(opacity=100); + width: 18px; +} +.spinner-arrow-up, +.spinner-arrow-down { + opacity: 0.6; + filter: alpha(opacity=60); + display: block; + font-size: 1px; + width: 18px; + height: 10px; + width: 100%; + height: 50%; + outline-style: none; +} +.spinner-arrow-hover { + background-color: #e6e6e6; + opacity: 1.0; + filter: alpha(opacity=100); +} +.spinner-arrow-up:hover, +.spinner-arrow-down:hover { + opacity: 1.0; + filter: alpha(opacity=100); + background-color: #e6e6e6; +} +.textbox-icon-disabled .spinner-arrow-up:hover, +.textbox-icon-disabled .spinner-arrow-down:hover { + opacity: 0.6; + filter: alpha(opacity=60); + background-color: #F2F2F2; + cursor: default; +} +.spinner .textbox-icon-disabled { + opacity: 0.6; + filter: alpha(opacity=60); +} +.spinner { + border-color: #D4D4D4; +} +.progressbar { + border-width: 1px; + border-style: solid; + border-radius: 5px; + overflow: hidden; + position: relative; +} +.progressbar-text { + text-align: center; + position: absolute; +} +.progressbar-value { + position: relative; + overflow: hidden; + width: 0; + transition: width 0.5s ease; + border-radius: 5px; +} +.progressbar { + border-color: #D4D4D4; +} +.progressbar-text { + color: #333; + font-size: 12px; +} +.progressbar-value .progressbar-text { + background-color: #0081c2; + color: #fff; +} +.searchbox { + display: inline-block; + white-space: nowrap; + margin: 0; + padding: 0; + border-width: 1px; + border-style: solid; + overflow: hidden; + vertical-align: middle; +} +.searchbox .searchbox-text { + font-size: 12px; + border: 0; + margin: 0; + padding: 0 2px; + vertical-align: top; +} +.searchbox .searchbox-prompt { + font-size: 12px; + color: #ccc; +} +.searchbox-button { + width: 18px; + height: 20px; + overflow: hidden; + display: inline-block; + vertical-align: top; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.searchbox-button-hover { + opacity: 1.0; + filter: alpha(opacity=100); +} +.searchbox .l-btn-plain { + border: 0; + padding: 0; + vertical-align: top; + opacity: 0.6; + filter: alpha(opacity=60); + border-radius: 0 0 0 0; +} +.searchbox .l-btn-plain:hover { + border: 0; + padding: 0; + opacity: 1.0; + filter: alpha(opacity=100); + border-radius: 0 0 0 0; +} +.searchbox a.m-btn-plain-active { + border-radius: 0 0 0 0; +} +.searchbox .m-btn-active { + border-width: 0 1px 0 0; + border-radius: 0 0 0 0; +} +.searchbox .textbox-button-right { + border-width: 0 0 0 1px; +} +.searchbox .textbox-button-left { + border-width: 0 1px 0 0; +} +.searchbox { + border-color: #D4D4D4; + background-color: #fff; +} +.searchbox .l-btn-plain { + background: #F2F2F2; +} +.searchbox .l-btn-plain-disabled, +.searchbox .l-btn-plain-disabled:hover { + opacity: 0.5; + filter: alpha(opacity=50); +} +.textbox-invalid { + border-color: #ffa8a8; + background-color: #fff3f3; +} +.slider-disabled { + opacity: 0.5; + filter: alpha(opacity=50); +} +.slider-h { + height: 22px; +} +.slider-v { + width: 22px; +} +.slider-inner { + position: relative; + height: 6px; + top: 7px; + border-width: 1px; + border-style: solid; + border-radius: 5px; +} +.slider-handle { + position: absolute; + display: block; + outline: none; + width: 20px; + height: 20px; + top: 50%; + margin-top: -10px; + margin-left: -10px; +} +.slider-tip { + position: absolute; + display: inline-block; + line-height: 12px; + font-size: 12px; + white-space: nowrap; + top: -22px; +} +.slider-rule { + position: relative; + top: 15px; +} +.slider-rule span { + position: absolute; + display: inline-block; + font-size: 0; + height: 5px; + border-width: 0 0 0 1px; + border-style: solid; +} +.slider-rulelabel { + position: relative; + top: 20px; +} +.slider-rulelabel span { + position: absolute; + display: inline-block; + font-size: 12px; +} +.slider-v .slider-inner { + width: 6px; + left: 7px; + top: 0; + float: left; +} +.slider-v .slider-handle { + left: 50%; + margin-top: -10px; +} +.slider-v .slider-tip { + left: -10px; + margin-top: -6px; +} +.slider-v .slider-rule { + float: left; + top: 0; + left: 16px; +} +.slider-v .slider-rule span { + width: 5px; + height: 'auto'; + border-left: 0; + border-width: 1px 0 0 0; + border-style: solid; +} +.slider-v .slider-rulelabel { + float: left; + top: 0; + left: 23px; +} +.slider-inner { + border-color: #D4D4D4; + background: #F2F2F2; +} +.slider-rule span { + border-color: #D4D4D4; +} +.slider-rulelabel span { + color: #333; +} +.menu { + position: absolute; + margin: 0; + padding: 2px; + border-width: 1px; + border-style: solid; + overflow: hidden; +} +.menu-item { + position: relative; + margin: 0; + padding: 0; + overflow: hidden; + white-space: nowrap; + cursor: pointer; + border-width: 1px; + border-style: solid; +} +.menu-text { + height: 20px; + line-height: 20px; + float: left; + padding-left: 28px; +} +.menu-icon { + position: absolute; + width: 16px; + height: 16px; + left: 2px; + top: 50%; + margin-top: -8px; +} +.menu-rightarrow { + position: absolute; + width: 16px; + height: 16px; + right: 0; + top: 50%; + margin-top: -8px; +} +.menu-line { + position: absolute; + left: 26px; + top: 0; + height: 2000px; + font-size: 1px; +} +.menu-sep { + margin: 3px 0px 3px 25px; + font-size: 1px; +} +.menu-active { + border-radius: 5px; +} +.menu-item-disabled { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default; +} +.menu-text, +.menu-text span { + font-size: 12px; +} +.menu-shadow { + position: absolute; + border-radius: 5px; + background: #ccc; + box-shadow: 2px 2px 3px #cccccc; + filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); +} +.menu-line { + border-left: 1px solid #ccc; + border-right: 1px solid #fff; +} +.menu-sep { + border-top: 1px solid #ccc; + border-bottom: 1px solid #fff; +} +.menu { + background-color: #fff; + border-color: #e6e6e6; + color: #333; +} +.menu-content { + background: #ffffff; +} +.menu-item { + border-color: transparent; + _border-color: #fff; +} +.menu-active { + border-color: #ddd; + color: #00438a; + background: #e6e6e6; +} +.menu-active-disabled { + border-color: transparent; + background: transparent; + color: #333; +} +.m-btn-downarrow, +.s-btn-downarrow { + display: inline-block; + position: absolute; + width: 16px; + height: 16px; + font-size: 1px; + right: 0; + top: 50%; + margin-top: -8px; +} +.m-btn-active, +.s-btn-active { + background: #e6e6e6; + color: #00438a; + border: 1px solid #ddd; + filter: none; +} +.m-btn-plain-active, +.s-btn-plain-active { + background: transparent; + padding: 0; + border-width: 1px; + border-style: solid; + border-radius: 5px; +} +.m-btn .l-btn-left .l-btn-text { + margin-right: 20px; +} +.m-btn .l-btn-icon-right .l-btn-text { + margin-right: 40px; +} +.m-btn .l-btn-icon-right .l-btn-icon { + right: 20px; +} +.m-btn .l-btn-icon-top .l-btn-text { + margin-right: 4px; + margin-bottom: 14px; +} +.m-btn .l-btn-icon-bottom .l-btn-text { + margin-right: 4px; + margin-bottom: 34px; +} +.m-btn .l-btn-icon-bottom .l-btn-icon { + top: auto; + bottom: 20px; +} +.m-btn .l-btn-icon-top .m-btn-downarrow, +.m-btn .l-btn-icon-bottom .m-btn-downarrow { + top: auto; + bottom: 0px; + left: 50%; + margin-left: -8px; +} +.m-btn-line { + display: inline-block; + position: absolute; + font-size: 1px; + display: none; +} +.m-btn .l-btn-left .m-btn-line { + right: 0; + width: 16px; + height: 500px; + border-style: solid; + border-color: #bbb; + border-width: 0 0 0 1px; +} +.m-btn .l-btn-icon-top .m-btn-line, +.m-btn .l-btn-icon-bottom .m-btn-line { + left: 0; + bottom: 0; + width: 500px; + height: 16px; + border-width: 1px 0 0 0; +} +.m-btn-large .l-btn-icon-right .l-btn-text { + margin-right: 56px; +} +.m-btn-large .l-btn-icon-bottom .l-btn-text { + margin-bottom: 50px; +} +.m-btn-plain-active, +.s-btn-plain-active { + border-color: #ddd; + background-color: #e6e6e6; + color: #00438a; +} +.s-btn:hover .m-btn-line, +.s-btn-active .m-btn-line, +.s-btn-plain-active .m-btn-line { + display: inline-block; +} +.l-btn:hover .s-btn-downarrow, +.s-btn-active .s-btn-downarrow, +.s-btn-plain-active .s-btn-downarrow { + border-style: solid; + border-color: #bbb; + border-width: 0 0 0 1px; +} +.messager-body { + padding: 10px; + overflow: hidden; +} +.messager-button { + text-align: center; + padding-top: 10px; +} +.messager-button .l-btn { + width: 70px; +} +.messager-icon { + float: left; + width: 32px; + height: 32px; + margin: 0 10px 10px 0; +} +.messager-progress { + padding: 10px; +} +.messager-p-msg { + margin-bottom: 5px; +} +.messager-body .messager-input { + width: 100%; + padding: 1px 0; + border: 1px solid #D4D4D4; +} +.tree { + margin: 0; + padding: 0; + list-style-type: none; +} +.tree li { + white-space: nowrap; +} +.tree li ul { + list-style-type: none; + margin: 0; + padding: 0; +} +.tree-node { + height: 18px; + white-space: nowrap; + cursor: pointer; +} +.tree-hit { + cursor: pointer; +} +.tree-expanded, +.tree-collapsed, +.tree-folder, +.tree-file, +.tree-checkbox, +.tree-indent { + display: inline-block; + width: 16px; + height: 18px; + vertical-align: top; + overflow: hidden; +} +.tree-title { + font-size: 12px; + display: inline-block; + text-decoration: none; + vertical-align: top; + white-space: nowrap; + padding: 0 2px; + height: 18px; + line-height: 18px; +} +.tree-node-proxy { + font-size: 12px; + line-height: 20px; + padding: 0 2px 0 20px; + border-width: 1px; + border-style: solid; + z-index: 9900000; +} +.tree-dnd-icon { + display: inline-block; + position: absolute; + width: 16px; + height: 18px; + left: 2px; + top: 50%; + margin-top: -9px; +} +.tree-node-top { + border-top: 1px dotted red; +} +.tree-node-bottom { + border-bottom: 1px dotted red; +} +.tree-node-append .tree-title { + border: 1px dotted red; +} +.tree-editor { + border: 1px solid #ccc; + font-size: 12px; + height: 14px !important; + height: 18px; + line-height: 14px; + padding: 1px 2px; + width: 80px; + position: absolute; + top: 0; +} +.tree-node-proxy { + background-color: #ffffff; + color: #333; + border-color: #D4D4D4; +} +.tree-node-hover { + background: #e6e6e6; + color: #00438a; +} +.tree-node-selected { + background: #0081c2; + color: #fff; +} +.validatebox-invalid { + border-color: #ffa8a8; + background-color: #fff3f3; + color: #000; +} +.tooltip { + position: absolute; + display: none; + z-index: 9900000; + outline: none; + opacity: 1; + filter: alpha(opacity=100); + padding: 5px; + border-width: 1px; + border-style: solid; + border-radius: 5px; + border-radius: 5px; +} +.tooltip-content { + font-size: 12px; +} +.tooltip-arrow-outer, +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + line-height: 0; + font-size: 0; + border-style: solid; + border-width: 6px; + border-color: transparent; + _border-color: tomato; + _filter: chroma(color=tomato); +} +.tooltip-right .tooltip-arrow-outer { + left: 0; + top: 50%; + margin: -6px 0 0 -13px; +} +.tooltip-right .tooltip-arrow { + left: 0; + top: 50%; + margin: -6px 0 0 -12px; +} +.tooltip-left .tooltip-arrow-outer { + right: 0; + top: 50%; + margin: -6px -13px 0 0; +} +.tooltip-left .tooltip-arrow { + right: 0; + top: 50%; + margin: -6px -12px 0 0; +} +.tooltip-top .tooltip-arrow-outer { + bottom: 0; + left: 50%; + margin: 0 0 -13px -6px; +} +.tooltip-top .tooltip-arrow { + bottom: 0; + left: 50%; + margin: 0 0 -12px -6px; +} +.tooltip-bottom .tooltip-arrow-outer { + top: 0; + left: 50%; + margin: -13px 0 0 -6px; +} +.tooltip-bottom .tooltip-arrow { + top: 0; + left: 50%; + margin: -12px 0 0 -6px; +} +.tooltip { + background-color: #ffffff; + border-color: #D4D4D4; + color: #333; +} +.tooltip-right .tooltip-arrow-outer { + border-right-color: #D4D4D4; +} +.tooltip-right .tooltip-arrow { + border-right-color: #ffffff; +} +.tooltip-left .tooltip-arrow-outer { + border-left-color: #D4D4D4; +} +.tooltip-left .tooltip-arrow { + border-left-color: #ffffff; +} +.tooltip-top .tooltip-arrow-outer { + border-top-color: #D4D4D4; +} +.tooltip-top .tooltip-arrow { + border-top-color: #ffffff; +} +.tooltip-bottom .tooltip-arrow-outer { + border-bottom-color: #D4D4D4; +} +.tooltip-bottom .tooltip-arrow { + border-bottom-color: #ffffff; +} +.tabs-panels { + border-color: transparent; +} +.tabs li a.tabs-inner { + border-color: transparent; + background: transparent; + filter: none; + color: #0088CC; +} +.menu-active { + background-color: #0081C2; + border-color: #0081C2; + color: #fff; +} +.menu-active-disabled { + border-color: transparent; + background: transparent; + color: #333; +} + +.tabs-scroller-left:before, +.tabs-scroller-right:before, +.tabs li a.tabs-close:before, +.datagrid-mask-msg:before, +.datagrid-sort .datagrid-sort-icon:before, +.datagrid-sort-desc .datagrid-sort-icon:before, +.datagrid-sort-asc .datagrid-sort-icon:before, +.panel-loading:before, +.panel-tool-min:before, +.panel-tool-max:before, +.panel-tool-restore:before, +.panel-tool-close:before, +.panel-tool-collapse:before, +.panel-tool-expand:before, +.accordion-collapse:before, +.accordion-expand:before, +.combo-arrow:before, +.spinner-arrow-up:before, +.spinner-arrow-down:before, +.searchbox-button:before, +.slider-handle:before, +.menu-rightarrow:before, +.m-btn-downarrow:before, +.s-btn-downarrow:before, +.layout-button-up:before, +.layout-button-down:before, +.layout-button-left:before, +.layout-button-right:before, +.pagination-first:before, +.pagination-prev:before, +.pagination-next:before, +.pagination-last:before, +.pagination-load:before, +.pagination-loading:before, +.calendar-prevmonth:before, +.calendar-nextmonth:before, +.calendar-prevyear:before, +.calendar-nextyear:before, +.calendar-menu-prev:before, +.calendar-menu-next:before, +.messager-error:before, +.messager-info:before, +.messager-warning:before, +.messager-question:before, +.tree-expanded:before, +.tree-collapsed:before, +.tree-expanded-hover:before, +.tree-collapsed-hover:before, +.tree-folder:before, +.tree-folder-open:before, +.tree-file:before, +.tree-dnd-yes:before, +.tree-dnd-no:before, +.tree-checkbox0:before, +.tree-checkbox1:before, +.tree-checkbox2:before, +.datagrid-row-expand:before, +.datagrid-row-collapse:before +{ + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: 14px; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.panel-loading:before { + content:"\f021"; + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.panel-tool-close:before { + content:"\f00d"; +} +.panel-tool-min:before { + content:"\f2d1"; + font-size:12px; +} +.panel-tool-max:before { + content:"\f2d0"; + font-size:12px; +} +.panel-tool-restore:before { + content:"\f2d2"; + font-size:12px; +} +.panel-tool-collapse:before { + content:"\f0d8"; +} +.panel-tool-expand:before { + content:"\f0d7"; +} +.accordion-collapse:before { + content:"\f102"; +} +.accordion-header-selected .accordion-collapse:before { + color:#fff; +} +.accordion-header-selected .accordion-collapse:hover:before { + color:#26719B; +} +.accordion-expand:before { + content:"\f103"; +} +.combo-arrow { + line-height:21px; + text-align:center; +} +.combo-arrow:before { + content:"\f078"; +} +.layout-button-up:before { + content:"\f102"; +} +.layout-button-down:before { + content:"\f103"; +} +.layout-button-left:before { + content:"\f100"; +} +.layout-button-right:before { + content:"\f101"; +} +.tabs-scroller-left:before, .tabs-scroller-right:before { + position:absolute; + font-size:16px; + top:50%; + left:50%; + margin-left:-4px; + margin-top:-8px; +} +.tabs-scroller-left:before { + content:"\f100"; +} +.tabs-scroller-right:before { + content:"\f101"; +} +.tabs li a.tabs-close:before { + content:"\f00d"; + font-size:12px; +} +.datagrid-sort-asc .datagrid-sort-icon, .datagrid-sort-desc .datagrid-sort-icon, .datagrid-sort .datagrid-sort-icon { + font-size:14px; + display:inline-block; +} +.datagrid-sort .datagrid-sort-icon:before { + content: "\f0dc"; + opacity:.2; +} +.datagrid-sort-asc .datagrid-sort-icon:before { + content: "\f0de"; + opacity:1; +} +.datagrid-sort-desc .datagrid-sort-icon:before{ + content:"\f0dd"; + opacity:1; +} +.datagrid-row-collapse:before { + content:"\f068"; +} +.datagrid-row-expand:before { + content:"\f067"; +} +.datagrid-mask-msg { + padding:10px; + background: #fff; +} +.datagrid-mask-msg:before { + content:"\f021"; + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; + margin-right:5px +} +.pagination-first:before { + content:"\f049" +} +.pagination-prev:before { + content:"\f04a" +} +.pagination-next:before { + content:"\f04e" +} +.pagination-last:before { + content:"\f050" +} +.pagination-load:before { + content:"\f021" +} +.pagination-loading:before { + content:"\f021"; + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.calendar-prevmonth { + left: 20px; + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.calendar-prevmonth:before { + content:"\f04b"; +} +.calendar-nextmonth { + right: 20px; +} +.calendar-nextmonth:before { + content:"\f04b"; +} +.calendar-prevyear { + left: 3px; +} +.calendar-prevyear:before { + content:"\f04a"; +} +.calendar-nextyear { + right: 3px; +} +.calendar-nextyear:before { + content:"\f04e"; +} +.calendar-menu-prev { + margin-right: 10px; +} +.calendar-menu-next { + margin-left: 10px; +} +.calendar-menu-prev:before { + font-size:12px; + content:"\f04a"; +} +.calendar-menu-next:before { + font-size:12px; + content:"\f04e"; +} +.datebox .combo-arrow { + line-height:26px; +} +.datebox .combo-arrow:before { + content:"\f073"; + color:#000; +} +.spinner-arrow-up:before { + content:"\f077"; + font-size:13px; +} +.spinner-arrow-down:before { + content:"\f078"; + font-size:13px; +} +.searchbox-button { + line-height:26px; +} +.searchbox-button:before { + content:"\f002"; +} +.slider-handle:before { + content:"\f192"; + font-size:20px; +} +.menu-rightarrow { + width:10px; +} +.menu-rightarrow:before { + content:"\f0da"; + color:#000; + font-size:16px; +} +.m-btn-downarrow:before, +.s-btn-downarrow:before { + content:"\f0d7"; + color:#000; + font-size:16px; +} +.messager-error:before { + content:'\f057'; + font-size:32px; + color:red; +} +.messager-info:before { + content:'\f05a'; + font-size:32px; + color:green; +} +.messager-question:before { + content:'\f059'; + font-size:32px; + color:#3697cd; +} +.messager-warning:before { + content:'\f071'; + font-size:32px; + color:yellow; +} +.tree-expanded:before { + content:"\f147"; + background: #fff; + font-size:15px; +} +.tree-expanded-hover:before { + content:"\f146"; + background: #fff; + font-size:15px; +} +.tree-collapsed:before { + content:"\f196"; + background: #fff;font-size:15px; +} +.tree-collapsed-hover:before { + content:"\f0fe"; + background: #fff; + font-size:15px; +} +.tree-lines li { + padding-left:0!important; +} +.tree-lines .tree-expanded, +.tree-lines .tree-root-first .tree-expanded { + background: url('images/tree_icons.png') no-repeat -144px 0; +} +.tree-lines .tree-collapsed, +.tree-lines .tree-root-first .tree-collapsed { + background: url('images/tree_icons.png') no-repeat -128px 0; +} +.tree-lines .tree-node-last .tree-expanded, +.tree-lines .tree-root-one .tree-expanded { + background: url('images/tree_icons.png') no-repeat -80px 0; +} +.tree-lines .tree-node-last .tree-collapsed, +.tree-lines .tree-root-one .tree-collapsed { + background: url('images/tree_icons.png') no-repeat -64px 0; +} +.tree-line { + background: url('images/tree_icons.png') no-repeat -176px 0; +} +.tree-join { + background: url('images/tree_icons.png') no-repeat -192px 0; +} +.tree-joinbottom { + background: url('images/tree_icons.png') no-repeat -160px 0; +} +.tree-folder:before { + content:"\f07b"; +} +.tree-folder-open:before { + content:"\f07c"; +} +.tree-file:before { + content:"\f0f6"; +} +.tree-loading { + background: url('images/loading.gif') no-repeat center center; +} +.tree-checkbox0:before { + content:"\f096"; +} +.tree-checkbox1:before { + content:"\f046"; +} +.tree-checkbox2:before { + content:"\f14a"; +} +.tree-dnd-yes:before { + content:"\f00c"; + color:green; + font-size:16px; +} +.tree-dnd-no:before { + content:"\f05e"; + color:red; + font-size:16px; +} diff --git a/assets/js/easy-ui/themes/modx/images/blank.gif b/assets/js/easy-ui/themes/modx/images/blank.gif new file mode 100644 index 0000000000..1d11fa9ada Binary files /dev/null and b/assets/js/easy-ui/themes/modx/images/blank.gif differ diff --git a/assets/js/easy-ui/themes/modx/images/tree_icons.png b/assets/js/easy-ui/themes/modx/images/tree_icons.png new file mode 100644 index 0000000000..e9be4f3a99 Binary files /dev/null and b/assets/js/easy-ui/themes/modx/images/tree_icons.png differ diff --git a/assets/js/easy-ui/themes/modx/images/validatebox_warning.png b/assets/js/easy-ui/themes/modx/images/validatebox_warning.png new file mode 100644 index 0000000000..2b3d4f05ba Binary files /dev/null and b/assets/js/easy-ui/themes/modx/images/validatebox_warning.png differ diff --git a/assets/js/euigrid/js/euigrid.js b/assets/js/euigrid/js/euigrid.js new file mode 100644 index 0000000000..c027aaf950 --- /dev/null +++ b/assets/js/euigrid/js/euigrid.js @@ -0,0 +1,158 @@ +(function($, window) { + var defaults = { + singleSelect: false, + checkOnSelect:false, + pagination: true, + pageSize:50, + pageList:[50,100,150,200], + fitColumns: true, + striped: true, + scrollbarSize: 0, + onBeforeLoad: function() { + $(this).edatagrid('clearChecked'); + $('.btn-extra',$(this).datagrid('getPanel')).parent().parent().hide(); + }, + onLoadSuccess: function () { + $(this).edatagrid('enableDnd'); + }, + onLoadError: function() { + $.messager.alert(_euigLang['error'],_euigLang['server_error']+' unknown','error'); + }, + onDestroy: function () { + $(this).edatagrid('reload'); + }, + onBeforeEdit: function (index, row) { + row.editing = true; + $(this).datagrid('refreshRow', index); + }, + onAfterEdit: function (index, row) { + row.editing = false; + $(this).datagrid('refreshRow', index); + }, + onCancelEdit: function (index, row) { + row.editing = false; + $(this).datagrid('refreshRow', index); + }, + onClickRow: function (index, row) { + row.editing = false; + $(this).edatagrid('cancelEdit', index); + }, + onSelect: function (index) { + $(this).edatagrid('unselectRow', index); + }, + onCheck: function(index) { + $(this).edatagrid('unselectRow', index); + $('.btn-extra',$(this).datagrid('getPanel')).parent().parent().show(); + }, + onUncheck: function() { + var rows = $(this).edatagrid('getChecked'); + if (!rows.length) $('.btn-extra',$(this).datagrid('getPanel')).parent().parent().hide(); + }, + onCheckAll: function() { + $(this).edatagrid('unselectAll'); + $('.btn-extra',$(this).datagrid('getPanel')).parent().parent().show(); + }, + onUncheckAll: function() { + $('.btn-extra',$(this).datagrid('getPanel')).parent().parent().hide(); + } + }; + function EUIGrid (options, tableId) { + this._options = $.extend({},defaults,options); + this._options.destroyMsg = { + confirm: { + title: _euigLang['delete'], + msg: _euigLang['are_you_sure_to_delete'] + } + }; + this._options.loadMsg =_euigLang['please_wait']; + this._tableId = tableId; + this._orderBy = this._options.indexField; + this._orderDir = 'desc'; + return this.init(); + } + EUIGrid.prototype = { + init: function() { + this._options.onSortColumn = this.onSortColumn.bind(this); + this._options.onBeforeDrag = this.onBeforeDrag.bind(this); + this._options.onBeforeDrop = this.onBeforeDrop.bind(this); + this._options.onDrop = this.onDrop.bind(this); + return $(this._tableId).edatagrid(this._options); + }, + onSortColumn: function (sort, order) { + this._orderBy = sort; + this._orderDir = order; + }, + onBeforeDrag: function (row) { + var grid = $(this._tableId); + if (this._orderBy == this._options.indexField && !row.editing) { + $('body').css('overflow-x', 'hidden'); + $('.datagrid-body',grid).css('overflow-y', 'hidden'); + } else { + return false; + } + }, + onBeforeDrop: function (targetRow, sourceRow, point) { + var grid = $(this._tableId); + $('body').css('overflow-x', 'auto'); + $('.datagrid-body',grid).css('overflow-y', 'auto'); + this.targetRow = targetRow; + this.targetRow.index = tgt = grid.edatagrid('getRowIndex', targetRow); + this.sourceRow = sourceRow; + this.sourceRow.index = src = grid.edatagrid('getRowIndex', sourceRow); + this.point = point; + dif = tgt - src; + if ((point == 'bottom' && dif == -1) || (point == 'top' && dif == 1)) return false; + }, + onDrop: function (targetRow, sourceRow, point) { + var grid = $(this._tableId); + var idField = this._options.idField; + var indexField = this._options.indexField; + var orderDir = this._orderDir; + src = this.sourceRow.index; + tgt = this.targetRow.index; + var data = { + 'target':{}, + 'source':{}, + 'point': point, + 'sf_rid': this._options.rid, + 'orderDir': this._orderDir + }; + data['target'][idField] = targetRow[idField]; + data['target'][indexField] = targetRow[indexField]; + data['source'][idField] = sourceRow[idField]; + data['source'][indexField] = sourceRow[indexField]; + + $.ajax({ + url: this._options.url+'?mode=reorder', + type: 'post', + dataType: 'json', + data: data + }).done(function (response) { + if (!response.success) { + $.messager.alert(_sfLang['error'], _sfLang['save_fail']); + grid.edatagrid('reload'); + } else { + rows = grid.edatagrid('getRows'); + if (tgt < src) { + rows[tgt][indexName] = targetRow[indexName]; + for (var i = tgt; i <= src; i++) { + rows[i][indexName] = rows[i - 1] != undefined ? rows[i - 1][indexName] - (orderDir == 'desc' ? 1 : -1) : rows[i][indexName]; + grid.edatagrid('refreshRow', i); + } + } else { + rows[tgt][indexName] = targetRow[indexName]; + for (var i = tgt; i >= src; i--) { + rows[i][indexName] = rows[i + 1] != undefined ? parseInt(rows[i + 1][indexName]) + (orderDir == 'desc' ? 1 : -1) : rows[i][indexName]; + grid.edatagrid('refreshRow', i); + } + } + } + + }).fail(function(xhr) { + var message = xhr.status == 200 ? _euigLang['parse_error'] : _euigLang['server_error'] + xhr.status + ' ' + xhr.statusText; + $.messager.alert(_euigLang['error'], message, 'error'); + }); + } + }; + window.EUIGrid = EUIGrid; +})(jQuery, window); diff --git a/assets/js/euigrid/lang/en.js b/assets/js/euigrid/lang/en.js new file mode 100644 index 0000000000..138a3e51f3 --- /dev/null +++ b/assets/js/euigrid/lang/en.js @@ -0,0 +1,14 @@ +_euigLang = []; +_euigLang['please_wait'] = 'Please, wait.'; +_euigLang['upload'] = 'Upload'; +_euigLang['cancel'] = 'Cancel'; +_euigLang['close'] = 'Close'; +_euigLang['delete'] = 'Delete'; +_euigLang['are_you_sure_to_delete'] = 'Are you sure to delete file?'; +_euigLang['error'] = 'Error'; +_euigLang['delete_fail'] = 'Failed to delete.'; +_euigLang['are_you_sure_to_delete_many'] = 'Are you sure to delete selected files?'; +_euigLang['save'] = 'Save'; +_euigLang['save_fail'] = 'Failed to save.'; +_euigLang['server_error'] = 'Server error: '; +_euigLang['parse_error'] = 'Failed to process server response'; diff --git a/assets/js/euigrid/lang/ru.js b/assets/js/euigrid/lang/ru.js new file mode 100644 index 0000000000..07e24c024b --- /dev/null +++ b/assets/js/euigrid/lang/ru.js @@ -0,0 +1,11 @@ +_euigLang = []; +_euigLang['please_wait'] = 'Подождите, пожалуйста.'; +_euigLang['cancel'] = 'Отменить'; +_euigLang['close'] = 'Закрыть'; +_euigLang['delete'] = 'Удаление'; +_euigLang['are_you_sure_to_delete'] = 'Вы уверены, что хотите удалить файл?'; +_euigLang['error'] = 'Ошибка'; +_euigLang['delete_fail'] = 'Не удалось удалить.'; +_euigLang['are_you_sure_to_delete_many'] = 'Вы уверены, что хотите удалить выделенные файлы?'; +_euigLang['server_error'] = 'Ошибка сервера: '; +_euigLang['parse_error'] = 'Не удалось обработать ответ сервера'; diff --git a/assets/js/euiuploader/css/euiuploader.css b/assets/js/euiuploader/css/euiuploader.css new file mode 100644 index 0000000000..3e1dc30ba8 --- /dev/null +++ b/assets/js/euiuploader/css/euiuploader.css @@ -0,0 +1,44 @@ +.js-fileapi-wrapper { + min-height: 300px; + opacity:1; +} +.dnd_hover { + opacity:0.5; +} +#euiUploadProgress { + padding:10px; + height:22px; + box-sizing: content-box; +} +#euiFilesList{ + height:285px; + overflow-y: scroll; +} +#euiUploadState table { + width:100%; +} +#euiUploadState table td, #euiUploadState table th { + padding:3px 5px; +} +#euiUploadState .sgrow1 { + width:251px; +} +#euiUploadState .sgrow2 { + width:65px; + text-align: center; +} +#euiUploadState .sgrow3 { + text-align: center; +} +#euiUploadState .progress .complete { + color:green; +} +#euiUploadState .progress .error { + color:red; +} +#euiUploadState table tbody tr:nth-child(even) { + background-color: #f5f5f5; +} +#euiUploadState table tbody tr:nth-child(odd) { + background-color: #fff; +} diff --git a/assets/js/euiuploader/js/euiuploader.js b/assets/js/euiuploader/js/euiuploader.js new file mode 100644 index 0000000000..677c578a11 --- /dev/null +++ b/assets/js/euiuploader/js/euiuploader.js @@ -0,0 +1,169 @@ +!function(){var e=Handlebars.template,n=Handlebars.templates=Handlebars.templates||{};n.uploadForm=e({1:function(e,n,s,a){var t=this.lambda,l=this.escapeExpression,i=n.helperMissing;return' \n '+l(t(null!=e?e.name:e,e))+'\n '+l((n.bytesToSize||e&&e.bytesToSize||i).call(e,null!=e?e.size:e,{name:"bytesToSize",hash:{},data:a}))+'\n \n \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,s,a){var t,l=this.lambda,i=this.escapeExpression,r='
                              \n
                              \n \n \n \n \n \n \n \n \n
                              '+i(l(null!=(t=null!=e?e.euiuLang:e)?t.file:t,e))+''+i(l(null!=(t=null!=e?e.euiuLang:e)?t.size:t,e))+''+i(l(null!=(t=null!=e?e.euiuLang:e)?t.progress:t,e))+'
                              \n
                              \n \n \n';return t=n.each.call(e,null!=e?e.files:e,{name:"each",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=t&&(r+=t),r+" \n
                              \n
                              \n
                              \n"},useData:!0})}(); +(function(window, $, api){ + var defaults = { + workspace:'', + dndArea:'', + uploadBtn:'', + filterFn:function(file,info){ + return false; + }, + completeCallback:function(){ + + } + }; + function EUIUploader (options) { + this._options = $.extend({},defaults,options); + this._errorCount = 0; + this._currentFile = 0; + this._xhr = 0; + return this.init(); + } + EUIUploader.prototype = { + init: function() { + var workspace = $(this._options.workspace); + var dndArea = $(this._options.dndArea, workspace); + var self = this; + workspace.append($('')); + $(this._options.uploadBtn, workspace).linkbutton({ + iconCls: 'fa fa-folder-o fa-lg', + text:_euiuLang['upload'], + onClick: function() { + self.clear(); + $('input[name="eui_files"]',workspace).trigger('click'); + } + }); + api.event.on($('input[name="eui_files"]',workspace)[0], 'change', function (evt){ + var files = api.getFiles(evt); // Retrieve file list + self.prepare(files); + }); + FileAPI.event.dnd(dndArea[0], function (over){ + if (over) { + dndArea.addClass('dnd_hover'); + } else { + dndArea.removeClass('dnd_hover'); + } + }, function(files){ + self.prepare(files); + }); + return this; + }, + prepare:function(files){ + var self = this; + if (typeof self._options.filterFn === 'function') { + api.filterFiles(files, self._options.filterFn, function (files, rejected) { + self.upload(files); + }); + } else { + self.clear(); + } + }, + upload:function(files) { + var self = this; + if( files.length ){ + var options = { + files: { file: files }, + beforeupload: function(xhr/**Object*/, options/**Object*/) { + var total = xhr.files.length; + var context = { + files: xhr.files, + euiuLang: _euiuLang + }; + var uploadStateForm = $(Handlebars.templates.uploadForm(context)); + uploadStateForm.dialog({ + width:450, + modal:true, + title:_euiuLang['files_upload'], + doSize:true, + collapsible:false, + minimizable:false, + maximizable:false, + resizable:false, + buttons:[{ + id:'euiCancelUpload', + iconCls:'btn-red fa fa-ban fa-lg', + text:_euiuLang['cancel'], + handler:function(){ + uploadStateForm.window('close',true); + } + }], + onOpen: function() { + $('body').css('overflow','hidden'); + $('#euiUploadProgress').progressbar(); + }, + onClose: function() { + if (self._xhr) self._xhr.abort(); + uploadStateForm.window('destroy',true); + $('.window-shadow,.window-mask').remove(); + $('body').css('overflow','auto'); + } + }); + }, + upload: function(xhr/**Object*/, options/**Object*/) { + //Начало загрузки + }, + fileupload: function (file/**Object*/, xhr/**Object*/, options/**Object*/){ + //Начало загрузки файла + }, + fileprogress: function(evt/**Object*/, file/**Object*/, xhr/**Object*/, options/**Object*/) { + var fileEl = $('.progress','#sgFilesListRow'+self._currentFile); + var part = Math.floor(evt.loaded / evt.total * 100); + fileEl.text(part+'%'); + }, + progress: function (evt/**Object*/, file/**Object*/, xhr/**Object*/, options/**Object*/){ + var part = Math.floor(evt.loaded / evt.total * 100); + $('#euiUploadProgress').progressbar('setValue',part); + }, + filecomplete: function(err/**String*/, xhr/**Object*/, file/**Object/, options/**Object*/) { + var fileEl = $('.progress','#sgFilesListRow'+self._currentFile); + var error = false; + if(err === false) { + var response; + try { + response = $.parseJSON(xhr.response); + } catch (error) { + response = { + success:false, + message:'parse_error' + } + } + if (!response.success) { + error = _euiuLang[response.message]; + } + } else { + error = _euiuLang['server_error'] + ' ' + err; + } + if (error !== false) { + fileEl.html('') + self._errorCount ++; + } else { + fileEl.html('') + } + self._currentFile++; + }, + complete: function (err, xhr){ + $('#euiCancelUpload').linkbutton({ + iconCls:'btn-red fa fa-ban fa-lg', + text:_euiuLang['close'] + }); + if (!self._errorCount) $('#euiCancelUpload').click(); + self.clear(); + if (typeof self._options.completeCallback === 'function') { + self._options.completeCallback(); + } + } + }; + this._xhr = api.upload($.extend({},this._options,options)); + } + }, + clear:function(){ + var workspace = $(this._options.workspace); + var upload = $('input[name="eui_files"]',workspace); + upload.wrap('
                              ').closest('form').get(0).reset(); + upload.unwrap(); + this._xhr = null; + this._currentFile = this._errorCount = 0; + } + }; + window.EUIUploader = EUIUploader; +})(window, jQuery, FileAPI); + diff --git a/assets/js/euiuploader/lang/en.js b/assets/js/euiuploader/lang/en.js new file mode 100644 index 0000000000..6a9e98d446 --- /dev/null +++ b/assets/js/euiuploader/lang/en.js @@ -0,0 +1,23 @@ +_euiuLang = []; +_euiuLang['upload'] = 'Upload'; +_euiuLang['file'] = 'File'; +_euiuLang['size'] = 'Size'; +_euiuLang['progress'] = 'Progress'; +_euiuLang['files_upload'] = 'Files upload'; +_euiuLang['cancel'] = 'Cancel'; +_euiuLang['close'] = 'Close'; +_euiuLang['uploaded'] = 'Loaded'; +_euiuLang['server_error'] = 'Server error: '; +_euiuLang['parse_error'] = 'Failed to process server response'; +_euiuUploadResult = []; +_euiuUploadResult['upload_failed_1'] = 'File size is greater than upload_max_filesize'; +_euiuUploadResult['upload_failed_2'] = 'File size is greater than allowed'; +_euiuUploadResult['upload_failed_3'] = 'The uploaded file was only partially uploaded'; +_euiuUploadResult['upload_failed_4'] = 'No file was uploaded'; +_euiuUploadResult['upload_failed_6'] = 'Missing a temporary folder'; +_euiuUploadResult['upload_failed_7'] = 'Failed to write file to disk'; +_euiuUploadResult['upload_failed_8'] = 'A PHP extension stopped the file upload'; +_euiuUploadResult['unable_to_process_file'] = 'Failed to process uploaded file'; +_euiuUploadResult['unable_to_move'] = 'Failed to save file'; +_euiuUploadResult['forbidden_file'] = 'File is forbidden to upload'; +_euiuUploadResult['unable_to_create_folder'] = 'Failed to create upload folder'; diff --git a/assets/js/euiuploader/lang/ru.js b/assets/js/euiuploader/lang/ru.js new file mode 100644 index 0000000000..289327ccb4 --- /dev/null +++ b/assets/js/euiuploader/lang/ru.js @@ -0,0 +1,23 @@ +_euiuLang = []; +_euiuLang['upload'] = 'Загрузить'; +_euiuLang['file'] = 'Файл'; +_euiuLang['size'] = 'Размер'; +_euiuLang['progress'] = 'Прогресс'; +_euiuLang['files_upload'] = 'Загрузка файлов'; +_euiuLang['cancel'] = 'Отменить'; +_euiuLang['close'] = 'Закрыть'; +_euiuLang['uploaded'] = 'Загружено'; +_euiuLang['server_error'] = 'Ошибка сервера: '; +_euiuLang['parse_error'] = 'Не удалось обработать ответ сервера'; +_euiuUploadResult = []; +_euiuUploadResult['upload_failed_1'] = 'Размер файла превысил значение upload_max_filesize'; +_euiuUploadResult['upload_failed_2'] = 'Размер файла превысил допустимое значение'; +_euiuUploadResult['upload_failed_3'] = 'Файл был загружен только частично'; +_euiuUploadResult['upload_failed_4'] = 'Файл не был загружен'; +_euiuUploadResult['upload_failed_6'] = 'Отсутствует временная папка'; +_euiuUploadResult['upload_failed_7'] = 'Не удалось записать файл на диск'; +_euiuUploadResult['upload_failed_8'] = 'PHP-расширение остановило загрузку файла'; +_euiuUploadResult['unable_to_process_file'] = 'Не удалось обработать файл'; +_euiuUploadResult['unable_to_move'] = 'Не удалось сохранить файл'; +_euiuUploadResult['forbidden_file'] = 'Файл запрещен для загрузки'; +_euiuUploadResult['unable_to_create_folder'] = 'Не удалось создать папку для хранения'; diff --git a/assets/js/euiuploader/tpl/readme.txt b/assets/js/euiuploader/tpl/readme.txt new file mode 100644 index 0000000000..d6fcbce211 --- /dev/null +++ b/assets/js/euiuploader/tpl/readme.txt @@ -0,0 +1,7 @@ +1. Install the Handlebars commandline script: +npm install -g handlebars + +2. Go to assets/plugins/simplegallery/js/tpl/ + +3. Compile templates: +handlebars *.handlebars -f templates.js -m \ No newline at end of file diff --git a/assets/js/euiuploader/tpl/templates.js b/assets/js/euiuploader/tpl/templates.js new file mode 100644 index 0000000000..2c80f0c886 --- /dev/null +++ b/assets/js/euiuploader/tpl/templates.js @@ -0,0 +1 @@ +!function(){var e=Handlebars.template,n=Handlebars.templates=Handlebars.templates||{};n.uploadForm=e({1:function(e,n,s,a){var t=this.lambda,l=this.escapeExpression,i=n.helperMissing;return' \n '+l(t(null!=e?e.name:e,e))+'\n '+l((n.bytesToSize||e&&e.bytesToSize||i).call(e,null!=e?e.size:e,{name:"bytesToSize",hash:{},data:a}))+'\n \n \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,s,a){var t,l=this.lambda,i=this.escapeExpression,r='
                              \n
                              \n \n \n \n \n \n \n \n \n
                              '+i(l(null!=(t=null!=e?e.euiuLang:e)?t.file:t,e))+''+i(l(null!=(t=null!=e?e.euiuLang:e)?t.size:t,e))+''+i(l(null!=(t=null!=e?e.euiuLang:e)?t.progress:t,e))+'
                              \n
                              \n \n \n';return t=n.each.call(e,null!=e?e.files:e,{name:"each",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=t&&(r+=t),r+" \n
                              \n
                              \n
                              \n"},useData:!0})}(); \ No newline at end of file diff --git a/assets/js/euiuploader/tpl/uploadForm.handlebars b/assets/js/euiuploader/tpl/uploadForm.handlebars new file mode 100644 index 0000000000..afa03a91dc --- /dev/null +++ b/assets/js/euiuploader/tpl/uploadForm.handlebars @@ -0,0 +1,25 @@ +
                              +
                              + + + + + + + + +
                              {{euiuLang.file}}{{euiuLang.size}}{{euiuLang.progress}}
                              +
                              + + + {{#each files}} + + + + + + {{/each}} + +
                              {{this.name}}{{bytesToSize this.size}}
                              +
                              +
                              diff --git a/assets/js/handlebars/helpers.js b/assets/js/handlebars/helpers.js new file mode 100644 index 0000000000..9e28dd717e --- /dev/null +++ b/assets/js/handlebars/helpers.js @@ -0,0 +1,20 @@ +(function (Handlebars) { + Handlebars.registerHelper('stripText', function(str, len){ + str.replace(/<\/?[^>]+>/gi, ''); + if (str.length > len) str = str.slice(0,len) + '...'; + return str; + }); + Handlebars.registerHelper('bytesToSize', function(bytes){ + if(bytes <= 0) return '0 B'; + var k = 1024; + var sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + var i = Math.floor(Math.log(bytes) / Math.log(k)); + return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i]; + }); + Handlebars.registerHelper('ifCond', function(v1, v2, options) { + if(v1 === v2) { + return options.fn(this); + } + return options.inverse(this); + }); +})(Handlebars); diff --git a/assets/lib/APIHelpers.class.php b/assets/lib/APIHelpers.class.php old mode 100755 new mode 100644 index f12af3c92e..030318aae7 --- a/assets/lib/APIHelpers.class.php +++ b/assets/lib/APIHelpers.class.php @@ -158,7 +158,7 @@ public static function genPass($len, $data = '') * @param $data * @return bool|false|string */ - private function _getEnv($data) + private static function _getEnv($data) { switch (true) { case (isset($_SERVER[$data])): diff --git a/assets/lib/Helpers/Assets.php b/assets/lib/Helpers/Assets.php old mode 100755 new mode 100644 index 42c60c8100..bead2df571 --- a/assets/lib/Helpers/Assets.php +++ b/assets/lib/Helpers/Assets.php @@ -72,7 +72,8 @@ public function registerJQuery() { $output = ''; $plugins = $this->modx->pluginEvent; - if ((array_search('ManagerManager', $plugins['OnDocFormRender']) === false)) { + //файл проверяется чтобы определить новую админку + if ((array_search('ManagerManager', $plugins['OnDocFormRender']) === false) || !file_exists(MODX_MANAGER_PATH . 'media/script/jquery/jquery.min.js')) { $output .= $this->registerScript('jQuery', array( 'src' => 'assets/js/jquery/jquery-1.9.1.min.js', 'version' => '1.9.1' @@ -108,7 +109,8 @@ public function registerScript($name, $params) if ($type == 'js') { $out = ''; } else { - $out = ''; + $media = isset($params['media']) ? " media=\"{$params['media']}\"" : ''; + $out = ""; } $this->modx->loadedjscripts[$name] = $params; @@ -125,6 +127,8 @@ public function registerScript($name, $params) public function registerScriptsList($list = array()) { $out = ''; + if (!is_array($list)) return $out; + foreach ($list as $script => $params) { $out .= $this->registerScript($script, $params); } diff --git a/assets/lib/Helpers/FS.php b/assets/lib/Helpers/FS.php old mode 100755 new mode 100644 index cf3bf638b1..b7423eb2e4 --- a/assets/lib/Helpers/FS.php +++ b/assets/lib/Helpers/FS.php @@ -107,11 +107,16 @@ public function takeFileName($file) /** * @param $file + * @param bool $lower * @return string */ - public function takeFileExt($file) + public function takeFileExt($file, $lower = true) { - return strtolower($this->_pathinfo($file, 'extension')); + $str = $this->_pathinfo($file, 'extension'); + if($lower){ + $str = strtolower($str); + } + return $str; } /** diff --git a/assets/lib/MODxAPI/MODx.php b/assets/lib/MODxAPI/MODx.php old mode 100755 new mode 100644 index a3385fa0e8..96b21682f6 --- a/assets/lib/MODxAPI/MODx.php +++ b/assets/lib/MODxAPI/MODx.php @@ -135,7 +135,7 @@ abstract class MODxAPI extends MODxAPIhelpers /** * @var DLCollection */ - private $_decodedFields; + protected $_decodedFields; /** * @var array @@ -755,6 +755,7 @@ public function copy($id) { $this->edit($id)->id = 0; $this->newDoc = true; + $this->store = array(); return $this; } diff --git a/assets/lib/MODxAPI/modManagers.php b/assets/lib/MODxAPI/modManagers.php new file mode 100644 index 0000000000..e72d314b3e --- /dev/null +++ b/assets/lib/MODxAPI/modManagers.php @@ -0,0 +1,689 @@ + array( + 'username' => "", + 'password' => "", + ), + 'attribute' => array( + 'fullname' => "", + 'role' => 0, + 'email' => "", + 'phone' => "", + 'mobilephone' => "", + 'blocked' => 0, + 'blockeduntil' => 0, + 'blockedafter' => 0, + 'logincount' => 0, + 'lastlogin' => 0, + 'thislogin' => 0, + 'failedlogincount' => 0, + 'sessionid' => "", + 'dob' => 0, + 'gender' => "", + 'country' => "", + 'state' => "", + 'city' => "", + 'street' => "", + 'zip' => "", + 'fax' => "", + 'photo' => "", + 'comment' => "" + ), + 'hidden' => array( + 'internalKey' + ) + ); + + /** + * @var string + */ + protected $givenPassword = ''; + protected $groupIds = array(); + protected $mgrPermissions = array(); + + /** + * MODxAPI constructor. + * @param DocumentParser $modx + * @param bool $debug + * @throws Exception + */ + public function __construct(DocumentParser $modx, $debug = false) + { + parent::__construct($modx, $debug); + $this->modx->loadExtension('phpass'); + } + + + /** + * @param $key + * @return bool + */ + public function issetField($key) + { + return (array_key_exists($key, $this->default_field['user']) || array_key_exists($key, + $this->default_field['attribute']) || in_array($key, $this->default_field['hidden'])); + } + + /** + * @param string $data + * @return string|false + */ + protected function findUser($data) + { + switch (true) { + case (is_int($data) || ((int)$data > 0 && (string)intval($data) === $data)): + $find = 'attribute.internalKey'; + break; + case filter_var($data, FILTER_VALIDATE_EMAIL): + $find = 'attribute.email'; + break; + case is_scalar($data): + $find = 'user.username'; + break; + default: + $find = false; + } + + return $find; + } + + /** + * @param $id + * @return $this + */ + public function edit($id) + { + $id = is_scalar($id) ? trim($id) : ''; + if ($this->getID() != $id) { + $this->close(); + $this->newDoc = false; + + if (!$find = $this->findUser($id)) { + $this->id = null; + } else { + $result = $this->query(" + SELECT * from {$this->makeTable('user_attributes')} as attribute + LEFT JOIN {$this->makeTable('manager_users')} as user ON user.id=attribute.internalKey + WHERE BINARY {$find}='{$this->escape($id)}' + "); + $this->field = $this->modx->db->getRow($result); + + $this->id = empty($this->field['internalKey']) ? null : $this->get('internalKey'); + $this->store($this->toArray()); + $result = $this->query("SELECT * FROM {$this->makeTable('user_roles')} WHERE `id`={$this->get('role')}"); + $permissions = $this->modx->db->getRow($result); + unset($permissions['id'], $permissions['name'], $permissions['description']); + $this->mgrPermissions = $permissions; + unset($this->field['id']); + unset($this->field['internalKey']); + } + } + + return $this; + } + + /** + * @param string $key + * @param $value + * @return $this + */ + public function set($key, $value) + { + if (is_scalar($value) && is_scalar($key) && !empty($key)) { + switch ($key) { + case 'password': + $this->givenPassword = $value; + $value = $this->getPassword($value); + break; + case 'sessionid': + session_regenerate_id(false); + $value = session_id(); + break; + } + $this->field[$key] = $value; + } + + return $this; + } + + /** + * @param $pass + * @return string + */ + public function getPassword($pass) + { + return $this->modx->phpass->HashPassword($pass); + } + + /** + * @param string $name + * @return bool + */ + public function hasPermission($name) + { + return (is_string($name) && $name && isset($this->mgrPermissions[$name])); + } + + /** + * @param bool $fire_events + * @param bool $clearCache + * @return bool|int|null|void + */ + public function save($fire_events = false, $clearCache = false) + { + if ($this->get('email') == '' || $this->get('username') == '' || $this->get('password') == '') { + $this->log['EmptyPKField'] = 'Email, username or password is empty
                              ' . print_r($this->toArray(),
                              +                    true) . '
                              '; + + return false; + } + + if (!$this->checkUnique('manager_users', 'username')) { + $this->log['UniqueUsername'] = 'username not unique
                              ' . print_r($this->get('username'),
                              +                    true) . '
                              '; + + return false; + } + + if (!$this->checkUnique('user_attributes', 'email', 'internalKey')) { + $this->log['UniqueEmail'] = 'Email not unique
                              ' . print_r($this->get('email'), true) . '
                              '; + + return false; + } + + if(!$this->get('role')) { + $this->log['UniqueEmail'] = 'Wrong manager role
                              ' . print_r($this->get('role'), true) . '
                              '; + } + + $this->set('sessionid', ''); + $fld = $this->toArray(); + foreach ($this->default_field['user'] as $key => $value) { + $tmp = $this->get($key); + if ($this->newDoc && (!is_int($tmp) && $tmp == '')) { + $this->field[$key] = $value; + } + $this->Uset($key, 'user'); + unset($fld[$key]); + } + if (!empty($this->set['user'])) { + if ($this->newDoc) { + $SQL = "INSERT into {$this->makeTable('manager_users')} SET " . implode(', ', $this->set['user']); + } else { + $SQL = "UPDATE {$this->makeTable('manager_users')} SET " . implode(', ', + $this->set['user']) . " WHERE id = " . $this->id; + } + $this->query($SQL); + } + + if ($this->newDoc) { + $this->id = $this->modx->db->getInsertId(); + } + + foreach ($this->default_field['attribute'] as $key => $value) { + $tmp = $this->get($key); + if ($this->newDoc && (!is_int($tmp) && $tmp == '')) { + $this->field[$key] = $value; + } + $this->Uset($key, 'attribute'); + unset($fld[$key]); + } + if (!empty($this->set['attribute'])) { + if ($this->newDoc) { + $this->set('internalKey', $this->id)->Uset('internalKey', 'attribute'); + $SQL = "INSERT into {$this->makeTable('user_attributes')} SET " . implode(', ', + $this->set['attribute']); + } else { + $SQL = "UPDATE {$this->makeTable('user_attributes')} SET " . implode(', ', + $this->set['attribute']) . " WHERE internalKey = " . $this->getID(); + } + $this->query($SQL); + } + unset($fld['id']); + foreach ($fld as $key => $value) { + if ($value == '' || !$this->isChanged($key)) { + continue; + } + $result = $this->query("SELECT `setting_value` FROM {$this->makeTable('web_user_settings')} WHERE `user` = '{$this->id}' AND `setting_name` = '{$key}'"); + if ($this->modx->db->getRecordCount($result) > 0) { + $this->query("UPDATE {$this->makeTable('user_settings')} SET `setting_value` = '{$value}' WHERE `user` = '{$this->id}' AND `setting_name` = '{$key}';"); + } else { + $this->query("INSERT into {$this->makeTable('user_settings')} SET `user` = {$this->id},`setting_name` = '{$key}',`setting_value` = '{$value}';"); + } + } + // TODO + if (!$this->newDoc && $this->givenPassword) { + $this->invokeEvent('OnManagerChangePassword', array( + 'userObj' => $this, + 'userid' => $this->id, + 'user' => $this->toArray(), + 'userpassword' => $this->givenPassword, + 'username' => $this->get('username') + ), $fire_events); + } + + if ($this->groupIds) { + $this->setUserGroups($this->id, $this->groupIds); + } + // TODO + $this->invokeEvent('OnManagerSaveUser', array( + 'userObj' => $this, + 'mode' => $this->newDoc ? "new" : "upd", + 'user' => $this->toArray(), + "userid" => $this->getID(), + "username" => $this->get('username'), + "userpassword" => $this->givenPassword, + "useremail" => $this->get('email'), + "userfullname" => $this->get('fullname'), + "userroleid" => $this->get('role') + ), $fire_events); + + if ($clearCache) { + $this->clearCache($fire_events); + } + + return $this->id; + } + + /** + * @param $ids + * @param bool $fire_events + * @return bool|null|void + */ + public function delete($ids, $fire_events = false) + { + if ($this->edit($ids)) { + $flag = $this->query(" + DELETE user,attribute FROM {$this->makeTable('user_attributes')} as attribute + LEFT JOIN {$this->makeTable('manager_users')} as user ON user.id=attribute.internalKey + WHERE attribute.internalKey='{$this->escape($this->getID())}'"); + $this->query("DELETE FROM {$this->makeTable('user_settings')} WHERE user='{$this->getID()}'"); + $this->query("DELETE FROM {$this->makeTable('member_groups')} WHERE member='{$this->getID()}'"); + $this->invokeEvent('OnManagerDeleteUser', array( + 'userObj' => $this, + 'userid' => $this->getID(), + 'internalKey' => $this->getID(), + 'username' => $this->get('username'), + 'timestamp' => time() + ), $fire_events); + } else { + $flag = false; + } + $this->close(); + + return $flag; + } + + /** + * @param int $id + * @param bool $fulltime + * @param string $cookieName + * @param bool $fire_events + * @return bool + */ + public function authUser($id = 0, $fulltime = true, $cookieName = 'modx_remember_manager', $fire_events = false) + { + $flag = false; + if (null === $this->getID() && $id) { + $this->edit($id); + } + if (null !== $this->getID()) { + $flag = true; + $this->save(false); + $this->SessionHandler('start', $cookieName, $fulltime); + $this->invokeEvent("OnManagerLogin", array( + 'userObj' => $this, + 'userid' => $this->getID(), + 'username' => $this->get('username'), + 'userpassword' => $this->givenPassword, + 'rememberme' => $fulltime + ), $fire_events); + } + + return $flag; + } + + /** + * @param int $id + * @return bool + */ + public function checkBlock($id = 0) + { + $tmp = clone $this; + if ($id && $tmp->getID() != $id) { + $tmp->edit($id); + } + $now = time(); + + $b = $tmp->get('blocked'); + $bu = $tmp->get('blockeduntil'); + $ba = $tmp->get('blockedafter'); + $flag = (($b && !$bu && !$ba) || ($bu && $now < $bu) || ($ba && $now > $ba)); + unset($tmp); + + return $flag; + } + + /** + * @param $id + * @param $password + * @param $blocker + * @param bool $fire_events + * @return bool + */ + public function testAuth($id, $password, $blocker, $fire_events = false) + { + $tmp = clone $this; + if ($id && $tmp->getID() != $id) { + $tmp->edit($id); + } + + $flag = $pluginFlag = false; + if ( + (null !== $tmp->getID()) && (!$blocker || ($blocker && !$tmp->checkBlock($id))) + ) { + $_password = $tmp->get('password'); + $eventResult = $this->getInvokeEventResult('OnManagerAuthentication', array( + 'userObj' => $this, + 'userid' => $tmp->getID(), + 'username' => $tmp->get('username'), + 'userpassword' => $password, + 'savedpassword' => $_password + ), $fire_events); + if (is_array($eventResult)) { + foreach ($eventResult as $result) { + $pluginFlag = (bool)$result; + } + } else { + $pluginFlag = (bool)$eventResult; + } + if (!$pluginFlag) { + $hashType = $this->getPasswordHashType($_password); + switch ($hashType) { + case 'phpass': + $flag = $this->modx->phpass->CheckPassword($password, $_password); + break; + case 'md5': + $flag = $_password == md5($password); + break; + case 'v1': + $algorithm = \APIhelpers::getkey($this->modx->config, 'pwd_hash_algo', 'UNCRYPT'); + $userAlgorithm = $this->getPasswordHashAlgorithm($_password); + if ($algorithm !== $userAlgorithm) { + $algorithm = $userAlgorithm; + } + $flag = $_password == $this->makeHash($password, $tmp->getID(), $algorithm); + break; + } + if ($flag && $hashType == 'md5' || $hashType == 'v1') { + $tmp->set('password', $password)->save(); + if ($id == $this->getID()) { + $this->field['password'] = $tmp->get('password'); + } + } + } + } + unset($tmp); + + return $flag || $pluginFlag; + } + + /** + * @param string $cookieName + * @param null $fire_events + */ + public function logOut($cookieName = 'modx_remember_manager', $fire_events = null) + { + if (!$uid = $this->modx->getLoginUserID('mgr')) { + return; + } + $params = array( + 'username' => $_SESSION['mgrShortname'], + 'internalKey' => $uid + ); + $this->invokeEvent('OnBeforeManagerLogout', $params, $fire_events); + $this->SessionHandler('destroy', $cookieName ? $cookieName : 'modx_remember_manager'); + $this->modx->db->delete($this->modx->getFullTableName('active_user_locks'), "sid = '{$this->modx->sid}'"); + // Clean up active_user_sessions + $this->modx->db->delete($this->modx->getFullTableName('active_user_sessions'), "sid = '{$this->modx->sid}'"); + $this->invokeEvent('OnManagerLogout', $params, $fire_events); + } + + /** + * SessionHandler + * Starts the user session on login success. Destroys session on error or logout. + * + * @param string $directive ('start' or 'destroy') + * @param string $cookieName + * @return modUsers + * @author Raymond Irving + * @author Scotty Delicious + * + * remeber может быть числом в секундах + */ + protected function SessionHandler($directive, $cookieName, $remember = true) + { + switch ($directive) { + case 'start': + if ($this->getID()) { + $_SESSION['usertype'] = 'manager'; + $_SESSION['mgrShortname'] = $this->get('username'); + $_SESSION['mgrFullname'] = $this->get('fullname'); + $_SESSION['mgrEmail'] = $this->get('email'); + $_SESSION['mgrValidated'] = 1; + $_SESSION['mgrInternalKey'] = $this->getID(); + $_SESSION['mgrFailedlogins'] = $this->get('failedlogincount'); + $_SESSION['mgrLastlogin'] = $this->get('lastlogin'); + $_SESSION['mgrLogincount'] = $this->get('logincount'); + $_SESSION['mgrRole'] = $this->get('role'); + $_SESSION['mgrPermissions'] = $this->mgrPermissions; + $_SESSION['mgrDocgroups'] = $this->getDocumentGroups(); + if ($remember) { + $this->setAutoLoginCookie($cookieName, $remember); + } + } + break; + case 'destroy': + if (isset($_SESSION['webValidated'])) { + unset($_SESSION['usertype']); + unset($_SESSION['webShortname']); + unset($_SESSION['mgrFullname']); + unset($_SESSION['mgrEmail']); + unset($_SESSION['mgrValidated']); + unset($_SESSION['mgrInternalKey']); + unset($_SESSION['mgrFailedlogins']); + unset($_SESSION['mgrLastlogin']); + unset($_SESSION['mgrLogincount']); + unset($_SESSION['mgrDocgroups']); + unset($_SESSION['mgrPermissions']); + + setcookie($cookieName, '', time() - 60, '/'); + } else { + if (isset($_COOKIE[session_name()])) { + setcookie(session_name(), '', time() - 60, '/'); + } + setcookie($cookieName, '', time() - 60, '/'); + session_destroy(); + } + break; + } + + return $this; + } + + /** + * @return bool + */ + public function isSecure() + { + $out = $this->modxConfig('server_protocol') == 'http' ? false : true; + + return $out; + } + + /** + * @param $cookieName + * @param bool $remember + * @return $this + */ + public function setAutoLoginCookie($cookieName, $remember = true) + { + if (!empty($cookieName) && $this->getID()) { + $secure = $this->isSecure(); + $remember = is_bool($remember) ? (60 * 60 * 24 * 365 * 5) : (int)$remember; + $cookieValue = $this->get('username'); + $cookieExpires = time() + $remember; + setcookie($cookieName, $cookieValue, $cookieExpires, '/', '', $secure, true); + } + + return $this; + } + + /** + * @param int $userID + * @return array + */ + public function getDocumentGroups($userID = 0) + { + $out = array(); + $user = $this->switchObject($userID); + if (null !== $user->getID()) { + $member_groups = $this->modx->getFullTableName('member_groups'); + $membergroup_access = $this->modx->getFullTableName('membergroup_access'); + + $sql = "SELECT `uga`.`documentgroup` FROM {$member_groups} as `ug` + INNER JOIN {$membergroup_access} as `uga` ON `uga`.`membergroup`=`ug`.`user_group` WHERE `ug`.`member` = " . $user->getID(); + $out = $this->modx->db->getColumn('documentgroup', $this->query($sql)); + + } + unset($user); + + return $out; + } + + /** + * @param int $userID + * @return array + */ + public function getUserGroups($userID = 0) + { + $out = array(); + $user = $this->switchObject($userID); + if (null !== $user->getID()) { + $member_groups = $this->makeTable('member_groups'); + $membergroup_names = $this->makeTable('membergroup_names'); + + $sql = "SELECT `ugn`.`name` FROM {$member_groups} as `ug` + INNER JOIN {$membergroup_names} as `ugn` ON `ugn`.`id`=`ug`.`user_group` + WHERE `ug`.`member` = " . $user->getID(); + $out = $this->modx->db->getColumn('name', $this->query($sql)); + } + unset($user); + + return $out; + } + + /** + * @param int $userID + * @param array $groupIds + * @return $this + */ + public function setUserGroups($userID = 0, $groupIds = array()) + { + if (!is_array($groupIds)) { + return $this; + } + if ($this->newDoc && $userID == 0) { + $this->groupIds = $groupIds; + } else { + $user = $this->switchObject($userID); + if ($uid = $user->getID()) { + foreach ($groupIds as $gid) { + $this->query("REPLACE INTO {$this->makeTable('member_groups')} (`user_group`, `member`) VALUES ('{$gid}', '{$uid}')"); + } + } + unset($user); + $this->groupIds = array(); + } + + return $this; + } + + /** + * @param string $pass + * @return string + */ + public function getPasswordHashType($pass) + { + $out = 'unknown'; + if (substr($pass, 0, 1) === '$') { + $out = 'phpass'; + } elseif (strpos($pass, '>') !== false) { + $out = 'v1'; + } elseif (strlen($pass) === 32) { + $out = 'md5'; + } + + return $out; + } + + /** + * @param string $pass + * @return string + */ + public function getPasswordHashAlgorithm($pass) + { + $pointer = strpos($pass, '>'); + $out = $pointer === false ? 'NOSALT' : substr($pass, 0, $pointer); + + return strtoupper($out); + } + + /** + * @param string $pass + * @param int $seed + * @param string $algorithm + * @return string + */ + public function makeHash($pass, $seed, $algorithm) + { + $salt = md5($pass . $seed); + + switch ($algorithm) { + case 'BLOWFISH_Y': + $salt = '$2y$07$' . substr($salt, 0, 22); + break; + case 'BLOWFISH_A': + $salt = '$2a$07$' . substr($salt, 0, 22); + break; + case 'SHA512': + $salt = '$6$' . substr($salt, 0, 16); + break; + case 'SHA256': + $salt = '$5$' . substr($salt, 0, 16); + break; + case 'MD5': + $salt = '$1$' . substr($salt, 0, 8); + break; + default: + $algorithm = 'UNCRYPT'; + break; + } + + $pass = $algorithm !== 'UNCRYPT' ? sha1($pass) . crypt($pass, $salt) : sha1($salt . $pass); + $out = strtolower($algorithm) . '>' . md5($salt . $pass) . substr(md5($salt), 0, 8); + + return $out; + } + + +} diff --git a/assets/lib/MODxAPI/modResource.php b/assets/lib/MODxAPI/modResource.php old mode 100755 new mode 100644 index 9f7afc2c48..55c83d5f69 --- a/assets/lib/MODxAPI/modResource.php +++ b/assets/lib/MODxAPI/modResource.php @@ -144,6 +144,9 @@ class modResource extends MODxAPI /** @var array связи ТВ и шаблонов */ private $tvTpl = array(); + /** @var array параметры ТВ с массивами */ + protected $tvaFields = array(); + /** * Массив администраторов * @var DLCollection @@ -279,6 +282,9 @@ public function renderTV($tvname) include_once MODX_MANAGER_PATH . "includes/tmplvars.format.inc.php"; include_once MODX_MANAGER_PATH . "includes/tmplvars.commands.inc.php"; $tvval = $this->get($tvname); + if ($this->isTVarrayField($tvname) && is_array($tvval)) { + $tvval = implode('||', $tvval); + } $param = APIHelpers::getkey($this->tvd, $tvname, array()); $display = APIHelpers::getkey($param, 'display', ''); $display_params = APIHelpers::getkey($param, 'display_params', ''); @@ -315,7 +321,7 @@ public function get($key) */ public function set($key, $value) { - if (is_scalar($value) && is_scalar($key) && !empty($key)) { + if ((is_scalar($value) || $this->isTVarrayField($key) || $this->isJsonField($key)) && is_scalar($key) && !empty($key)) { switch ($key) { case 'parent': $value = (int)$value; @@ -452,7 +458,14 @@ protected function getTime($value) */ public function create($data = array()) { - parent::create($data); + $this->close(); + $fld = array(); + foreach ($this->tvd as $name => $tv) { + $fld[$name] = $tv['value']; + }; + $this->store($fld); + + $this->fromArray(array_merge($fld, $data)); $this->set('createdby', null) ->set('editedby', null) ->set('createdon', time()) @@ -470,6 +483,7 @@ public function edit($id) $id = is_scalar($id) ? trim($id) : ''; if ($this->getID() != $id) { $this->close(); + $this->markAllEncode(); $this->newDoc = false; $result = $this->query("SELECT * from {$this->makeTable('site_content')} where `id`=" . (int)$id); @@ -483,6 +497,7 @@ public function edit($id) } else { $this->id = $this->field['id']; $this->set('editedby', null)->touch(); + $this->decodeFields(); } $this->store($this->toArray(null, null, null, false)); unset($this->field['id']); @@ -526,7 +541,7 @@ public function save($fire_events = false, $clearCache = false) 'docObj' => $this ), $fire_events); - $fld = $this->toArray(null, null, null, false); + $fld = $this->encodeFields()->toArray(null, null, null, false); foreach ($this->default_field as $key => $value) { $tmp = $this->get($key); if ($this->newDoc && (!is_int($tmp) && $tmp == '')) { @@ -600,9 +615,9 @@ public function save($fire_events = false, $clearCache = false) } if (!$this->newDoc && !empty($_insertTVs)) { - $ids = implode(',',array_keys($_insertTVs)); + $ids = implode(',', array_keys($_insertTVs)); $result = $this->query("SELECT `tmplvarid` FROM {$this->makeTable('site_tmplvar_contentvalues')} WHERE `contentid`={$this->id} AND `tmplvarid` IN ({$ids})"); - $existedTVs = $this->modx->db->getColumn('tmplvarid',$result); + $existedTVs = $this->modx->db->getColumn('tmplvarid', $result); foreach ($existedTVs as $id) { $_updateTVs[$id] = $_insertTVs[$id]; unset($_insertTVs[$id]); @@ -610,7 +625,7 @@ public function save($fire_events = false, $clearCache = false) } if (!empty($_updateTVs)) { - foreach($_updateTVs as $id => $value) { + foreach ($_updateTVs as $id => $value) { $this->query("UPDATE {$this->makeTable('site_tmplvar_contentvalues')} SET `value` = '{$value}' WHERE `contentid` = {$this->id} AND `tmplvarid` = {$id}"); } } @@ -620,12 +635,12 @@ public function save($fire_events = false, $clearCache = false) foreach ($_insertTVs as $id => $value) { $values[] = "({$this->id}, {$id}, '{$value}')"; } - $values = implode(',',$values); + $values = implode(',', $values); $this->query("INSERT into {$this->makeTable('site_tmplvar_contentvalues')} (`contentid`,`tmplvarid`,`value`) VALUES {$values}"); } if (!empty($_deleteTVs)) { - $ids = implode(',',$_deleteTVs); + $ids = implode(',', $_deleteTVs); $this->query("DELETE FROM {$this->makeTable('site_tmplvar_contentvalues')} WHERE `contentid` = '{$this->id}' AND `tmplvarid` IN ({$ids})"); } @@ -643,6 +658,7 @@ public function save($fire_events = false, $clearCache = false) if ($clearCache) { $this->clearCache($fire_events); } + $this->decodeFields(); return $this->id; } @@ -764,7 +780,7 @@ private function systemID() * @param $alias * @return string */ - private function checkAlias($alias) + protected function checkAlias($alias) { $alias = strtolower($alias); if ($this->modxConfig('friendly_urls')) { @@ -805,15 +821,24 @@ public function issetField($key) protected function get_TV($reload = false) { if (empty($this->modx->_TVnames) || $reload) { - $result = $this->query('SELECT `id`,`name` FROM ' . $this->makeTable('site_tmplvars')); + $result = $this->query('SELECT `id`,`name`,`type` FROM ' . $this->makeTable('site_tmplvars')); while ($row = $this->modx->db->GetRow($result)) { - $this->modx->_TVnames[$row['name']] = $row['id']; + $this->modx->_TVnames[$row['name']] = array( + "id" => $row['id'], + "type" => $row['type'] + ); } } - foreach ($this->modx->_TVnames as $name => $id) { - $this->tvid[$id] = $name; - $this->tv[$name] = $id; + $arrayTypes = array('checkbox', 'listbox-multiple'); + $arrayTVs = array(); + foreach ($this->modx->_TVnames as $name => $data) { + $this->tvid[$data['id']] = $name; + $this->tv[$name] = $data['id']; + if (in_array($data['type'], $arrayTypes)) { + $arrayTVs[] = $name; + } } + if (empty($this->tvaFields)) $this->tvaFields = $arrayTVs; $this->loadTVTemplate()->loadTVDefault(array_values($this->tv)); return $this; @@ -881,7 +906,7 @@ public function setTemplate($tpl) /** * @return string */ - private function getAlias() + protected function getAlias() { if ($this->modxConfig('friendly_urls') && $this->modxConfig('automatic_alias') && $this->get('alias') == '') { $alias = strtr($this->get('pagetitle'), $this->table); @@ -961,4 +986,92 @@ public function setDefaultTemplate() return $this; } + + /** + * Декодирует конкретное поле + * @param string $field Имя поля + * @param bool $store обновить распакованное поле + * @return array ассоциативный массив с данными из json строки + */ + public function decodeField($field, $store = false) + { + $out = array(); + if ($this->isDecodableField($field)) { + $data = $this->get($field); + if ($this->isTVarrayField($field)) { + $out = explode('||', $data); + } else { + $out = jsonHelper::jsonDecode($data, array('assoc' => true), true); + } + } + if ($store) { + $this->field[$field] = $out; + $this->markAsDecode($field); + } + + return $out; + } + + /** + * Запаковывает конкретное поле в JSON + * @param string $field Имя поля + * @param bool $store обновить запакованное поле + * @return string|null json строка + */ + public function encodeField($field, $store = false) + { + $out = null; + if ($this->isEncodableField($field)) { + $data = $this->get($field); + if ($this->isTVarrayField($field)) { + $out = is_array($data) ? implode('||', $data) : $data; + } else { + $out = json_encode($data); + } + } + if ($store) { + $this->field[$field] = $out; + $this->markAsEncode($field); + } + + return $out; + } + + /** + * Может ли содержать данное поле json массив + * @param string $field имя поля + * @return boolean + */ + public function isTVarrayField($field) + { + return (is_scalar($field) && in_array($field, $this->tvaFields)); + } + + /** + * Пометить все поля как запакованные + * @return $this + */ + public function markAllEncode() + { + parent::markAllEncode(); + foreach ($this->tvaFields as $field) { + $this->markAsEncode($field); + } + + return $this; + } + + /** + * Пометить все поля как распакованные + * @return $this + */ + public function markAllDecode() + { + parent::markAllDecode(); + foreach ($this->tvaFields as $field) { + $this->markAsDecode($field); + } + + return $this; + } } diff --git a/assets/lib/MODxAPI/modUsers.php b/assets/lib/MODxAPI/modUsers.php old mode 100755 new mode 100644 index 1448091973..db8fc9e1c3 --- a/assets/lib/MODxAPI/modUsers.php +++ b/assets/lib/MODxAPI/modUsers.php @@ -49,6 +49,7 @@ class modUsers extends MODxAPI * @var string */ protected $givenPassword = ''; + protected $groupIds = array(); /** * @param $key @@ -238,6 +239,9 @@ public function save($fire_events = false, $clearCache = false) 'username' => $this->get('username') ), $fire_events); } + + if ($this->groupIds) $this->setUserGroups($this->id, $this->groupIds); + $this->invokeEvent('OnWebSaveUser', array( 'userObj' => $this, 'mode' => $this->newDoc ? "new" : "upd", @@ -386,8 +390,12 @@ public function AutoLogin($fulltime = true, $cookieName = 'WebLoginPE', $fire_ev $this->close(); $q = $this->modx->db->query("SELECT id FROM " . $this->makeTable('web_users') . " WHERE md5(username)='{$this->escape($cookie[0])}'"); $id = $this->modx->db->getValue($q); - if ($this->edit($id) && null !== $this->getID() && $this->get('password') == $cookie[1] && $this->get('sessionid') == $cookie[2] && $this->testAuth($this->getID(), - $cookie[1], true) + if ( + $this->edit($id) + && null !== $this->getID() + && $this->get('password') == $cookie[1] + && $this->get('sessionid') == $cookie[2] + && !$this->checkBlock($this->getID()) ) { $flag = $this->authUser($this->getID(), $fulltime, $cookieName, $fire_events); @@ -497,13 +505,14 @@ public function isSecure() * @param bool $remember * @return $this */ - protected function setAutoLoginCookie($cookieName, $remember = true) + public function setAutoLoginCookie($cookieName, $remember = true) { - if (!empty($cookieName)) { + if (!empty($cookieName) && $this->getID()) { $secure = $this->isSecure(); - $cookieValue = array(md5($this->get('username')), $this->get('password'), $this->get('sessionid')); + $remember = is_bool($remember) ? (60 * 60 * 24 * 365 * 5) : (int)$remember; + $cookieValue = array(md5($this->get('username')), $this->get('password'), $this->get('sessionid'), $remember); $cookieValue = implode('|', $cookieValue); - $cookieExpires = time() + (is_bool($remember) ? (60 * 60 * 24 * 365 * 5) : (int)$remember); + $cookieExpires = time() + $remember; setcookie($cookieName, $cookieValue, $cookieExpires, '/', '', $secure, true); } @@ -562,11 +571,18 @@ public function getUserGroups($userID = 0) */ public function setUserGroups($userID = 0, $groupIds = array()) { - $user = $this->switchObject($userID); - if (($uid = $user->getID()) && is_array($groupIds)) { - foreach ($groupIds as $gid) { - $this->query("REPLACE INTO {$this->makeTable('web_groups')} (`webgroup`, `webuser`) VALUES ('{$gid}', '{$uid}')"); + if (!is_array($groupIds)) return $this; + if ($this->newDoc && $userID == 0) { + $this->groupIds = $groupIds; + } else { + $user = $this->switchObject($userID); + if ($uid = $user->getID()) { + foreach ($groupIds as $gid) { + $this->query("REPLACE INTO {$this->makeTable('web_groups')} (`webgroup`, `webuser`) VALUES ('{$gid}', '{$uid}')"); + } } + unset($user); + $this->groupIds = array(); } return $this; diff --git a/assets/lib/SimpleTab/plugin.class.php b/assets/lib/SimpleTab/plugin.class.php old mode 100755 new mode 100644 index b8e60d47a9..78cba82d99 --- a/assets/lib/SimpleTab/plugin.class.php +++ b/assets/lib/SimpleTab/plugin.class.php @@ -125,20 +125,7 @@ public function prerender() } $this->registerEvents($this->pluginEvents); } - $output = ''; - $plugins = $this->modx->pluginEvent; - if (($this->renderEvent !== 'OnDocFormRender' || (array_search('ManagerManager', - $plugins['OnDocFormRender']) === false)) - ) { - $jquery = $this->assets->registerScript('jQuery', array( - 'version' => '1.9.1', - 'src' => 'assets/js/jquery/jquery-1.9.1.min.js' - )); - if ($jquery !== false) { - $output .= $jquery; - $output .= ''; - } - } + $output = $this->assets->registerJQuery(); $tpl = MODX_BASE_PATH . $this->tpl; if ($this->fs->checkFile($tpl)) { $output .= '[+js+][+styles+]' . file_get_contents($tpl); @@ -165,12 +152,7 @@ public function renderJS($list, $ph = array()) $scripts = $this->DLTemplate->parseChunk('@CODE:' . $scripts, $ph); $scripts = json_decode($scripts, true); $scripts = isset($scripts['scripts']) ? $scripts['scripts'] : $scripts['styles']; - foreach ($scripts as $name => $params) { - $script = $this->assets->registerScript($name, $params); - if ($script !== false) { - $js .= $script; - } - } + $js = $this->assets->registerScriptsList($scripts); } else { if ($list == $this->jsListDefault) { $this->modx->logEvent(0, 3, "Cannot load {$this->jsListDefault} .", $this->pluginName); diff --git a/assets/lib/SimpleTab/table.abstract.php b/assets/lib/SimpleTab/table.abstract.php old mode 100755 new mode 100644 index 63ae1b726f..7fb616756a --- a/assets/lib/SimpleTab/table.abstract.php +++ b/assets/lib/SimpleTab/table.abstract.php @@ -44,7 +44,6 @@ public function __construct($modx, $debug = false) { parent::__construct($modx, $debug); $this->modx = $modx; - $this->params = (isset($modx->event->params) && is_array($modx->event->params)) ? $modx->event->params : array(); $this->fs = \Helpers\FS::getInstance(); } @@ -130,7 +129,7 @@ public function deleteThumb($url, $cache = false) if ($cache) { return; } - $thumbsCache = isset($this->params['thumbsCache']) ? $this->params['thumbsCache'] : $this->thumbsCache; + $thumbsCache = \APIhelpers::getkey($this->params,'thumbsCache',$this->thumbsCache); $thumb = $thumbsCache . $url; if ($this->fs->checkFile($thumb)) { $this->deleteThumb($thumb, true); @@ -142,7 +141,7 @@ public function deleteThumb($url, $cache = false) * @param null $fire_events * @return $this */ - public function delete($ids, $fire_events = null) + public function delete($ids, $fire_events = false) { $out = parent::delete($ids, $fire_events); $this->query("ALTER TABLE {$this->makeTable($this->table)} AUTO_INCREMENT = 1"); @@ -156,7 +155,7 @@ public function delete($ids, $fire_events = null) * @param null $fire_events * @return $this */ - public function deleteAll($ids, $rid, $fire_events = null) + public function deleteAll($ids, $rid, $fire_events = false) { $this->clearIndexes($ids, $rid); @@ -180,6 +179,7 @@ public function fieldNames() */ public function stripName($name) { + $filename = $this->fs->takeFileName($name); $ext = $this->fs->takeFileExt($name); @@ -258,4 +258,20 @@ public function makeThumb($folder, $url, $options) return false; } } + + /** + * @return array + */ + public function getParams() + { + return $this->params; + } + + /** + * @param array $params + */ + public function setParams($params = array()) + { + if (is_array($params)) $this->params = $params; + } } diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php index f61393c304..1a554dae9d 100644 --- a/assets/lib/class.modxRTEbridge.php +++ b/assets/lib/class.modxRTEbridge.php @@ -10,7 +10,7 @@ class modxRTEbridge public $editorKey = ''; // Key for config/tpl/settings-files (ckeditor4, tinymce4, ...) public $theme = ''; // Theme-key (default, simple, mini ... ) public $pluginParams = array(); // Params from Modx plugin-configuration - public $modxParams = array(); // Holds actual settings coming from Modx- or user-configuration + public $modxParams = array(); // Holds actual settings merged from Modx- and user-configuration public $bridgeParams = array(); // Holds translation of Modx Configuration-Keys to Editor Configuration-Keys public $themeConfig = array(); // Valid params and defaults for Editor public $tvOptions = array(); // Options set via TV-Option like {"theme":"mini"} @@ -21,7 +21,7 @@ class modxRTEbridge public $langArr = array(); // Holds lang strings public $debug = false; // Enable/disable debug messages via HTML-comment public $debugMessages = array(); // Holds all messages - added by $this->debugMessages[] = 'Message'; - public $ajaxSecHash = array(); // Holds security-hashes + public $ajaxSecHash = array(); // Holds security-hashes public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions=array(), $basePath='') { @@ -62,9 +62,6 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions case 12: // Edit user case 119: // Purge plugin processor $editorConfig = $usersettings; - if (!empty($usersettings[$this->editorKey . '_theme'])) { - $usersettings[$this->editorKey . '_theme'] = $settings[$this->editorKey . '_theme']; - } break; // Get Modx-config case 17: // Modx-configuration @@ -79,19 +76,40 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions 'custom_plugins', 'custom_buttons1', 'custom_buttons2', 'custom_buttons3', 'custom_buttons4', 'template_docs', 'template_chunks' ); - + + // Add defaultCheckbox-Values for user-settings + $settingsRows = array(); + include($basePath . 'gsettings/gsettings.rows.inc.php'); + $this->gSettingsRows = $settingsRows; + foreach($this->gSettingsRows as $param=>$row) { + if(isset($row['defaultCheckbox']) && $row['defaultCheckbox']) { + $useGlobalName = $editorKey . '_' . $param . '_useglobal'; + $this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; + } + } + // Add custom settings from bridge - foreach ($this->gSettingsCustom as $name => $x) { - if (!in_array($name, $modxParamsArr)) $modxParamsArr[] = $name; + foreach ($this->gSettingsCustom as $param => $row) { + if (!in_array($param, $modxParamsArr)) $modxParamsArr[] = $param; + // Handle defaultCheckbox + if(isset($row['defaultCheckbox']) && $row['defaultCheckbox']) { + $useGlobalName = $editorKey . '_' . $param . '_useglobal'; + $this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; + } }; // Take over editor-configuration from Modx foreach ($modxParamsArr as $p) { - $value = isset($editorConfig[$editorKey . '_' . $p]) ? $editorConfig[$editorKey . '_' . $p] : NULL; - $value = $value === NULL && isset($this->gSettingsDefaultValues[$p]) ? $this->gSettingsDefaultValues[$p] : $value; - + $useGlobalName = $p . '_useglobal'; + if (!in_array($mgrAction,array(11,12)) && isset($this->modxParams[$useGlobalName]) && $this->modxParams[$useGlobalName] == '1' && isset($modx->configGlobal[$editorKey . '_' . $p])) { + $value = $modx->configGlobal[$editorKey . '_' . $p]; + } + else { + $value = isset($editorConfig[$editorKey . '_' . $p]) ? $editorConfig[$editorKey . '_' . $p] : null; + $value = $value === null && isset($this->gSettingsDefaultValues[$p]) ? $this->gSettingsDefaultValues[$p] : $value; + } $this->modxParams[$p] = $value; - }; + } // Set TV-options $this->tvOptions = $tvOptions; @@ -195,7 +213,7 @@ public function setLang($key, $string, $overwriteExisting = false) // Get translation public function lang($key = '', $returnNull = false) { - if (!$key) return; + if (!$key) return $returnNull ? NULL : ''; if (isset($this->langArr[$key])) return $this->langArr[$key]; return $returnNull ? NULL : 'lang_' . $key; // Show missing key as fallback } @@ -473,7 +491,7 @@ public function addEditorScriptToBody() // Outputs Modx- / user-configuration settings public function getModxSettings() { - global $modx, $usersettings, $settings; + global $modx; $params = &$this->pluginParams; if (defined('INTERFACE_RENDERED_' . $this->editorKey)) { @@ -493,16 +511,6 @@ public function getModxSettings() $ph['display'] = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; $ph['display'] = $modx->config['use_editor'] == 1 ? $ph['display'] : 'none'; - // Prepare setting "editor_theme" - $theme_options = ''; - switch ($modx->manager->action) { - case '11'; - case '12'; - case '119'; - $selected = empty($ph[$this->editorKey . '_theme']) ? '"selected"' : ''; - $theme_options .= '\n"; - } - // Prepare setting "theme" $ph['theme_options'] = $this->getThemeNames(); @@ -570,13 +578,26 @@ public function getModxSettings() $row['messageVal'] = !empty($row['messageVal']) ? $row['messageVal'] : ''; // Prepare displaying of default values - $row['default'] = isset($this->gSettingsDefaultValues[$name]) ? '' . $this->lang('default') . '' . $this->gSettingsDefaultValues[$name] . '' : ''; - - // Simple nested parsing - $output = $this->parsePlaceholders($settingsRowTpl, $row); // Replace general translations - $output = $this->parsePlaceholders($output, $ph); // Replace values / settings - $output = $this->parsePlaceholders($output, $row); // Replace new PHs from values / settings - $output = $this->parsePlaceholders($output, $ph); // Replace last values / settings + $row['default'] = isset($this->gSettingsDefaultValues[$name]) ? '' . $this->lang('default') . '' . $this->gSettingsDefaultValues[$name] . '' : ''; + + // Prepare Default-Checkboxes for user-settings + if(in_array($modx->manager->action, array(11,12)) && isset($row['defaultCheckbox']) && $row['defaultCheckbox']) { + $useGlobalName = $name . '_useglobal'; + $useGlobal = is_null($this->modxParams[$useGlobalName]) || !empty($this->modxParams[$useGlobalName]) ? '1' : '0'; + $useGlobalBool = $useGlobal ? true : false; + $row['defaultCheckbox'] = ''; + } else { + $row['defaultCheckbox'] = ''; + } + + // Nested parsing + $output = $settingsRowTpl; + $bt=md5(''); + while($bt !== md5($output)) { + $bt = md5($output); + $output = $this->parsePlaceholders($output, $row); // Replace general translations + $output = $this->parsePlaceholders($output, $ph); // Replace values / settings + } $ph['rows'] .= $output . "\n"; }; @@ -650,7 +671,7 @@ public function getThemeNames() public function getSkinNames() { - global $modx, $usersettings, $settings; + global $modx; $params = $this->pluginParams; if (empty($params['skinsDirectory'])) { @@ -713,7 +734,7 @@ public function initLang($basePath) // Init langArray once if (empty($this->langArr)) { - $lang_name = $modx->config['manager_language']; + $lang_name = !empty($_SESSION['mgrUsrConfigSet']['manager_language']) ? $_SESSION['mgrUsrConfigSet']['manager_language'] : $modx->config['manager_language']; $gsettings_path = $basePath . "lang/gsettings/"; // Holds general translations $custom_path = $basePath . "lang/custom/"; // Holds custom translations $lang_file = $lang_name . '.inc.php'; @@ -798,11 +819,11 @@ public function addQuotesToCommaList($str, $quote = '"') public function parseEditableIds($source, $attrContentEditable=false) { if(!isset($_SESSION['mgrValidated'])) return $source; - $attrContentEditable = $attrContentEditable == true ? ' contenteditable="true"' : ''; - + $attrContentEditable = $attrContentEditable == true ? ' contenteditable="true"' : ''; + $matchPhs = '~\[\*#(.*?)\*\]~'; // match [*#content*] / content preg_match_all($matchPhs, $source, $editableIds); - + $this->setEditableIds($editableIds); $source = preg_replace($matchPhs, '
                              [*$1*]
                              ', $source); @@ -852,11 +873,11 @@ public function unprotectModxPlaceholders($output) public function prepareAjaxSecHash($docId) { - if(isset($this->ajaxSecHash[$docId])) return $this->ajaxSecHash[$docId]; + if(isset($this->ajaxSecHash[$docId])) return $this->ajaxSecHash[$docId]; - $secHash = md5(rand(0, 999999999) + rand(0, 999999999)); - $_SESSION['modxRTEbridge']['secHash'][$docId] = $secHash; - $this->ajaxSecHash[$docId] = $secHash; + $secHash = md5(rand(0, 999999999) + rand(0, 999999999)); + $_SESSION['modxRTEbridge']['secHash'][$docId] = $secHash; + $this->ajaxSecHash[$docId] = $secHash; return $secHash; } @@ -977,4 +998,4 @@ public function saveContentProcessor($rid, $ppPluginName, $ppEditableIds='editab return 'Not logged into manager!'; } } -} \ No newline at end of file +} diff --git a/assets/modules/docmanager/templates/main.tpl b/assets/modules/docmanager/templates/main.tpl index 13c72d12fc..637fc0b3b9 100644 --- a/assets/modules/docmanager/templates/main.tpl +++ b/assets/modules/docmanager/templates/main.tpl @@ -1,105 +1,103 @@ - - [+lang.DM_module_title+] - - - - - - - + + + + - [+onManagerMainFrameHeaderHTMLBlock+] - - -

                              - - - - - [+lang.DM_module_title+] - + + return true; + } + + [+onManagerMainFrameHeaderHTMLBlock+] + + + +

                              + [+lang.DM_module_title+]

                              - -
                              -
                              - - -
                              -

                              [+lang.DM_change_template+]

                              - - [+view.templates+] -
                              - -
                              -

                              [+lang.DM_template_variables+]

                              - - [+view.templatevars+] -
                              - -
                              -

                              [+lang.DM_doc_permissions+]

                              - - [+view.documentgroups+] -
                              - -
                              -

                              [+lang.DM_other+]

                              - - [+view.misc+] - [+view.changeauthors+] -
                              -
                              + + + +
                              +
                              + + +
                              +

                              [+lang.DM_change_template+]

                              + + [+view.templates+] +
                              + +
                              +

                              [+lang.DM_template_variables+]

                              + + [+view.templatevars+] +
                              + +
                              +

                              [+lang.DM_doc_permissions+]

                              + + [+view.documentgroups+] +
                              + +
                              +

                              [+lang.DM_other+]

                              + + [+view.misc+] + [+view.changeauthors+] +
                              - [+view.documents+] - [+view.tab+] - +
                              +[+view.documents+] +[+view.tab+] + \ No newline at end of file diff --git a/assets/modules/docmanager/templates/misc.tpl b/assets/modules/docmanager/templates/misc.tpl index 2756908e0a..0bc98caef0 100644 --- a/assets/modules/docmanager/templates/misc.tpl +++ b/assets/modules/docmanager/templates/misc.tpl @@ -1,58 +1,58 @@ -

                              [+lang.DM_adjust_dates_header+]


                              +

                              [+lang.DM_adjust_dates_header+]


                              [+lang.DM_adjust_dates_desc+]


                              - - - - - - - - - - - - - - - - - -
                              - - -
                              - - -
                              - - -
                              - - -
                              + + + + + + + + + + + + + + + + + +
                              + + +
                              + + +
                              + + +
                              + + +

                              -

                              [+lang.DM_other_header+]

                              +

                              [+lang.DM_other_header+]


                              [+lang.DM_misc_desc+]


                              - - - - - - - - - - - - - - + + + + + + + + + + + + + -

                              -   -   + +

                              +   +  
                              \ No newline at end of file diff --git a/assets/modules/docmanager/templates/update.tpl b/assets/modules/docmanager/templates/update.tpl index 457d913007..9d3216dae6 100644 --- a/assets/modules/docmanager/templates/update.tpl +++ b/assets/modules/docmanager/templates/update.tpl @@ -1,44 +1,46 @@ - - [+lang.DM_update_title+] - - - - - - - -

                              [+lang.DM_module_title+]

                              - - -
                              -
                              [+lang.DM_update_title+]
                              -
                              -

                              [+update.message+]

                              - -
                              -
                              - + + [+lang.DM_update_title+] + + + + + + + + +

                              [+lang.DM_module_title+]

                              + + + +
                              +
                              [+lang.DM_update_title+]
                              +
                              +

                              [+update.message+]

                              + +
                              +
                              + \ No newline at end of file diff --git a/assets/modules/docmanager/tv.ajax.php b/assets/modules/docmanager/tv.ajax.php index e32936901f..a67d6e491c 100644 --- a/assets/modules/docmanager/tv.ajax.php +++ b/assets/modules/docmanager/tv.ajax.php @@ -283,6 +283,3 @@ function ParseIntputOptions($v) { else $a = explode("||", $v); return $a; } - - -?> diff --git a/assets/modules/store/core.php b/assets/modules/store/core.php old mode 100755 new mode 100644 index 4f030f256e..215b44f50a --- a/assets/modules/store/core.php +++ b/assets/modules/store/core.php @@ -6,8 +6,9 @@ $version = "0.1.2"; $Store = new Store; +$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; -switch($_REQUEST['action']){ +switch($action){ case 'saveuser': $_SESSION['STORE_USER'] = $modx->db->escape($_POST['res']); break; @@ -27,7 +28,7 @@ if ($file!='%url%' && $file!='' && $file!=' '){ $url = $file; } else { - $url = "http://modx-store.com/get.php?get=file&cid=".$id; + $url = "http://extras.evolution-cms.com/get.php?get=file&cid=".$id; } if (!$Store->downloadFile($url ,MODX_BASE_PATH."assets/cache/store/temp.zip")){ @@ -86,7 +87,7 @@ } $Store->lang['user_email'] = $_SESSION['mgrEmail']; - $Store->lang['hash'] = stripslashes( $_SESSION['STORE_USER'] ); + $Store->lang['hash'] = isset($_SESSION['STORE_USER']) ? stripslashes( $_SESSION['STORE_USER'] ) : ''; $Store->lang['lang'] = $Store->language; $Store->lang['_type'] = json_encode($PACK); $Store->lang['v'] = $version; @@ -118,7 +119,7 @@ function quit(){ } function get_version($text){ preg_match('/(.*)<\/strong>/s',$text, $match); - return $match[1]; + return isset($match[1]) ? $match[1] : ''; } static function parse($tpl,$field){ @@ -127,9 +128,9 @@ static function parse($tpl,$field){ $evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock'); $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; $tpl = str_replace('[+onManagerMainFrameHeaderHTMLBlock+]',$onManagerMainFrameHeaderHTMLBlock,$tpl); - return $tpl; + return $tpl; } - function tpl($file){ + function tpl($file){ $lang = $this->lang; ob_start(); include($file); @@ -226,4 +227,3 @@ private static function mkDir($folder, $perm=0777) { } } } -?> \ No newline at end of file diff --git a/assets/modules/store/css/style.css b/assets/modules/store/css/style.css old mode 100755 new mode 100644 index 4b756905f2..ca35e86b1d --- a/assets/modules/store/css/style.css +++ b/assets/modules/store/css/style.css @@ -149,12 +149,16 @@ width: 230px; } .box { - width: 200px; + width: 220px; border: 1px solid #e0e0e0; background: #fff; padding: 10px; margin-bottom: 10px; box-shadow: 0px 0px 3px rgba(119, 117, 117, 0.1); + -moz-osx-font-smoothing: grayscale; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box } .mh { min-height: 150px; diff --git a/assets/modules/store/installer/instprocessor-fast.php b/assets/modules/store/installer/instprocessor-fast.php old mode 100755 new mode 100644 index a1598e671b..812862345e --- a/assets/modules/store/installer/instprocessor-fast.php +++ b/assets/modules/store/installer/instprocessor-fast.php @@ -318,7 +318,7 @@ function parseProperties($propertyString) { $name = $modx->db->escape($moduleModule[0]); $desc = $modx->db->escape($moduleModule[1]); $filecontent = $moduleModule[2]; - $properties = $modx->db->escape($moduleModule[3]); + $properties = $moduleModule[3]; $guid = $modx->db->escape($moduleModule[4]); $shared = $modx->db->escape($moduleModule[5]); $category = $modx->db->escape($moduleModule[6]); @@ -336,13 +336,14 @@ function parseProperties($propertyString) { $rs = $modx->db->query("SELECT * FROM `" . $table_prefix . "site_modules` WHERE name='$name'"); if ($modx->db->getRecordCount($rs)) { $row = $modx->db->getRow($rs,'assoc'); - $props = propUpdate($properties,$modx->db->escape($row['properties'])); + $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { echo "

                              " . mysql_error() . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { + $properties = $modx->db->escape(parseProperties($properties, true)); if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { echo "

                              " . mysql_error() . "

                              "; return; @@ -365,7 +366,7 @@ function parseProperties($propertyString) { $name = $modx->db->escape($modulePlugin[0]); $desc = $modx->db->escape($modulePlugin[1]); $filecontent = $modulePlugin[2]; - $properties = $modx->db->escape($modulePlugin[3]); + $properties = $modulePlugin[3]; $events = explode(",", $modulePlugin[4]); $guid = $modx->db->escape($modulePlugin[5]); $category = $modx->db->escape($modulePlugin[6]); @@ -397,7 +398,7 @@ function parseProperties($propertyString) { if ($modx->db->getRecordCount($rs)) { $insert = true; while($row = $modx->db->getRow($rs,'assoc')) { - $props = propUpdate($properties,$modx->db->escape($row['properties'])); + $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if($row['description'] == $desc){ if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) { echo "

                              " . mysql_error() . "

                              "; @@ -412,6 +413,7 @@ function parseProperties($propertyString) { } } if($insert === true) { + $properties = $modx->db->escape(parseProperties($properties, true)); if(!@$modx->db->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);",$sqlParser->conn)) { echo "

                              ".mysql_error()."

                              "; return; @@ -419,7 +421,7 @@ function parseProperties($propertyString) { } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { - + $properties = $modx->db->escape(parseProperties($properties, true)); if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid',$disabled,$category);")) { echo "

                              " . mysql_error() . "

                              "; return; @@ -455,7 +457,7 @@ function parseProperties($propertyString) { $name = $modx->db->escape($moduleSnippet[0]); $desc = $modx->db->escape($moduleSnippet[1]); $filecontent = $moduleSnippet[2]; - $properties = $modx->db->escape($moduleSnippet[3]); + $properties = $moduleSnippet[3]; $category = $modx->db->escape($moduleSnippet[4]); if (!file_exists($filecontent)) echo "

                                $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

                              "; @@ -473,13 +475,14 @@ function parseProperties($propertyString) { if ($modx->db->getRecordCount($rs)) { $row = $modx->db->getRow($rs,'assoc'); - $props = propUpdate($properties,$modx->db->escape($row['properties'])); + $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if (!$modx->db->query("UPDATE `" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { echo "

                              " . mysql_error() . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; - } else { + } else { + $properties = $modx->db->escape(parseProperties($properties, true)); if (!$modx->db->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { echo "

                              " . mysql_error() . "

                              "; return; @@ -527,36 +530,73 @@ function parseProperties($propertyString) { echo "

                              " . $_lang['installation_successful'] . "

                              "; - // Property Update function function propUpdate($new,$old){ - // Split properties up into arrays - $returnArr = array(); - $newArr = explode("&",$new); - $oldArr = explode("&",$old); - - foreach ($newArr as $k => $v) { - if(!empty($v)){ - $tempArr = explode("=",trim($v)); - $returnArr[$tempArr[0]] = $tempArr[1]; - } - } - foreach ($oldArr as $k => $v) { - if(!empty($v)){ - $tempArr = explode("=",trim($v)); - $returnArr[$tempArr[0]] = $tempArr[1]; + $newArr = parseProperties($new); + $oldArr = parseProperties($old); + foreach ($oldArr as $k => $v){ + if (isset($v['0']['options'])){ + $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; } } + $return = $oldArr + $newArr; + $return = json_encode($return, JSON_UNESCAPED_UNICODE); + $return = ($return != '[]') ? $return : ''; + return $return; +} - // Make unique array - $returnArr = array_unique($returnArr); +function parseProperties($propertyString, $json=false) { + $propertyString = str_replace('{}', '', $propertyString ); + $propertyString = str_replace('} {', ',', $propertyString ); - // Build new string for new properties value - foreach ($returnArr as $k => $v) { - $return .= "&$k=$v "; + if(empty($propertyString)) return array(); + if($propertyString=='{}' || $propertyString=='[]') return array(); + + $jsonFormat = isJson($propertyString, true); + $property = array(); + // old format + if ( $jsonFormat === false) { + $props= explode('&', $propertyString); + $arr = array(); + $key = array(); + foreach ($props as $prop) { + if ($prop != ''){ + $arr = explode(';', $prop); + $key = explode('=', $arr['0']); + $property[$key['0']]['0']['label'] = trim($key['1']); + $property[$key['0']]['0']['type'] = trim($arr['1']); + switch ($arr['1']) { + case 'list': + case 'list-multi': + case 'checkbox': + case 'radio': + case 'menu': + $property[$key['0']]['0']['value'] = trim($arr['3']); + $property[$key['0']]['0']['options'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['3']); + break; + default: + $property[$key['0']]['0']['value'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['2']); + } + $property[$key['0']]['0']['desc'] = ''; + } + + } + // new json-format + } else if(!empty($jsonFormat)){ + $property = $jsonFormat; + } + if ($json) { + $property = json_encode($property, JSON_UNESCAPED_UNICODE); } + $property = ($property != '[]') ? $property : ''; + return $property; +} - return $return; +function isJson($string, $returnData=false) { + $data = json_decode($string, true); + return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; } function getCreateDbCategory($category) { @@ -579,4 +619,4 @@ function getCreateDbCategory($category) { } } return $category_id; -} +} \ No newline at end of file diff --git a/assets/modules/store/installer/instprocessor.php b/assets/modules/store/installer/instprocessor.php old mode 100755 new mode 100644 index 720d1f53ae..64a84d3a30 --- a/assets/modules/store/installer/instprocessor.php +++ b/assets/modules/store/installer/instprocessor.php @@ -112,14 +112,14 @@ function parseProperties($propertyString) { $rs = $modx->db->query("SELECT * FROM `" . $table_prefix . "site_templates` WHERE templatename='$name'"); if ($modx->db->getRecordCount($rs)) { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name';")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_templates` SET content='$template', description='$desc', category='$category_id', locked='$locked' WHERE templatename='$name';")) { $errors += 1; echo "

                              " . mysql_error() . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');")) { + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template','$category_id','$locked');")) { $errors += 1; echo "

                              " . mysql_error() . "

                              "; return; @@ -159,7 +159,7 @@ function parseProperties($propertyString) { if ($modx->db->getRecordCount($rs)) { $insert = true; while($row = $modx->db->getRow($rs,'assoc')) { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category='$category', locked='$locked', elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id='{$row['id']}';")) { echo "

                              " . mysql_error() . "

                              "; return; } @@ -168,7 +168,7 @@ function parseProperties($propertyString) { echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { //$q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',(SELECT (CASE COUNT(*) WHEN 0 THEN 0 ELSE `id` END) `id` FROM `" . $table_prefix . "categories` WHERE `category` = '$category'),$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; - $q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; + $q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc','$category','$locked','$input_options','$output_widget','$output_widget_params','$input_default');"; if (!@ $modx->db->query($q)) { echo "

                              " . mysql_error() . "

                              "; return; @@ -186,18 +186,18 @@ function parseProperties($propertyString) { $ds=$modx->db->query("SELECT id FROM `".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';" ); $row = $modx->db->getRow($ds,'assoc'); $id = $row["id"]; - $modx->db->query('DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\''); + $modx->db->query("DELETE FROM $dbase.`" . $table_prefix . "site_tmplvar_templates` WHERE tmplvarid = '$id';"); // add tv -> template assignments foreach ($assignments as $assignment) { $template = $modx->db->escape($assignment); - $where = "WHERE templatename='$template'"; - if ($template=='*') $where =''; + $where = "WHERE templatename='$template'"; + if ($template=='*') $where =''; $ts = $modx->db->query("SELECT id FROM `".$table_prefix."site_templates` $where;" ); if ($ds && $ts) { $tRow = $modx->db->getRow($ts,'assoc'); $templateId = $tRow['id']; - $modx->db->query("INSERT INTO `" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); + $modx->db->query("INSERT INTO `" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES('$id', '$templateId');"); } } } @@ -238,7 +238,7 @@ function parseProperties($propertyString) { } $update = $count_original_name > 0 && $overwrite == 'true'; if ($update) { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category='$category_id' WHERE name='$name';")) { $errors += 1; echo "

                              " . mysql_error() . "

                              "; return; @@ -248,7 +248,7 @@ function parseProperties($propertyString) { if($count_original_name > 0 && $overwrite == 'false') { $name = $newname; } - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);")) { + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk','$category_id');")) { $errors += 1; echo "

                              " . mysql_error() . "

                              "; return; @@ -270,7 +270,7 @@ function parseProperties($propertyString) { $name = $modx->db->escape($moduleModule[0]); $desc = $modx->db->escape($moduleModule[1]); $filecontent = $moduleModule[2]; - $properties = $modx->db->escape($moduleModule[3]); + $properties = $moduleModule[3]; $guid = $modx->db->escape($moduleModule[4]); $shared = $modx->db->escape($moduleModule[5]); $category = $modx->db->escape($moduleModule[6]); @@ -288,14 +288,15 @@ function parseProperties($propertyString) { $rs = $modx->db->query("SELECT * FROM `" . $table_prefix . "site_modules` WHERE name='$name'"); if ($modx->db->getRecordCount($rs)) { $row = $modx->db->getRow($rs,'assoc'); - $props = propUpdate($properties,$modx->db->escape($row['properties'])); + $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { echo "

                              " . mysql_error() . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { + $properties = $modx->db->escape(parseProperties($properties, true)); + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', '$category');")) { echo "

                              " . mysql_error() . "

                              "; return; } @@ -316,7 +317,7 @@ function parseProperties($propertyString) { $name = $modx->db->escape($modulePlugin[0]); $desc = $modx->db->escape($modulePlugin[1]); $filecontent = $modulePlugin[2]; - $properties = $modx->db->escape($modulePlugin[3]); + $properties = $modulePlugin[3]; $events = explode(",", $modulePlugin[4]); $guid = $modx->db->escape($modulePlugin[5]); $category = $modx->db->escape($modulePlugin[6]); @@ -347,34 +348,35 @@ function parseProperties($propertyString) { if ($modx->db->getRecordCount($rs)) { $insert = true; while($row = $modx->db->getRow($rs,'assoc')) { - $props = propUpdate($properties,$modx->db->escape($row['properties'])); + $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if($row['description'] == $desc){ - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id='{$row['id']}';")) { echo "

                              " . mysql_error() . "

                              "; return; } $insert = false; } else { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE id='{$row['id']}';")) { echo "

                              ".mysql_error()."

                              "; return; } } } if($insert === true) { - if(!@$modx->db->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);" )) { + $properties = $modx->db->escape(parseProperties($properties, true)); + if(!@$modx->db->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0','$category');" )) { echo "

                              ".mysql_error()."

                              "; return; } } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { - - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid',$disabled,$category);")) { + $properties = $modx->db->escape(parseProperties($properties, true)); + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','$disabled','$category');")) { echo "

                              " . mysql_error() . "

                              "; return; } - + echo "

                                $name: " . $_lang['installed'] . "

                              "; } // add system events @@ -384,7 +386,7 @@ function parseProperties($propertyString) { $row = $modx->db->getRow($ds,'assoc'); $id = $row["id"]; // remove existing events - $modx->db->query('DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''); + $modx->db->query("DELETE FROM $dbase.`" . $table_prefix . "site_plugin_events` WHERE pluginid = '$id';"); // add new events $modx->db->query("INSERT INTO `" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM `" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')"); } @@ -405,7 +407,7 @@ function parseProperties($propertyString) { $name = $modx->db->escape($moduleSnippet[0]); $desc = $modx->db->escape($moduleSnippet[1]); $filecontent = $moduleSnippet[2]; - $properties = $modx->db->escape($moduleSnippet[3]); + $properties = $moduleSnippet[3]; $category = $modx->db->escape($moduleSnippet[4]); if (!file_exists($filecontent)) echo "

                                $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

                              "; @@ -419,18 +421,19 @@ function parseProperties($propertyString) { $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); $snippet = $modx->db->escape($snippet); $rs = $modx->db->query("SELECT * FROM `" . $table_prefix . "site_snippets` WHERE name='$name'"); - + if ($modx->db->getRecordCount($rs)) { - + $row = $modx->db->getRow($rs,'assoc'); - $props = propUpdate($properties,$modx->db->escape($row['properties'])); + $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if (!$modx->db->query("UPDATE `" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { echo "

                              " . mysql_error() . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; - } else { - if (!$modx->db->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { + } else { + $properties = $modx->db->escape(parseProperties($properties, true)); + if (!$modx->db->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties','$category');")) { echo "

                              " . mysql_error() . "

                              "; return; } @@ -481,37 +484,75 @@ function parseProperties($propertyString) { // Property Update function function propUpdate($new,$old){ - // Split properties up into arrays - $returnArr = array(); - $newArr = explode("&",$new); - $oldArr = explode("&",$old); - - foreach ($newArr as $k => $v) { - if(!empty($v)){ - $tempArr = explode("=",trim($v)); - $returnArr[$tempArr[0]] = $tempArr[1]; + $newArr = parseProperties($new); + $oldArr = parseProperties($old); + foreach ($oldArr as $k => $v){ + if (isset($v['0']['options'])){ + $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; } } - foreach ($oldArr as $k => $v) { - if(!empty($v)){ - $tempArr = explode("=",trim($v)); - $returnArr[$tempArr[0]] = $tempArr[1]; + $return = $oldArr + $newArr; + $return = json_encode($return, JSON_UNESCAPED_UNICODE); + $return = ($return != '[]') ? $return : ''; + return $return; +} + +function parseProperties($propertyString, $json=false) { + $propertyString = str_replace('{}', '', $propertyString ); + $propertyString = str_replace('} {', ',', $propertyString ); + + if(empty($propertyString)) return array(); + if($propertyString=='{}' || $propertyString=='[]') return array(); + + $jsonFormat = isJson($propertyString, true); + $property = array(); + // old format + if ( $jsonFormat === false) { + $props= explode('&', $propertyString); + $arr = array(); + $key = array(); + foreach ($props as $prop) { + if ($prop != ''){ + $arr = explode(';', $prop); + $key = explode('=', $arr['0']); + $property[$key['0']]['0']['label'] = trim($key['1']); + $property[$key['0']]['0']['type'] = trim($arr['1']); + switch ($arr['1']) { + case 'list': + case 'list-multi': + case 'checkbox': + case 'radio': + case 'menu': + $property[$key['0']]['0']['value'] = trim($arr['3']); + $property[$key['0']]['0']['options'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['3']); + break; + default: + $property[$key['0']]['0']['value'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['2']); + } + $property[$key['0']]['0']['desc'] = ''; + } + } + // new json-format + } else if(!empty($jsonFormat)){ + $property = $jsonFormat; } - - // Make unique array - $returnArr = array_unique($returnArr); - - // Build new string for new properties value - foreach ($returnArr as $k => $v) { - $return .= "&$k=$v "; + if ($json) { + $property = json_encode($property, JSON_UNESCAPED_UNICODE); } + $property = ($property != '[]') ? $property : ''; + return $property; +} - return $return; +function isJson($string, $returnData=false) { + $data = json_decode($string, true); + return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; } function getCreateDbCategory($category, $sqlParser) { - + global $modx; $dbase = $modx->db->config['dbase']; $table_prefix = $modx->db->config['table_prefix']; diff --git a/assets/modules/store/installer/setup.info.php b/assets/modules/store/installer/setup.info.php index 7264d92be2..d81db2c31a 100755 --- a/assets/modules/store/installer/setup.info.php +++ b/assets/modules/store/installer/setup.info.php @@ -85,9 +85,10 @@ } $params = parse_docblock($chunkPath, $tplfile); if(is_array($params) && count($params) > 0) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; $mc[] = array( $params['name'], - $params['description'], + $description, "$chunkPath/{$params['filename']}", $params['modx_category'], array_key_exists('overwrite', $params) ? $params['overwrite'] : 'true', diff --git a/assets/modules/store/installer/sqlParser.class.php b/assets/modules/store/installer/sqlParser.class.php index 47795f9cd8..6d80fc4438 100755 --- a/assets/modules/store/installer/sqlParser.class.php +++ b/assets/modules/store/installer/sqlParser.class.php @@ -6,7 +6,6 @@ class SqlParser { var $host, $dbname, $prefix, $user, $password, $mysqlErrors; var $conn, $installFailed, $sitename, $adminname, $adminemail, $adminpass, $managerlanguage; var $mode, $fileManagerPath, $imgPath, $imgUrl; - var $dbVersion; var $connection_charset, $connection_method; function SqlParser( ) { @@ -73,7 +72,7 @@ function process($filename) { if (preg_match('/^\#/', $sql_do)) continue; // strip out comments and \n for mysql 3.x - if ($this->dbVersion <4.0) { + if ( floatval( $modx->db->getVersion() ) < 4.0 ) { $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do); $sql_do = str_replace('\r', "", $sql_do); $sql_do = str_replace('\n', "", $sql_do); diff --git a/assets/plugins/codemirror/cm/lib/codemirror.css b/assets/plugins/codemirror/cm/lib/codemirror.css index 9ce72ff007..1f2eb93c73 100644 --- a/assets/plugins/codemirror/cm/lib/codemirror.css +++ b/assets/plugins/codemirror/cm/lib/codemirror.css @@ -433,14 +433,15 @@ span.CodeMirror-selectedtext { background: none; } background-color: rgba(0, 0, 0, 0.05); font-weight:bold; } -.cm-modxAttribute, .cm-modxAttributeValue { +.cm-modxAttribute { color: #00c; background-color: rgba(0, 0, 0, 0.05); } .cm-modxAttributeValue { - font-weight:bold; + /*font-weight:bold;*/ + color: #000; } .cm-modxBinding { color: #bc00cc; font-weight:900; -} +} \ No newline at end of file diff --git a/assets/plugins/codemirror/cm/theme/default.css b/assets/plugins/codemirror/cm/theme/default.css old mode 100755 new mode 100644 index e68f0fb378..27687ed094 --- a/assets/plugins/codemirror/cm/theme/default.css +++ b/assets/plugins/codemirror/cm/theme/default.css @@ -1,3 +1,4 @@ +.cm-s-default pre {line-height: 1.3;} .cm-s-default span.cm-keyword {color: #708;} .cm-s-default span.cm-atom {color: #219;} .cm-s-default span.cm-number {color: #164;} diff --git a/assets/plugins/codemirror/cm/theme/one-dark.css b/assets/plugins/codemirror/cm/theme/one-dark.css new file mode 100644 index 0000000000..d521d0f682 --- /dev/null +++ b/assets/plugins/codemirror/cm/theme/one-dark.css @@ -0,0 +1,161 @@ +/* + Name: one-dark + Author: Török Ádám (http://github.com/Aerobird98) + + Original Atom One Dark Theme (https://github.com/atom/one-dark-syntax & https://github.com/atom/one-dark-ui) +*/ + +/* UI Theme /----------------------------------------------------------------------------------- */ +.cm-s-one-dark.CodeMirror { +border: none; +font-size: 1em; +} +.cm-s-one-dark.CodeMirror pre { +line-height: 1.3; +} +.cm-s-one-dark.CodeMirror .CodeMirror-activeline-background { +background: #23272f !important; +} +.cm-s-one-dark.CodeMirror .cm-tab::before { +content: ""; +position: absolute; +border-left: 1px solid #353b46; +height: 100%; +} +.cm-s-one-dark.CodeMirror .cm-tab:first-child::before { +display: none; +} +.cm-s-one-dark.CodeMirror, .cm-s-one-dark .CodeMirror-scroll { +font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; +font-weight: 300; +font-size: 1em; +background-color: #282c34; +color: #abb2bf; +} +.cm-s-one-dark div.CodeMirror-selected { +background: #343c4a; +} +.cm-s-one-dark .CodeMirror-focused div.CodeMirror-selected { +background: #485263; +} +.cm-s-one-dark .CodeMirror-lines { +padding: 4px 0; /* Vertical padding around content */ +} +.cm-s-one-dark .CodeMirror pre { +padding: 0 4px; /* Horizontal padding of content */ +} +/* Gutter & Folding */ +.cm-s-one-dark .CodeMirror-gutters { +border-color: #3c4048; +} +.cm-s-one-dark .CodeMirror .CodeMirror-gutters, .cm-s-one-dark .CodeMirror-gutter { +white-space: nowrap; +border: none; +background: #282c34; +} +.cm-s-one-dark .CodeMirror-linenumber { +padding: 0 10px; +min-width: 20px; +text-align: right; +font-size: 0.8em; +white-space: nowrap; +color: #5f6b82; +} +/* ...folding addon: fold/... */ +.cm-s-one-dark .CodeMirror-foldmarker { +line-height: .3; +cursor: pointer; +color: #abb2bf; +background: #343c4a; +} +.cm-s-one-dark .CodeMirror-foldgutter { +width: 15px; +border: none; +} +.cm-s-one-dark .CodeMirror-foldgutter-open, .cm-s-one-dark .CodeMirror-foldgutter-folded { +cursor: pointer; +} +.cm-s-one-dark .CodeMirror-foldgutter-open:after { +content: "\25BE"; +color: #393e46; +} +.cm-s-one-dark .CodeMirror.over-gutter, .cm-s-one-dark .CodeMirror-activeline .CodeMirror-foldgutter-open:after { +color: #5c6370; +} +.cm-s-one-dark .CodeMirror-foldgutter-folded:after { +content: "\25B8"; +color: #5c6370; +} +/* ...misc */ +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { +background-color: #ccc; /* The little square between H and V scrollbars */ +} +/* Cursor */ + +.cm-s-one-dark .CodeMirror-cursor { +border-left: 2px solid hsl(220, 100%, 66%) !important; +} +.cm-s-one-dark .CodeMirror-overwrite .CodeMirror-cursor { +border-left: none !important; +border-bottom: 1px solid #fff; +} +/* Popular addons */ + +/* addon: adit/machingbrackets.js & addon: edit/matchtags.js */ +.cm-s-one-dark .CodeMirror-matchingbracket, .cm-s-one-dark .CodeMirror-matchingtag { +/* Ensure visibility against gray inline editor background */ +background-color: rgba(204, 217, 255, 0.09); +color: #abb2bf !important; +border-bottom: 1px solid #528bff; +} +/* Syntax Theme /---------------------------------------------------------------------------------- */ + +/* markdown */ +.cm-s-one-dark .cm-header { color: #e06c75; } +.cm-s-one-dark .cm-quote { color: #5c6370; font-style: italic; } +.cm-s-one-dark .cm-negative { color: #e06c75; } +.cm-s-one-dark .cm-positive { color: #e06c75; } +.cm-s-one-dark .cm-strong { color: #d19a66; font-weight: bold; } +.cm-s-one-dark .cm-header .cm-strong { color: #d19a66; font-weight: bold; } +.cm-s-one-dark .cm-em { color: #c678dd; font-style: italic; } +.cm-s-one-dark .cm-header .cm-em { color: #c678dd; font-style: italic; } +/* xml, html, ... */ +.cm-s-one-dark .cm-tag { color: #e06c75; } +.cm-s-one-dark .cm-attribute { color: #d19a66; } +.cm-s-one-dark .cm-link { color: #98c379; border-bottom: solid 1px #98c379; } +/* other ... (for example javascript) */ +.cm-s-one-dark .cm-builtin { color: #e06c75; } +.cm-s-one-dark .cm-keyword { color: #c678dd; } +.cm-s-one-dark .cm-def { color: #e5c07b; } +/* original: #d19a66; */ + +.cm-s-one-dark .cm-atom { color: #d19a66; } +.cm-s-one-dark .cm-number { color: #d19a66; } +.cm-s-one-dark .cm-property { color: #61afef; } +/* original: #abb2bf */ +.cm-s-one-dark .cm-qualifier { color: #d19a66; } +.cm-s-one-dark .cm-variable { color: #e06c75; } +.cm-s-one-dark .cm-variable-2 { color: #abb2bf; } +.cm-s-one-dark .cm-variable-3 { color: #e5c07b; } +.cm-s-one-dark .cm-string { color: #98c379; } +.cm-s-one-dark .cm-string-2 { color: #98c379; } +.cm-s-one-dark .cm-punctuation { color: #abb2bf; } +.cm-s-one-dark .cm-operator { color: #abb2bf; } +.cm-s-one-dark .cm-meta { color: #abb2bf; } +.cm-s-one-dark .cm-bracket { color: #abb2bf; } +.cm-s-one-dark .cm-comment { color: #5c6370; font-style: italic; } +.cm-s-one-dark .cm-modxChunk, .cm-s-one-dark .cm-modxSnippet, .cm-s-one-dark .cm-modxTv, .cm-s-one-dark .cm-modxPlaceholder, .cm-s-one-dark .cm-modxSnippetNoCache, .cm-s-one-dark .cm-modxVariable, .cm-s-one-dark .cm-modxUrl, .cm-s-one-dark .cm-modxConfig { +color: #00d4c0; +font-weight: 100; +} +.cm-s-one-dark .cm-modxAttribute { +color: #009688; +} +.cm-s-one-dark .cm-modxAttributeValue { +font-weight: 100; +color: #ababab; +} +.cm-s-one-dark .cm-modxBinding { +color: #a859b5; +font-weight: 100; +} diff --git a/assets/plugins/codemirror/codemirror.plugin.php b/assets/plugins/codemirror/codemirror.plugin.php index f6edf6624d..78b0d0d16b 100644 --- a/assets/plugins/codemirror/codemirror.plugin.php +++ b/assets/plugins/codemirror/codemirror.plugin.php @@ -23,7 +23,8 @@ /* * Default Plugin configuration */ -$theme = (isset($theme) ? $theme : 'default'); +$theme = $defaulttheme = (isset($theme) ? $theme : 'default'); +$darktheme = (isset($darktheme) ? $darktheme : 'one-dark'); $indentUnit = (isset($indentUnit) ? $indentUnit : 4); $tabSize = (isset($tabSize) ? $tabSize : 4); $lineWrapping = (isset($lineWrapping) ? $lineWrapping : false); @@ -34,6 +35,11 @@ $indentWithTabs = (isset($indentWithTabs) ? $indentWithTabs : false); $undoDepth = (isset($undoDepth) ? $undoDepth : 200); $historyEventDelay = (isset($historyEventDelay) ? $historyEventDelay : 1250); +$fontSize = (isset($fontSize) ? 'font-size:' . $fontSize . 'px !important;' : ''); +$lineHeight = (isset($lineHeight) ? 'line-height:' . $lineHeight . ' !important;' : ''); +if(isset($_COOKIE['MODX_themeColor']) && $_COOKIE['MODX_themeColor'] == 'dark') { + $theme = $darktheme; +} /* * This plugin is only valid in "text" mode. So check for the current Editor */ @@ -78,13 +84,14 @@ $mode = "application/json"; $lang = "javascript"; break; - case "application/x-httpd-php": - $mode = "application/x-httpd-php"; - $lang = "php"; - break; + case "application/x-httpd-php": + $mode = "application/x-httpd-php"; + $lang = "php"; + break; } break; case 'OnDocFormRender' : + if($content['type'] == 'reference') return; $textarea_name = 'ta'; $object_name = $content['pagetitle']; $xrte = (('htmlmixed' == $mode) ? $xrte : 0); @@ -135,7 +142,9 @@ define('INIT_CODEMIRROR', 1); $output = <<< HEREDOC - + + + @@ -153,57 +162,58 @@ var mustacheOverlay = { token: function(stream, state) { var ch; - if (stream.match("[[")) { + if (stream.match("[[") || stream.match("`[[")) { while ((ch = stream.next()) != null) if (ch == "?" || (ch == "]"&& stream.next() == "]")) break; return "modxSnippet"; } - if (stream.match("{{")) { + if (stream.match("{{") || stream.match("`{{")) { while ((ch = stream.next()) != null) if (ch == "}" && stream.next() == "}") break; stream.eat("}"); return "modxChunk"; } - if (stream.match("[*")) { + if (stream.match("[*") || stream.match("`[*")) { while ((ch = stream.next()) != null) if (ch == "*" && stream.next() == "]") break; stream.eat("]"); return "modxTv"; } - if (stream.match("[+")) { + if (stream.match("[+") || stream.match("`[+")) { while ((ch = stream.next()) != null) if (ch == "+" && stream.next() == "]") break; stream.eat("]"); return "modxPlaceholder"; } - if (stream.match("[!")) { + if (stream.match("[!") || stream.match("`[!")) { while ((ch = stream.next()) != null) if (ch == "?" || (ch == "!"&& stream.next() == "]")) break; return "modxSnippetNoCache"; } - if (stream.match("[(")) { + if (stream.match("[(") || stream.match("`[(")) { while ((ch = stream.next()) != null) if (ch == ")" && stream.next() == "]") break; stream.eat("]"); return "modxVariable"; } - if (stream.match("[~")) { + if (stream.match("[~") || stream.match("`[~")) { while ((ch = stream.next()) != null) if (ch == "~" && stream.next() == "]") break; stream.eat("]"); return "modxUrl"; } - if (stream.match("[^")) { + if (stream.match("[^") || stream.match("`[^")) { while ((ch = stream.next()) != null) if (ch == "^" && stream.next() == "]") break; stream.eat("]"); return "modxConfig"; } - if (ch = stream.match(/&([^\s=]+=+`)?/)) { + if (ch = stream.match(/&([^\s=]+=)?/)) { if(ch[1] != undefined) return "modxAttribute"; } - if (stream.match("`")) { + if (stream.match(/`([^\s=]+`)?/)) { + if (stream.match("`[")) return; return "modxAttributeValue"; } if (stream.match("@inherit", true, true) || @@ -240,6 +250,8 @@ function makeMarker(symbol) { var config = { mode: 'MODx-{$mode}', theme: '{$theme}', + defaulttheme: '{$defaulttheme}', + darktheme: '{$darktheme}', readOnly: {$readOnly}, indentUnit: {$indentUnit}, tabSize: {$tabSize}, diff --git a/assets/plugins/codemirror/codemirror.plugin.tpl b/assets/plugins/codemirror/codemirror.plugin.tpl index e47bd91e88..6f5380afe5 100644 --- a/assets/plugins/codemirror/codemirror.plugin.tpl +++ b/assets/plugins/codemirror/codemirror.plugin.tpl @@ -9,14 +9,15 @@ * @package modx * @internal @events OnDocFormRender,OnChunkFormRender,OnModFormRender,OnPluginFormRender,OnSnipFormRender,OnTempFormRender,OnRichTextEditorInit * @internal @modx_category Manager and Admin - * @internal @properties &theme=Theme;list;default,ambiance,blackboard,cobalt,eclipse,elegant,erlang-dark,lesser-dark,midnight,monokai,neat,night,rubyblue,solarized,twilight,vibrant-ink,xq-dark,xq-light;default &indentUnit=Indent unit;int;4 &tabSize=The width of a tab character;int;4 &lineWrapping=lineWrapping;list;true,false;true &matchBrackets=matchBrackets;list;true,false;true &activeLine=activeLine;list;true,false;false &emmet=emmet;list;true,false;true &search=search;list;true,false;false &indentWithTabs=indentWithTabs;list;true,false;true &undoDepth=undoDepth;int;200 &historyEventDelay=historyEventDelay;int;1250 + * @internal @properties &theme=Theme;list;default,ambiance,blackboard,cobalt,eclipse,elegant,erlang-dark,lesser-dark,midnight,monokai,neat,night,one-dark,rubyblue,solarized,twilight,vibrant-ink,xq-dark,xq-light;default &darktheme=Dark Theme;list;default,ambiance,blackboard,cobalt,eclipse,elegant,erlang-dark,lesser-dark,midnight,monokai,neat,night,one-dark,rubyblue,solarized,twilight,vibrant-ink,xq-dark,xq-light;one-dark &fontSize=Font-size;list;10,11,12,13,14,15,16,17,18;14 &lineHeight=Line-height;list;1,1.1,1.2,1.3,1.4,1.5;1.3 &indentUnit=Indent unit;int;4 &tabSize=The width of a tab character;int;4 &lineWrapping=lineWrapping;list;true,false;true &matchBrackets=matchBrackets;list;true,false;true &activeLine=activeLine;list;true,false;false &emmet=emmet;list;true,false;true &search=search;list;true,false;false &indentWithTabs=indentWithTabs;list;true,false;true &undoDepth=undoDepth;int;200 &historyEventDelay=historyEventDelay;int;1250 * @internal @installset base * @reportissues https://github.com/modxcms/evolution * @documentation Official docs https://codemirror.net/doc/manual.html * @author hansek from http://www.modxcms.cz * @author update Mihanik71 * @author update Deesen - * @lastupdate 11/04/2016 + * @author update 64j + * @lastupdate 3/07/2017 */ $_CM_BASE = 'assets/plugins/codemirror/'; diff --git a/assets/plugins/elementsintree/assets/txt_content.tpl b/assets/plugins/elementsintree/assets/txt_content.tpl index 1550a51a87..274e6aa9e8 100644 --- a/assets/plugins/elementsintree/assets/txt_content.tpl +++ b/assets/plugins/elementsintree/assets/txt_content.tpl @@ -1,224 +1,3 @@ - - ").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.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(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t(" ",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[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")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}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 e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter; +this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("").parent().append("")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=h.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("
                              ").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),h(n,e)},1)}).fail(function(t,e){setTimeout(function(){h(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("
                              ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){l.of=t,a.is(":hidden")||a.position(l)}var o,a,r,h,l=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),h=t("
                              ").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("
                              ").attr("role","tooltip"),s=t("
                              ").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}); \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/ddmultiplefields.php b/assets/plugins/managermanager/widgets/ddmultiplefields/ddmultiplefields.php old mode 100755 new mode 100644 index 5d76aecd85..d34c6d72ee --- a/assets/plugins/managermanager/widgets/ddmultiplefields/ddmultiplefields.php +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/ddmultiplefields.php @@ -47,7 +47,7 @@ function mm_ddMultipleFields($tvs = '', $roles = '', $templates = '', $columns = if ($e->name == 'OnDocFormPrerender'){ global $_lang; - $output .= includeJsCss($site.'assets/plugins/managermanager/js/jquery-ui-1.10.3.min.js', 'html', 'jquery-ui', '1.10.3'); + $output .= includeJsCss($site.'assets/plugins/managermanager/js/jquery-ui.min.js', 'html', 'jquery-ui', '1.12.1'); $output .= includeJsCss($widgetDir.'ddmultiplefields.css', 'html'); $output .= includeJsCss($widgetDir.'jquery.ddMM.mm_ddMultipleFields.js', 'html', 'jquery.ddMM.mm_ddMultipleFields', '1.1.1'); @@ -63,7 +63,13 @@ function mm_ddMultipleFields($tvs = '', $roles = '', $templates = '', $columns = foreach ($columnsDataTemp as $value){ //Евалим знение и записываем результат или исходное значени - $eval = @eval($value); + try { + $eval = eval($value); + } catch (Throwable $t) { + echo $t->getMessage(), "\n"; + } catch (Exception $e) { + echo $e->getMessage(), "\n"; + } $columnsData[] = $eval ? addslashes(json_encode($eval)) : addslashes($value); } //Сливаем в строку, что бы передать на клиент diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/jquery.ddMM.mm_ddMultipleFields.js b/assets/plugins/managermanager/widgets/ddmultiplefields/jquery.ddMM.mm_ddMultipleFields.js index 2d6946bde8..9ae89ead5d 100755 --- a/assets/plugins/managermanager/widgets/ddmultiplefields/jquery.ddMM.mm_ddMultipleFields.js +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/jquery.ddMM.mm_ddMultipleFields.js @@ -541,10 +541,10 @@ $.ddMM.mm_ddMultipleFields = { $('').appendTo($fieldCol).find('a').on('click', function(event){ _this.richtextWindow = window.open($.ddMM.config.site_url + $.ddMM.urls.mm + 'widgets/ddmultiplefields/richtext/index.php', 'mm_ddMultipleFields_richtext', new Array( - 'width=600', - 'height=550', - 'left=' + (($.ddTools.windowWidth - 600) / 2), - 'top=' + (($.ddTools.windowHeight - 550) / 2), + 'width=700', + 'height=600', + 'left=' + (($.ddTools.windowWidth - 700) / 2), + 'top=' + (($.ddTools.windowHeight - 600) / 2), 'menubar=no', 'toolbar=no', 'location=no', diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php index e5fcd928c2..5755ba94ac 100755 --- a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php @@ -37,7 +37,7 @@ require_once($modx->config['base_path'].$mmDir.'modx.ddtools.class.php'); $temp = $modx->invokeEvent('OnRichTextEditorInit', array( - 'editor' => 'TinyMCE', + 'editor' => $modx->config['which_editor'], 'elements' => array('ddMultipleFields_richtext') )); diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/script.js b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/script.js index b62cd09a9e..f8d13fdde6 100755 --- a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/script.js +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/script.js @@ -1,15 +1,17 @@ $(function(){ var $textarea = $('#ddMultipleFields_richtext'); - + $textarea.val(window.$ddField.html()).trigger('change'); - + $('.js-ok').on('click', function(){ - tinyMCE.triggerSave(); + if (typeof tinyMCE != 'undefined') { + tinyMCE.triggerSave(); + } window.$ddField.html($textarea.val()); $textarea.val(''); window.close(); }); - + $('.js-cancel').on('click', function(){ $textarea.val(''); window.close(); diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/style.css b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/style.css index 0a5094fdf5..8aaa7df8e6 100755 --- a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/style.css +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/style.css @@ -1,4 +1,16 @@ +html, body { + height: 100%; +} +textarea { + width: 100%; + min-height: 250px; + box-sizing: border-box; + height: calc( 100% - 45px ); +} .buttons { padding-top: 10px; text-align: right; +} +body > .mce-container { + box-sizing: border-box; } \ No newline at end of file diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/template.html b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/template.html index e3671a5141..72d334bcae 100755 --- a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/template.html +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/template.html @@ -6,13 +6,13 @@ Tiny MCE - + [+tinyMCE+] - +
                              - \ No newline at end of file + diff --git a/assets/plugins/managermanager/widgets/ddselectdocuments/ddselectdocuments.php b/assets/plugins/managermanager/widgets/ddselectdocuments/ddselectdocuments.php old mode 100755 new mode 100644 index f47289a39d..54dc2714cc --- a/assets/plugins/managermanager/widgets/ddselectdocuments/ddselectdocuments.php +++ b/assets/plugins/managermanager/widgets/ddselectdocuments/ddselectdocuments.php @@ -1,7 +1,7 @@ Event; @@ -39,7 +39,7 @@ function mm_ddSelectDocuments($tvs = '', $roles = '', $templates = '', $parentId $widgetDir = $pluginDir.'widgets/ddselectdocuments/'; $output .= includeJsCss($widgetDir.'ddselectdocuments.css', 'html'); - $output .= includeJsCss($pluginDir.'js/jquery-ui-1.10.3.min.js', 'html', 'jquery-ui', '1.10.3'); + $output .= includeJsCss($pluginDir.'js/jquery-ui.min.js', 'html', 'jquery-ui', '1.12.1'); $output .= includeJsCss($widgetDir.'jquery.ddMultipleInput-1.2.1.min.js', 'html', 'jquery.ddMultipleInput', '1.2.1'); $e->output($output); @@ -130,16 +130,16 @@ function mm_ddSelectDocuments($tvs = '', $roles = '', $templates = '', $parentId ); } - $output .= "//---------- mm_ddSelectDocuments :: Begin -----\n"; + $output .= '//---------- mm_ddSelectDocuments :: Begin -----'.PHP_EOL; foreach ($tvs as $tv){ $output .= ' -$j("#tv'.$tv['id'].'").ddMultipleInput({source: '.$jsonDocs.', max: '.$max.', allowDoubling: '.$allowDoubling.'}); +$j("#tv'.$tv['id'].'").ddMultipleInput({source: '.$jsonDocs.', max: '.(int) $max.', allowDoubling: '.(int) $allowDoubling.'}); '; } - $output .= "//---------- mm_ddSelectDocuments :: End -----\n"; + $output .= '//---------- mm_ddSelectDocuments :: End -----'.PHP_EOL; $e->output($output); } diff --git a/assets/plugins/qm/css/actionButtons.css b/assets/plugins/qm/css/actionButtons.css new file mode 100644 index 0000000000..351fdddac7 --- /dev/null +++ b/assets/plugins/qm/css/actionButtons.css @@ -0,0 +1,95 @@ +/* Action buttons based on MODxRE Theme */ + +#qmEditor ul +{ /* .actionButtons --> #qmEditor */ + margin: 0; + padding: 0px 10px 0px 0px; + list-style-type: none; +} + +#qmEditor li +{ + margin: 0 8px 0 0; + float: left; + height: 15px; + line-height: 15px; + padding: 0; + list-style-type: none; + height: auto; + width: auto; + background: none; + border: 0; + list-style-image:none; +} + +#qmEditor .qmButton, .qm-edit, .qm-new, .qm-tv, .qm-save, .qm-cancel +{ + font-size: 13px; + font-weight: 500; + text-shadow: none; + background: #fff; + filter: none; + color: #555; + border-width: 1px; + border-style: solid; + border-color: #E4E4E4; + border-radius: 3px !important; + /*box-shadow: 0 0 0 1px #E4E4E4;*/ + box-shadow: none; + transition: none; +} +#qmEditor .qmButton, .qm-edit, .qm-new, .qm-tv, .qm-save, .qm-cancel +{ + padding: 6px 10px; +} +.qm-tv a, .qm-save a, .qm-cancel a +{ + padding: 9px 10px; +} +#qmEditor .qmButton.qmClose +{ + padding: 3px 15px 6px 10px; + color: #dedede; + background-color: Transparent; + border:none; +} +#qmEditor .qmButton.qmClose:hover +{ + color: #fff; + background-color: Transparent; +} +#qmEditor .qmButton:hover, .qm-edit:hover, .qm-new:hover, .qm-tv:hover, .qm-save:hover, .qm-cancel:hover +{ + background: none; + filter: none; + background-color: #3697cd; + box-shadow: none; + border-color: #3697cd; + color: #FFF !important; + transition: none; + text-decoration: none; +} +a.colorbox.cboxElement:hover, .qm-cancel a:hover, .qm-save a:hover +{ + color: #FFF !important; +} +#qmEditor .qmButton:active +{ + background-color: #3189ba; + border-color: #3189ba; +} + +#qmEditor .qmButton.primary, .qm-save a +{ + color: #fff; + border-color: #32AB9A; + background-color: #32AB9A; + background-image: linear-gradient(#32AB9A, #00948E); +} +#qmEditor .qmButton.primary:hover, .qm-save a:hover +{ + background-color: #2b9385; + background-image: linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} +#qmEditor i.fa {font-size:24px;} \ No newline at end of file diff --git a/assets/plugins/qm/css/navButtons.css b/assets/plugins/qm/css/navButtons.css new file mode 100644 index 0000000000..3f47981186 --- /dev/null +++ b/assets/plugins/qm/css/navButtons.css @@ -0,0 +1,94 @@ +/* Action buttons based Manager nav */ + +#qmEditor ul +{ /* .actionButtons --> #qmEditor */ + margin: 0; + padding: 0px 10px 0px 0px; + list-style-type: none; +} + +#qmEditor li +{ + margin: 0 8px 0 0; + float: left; + height: 15px; + line-height: 15px; + padding: 0; + list-style-type: none; + height: auto; + width: auto; + background: none; + border: 0; + list-style-image:none; +} + +#qmEditor .qmButton, .qm-edit, .qm-new, .qm-tv, .qm-save, .qm-cancel +{ + font-size: 13px; + font-weight: 500; + text-shadow: none; + background: #fff; + filter: none; + border: 1px solid rgba(255, 255, 255, 0.6); + padding: 2px 7px; + border-radius: 3px; + margin: 0 2px; + background-color: rgba(255,255,255,.1); + color: #fff !important; + /*box-shadow: 0 0 0 1px #E4E4E4;*/ + box-shadow: none; + transition: none; +} +#qmEditor .qmButton, .qm-edit, .qm-new, .qm-tv, .qm-save, .qm-cancel +{ + padding: 6px 10px; +} +.qm-tv a, .qm-save a, .qm-cancel a +{ + padding: 9px 10px; +} +#qmEditor .qmButton.qmClose +{ + padding: 3px 10px 6px 10px; + color: #dedede!important; + background-color: Transparent; + border:none; +} +#qmEditor .qmButton.qmClose:hover +{ + color: #fff!important; + background-color: Transparent; +} +#qmEditor .qmButton:hover, .qm-edit:hover, .qm-new:hover, .qm-tv:hover, .qm-save:hover, .qm-cancel:hover +{ + text-decoration: none; + background-color: rgba(255,255,255,.3); +} +.qm-cancel a:hover, .qm-save a:hover +{ + color: #FFF !important; +} +a.colorbox.cboxElement{color:#FFF!important; background-color:rgba(57, 81, 93, 0.8);border-color: rgba(255, 255, 255, 0.8)} +a.colorbox.cboxElement:hover{color:#FFF!important; background-color:rgba(57, 81, 93,.4); border-color: rgba(255, 255, 255, 1)} + + +#qmEditor .qmButton:active +{ + background-color: #3189ba; + border-color: #3189ba; +} + +.qm-save a +{ + color: #fff; + border-color: #32AB9A; + background-color: #32AB9A; + background-image: linear-gradient(#32AB9A, #00948E); +} +.qm-save a:hover +{ + background-color: #2b9385; + background-image: linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} +#qmEditor i.fa {font-size:24px;} \ No newline at end of file diff --git a/assets/plugins/qm/css/style.css b/assets/plugins/qm/css/style.css index 9493d44f35..6d41bb2f1a 100755 --- a/assets/plugins/qm/css/style.css +++ b/assets/plugins/qm/css/style.css @@ -79,11 +79,6 @@ padding: 6px 6px; } -.qm-cancel span -{ - background: transparent url(images/stop.png) no-repeat left center; - padding-left: 20px; -} .qm-save { @@ -94,7 +89,50 @@ { margin-right: 20px; } - +.qm-save, .qm-cancel +{ + font-size: 13px; + font-weight: 500; + text-shadow: none; + background: #fff; + filter: none; + color: #555; + border-width: 1px; + border-style: solid; + border-color: #E4E4E4; + border-radius: 3px !important; + /*box-shadow: 0 0 0 1px #E4E4E4;*/ + box-shadow: none; + transition: none; +} +.qm-save:hover, .qm-cancel:hover +{ + background: none; + filter: none; + background-color: #3697cd; + box-shadow: none; + border-color: #3697cd; + color: #FFF !important; + transition: none; + text-decoration: none; +} +.qm-cancel a:hover, .qm-save a:hover +{ + color: #FFF !important; +} +.qm-save a +{ + color: #fff; + border-color: #32AB9A; + background-color: #32AB9A; + background-image: linear-gradient(#32AB9A, #00948E); +} +.qm-save a:hover +{ + background-color: #2b9385; + background-image: linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} #qm-tv-actions { position: fixed; @@ -167,25 +205,36 @@ #qmEditor, #qmEditorClosed { - font-family: Arial, Helvetica, sans-serif !important; - top:0; - left:0; - padding: 3px; position: fixed; - width: 100%; - line-height:1; + font-family: Arial, Helvetica, sans-serif !important; + line-height: 1; z-index: 2147483647; - background: #657587 url(images/tinylogo.png) no-repeat -2px 3px; + height: 40px; + box-sizing: border-box; + padding: 5px 0 0 10px; + color: #fff; + background: none; + background-color: #39515D !important; + background-image: -webkit-linear-gradient(left, #3f4850 0%, #365462 46%, #3e5554 60%, #42554d 68%, #573d4e 100%) !important; + background-image: -o-linear-gradient(left, #3f4850 0%, #365462 46%, #3e5554 60%, #42554d 68%, #573d4e 100%) !important; + background-image: linear-gradient(to right, #3f4850 0%, #365462 46%, #3e5554 60%, #42554d 68%, #573d4e 100%) !important; text-align: left; - opacity:0.5; - ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - filter: alpha(opacity=50); - top: -28px; + opacity:0.7; + ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; + filter: alpha(opacity=70); -webkit-transition-duration: 0.7s; -moz-transition-duration: 0.7s; transition-duration: 0.7s; + text-shadow: none; +} + + +#qmEditor > li +{ + line-height: 30px; } - + + #qmEditor *:focus, #qmEditor *:active { outline: none !important; @@ -205,20 +254,15 @@ padding: 0; line-height: normal; border: 0; + text-decoration: none; } #qmEditor .qmId { - font-size: 20px; - line-height: 25px; - color: black; -} - -#qmEditor .qmEdit span, .qm-edit span, .qm-save span, .qm-tv span -{ - background: transparent url(images/save.png) no-repeat left center; - padding-left: 20px; + font-size: 18px; + line-height: 30px; + color: #fff; + font-weight: normal; } - #qmEditor .qmButton span { @@ -226,12 +270,26 @@ #qmEditorClosed { - height: 26px; + height: 40px!important; display: none; width: 40px !important; cursor: pointer !important; + margin-right: 20px!important; +} +#qmEditorClosed:after +{ + display:block; + float:left; + font-family: FontAwesome; + content: "\f0a9"; + color: #dedede; + font-size:22px; + margin-top: 3px; +} +div#qmEditorClosed:hover:after +{ + color: #fff; } - #qmClose { display: block; @@ -239,87 +297,40 @@ margin-right: -2px !important; } -#qmLogoClose +a#qmLogoClose { display: block; float: left; - height: 26px !important; - width: 40px !important; - margin: 0; + height: 30px !important; + width: 30px !important; text-decoration: none !important; border: 0 !important; - background: transparent url(images/transparent.gif) repeat; } - +a#qmLogoClose:after +{ + display:block; + font-family: FontAwesome; + content: "\f0a8"; + color: #dedede; + font-size:22px; + margin-top: 3px; +} +a:hover#qmLogoClose:after +{ + color: #FFF; +} #qmEditor:hover, #qmEditorClosed:hover { opacity:1; -ms-filter:"" !important; filter:none !important; - top: 0px; +/* top: 0px;*/ -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s; } -/* Action buttons based on MODX Carbon Theme */ -#qmEditor ul -{ /* .actionButtons --> #qmEditor */ - margin: 0; - padding: 0px 10px 0px 0px; - list-style-type: none; -} -#qmEditor li -{ - margin: 0 8px 0 0; - float: left; - height: 15px; - line-height: 15px; - padding: 0; - list-style-type: none; - height: auto; - width: auto; - background: none; - border: 0; - list-style-image:none; -} - -#qmEditor .qmButton, .qm-edit, .qm-new, .qm-tv, .qm-save, .qm-cancel -{ - color: #3b454f; - font-weight: bold; - font-size: 12px; - background: #c7ced2 url(images/button-gradient.png) repeat-x 0px -6px; - padding: 4px 6px; - white-space: nowrap; - text-decoration: none; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -webkit-text-shadow: 1px 1px 0 #fff; - -moz-text-shadow: 0 1px 1px #fff; - text-shadow: 0 1px 1px #fff; - border: 1px solid #8ea4be; - outline: none; -} - -#qmEditor .qmButton:hover, .qm-edit:hover, .qm-new:hover, .qm-tv:hover, .qm-save:hover, .qm-cancel:hover -{ - background-position: bottom left; - -webkit-box-shadow: 0 0 10px #b8c7d6; - -moz-box-shadow: 0 0 10px #b8c7d6; - box-shadow: 0 0 10px #b8c7d6; - -webkit-transition: -webkit-box-shadow 0.2s linear; -} -#qmEditor .qmButton:active -{ - background-color: #92aac4; - background-position: bottom left; - -webkit-box-shadow: 0 0 10px #b8c7d6; - -moz-box-shadow: 0 0 10px #b8c7d6; - box-shadow: 0 0 10px #b8c7d6; -} diff --git a/assets/plugins/qm/js/jquery.colorbox-min.js b/assets/plugins/qm/js/jquery.colorbox-min.js index 230da8fe05..b5109a262e 100644 --- a/assets/plugins/qm/js/jquery.colorbox-min.js +++ b/assets/plugins/qm/js/jquery.colorbox-min.js @@ -1,7 +1,6 @@ /*! - Colorbox v1.4.27 - 2013-07-16 - jQuery lightbox and modal window plugin - (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox - license: http://www.opensource.org/licenses/mit-license.php + Colorbox 1.6.4 + license: MIT + http://www.jacklmoore.com/colorbox */ -(function(t,e,i){function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.style.cssText=n),t(r)}function n(){return i.innerHeight?i.innerHeight:t(i).height()}function r(t){var e=E.length,i=(j+t)%e;return 0>i?e+i:i}function l(t,e){return Math.round((/%/.test(t)?("x"===e?H.width():n())/100:1)*parseInt(t,10))}function h(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in v[0]&&!v[0].contains(t.target)&&(t.stopPropagation(),v.focus())}function d(){var e,i=t.data(A,Z);null==i?(O=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):O=t.extend({},i);for(e in O)t.isFunction(O[e])&&"on"!==e.slice(0,2)&&(O[e]=O[e].call(A));O.rel=O.rel||A.rel||t(A).data("rel")||"nofollow",O.href=O.href||t(A).attr("href"),O.title=O.title||A.title,"string"==typeof O.href&&(O.href=t.trim(O.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",l="click."+te;O.slideshow&&E[1]?(e=function(){clearTimeout(t)},i=function(){(O.loop||E[j+1])&&(t=setTimeout(J.next,O.slideshowSpeed))},o=function(){R.html(O.slideshowStop).unbind(l).one(l,n),se.bind(ne,i).bind(oe,e).bind(re,n),v.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),R.html(O.slideshowStart).unbind(l).one(l,function(){J.next(),o()}),v.removeClass(r+"on").addClass(r+"off")},O.slideshowAuto?o():n()):v.removeClass(r+"off "+r+"on")}function p(i){G||(A=i,d(),E=t(A),j=0,"nofollow"!==O.rel&&(E=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===O.rel}),j=E.index(A),-1===j&&(E=E.add(A),j=E.length-1)),g.css({opacity:parseFloat(O.opacity),cursor:O.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&v.add(g).removeClass(V),O.className&&v.add(g).addClass(O.className),V=O.className,O.closeButton?P.html(O.close).appendTo(x):P.appendTo("
                              "),$||($=q=!0,v.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden"),x.css({width:"",height:""}).append(W),_=b.height()+k.height()+x.outerHeight(!0)-x.height(),D=T.width()+C.width()+x.outerWidth(!0)-x.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),O.w=l(O.initialWidth,"x"),O.h=l(O.initialHeight,"y"),J.position(),u(),c(ie,O.onOpen),B.add(S).hide(),v.focus(),O.trapFocus&&e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(le,function(){e.removeEventListener("focus",a,!0)})),O.returnFocus&&se.one(le,function(){t(A).focus()})),w())}function f(){!v&&e.body&&(X=!1,H=t(i),v=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),L=t([o(ae,"LoadingOverlay")[0],o(ae,"LoadingGraphic")[0]]),y=o(ae,"Wrapper"),x=o(ae,"Content").append(S=o(ae,"Title"),M=o(ae,"Current"),K=t('
                              '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
                              '+o+'
                              '+s+"
                              "+a+"
                              "},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return a.desktop||u(),h}),r(_e,[Ne],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Se,[Ne,_e],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(ke,[pe,xe],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Te,[pe,ke],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Re,[Te],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'
                              0%
                              '},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Ae,[pe,xe,Re,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n=''),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r=''),e.progressBar&&(i=e.progressBar.renderHtml()),'"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Be,[Ae,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(De,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(Le,[I,T,y,De,A,C,h,m,u,k],function(e,t,n,r,i,o,a,s,l,c){return function(u){function d(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}}function f(){var e=u.getDoc().documentMode;return e?e:6}function h(e){return e.isDefaultPrevented()}function p(e){var t,n;e.dataTransfer&&(u.selection.isCollapsed()&&"IMG"==e.target.tagName&&Q.select(e.target),t=u.selection.getContent(),t.length>0&&(n=oe+escape(u.id)+","+escape(t),e.dataTransfer.setData(ae,n)))}function m(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(ae),t&&t.indexOf(oe)>=0)?(t=t.substr(oe.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function g(e){u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:e}):u.execCommand("mceInsertContent",!1,e)}function v(){function i(e){var t=C.schema.getBlockElements(),n=u.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==X.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock),r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=u.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||X(n).append(r.childNodes),X(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function d(e,n){var r,i,s,l,c,d;if(!e.collapsed)return e;if(c=e.startContainer,d=e.startOffset,3==c.nodeType)if(n){if(d0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(u.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function f(e){var t=x.getRng();return t=d(t,e),c(t)?!0:void 0}function v(e,t){function n(e,n){return m=X(n).parents().filter(function(e,t){return!!u.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),u.selection.setRng(t),p):null}function i(e){return e&&u.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,d,f,h,p,m;if(t.collapsed&&(f=t.startContainer,h=t.startOffset,a=C.getParent(f,C.isBlock),i(a)))if(1==f.nodeType){if(f=f.childNodes[h],f&&"BR"!=f.tagName)return;if(d=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(d)&&C.isEmpty(d)&&n(a,f))return C.remove(d),!0}else if(3==f.nodeType){if(o=r.create(a,f),c=a.cloneNode(!0),f=r.resolve(c,o),e){if(h>=f.data.length)return;f.deleteData(h,1)}else{if(0>=h)return;f.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,f)}}function y(e){var t,n,r;f(e)||(s.each(u.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&u.dom.setAttrib(e,"style",u.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(u.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),u.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=u.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,u.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),u.selection.setRng(n))}})}}),t.disconnect(),s.each(u.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=u.getDoc(),C=u.dom,x=u.selection,w=window.MutationObserver,E,N;w||(E=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),u.on("keydown",function(e){var t=e.keyCode==G,n=e.ctrlKey||e.metaKey;if(!h(e)&&(t||e.keyCode==K)){var r=u.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(v(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o0))return;e.preventDefault(),n&&u.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),y(t)}}),u.on("keypress",function(t){if(!h(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=u.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=X(n.startContainer).parents().filter(function(e,t){return!!u.schema.getTextInlineElements()[t.nodeName]}),y(!0),r=r.filter(function(e,t){return!X.contains(u.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(u.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?X(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),u.selection.setRng(n)):u.selection.setContent(s)}}),u.addCommand("Delete",function(){y()}),u.addCommand("ForwardDelete",function(){y(!0)}),E||(u.on("dragstart",function(e){N=x.getRng(),p(e)}),u.on("drop",function(e){if(!h(e)){var n=m(e);n&&(e.preventDefault(),l.setEditorTimeout(u,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);N&&(x.setRng(N),N=null),y(),x.setRng(r),g(n.html)}))}}),u.on("cut",function(e){h(e)||!e.clipboardData||u.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",u.selection.getContent()),e.clipboardData.setData("text/plain",u.selection.getContent({format:"text"})),l.setEditorTimeout(u,function(){y(!0)}))}))}function y(){function e(e){var t=J.create("body"),n=e.cloneContents();return t.appendChild(n),Q.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(u.getBody()),t.compareRanges(n,r)}var i=e(n),o=J.createRng();o.selectNode(u.getBody());var a=e(o);return i===a}u.on("keydown",function(e){var t=e.keyCode,r,i;if(!h(e)&&(t==G||t==K)){if(r=u.selection.isCollapsed(),i=u.getBody(),r&&!J.isEmpty(i))return;if(!r&&!n(u.selection.getRng()))return;e.preventDefault(),u.setContent(""),i.firstChild&&J.isBlock(i.firstChild)?u.selection.setCursorLocation(i.firstChild,0):u.selection.setCursorLocation(i,0),u.nodeChanged()}})}function b(){u.shortcuts.add("meta+a",null,"SelectAll")}function C(){u.settings.content_editable||J.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==u.getDoc().documentElement)if(t=Q.getRng(),u.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;Q.placeCaretAt(e.clientX,e.clientY)}else Q.setRng(t)})}function x(){u.on("keydown",function(e){if(!h(e)&&e.keyCode===K){if(!u.getBody().getElementsByTagName("hr").length)return;if(Q.isCollapsed()&&0===Q.getRng(!0).startOffset){var t=Q.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return J.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(J.remove(n),e.preventDefault())}}})}function w(){window.Range.prototype.getClientRects||u.on("mousedown",function(e){if(!h(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),l.setEditorTimeout(u,function(){t.focus()})}})}function E(){u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==J.getContentEditableParent(t)&&(e.preventDefault(),Q.getSel().setBaseAndExtent(t,0,t,1),u.nodeChanged()),"A"==t.nodeName&&J.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),Q.select(t))})}function N(){function e(){var e=J.getAttribs(Q.getStart().cloneNode(!1));return function(){var t=Q.getStart();t!==u.getBody()&&(J.setAttrib(t,"style",null),Y(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!Q.isCollapsed()&&J.getParent(Q.getStart(),J.isBlock)!=J.getParent(Q.getEnd(),J.isBlock)}u.on("keypress",function(n){var r;return h(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),u.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),J.bind(u.getDoc(),"cut",function(n){var r;!h(n)&&t()&&(r=e(),l.setEditorTimeout(u,function(){r()}))})}function _(){document.body.setAttribute("role","application")}function S(){u.on("keydown",function(e){if(!h(e)&&e.keyCode===K&&Q.isCollapsed()&&0===Q.getRng(!0).startOffset){var t=Q.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(), -!1}})}function k(){f()>7||(d("RespectVisibilityInDesign",!0),u.contentStyles.push(".mceHideBrInPre pre br {display: none}"),J.addClass(u.getBody(),"mceHideBrInPre"),ee.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),te.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function T(){J.bind(u.getBody(),"mouseup",function(){var e,t=Q.getNode();"IMG"==t.nodeName&&((e=J.getStyle(t,"width"))&&(J.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),J.setStyle(t,"width","")),(e=J.getStyle(t,"height"))&&(J.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),J.setStyle(t,"height","")))})}function R(){u.on("keydown",function(t){var n,r,i,o,a;if(!h(t)&&t.keyCode==e.BACKSPACE&&(n=Q.getRng(),r=n.startContainer,i=n.startOffset,o=J.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(u.formatter.toggle("blockquote",null,a),n=J.createRng(),n.setStart(r,0),n.setEnd(r,0),Q.setRng(n))}})}function A(){function e(){u._refreshContentEditable(),d("StyleWithCSS",!1),d("enableInlineTableEditing",!1),Z.object_resizing||d("enableObjectResizing",!1)}Z.readonly||u.on("BeforeExecCommand MouseDown",e)}function B(){function e(){Y(J.select("a"),function(e){var t=e.parentNode,n=J.getRoot();if(t.lastChild===e){for(;t&&!J.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}J.add(t,"br",{"data-mce-bogus":1})}})}u.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function D(){Z.forced_root_block&&u.on("init",function(){d("DefaultParagraphSeparator",Z.forced_root_block)})}function L(){u.on("keydown",function(e){var t;h(e)||e.keyCode!=K||(t=u.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),u.undoManager.beforeChange(),J.remove(t.item(0)),u.undoManager.add()))})}function M(){var e;f()>=10&&(e="",Y("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),u.contentStyles.push(e+"{padding-right: 1px !important}"))}function P(){f()<9&&(ee.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),te.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function H(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),J.unbind(r,"mouseup",n),J.unbind(r,"mousemove",t),a=o=0}var r=J.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,J.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(J.bind(r,"mouseup",n),J.bind(r,"mousemove",t),J.getRoot().focus(),a.select())}})}function O(){u.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||Q.normalize()},!0)}function I(){u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function F(){u.inline||u.on("keydown",function(){document.activeElement==document.body&&u.getWin().focus()})}function z(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))}function W(){a.mac&&u.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),u.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function V(){d("AutoUrlDetect",!1)}function U(){u.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function $(){u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})})}function q(){ee.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function j(){u.on("dragstart",function(e){p(e)}),u.on("drop",function(e){if(!h(e)){var n=m(e);if(n&&n.id!=u.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,u.getDoc());Q.setRng(r),g(n.html)}}})}var Y=s.each,X=u.$,K=e.BACKSPACE,G=e.DELETE,J=u.dom,Q=u.selection,Z=u.settings,ee=u.parser,te=u.serializer,ne=a.gecko,re=a.ie,ie=a.webkit,oe="data:text/mce-internal,",ae=re?"Text":"URL";R(),y(),a.windowsPhone||O(),ie&&(v(),C(),E(),D(),$(),S(),q(),a.iOS?(F(),z(),U()):b()),re&&a.ie<11&&(x(),_(),k(),T(),L(),M(),P(),H()),a.ie>=11&&(z(),S()),a.ie&&(b(),V(),j()),ne&&(x(),w(),N(),A(),B(),I(),W(),S())}}),r(Me,[ae,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Pe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(t,n){var r=t.readonly?"readonly":"design";n!=r&&("readonly"==n?(t.selection.controlSelection.hideResizeRect(),t.readonly=!0,t.getBody().contentEditable=!1):(t.readonly=!1,t.getBody().contentEditable=!0,e(t,"StyleWithCSS",!1),e(t,"enableInlineTableEditing",!1),e(t,"enableObjectResizing",!1),t.focus(),t.nodeChanged()),t.fire("SwitchMode",{mode:n}))}return{setMode:t}}),r(He,[m,h],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e,s,l,c){var u,d,f;f={func:l,scope:c||a,desc:a.translate(s)},n(r(e,"+"),function(e){e in o?f[e]=!0:/^[0-9]{2,}$/.test(e)?f.keyCode=parseInt(e,10):(f.charCode=e.charCodeAt(0),f.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),u=[f.keyCode];for(d in o)f[d]?u.push(d):f[d]=!1;return f.id=u.join(","),f.access&&(f.alt=!0,t.mac?f.ctrl=!0:f.shift=!0),f.meta&&(t.mac?f.meta=!0:(f.ctrl=!0,f.meta=!1)),f}var l=this,c={};a.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&!e.isDefaultPrevented()&&n(c,function(t){return t.ctrl==e.ctrlKey&&t.meta==e.metaKey&&t.alt==e.altKey&&t.shift==e.shiftKey&&(e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode)?(e.preventDefault(),"keydown"==e.type&&t.func.call(t.scope),!0):void 0})}),l.add=function(t,i,o,l){var u;return u=o,"string"==typeof o?o=function(){a.execCommand(u,!1,null)}:e.isArray(u)&&(o=function(){a.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t=s(e,i,o,l);c[t.id]=t}),!0},l.remove=function(e){var t=s(e);return c[t.id]?(delete c[t.id],!0):!1}}}),r(Oe,[c,m,z],function(e,t,n){return function(r){function i(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function o(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function a(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(i(e))}}function s(e,t,n,a){var s,l,c;s=new XMLHttpRequest,s.open("POST",r.url),s.withCredentials=r.credentials,c=a(),s.upload.onprogress=function(e){var t=Math.round(e.loaded/e.total*100);c.progressBar.value(t)},s.onerror=function(){c.close(),n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return c.close(),200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(o(r.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),i(e)),s.send(l)}function l(){return new e(function(e){e([])})}function c(e){return e.then(function(e){return e})["catch"](function(e){return e})}function u(e,t,n){var r=e(n),i=c(r);return delete p[t],p[t]=i,i}function d(e,n){return t.map(e,function(e){var t=e.id();return p[t]?p[t]:u(n,t,e)})}function f(t,n){function i(t){return new e(function(e){var i=r.handler;try{i(a(t),function(n){e({url:n,blobInfo:t,status:!0})},function(n){e({url:"",blobInfo:t,status:!1,error:n})},n)}catch(o){e({url:"",blobInfo:t,status:!1,error:o.message})}})}var o=d(t,i);return e.all(o)}function h(e,t){return r.url||r.handler!==s?f(e,t):l()}var p={};return r=t.extend({credentials:!1,handler:s},r),{upload:h}}}),r(Ie,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),N(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=E(g,!0,t),u=E(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(N(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,E=e.curry,N=n.isElement,_=o.isCaretCandidate,S=E(p,!0),k=E(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:E(y,0),isAfterContentEditableFalse:E(y,-1),normalizeRange:v}}),r(Ue,[_,W,$,Ve,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t0)return n(y,--b);if(h(e)&&b0&&(x=s(y,b-1),m(x)))return!g(x)&&(w=r.findNode(x,e,v,x))?d(w)?n(w,w.data.length):n.after(w):d(x)?n(x,x.data.length):n.before(x);if(h(e)&&b0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a
                              ').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(qe,[p,_,V],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(je,[z,p,qe,W,Ve,Ue,$,V],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ye,[z,p,_,qe,V,Ve,W],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Xe,[_,p,z],function(e,t,n){function r(e){function r(e){return i(e)}function a(t){f(e.getBody()).css("cursor",t)}function s(t){return t==g.element||e.dom.isChildOf(t,g.element)?!1:!i(t)}function l(t){var n,r,i,o,s=0,l=0,c,u,d,h;0===t.button&&(n=t.screenX-g.screenX,r=t.screenY-g.screenY,c=Math.max(Math.abs(n),Math.abs(r)),!g.dragging&&c>10&&(g.dragging=!0,a("default"),g.clone=g.element.cloneNode(!0),i=m.getPos(g.element),g.relX=g.clientX-i.x,g.relY=g.clientY-i.y,g.width=g.element.offsetWidth,g.height=g.element.offsetHeight,f(g.clone).css({width:g.width,height:g.height}).removeAttr("data-mce-selected"),g.ghost=f("
                              ").css({position:"absolute",opacity:.5,overflow:"hidden",width:g.width,height:g.height}).attr({"data-mce-bogus":"all",unselectable:"on",contenteditable:"false"}).addClass("mce-drag-container mce-reset").append(g.clone).appendTo(e.getBody())[0],o=e.dom.getViewPort(e.getWin()),g.maxX=o.w,g.maxY=o.h),g.dragging&&(e.selection.placeCaretAt(t.clientX,t.clientY),u=g.clientX+n-g.relX,d=g.clientY+r+5,u+g.width>g.maxX&&(s=u+g.width-g.maxX),d+g.height>g.maxY&&(l=d+g.height-g.maxY),h="BODY"!=e.getBody().nodeName?e.getBody().getBoundingClientRect():{left:0,top:0},f(g.ghost).css({left:u-h.left,top:d-h.top,width:g.width-s,height:g.height-l})))}function c(){var t;if(g.dragging&&(e.selection.setRng(e.selection.getSel().getRangeAt(0)),s(e.selection.getNode()))){var n=g.element;if(t=e.fire("drop",{targetClone:n}),t.isDefaultPrevented())return;n=t.targetClone,e.undoManager.transact(function(){e.insertContent(m.getOuterHTML(n)),f(g.element).remove()})}d()}function u(a){var s,u;if(d(),0===a.button&&(s=t.find(e.dom.getParents(a.target),n.or(i,o)),r(s))){if(u=e.fire("dragstart",{target:s}),u.isDefaultPrevented())return;e.on("mousemove",l),e.on("mouseup",c),h!=p&&(m.bind(h,"mousemove",l),m.bind(h,"mouseup",c)),g={screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,element:s}}}function d(){f(g.ghost).remove(),a(null),e.off("mousemove",l),e.off("mouseup",d),h!=p&&(m.unbind(h,"mousemove",l),m.unbind(h,"mouseup",d)),g={}}var f=e.$,h=document,p=e.getDoc(),m=e.dom,g={};e.on("mousedown",u),e.on("drop",function(t){var n=e.getDoc().elementFromPoint(t.clientX,t.clientY);(i(n)||i(e.dom.getContentEditableParent(n)))&&t.preventDefault()})}var i=e.isContentEditableFalse,o=e.isContentEditableTrue;return{init:r}}),r(Ke,[h,Ue,$,k,Ve,$e,je,Ye,_,T,V,I,z,p,u,Xe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(e){return c.dom.isBlock(e)}function S(e){e&&c.selection.setRng(e)}function k(){return c.selection.getRng()}function T(e,t){c.selection.scrollIntoView(e,t)}function R(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(T(t,-1===e),ne.show(n,t))}function A(e){var t;return ne.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:B(e)}function B(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function D(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function L(e,t){return t=i.normalizeRange(e,Q,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function M(e){return r.isCaretContainerBlock(e.startContainer)}function P(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?R(e,i,-1==e):(s=M(r),o=L(e,r),n(o)?A(o.getNode(-1==e)):(o=t(o))?n(o)?R(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&D(o,a)?R(e,a.getNode(-1==e),1==e):s?U(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=L(e,n),i=t(Q,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),N(r)&&(p=r.getNode()),E(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),R(e,l.node,f>d);if(p){var m=a.positionsUntil(e,Q,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return U(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return U(l.position.toRange())}}function O(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='
                              '),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?ee(n.fromRangeStart(r)):te(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function I(e,t,n,r){var i;return(i=P(e,t,n,r))?i:(i=O(e,r),i?i:null)}function F(e,t,n){var r;return(r=H(e,t,n))?r:(r=O(e,n),r?r:null)}function z(){return oe("*[data-mce-caret]")[0]}function W(e){e=oe(e),e.attr("data-mce-caret")&&(ne.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),S(k()),T(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,Q,e),t=n.fromRangeStart(e),x(t.getNode())?R(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?R(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?R(1,r,!1):(ne.hide(),null))}function U(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function $(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=te(n.before(e)),i||(t=ee(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),G(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function q(e,t,n){var r,i;return!n.collapsed&&(r=_(n),x(r))?U($(r)):(i=L(e,n),t(i)?U($(i.getNode(-1==e))):void 0)}function j(){function e(e,t){var n=t(k());n&&!e.isDefaultPrevented()&&(e.preventDefault(),S(n))}function t(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function r(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function i(){var e,r=t(c.selection.getNode());C(r)&&y(r)&&c.dom.isEmpty(r)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(r).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function o(e){var t=z();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function l(e){var t;switch(e.keyCode){case d.DELETE:t=i();break;case d.BACKSPACE:t=i()}t&&e.preventDefault()}var f=b(I,1,ee,N),g=b(I,-1,te,E),v=b(q,1,N),w=b(q,-1,E),_=b(F,-1,a.upUntil),T=b(F,1,a.downUntil);c.on("mouseup",function(){var e=k();e.collapsed&&S(V(e))}),c.on("mousedown",function(e){var n;if(n=t(e.target))x(n)?(e.preventDefault(),K(A(n))):(G(),r(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{G(),ne.hide();var i=s.closestCaret(Q,e.clientX,e.clientY);i&&(e.preventDefault(),c.getBody().focus(),S(R(1,i.node,i.before)))}}),c.on("keydown",function(t){if(!d.modifierPressed(t))switch(t.keyCode){case d.RIGHT:e(t,f);break;case d.DOWN:e(t,T);break;case d.LEFT:e(t,g);break;case d.UP:e(t,_);break;case d.DELETE:e(t,v);break;case d.BACKSPACE:e(t,w);break;default:x(c.selection.getNode())&&t.preventDefault()}}),c.on("keyup compositionstart",function(e){o(e),l(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){S(U($(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ie){if(!ie.parentNode)return void(ie=null);t=t.cloneRange(),t.selectNode(ie),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=K(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng(U(c.selection.getRng()))},0)}),m.init(c)}function Y(){var e=c.contentStyles,t=".mce-content-body";e.push(ne.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;width: 100pxheight: 100px}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function X(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function K(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return G(),null;if(t.collapsed){if(G(),!X(t)){if(f=L(1,t),x(f.getNode()))return R(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return R(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(G(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(G(),null):(h=d.targetClone,o=r("#"+re),0===o.length&&(o=r('
                              ').attr("id",re),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),c.getBody().focus(),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ie=n,t)):(G(),null))}function G(){ie&&(ie.removeAttribute("data-mce-selected"),c.$("#"+re).remove(),ie=null)}function J(){ne.destroy(),ie=null}var Q=c.getBody(),Z=new t(Q),ee=b(v,Z.next),te=b(v,Z.prev),ne=new o(c.getBody(),y),re="sel-"+c.dom.uniqueId(),ie,oe=c.$;return e.ceFalse&&(j(),Y()),{showBlockCaretContainer:W,destroy:J}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,E=i.isAfterContentEditableFalse,N=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(Ge,[w,g,N,R,A,H,P,Y,J,Q,Z,ee,te,ne,E,d,Se,Be,B,L,Le,h,m,u,Me,Pe,He,We,Ke],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,E,N,_,S,k,T,R){function A(e,t,i){ -var o=this,a,s;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,o.settings=t=M({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},i.defaultSettings,t),r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var B=e.DOM,D=r.ThemeManager,L=r.PluginManager,M=E.extend,P=E.each,H=E.explode,O=E.inArray,I=E.trim,F=E.resolve,z=g.Event,W=w.gecko,V=w.ie;return A.prototype={render:function(){function e(){B.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!D.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",D.load(r.theme,t)}E.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),P(r.external_plugins,function(e,t){L.load(t,e),r.plugins+=" "+t}),P(r.plugins.split(/[ ,]/),function(e){if(e=I(e),e&&!L.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=L.dependencies(e);P(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=L.createUrl(t,e),L.load(e.resource,e)})}else L.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!z.domLoaded)return void B.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||B.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(B.insertAfter(B.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},B.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=B.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=L.get(n),i,o;if(i=L.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=I(n),r&&-1===O(m,n)){if(P(L.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(this.editorManager.i18n.setCode(n.language),t.rtl=n.rtl_ui||this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||B.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=D.get(n.theme),t.theme=new c(t,D.urls[n.theme]),t.theme.init&&t.theme.init(t,D.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),P(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&P(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',!/#$/.test(document.location.href))for(p=0;p',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+=''),t.iframeHTML+='
                              ';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=B.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},B.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=B.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(B.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=B.isHidden(l.editorContainer)),t.getElement().style.display="none",B.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();B.removeClass(e,"mce-content-body"),B.removeClass(e,"mce-edit-focus"),B.setAttrib(e,"contentEditable",null)}),B.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==B.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,B.setAttrib(p,"spellcheck","false")),n.fire("PostRender"),n.quirks=new x(n),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){P(r.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                              [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",P(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),P(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&N.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?F(r):0,n=F(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?P(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[I(e[0])]=I(e[1]):i[I(e[0])]=I(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(B.show(e.getContainer()),B.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(B.hide(e.getContainer()),B.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=B.getParent(t.id,"form"))&&P(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'
                              ',"TABLE"==r.nodeName?e=""+o+"":/^(UL|OL)$/.test(r.nodeName)&&(e="
                            • "+o+"
                            • "),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='
                              '),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=I(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=I(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=M({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=B.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=B.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),P(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&B.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),B.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),B.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),B.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return W?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},M(A.prototype,_),A}),r(Je,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(Qe,[w,u,h],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&t.target!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),t.target==document.body||d(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor;if(n.inline&&!n.dom.isChildOf(t.target,n.getBody())){var r=n.selection.getRng();r.collapsed||(n.lastRng=r)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(Ze,[Ge,g,w,ne,h,m,c,ae,Je,Qe],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize",u):t(window).off("resize",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&s(t,e.editor_deselector)||e.editor_selector&&!s(t,e.editor_selector)||n.push(t)})}return n}function c(){function a(t,n,r){if(!h(u.get(t))){var i=new e(t,n,u);d.push(i),i.on("init",function(){++s===m.length&&f(d)}),i.targetElm=i.targetElm||r,i.render()}}var s=0,d=[],m;return p.unbind(window,"ready",c),i("onpageload"),m=t.unique(l(n)),n.types?void g(n.types,function(e){o.each(m,function(t){return p.is(t,e.selector)?(a(r(t),v({},n,e),t),!1):!0})}):void g(m,function(e){a(r(e),n,e)})}var u=this,d,f=function(e){d=e};return u.settings=n,p.bind(window,"ready",c),new a(function(e){d?e(d):f=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(et,[Ze,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(tt,[ae,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(nt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(rt,[nt,tt,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(it,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ot,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(at,[w,d,E,N,m,h],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){ -a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(st,[re,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(lt,[st],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
                              '+this._super(e)}})}),r(ct,[Te],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
                              "},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append(''),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(ut,[ve],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'
                              '+(e.settings.html||"")+t.renderHtml(e)+"
                              "}})}),r(dt,[Te],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
                              '+e.encode(e.state.get("text"))+"
                              "},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(ft,[Te,me,ue,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='
                              ",e.classes.add("has-open")),'
                              '+s+"
                              "},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(ht,[ft],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e._rendered&&e.repaintColor(t.value)}),e._super()}})}),r(pt,[ct,Ee],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(mt,[pt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a=''+e.encode(r)+""),'
                              '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(gt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(vt,[Te,ye,ue,gt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='
                              ';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='
                              '+e()+'
                              ','
                              '+i+"
                              "}})}),r(yt,[Te],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'
                              '+e._getDataPathHtml(e.state.get("row"))+"
                              "},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'":"")+'
                              '+n[r].name+"
                              ";return o||(o='
                              \xa0
                              '),o}})}),r(bt,[yt,Ze],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return r.settings.elementpath!==!1&&(n.on("select",function(e){r.focus(),r.selection.select(this.row()[e.index].element),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}n.row(i)})),n._super()}})}),r(Ct,[ve],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'
                              '+(e.settings.title?'
                              '+e.settings.title+"
                              ":"")+'
                              '+(e.settings.html||"")+t.renderHtml(e)+"
                              "}})}),r(xt,[ve,Ct,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(wt,[xt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
                              '+(e.settings.title?''+e.settings.title+"":"")+'
                              '+(e.settings.html||"")+t.renderHtml(e)+"
                              "}})}),r(Et,[ft,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Nt,[lt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(_t,[lt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,E,N,_,S,k,T,R,A,B,D,L,M,P,H,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",N="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",H="left",M="w",D="x",L="innerW",P="minW",O="right",I="deltaW",F="contentW"):(S="x",N="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",H="top",M="h",D="y",L="innerH",P="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],E=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[H]+p[P]+o[O],y>E&&(E=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=E+i[I],x[B]=i[R]-d,x[F]=E,x.minW=W(x.minW,i.maxW),x.minH=W(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[H],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[H]-o[O]),x[D]=o[H]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[N]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(St,[st],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(kt,[pe,Te,Ee,m,Ze,h],function(e,t,n,r,i,o){function a(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&c(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function l(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function c(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var u;u=i(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){c(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:l,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:u}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:c,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:u})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Tt,[lt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,E,N=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,N[d]=S>N[d]?S:N[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),T-=(d>0?y:0)+N[d];for(R=o.innerH-g.top-g.bottom,E=0,f=0;n>f;f++)E+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,E+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=E+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;dd;d++)N[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var H=e.parent();H&&(H._lastRect=null,H.recalc())}}})}),r(Rt,[Te,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(At,[Te],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'
                              '+e.encode(e.state.get("text"))+'
                              '},bindStates:function(){ -var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Bt,[Te,ue],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'":''+e.encode(e.state.get("text"))+""},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Dt,[ve],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(Lt,[Dt],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Mt,[ct,me,Lt],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s=''+e.encode(a)+""),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
                              '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(Pt,[Te,me,h,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t'+("-"!==a?'\xa0":"")+("-"!==a?''+a+"":"")+(c?'
                              '+c+"
                              ":"")+(i.menu?'
                              ':"")+"
                              "},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ht,[g,pe,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('
                              '),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Ot,[Ee,Pt,Ht,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(It,[Mt,Ot],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i
                              '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(Wt,[Te],function(e){function t(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Vt,[Te,ye,ue],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t){var r,i,o,a,s;"v"==e.settings.orientation?(a="top",o="height",i="h"):(a="left",o="width",i="w"),r=(e.layoutRect()[i]||100)-n.getSize(e.getEl("handle"))[o],s=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",e.getEl("handle").style[a]=s,e.getEl("handle").style.height=e.layoutRect().h+"px"}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
                              '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e=this,i,o,a=0,s,l,c,u,d,f,h,p;l=e._minValue,c=e._maxValue,s=e.value(),"v"==e.settings.orientation?(d="screenY",f="top",h="height",p="h"):(d="screenX",f="left",h="width",p="w"),e._super(),e._dragHelper=new t(e._id,{handle:e._id+"-handle",start:function(t){i=t[d],o=parseInt(e.getEl("handle").style[f],10),u=(e.layoutRect()[p]||100)-n.getSize(e.getEl("handle"))[h],e.fire("dragstart",{value:s})},drag:function(t){var n=t[d]-i,h=e.getEl("handle");a=r(o+n,0,u),h.style[f]=a+"px",s=l+a/u*(c-l),e.value(s),e.tooltip().text(""+e.settings.previewFilter(s)).show().moveRel(h,"bc tc"),e.fire("drag",{value:s})},stop:function(){e.tooltip().hide(),e.fire("dragend",{value:s})}})},repaint:function(){this._super(),i(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){i(e,t.value)}),e._super()}})}),r(Ut,[Te],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'
                              '}})}),r($t,[Mt,ue,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),'
                              '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(qt,[St],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(jt,[Ce,g,ue],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
                              '+n+'
                              '+t.renderHtml(e)+"
                              "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Yt,[Te],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e.state.get("value"),!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Xt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,E,N,T,A,B,D,L,M,P,H,I,F,j,Y,J,Q,te,ne,re,ie,ae,le,ce,he,pe,me,ge,ve,ye,be,Ce,xe,we,Ee,Ne,_e,Se,ke,Te,Re,Ae,Be,Me,He,Ge,Je,Qe,Ze,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Et,Nt,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ht,Ot,It,Ft,zt,Wt,Vt,Ut,$t,qt,jt,Yt])}(this); \ No newline at end of file +// 4.6.3 (2017-05-30) +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i=d.x&&f.x+f.w<=d.w+d.x&&f.y>=d.y&&f.y+f.h<=d.h+d.y)return e[g];return null}function c(a,b,c){return f(a.x-b,a.y-c,a.w+2*b,a.h+2*c)}function d(a,b){var c,d,e,g;return c=i(a.x,b.x),d=i(a.y,b.y),e=h(a.x+a.w,b.x+b.w),g=h(a.y+a.h,b.y+b.h),e-c<0||g-d<0?null:f(c,d,e-c,g-d)}function e(a,b,c){var d,e,g,h,j,k,l,m,n,o;return j=a.x,k=a.y,l=a.x+a.w,m=a.y+a.h,n=b.x+b.w,o=b.y+b.h,d=i(0,b.x-j),e=i(0,b.y-k),g=i(0,l-n),h=i(0,m-o),j+=d,k+=e,c&&(l+=d,m+=e,j-=g,k-=h),l-=g,m-=h,f(j,k,l-j,m-k)}function f(a,b,c,d){return{x:a,y:b,w:c,h:d}}function g(a){return f(a.left,a.top,a.width,a.height)}var h=Math.min,i=Math.max,j=Math.round;return{inflate:c,relativePosition:a,findBestRelativePosition:b,intersect:d,clamp:e,create:f,fromClientRect:g}}),g("4",[],function(){function a(a,b){return function(){a.apply(b,arguments)}}function b(b){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof b)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(b,a(d,this),a(e,this))}function c(a){var b=this;return null===this._state?void this._deferreds.push(a):void i(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(b){return void a.reject(b)}a.resolve(d)})}function d(b){try{if(b===this)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){var c=b.then;if("function"==typeof c)return void h(a(c,b),a(d,this),a(e,this))}this._state=!0,this._value=b,f.call(this)}catch(a){e.call(this,a)}}function e(a){this._state=!1,this._value=a,f.call(this)}function f(){for(var a=0,b=this._deferreds.length;a=534;return{opera:b,webkit:c,ie:d,gecko:g,mac:h,iOS:i,android:j,contentEditable:q,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=d,range:window.getSelection&&"Range"in window,documentMode:d&&!f?document.documentMode||7:10,fileApi:k,ceFalse:d===!1||d>8,canHaveCSP:d===!1||d>11,desktop:!l&&!m,windowsPhone:n}}),g("7",["5","6"],function(a,b){"use strict";function c(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)}function d(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d||!1):a.detachEvent&&a.detachEvent("on"+b,c)}function e(a,b){var c,d=b;return c=a.path,c&&c.length>0&&(d=c[0]),a.deepPath&&(c=a.deepPath(),c&&c.length>0&&(d=c[0])),d}function f(a,c){var d,f,g=c||{};for(d in a)k[d]||(g[d]=a[d]);if(g.target||(g.target=g.srcElement||document),b.experimentalShadowDom&&(g.target=e(a,g.target)),a&&j.test(a.type)&&a.pageX===f&&a.clientX!==f){var h=g.target.ownerDocument||document,i=h.documentElement,o=h.body;g.pageX=a.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),g.pageY=a.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)}return g.preventDefault=function(){g.isDefaultPrevented=n,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},g.stopPropagation=function(){g.isPropagationStopped=n,a&&(a.stopPropagation?a.stopPropagation():a.cancelBubble=!0)},g.stopImmediatePropagation=function(){g.isImmediatePropagationStopped=n,g.stopPropagation()},l(g)===!1&&(g.isDefaultPrevented=m,g.isPropagationStopped=m,g.isImmediatePropagationStopped=m),"undefined"==typeof g.metaKey&&(g.metaKey=!1),g}function g(e,f,g){function h(){return"complete"===l.readyState||"interactive"===l.readyState&&l.body}function i(){g.domLoaded||(g.domLoaded=!0,f(m))}function j(){h()&&(d(l,"readystatechange",j),i())}function k(){try{l.documentElement.doScroll("left")}catch(b){return void a.setTimeout(k)}i()}var l=e.document,m={type:"ready"};return g.domLoaded?void f(m):(!l.addEventListener||b.ie&&b.ie<11?(c(l,"readystatechange",j),l.documentElement.doScroll&&e.self===e.top&&k()):h()?i():c(e,"DOMContentLoaded",i),void c(e,"load",i))}function h(){function a(a,b){var c,d,e,f,g=m[b];if(c=g&&g[a.type])for(d=0,e=c.length;dv.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function c(a){return a[M]=!0,a}function d(a){var b=F.createElement("div");try{return!!a(b)}catch(a){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function e(a,b){for(var c=a.split("|"),d=a.length;d--;)v.attrHandle[c[d]]=b}function f(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||V)-(~a.sourceIndex||V);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function g(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function h(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function i(a){return c(function(b){return b=+b,c(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function j(a){return a&&typeof a.getElementsByTagName!==U&&a}function k(){}function l(a){for(var b=0,c=a.length,d="";b1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function o(b,c,d){for(var e=0,f=c.length;e-1&&(c[j]=!(g[j]=l))}}else t=p(t===g?t.splice(q,t.length):t),f?f(null,g,t,i):$.apply(g,t)})}function r(a){for(var b,c,d,e=a.length,f=v.relative[a[0].type],g=f||v.relative[" "],h=f?1:0,i=m(function(a){return a===b},g,!0),j=m(function(a){return aa.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==B)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];h1&&n(k),h>1&&l(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ga,"$1"),c,h0,f=b.length>0,g=function(c,g,h,i,j){var k,l,m,n=0,o="0",q=c&&[],r=[],s=B,t=c||f&&v.find.TAG("*",j),u=O+=null==s?1:Math.random()||.1,w=t.length;for(j&&(B=g!==F&&g);o!==w&&null!=(k=t[o]);o++){if(f&&k){for(l=0;m=b[l++];)if(m(k,g,h)){i.push(k);break}j&&(O=u)}e&&((k=!m&&k)&&n--,c&&q.push(k))}if(n+=o,e&&o!==n){for(l=0;m=d[l++];)m(q,r,g,h);if(c){if(n>0)for(;o--;)q[o]||r[o]||(r[o]=Y.call(i));r=p(r)}$.apply(i,r),j&&!c&&r.length>0&&n+d.length>1&&a.uniqueSort(i)}return j&&(O=u,B=s),q};return e?c(g):g}var t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M="sizzle"+-new Date,N=window.document,O=0,P=0,Q=b(),R=b(),S=b(),T=function(a,b){return a===b&&(D=!0),0},U="undefined",V=1<<31,W={}.hasOwnProperty,X=[],Y=X.pop,Z=X.push,$=X.push,_=X.slice,aa=X.indexOf||function(a){for(var b=0,c=this.length;b+~]|"+ca+")"+ca+"*"),ja=new RegExp("="+ca+"*([^\\]'\"]*?)"+ca+"*\\]","g"),ka=new RegExp(fa),la=new RegExp("^"+da+"$"),ma={ID:new RegExp("^#("+da+")"),CLASS:new RegExp("^\\.("+da+")"),TAG:new RegExp("^("+da+"|[*])"),ATTR:new RegExp("^"+ea),PSEUDO:new RegExp("^"+fa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ca+"*(even|odd|(([+-]|)(\\d*)n|)"+ca+"*(?:([+-]|)"+ca+"*(\\d+)|))"+ca+"*\\)|)","i"),bool:new RegExp("^(?:"+ba+")$","i"),needsContext:new RegExp("^"+ca+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ca+"*((?:-\\d)?\\d*)"+ca+"*\\)|)(?=[^-]|$)","i")},na=/^(?:input|select|textarea|button)$/i,oa=/^h\d$/i,pa=/^[^{]+\{\s*\[native \w/,qa=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ra=/[+~]/,sa=/'|\\/g,ta=new RegExp("\\\\([\\da-f]{1,6}"+ca+"?|("+ca+")|.)","ig"),ua=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{$.apply(X=_.call(N.childNodes),N.childNodes),X[N.childNodes.length].nodeType}catch(a){$={apply:X.length?function(a,b){Z.apply(a,_.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}u=a.support={},x=a.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},E=a.setDocument=function(a){function b(a){try{return a.top}catch(a){}return null}var c,e=a?a.ownerDocument||a:N,g=e.defaultView;return e!==F&&9===e.nodeType&&e.documentElement?(F=e,G=e.documentElement,H=!x(e),g&&g!==b(g)&&(g.addEventListener?g.addEventListener("unload",function(){E()},!1):g.attachEvent&&g.attachEvent("onunload",function(){E()})),u.attributes=d(function(a){return a.className="i",!a.getAttribute("className")}),u.getElementsByTagName=d(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),u.getElementsByClassName=pa.test(e.getElementsByClassName),u.getById=d(function(a){return G.appendChild(a).id=M,!e.getElementsByName||!e.getElementsByName(M).length}),u.getById?(v.find.ID=function(a,b){if(typeof b.getElementById!==U&&H){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},v.filter.ID=function(a){var b=a.replace(ta,ua);return function(a){return a.getAttribute("id")===b}}):(delete v.find.ID,v.filter.ID=function(a){var b=a.replace(ta,ua);return function(a){var c=typeof a.getAttributeNode!==U&&a.getAttributeNode("id");return c&&c.value===b}}),v.find.TAG=u.getElementsByTagName?function(a,b){if(typeof b.getElementsByTagName!==U)return b.getElementsByTagName(a)}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},v.find.CLASS=u.getElementsByClassName&&function(a,b){if(H)return b.getElementsByClassName(a)},J=[],I=[],(u.qsa=pa.test(e.querySelectorAll))&&(d(function(a){a.innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+ca+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||I.push("\\["+ca+"*(?:value|"+ba+")"),a.querySelectorAll(":checked").length||I.push(":checked")}),d(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&I.push("name"+ca+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||I.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),I.push(",.*:")})),(u.matchesSelector=pa.test(K=G.matches||G.webkitMatchesSelector||G.mozMatchesSelector||G.oMatchesSelector||G.msMatchesSelector))&&d(function(a){u.disconnectedMatch=K.call(a,"div"),K.call(a,"[s!='']:x"),J.push("!=",fa)}),I=I.length&&new RegExp(I.join("|")),J=J.length&&new RegExp(J.join("|")),c=pa.test(G.compareDocumentPosition),L=c||pa.test(G.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},T=c?function(a,b){if(a===b)return D=!0,0;var c=!a.compareDocumentPosition-!b.compareDocumentPosition;return c?c:(c=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&c||!u.sortDetached&&b.compareDocumentPosition(a)===c?a===e||a.ownerDocument===N&&L(N,a)?-1:b===e||b.ownerDocument===N&&L(N,b)?1:C?aa.call(C,a)-aa.call(C,b):0:4&c?-1:1)}:function(a,b){if(a===b)return D=!0,0;var c,d=0,g=a.parentNode,h=b.parentNode,i=[a],j=[b];if(!g||!h)return a===e?-1:b===e?1:g?-1:h?1:C?aa.call(C,a)-aa.call(C,b):0;if(g===h)return f(a,b);for(c=a;c=c.parentNode;)i.unshift(c);for(c=b;c=c.parentNode;)j.unshift(c);for(;i[d]===j[d];)d++;return d?f(i[d],j[d]):i[d]===N?-1:j[d]===N?1:0},e):F},a.matches=function(b,c){return a(b,null,null,c)},a.matchesSelector=function(b,c){if((b.ownerDocument||b)!==F&&E(b),c=c.replace(ja,"='$1']"),u.matchesSelector&&H&&(!J||!J.test(c))&&(!I||!I.test(c)))try{var d=K.call(b,c);if(d||u.disconnectedMatch||b.document&&11!==b.document.nodeType)return d}catch(a){}return a(c,F,null,[b]).length>0},a.contains=function(a,b){return(a.ownerDocument||a)!==F&&E(a),L(a,b)},a.attr=function(a,b){(a.ownerDocument||a)!==F&&E(a);var c=v.attrHandle[b.toLowerCase()],d=c&&W.call(v.attrHandle,b.toLowerCase())?c(a,b,!H):void 0;return void 0!==d?d:u.attributes||!H?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},a.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},a.uniqueSort=function(a){var b,c=[],d=0,e=0;if(D=!u.detectDuplicates,C=!u.sortStable&&a.slice(0),a.sort(T),D){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return C=null,a},w=a.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=w(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=w(b);return c},v=a.selectors={cacheLength:50,createPseudo:c,match:ma,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ta,ua),a[3]=(a[3]||a[4]||a[5]||"").replace(ta,ua),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(b){return b[1]=b[1].toLowerCase(),"nth"===b[1].slice(0,3)?(b[3]||a.error(b[0]),b[4]=+(b[4]?b[5]+(b[6]||1):2*("even"===b[3]||"odd"===b[3])),b[5]=+(b[7]+b[8]||"odd"===b[3])):b[3]&&a.error(b[0]),b},PSEUDO:function(a){var b,c=!a[6]&&a[2];return ma.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&ka.test(c)&&(b=y(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ta,ua).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=Q[a+" "];return b||(b=new RegExp("(^|"+ca+")"+a+"("+ca+"|$)"))&&Q(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==U&&a.getAttribute("class")||"")})},ATTR:function(b,c,d){return function(e){var f=a.attr(e,b);return null==f?"!="===c:!c||(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f+" ").indexOf(d)>-1:"|="===c&&(f===d||f.slice(0,d.length+1)===d+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[M]||(q[M]={}),j=k[a]||[],n=j[0]===O&&j[1],m=j[0]===O&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[O,n,m];break}}else if(s&&(j=(b[M]||(b[M]={}))[a])&&j[0]===O)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[M]||(l[M]={}))[a]=[O,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(b,d){var e,f=v.pseudos[b]||v.setFilters[b.toLowerCase()]||a.error("unsupported pseudo: "+b);return f[M]?f(d):f.length>1?(e=[b,b,"",d],v.setFilters.hasOwnProperty(b.toLowerCase())?c(function(a,b){for(var c,e=f(a,d),g=e.length;g--;)c=aa.call(a,e[g]),a[c]=!(b[c]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:c(function(a){var b=[],d=[],e=z(a.replace(ga,"$1"));return e[M]?c(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,c,f){return b[0]=a,e(b,null,f,d),!d.pop()}}),has:c(function(b){return function(c){return a(b,c).length>0}}),contains:c(function(a){return a=a.replace(ta,ua),function(b){return(b.textContent||b.innerText||w(b)).indexOf(a)>-1}}),lang:c(function(b){return la.test(b||"")||a.error("unsupported lang: "+b),b=b.replace(ta,ua).toLowerCase(),function(a){var c;do if(c=H?a.lang:a.getAttribute("xml:lang")||a.getAttribute("lang"))return c=c.toLowerCase(),c===b||0===c.indexOf(b+"-");while((a=a.parentNode)&&1===a.nodeType);return!1}}),target:function(a){var b=window.location&&window.location.hash;return b&&b.slice(1)===a.id},root:function(a){return a===G},focus:function(a){return a===F.activeElement&&(!F.hasFocus||F.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!v.pseudos.empty(a)},header:function(a){return oa.test(a.nodeName)},input:function(a){return na.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:i(function(){return[0]}),last:i(function(a,b){return[b-1]}),eq:i(function(a,b,c){return[c<0?c+b:c]}),even:i(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:i(function(a,b,c){for(var d=c<0?c+b:c;++d2&&"ID"===(g=f[0]).type&&u.getById&&9===b.nodeType&&H&&v.relative[f[1].type]){if(b=(v.find.ID(g.matches[0].replace(ta,ua),b)||[])[0],!b)return c;k&&(b=b.parentNode),a=a.slice(f.shift().value.length)}for(e=ma.needsContext.test(a)?0:f.length;e--&&(g=f[e],!v.relative[h=g.type]);)if((i=v.find[h])&&(d=i(g.matches[0].replace(ta,ua),ra.test(f[0].type)&&j(b.parentNode)||b))){if(f.splice(e,1),a=d.length&&l(f),!a)return $.apply(c,d),c;break}}return(k||z(a,m))(d,b,!H,c,ra.test(a)&&j(b.parentNode)||b),c},u.sortStable=M.split("").sort(T).join("")===M,u.detectDuplicates=!!D,E(),u.sortDetached=d(function(a){return 1&a.compareDocumentPosition(F.createElement("div"))}),d(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||e("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),u.attributes&&d(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||e("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),d(function(a){return null==a.getAttribute("disabled")})||e(ba,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),a}),g("1g",[],function(){function a(a){var b,c,d=a;if(!j(a))for(d=[],b=0,c=a.length;b=0;e--)i(a,b[e],c,d);else for(e=0;e)[^>]*$|#([\w\-]*)$)/,A=a.Event,B=c.makeMap("children,contents,next,prev"),C=c.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),D=c.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),E={"for":"htmlFor","class":"className",readonly:"readOnly"},F={"float":"cssFloat"},G={},H={},I=/^\s*|\s*$/g;return l.fn=l.prototype={constructor:l,selector:"",context:null,length:0,init:function(a,b){var c,d,e=this;if(!a)return e;if(a.nodeType)return e.context=e[0]=a,e.length=1,e;if(b&&b.nodeType)e.context=b;else{if(b)return l(a).attr(b);e.context=b=document}if(f(a)){if(e.selector=a,c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c)return l(b).find(a);if(c[1])for(d=h(a,q(b)).firstChild;d;)x.call(e,d),d=d.nextSibling;else{if(d=q(b).getElementById(c[2]),!d)return e;if(d.id!==c[2])return e.find(a);e.length=1,e[0]=d}}else this.add(a,!1);return e},toArray:function(){return c.toArray(this)},add:function(a,b){var c,d,e=this;if(f(a))return e.add(l(a));if(b!==!1)for(c=l.unique(e.toArray().concat(l.makeArray(a))),e.length=c.length,d=0;d1&&(B[a]||(e=l.unique(e)),0===a.indexOf("parents")&&(e=e.reverse())),e=l(e),c?e.filter(c):e}}),o({parentsUntil:function(a,b){return r(a,"parentNode",b)},nextUntil:function(a,b){return s(a,"nextSibling",1,b).slice(1)},prevUntil:function(a,b){return s(a,"previousSibling",1,b).slice(1)}},function(a,b){l.fn[a]=function(c,d){var e=this,f=[];return e.each(function(){var a=b.call(f,this,c,f);a&&(l.isArray(a)?f.push.apply(f,a):f.push(a))}),this.length>1&&(f=l.unique(f),0!==a.indexOf("parents")&&"prevUntil"!==a||(f=f.reverse())),f=l(f),d?f.filter(d):f}}),l.fn.is=function(a){return!!a&&this.filter(a).length>0},l.fn.init.prototype=l.fn,l.overrideDefaults=function(a){function b(d,e){return c=c||a(),0===arguments.length&&(d=c.element),e||(e=c.context),new b.fn.init(d,e)}var c;return l.extend(b,this),b},d.ie&&d.ie<8&&(u(G,"get",{maxlength:function(a){var b=a.maxLength;return 2147483647===b?v:b},size:function(a){var b=a.size;return 20===b?v:b},"class":function(a){return a.className},style:function(a){var b=a.style.cssText;return 0===b.length?v:b}}),u(G,"set",{"class":function(a,b){a.className=b},style:function(a,b){a.style.cssText=b}})),d.ie&&d.ie<9&&(F["float"]="styleFloat",u(H,"set",{opacity:function(a,b){var c=a.style;null===b||""===b?c.removeAttribute("filter"):(c.zoom=1,c.filter="alpha(opacity="+100*b+")")}})),l.attrHooks=G,l.cssHooks=H,l}),g("b",[],function(){return function(a,b){function c(a,b,c,d){function e(a){return a=parseInt(a,10).toString(16),a.length>1?a:"0"+a}return"#"+e(b)+e(c)+e(d)}var d,e,f,g,h=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,j=/\s*([^:]+):\s*([^;]+);?/g,k=/\s+$/,l={},m="\ufeff";for(a=a||{},b&&(f=b.getValidStyles(),g=b.getInvalidStyles()),e=("\\\" \\' \\; \\: ; : "+m).split(" "),d=0;d-1&&c||(w[a+b]=d==-1?i[0]:i.join(" "),delete w[a+"-top"+b],delete w[a+"-right"+b],delete w[a+"-bottom"+b],delete w[a+"-left"+b])}}function f(a){var b,c=w[a];if(c){for(c=c.split(" "),b=c.length;b--;)if(c[b]!==c[0])return!1;return w[a]=c[0],!0}}function g(a,b,c,d){f(b)&&f(c)&&f(d)&&(w[a]=w[b]+" "+w[c]+" "+w[d],delete w[b],delete w[c],delete w[d])}function n(a){return v=!0,l[a]}function o(a,b){return v&&(a=a.replace(/\uFEFF[0-9]/g,function(a){return l[a]})),b||(a=a.replace(/\\([\'\";:])/g,"$1")),a}function p(a){return String.fromCharCode(parseInt(a.slice(1),16))}function q(a){return a.replace(/\\[0-9a-f]+/gi,p)}function r(b,c,d,e,f,g){if(f=f||g)return f=o(f),"'"+f.replace(/\'/g,"\\'")+"'";if(c=o(c||d||e),!a.allow_script_urls){var h=c.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(h))return"";if(!a.allow_svg_data_urls&&/^data:image\/svg/i.test(h))return""}return x&&(c=x.call(y,c,"style")),"url('"+c.replace(/\'/g,"\\'")+"')"}var s,t,u,v,w={},x=a.url_converter,y=a.url_converter_scope||this;if(b){for(b=b.replace(/[\u0000-\u001F]/g,""),b=b.replace(/\\[\"\';:\uFEFF]/g,n).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(a){return a.replace(/[;:]/g,n)});s=j.exec(b);)if(j.lastIndex=s.index+s[0].length,t=s[1].replace(k,"").toLowerCase(),u=s[2].replace(k,""),t&&u){if(t=q(t),u=q(u),t.indexOf(m)!==-1||t.indexOf('"')!==-1)continue;if(!a.allow_script_urls&&("behavior"==t||/expression\s*\(|\/\*|\*\//.test(u)))continue;"font-weight"===t&&"700"===u?u="bold":"color"!==t&&"background-color"!==t||(u=u.toLowerCase()),u=u.replace(h,c),u=u.replace(i,r),w[t]=v?o(u,!0):u}e("border","",!0),e("border","-width"),e("border","-color"),e("border","-style"),e("padding",""),e("margin",""),g("border","border-width","border-style","border-color"),"medium none"===w.border&&delete w.border,"none"===w["border-image"]&&delete w["border-image"]}return w},serialize:function(a,b){function c(b){var c,d,e,g;if(c=f[b])for(d=0,e=c.length;d0?" ":"")+b+": "+g+";")}function d(a,b){var c;return c=g["*"],(!c||!c[a])&&(c=g[b],!c||!c[a])}var e,h,i="";if(b&&f)c("*"),c(b);else for(e in a)h=a[e],!h||g&&!d(e,b)||(i+=(i.length>0?" ":"")+e+": "+h+";");return i}}}}),g("c",[],function(){return function(a,b){function c(a,c,d,e){var f,g;if(a){if(!e&&a[c])return a[c];if(a!=b){if(f=a[d])return f;for(g=a.parentNode;g&&g!=b;g=g.parentNode)if(f=g[d])return f}}}function d(a,c,d,e){var f,g,h;if(a){if(f=a[d],b&&f===b)return;if(f){if(!e)for(h=f[c];h;h=h[c])if(!h[c])return h;return f}if(g=a.parentNode,g&&g!==b)return g}}var e=a;this.current=function(){return e},this.next=function(a){return e=c(e,"firstChild","nextSibling",a)},this.prev=function(a){return e=c(e,"lastChild","previousSibling",a)},this.prev2=function(a){return e=d(e,"lastChild","previousSibling",a)}}}),g("d",["9"],function(a){function b(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.textContent||b.innerText||a}function c(a,b){var c,d,f,g={};if(a){for(a=a.split(","),b=b||10,c=0;c\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,i=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,j=/[<>&\"\']/g,k=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,l={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};e={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},f={"<":"<",">":">","&":"&",""":'"',"'":"'"},d=c("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var m={encodeRaw:function(a,b){return a.replace(b?h:i,function(a){return e[a]||a})},encodeAllRaw:function(a){return(""+a).replace(j,function(a){return e[a]||a})},encodeNumeric:function(a,b){return a.replace(b?h:i,function(a){return a.length>1?"&#"+(1024*(a.charCodeAt(0)-55296)+(a.charCodeAt(1)-56320)+65536)+";":e[a]||"&#"+a.charCodeAt(0)+";"})},encodeNamed:function(a,b,c){return c=c||d,a.replace(b?h:i,function(a){return e[a]||c[a]||a})},getEncodeFunc:function(a,b){function f(a,c){return a.replace(c?h:i,function(a){return void 0!==e[a]?e[a]:void 0!==b[a]?b[a]:a.length>1?"&#"+(1024*(a.charCodeAt(0)-55296)+(a.charCodeAt(1)-56320)+65536)+";":"&#"+a.charCodeAt(0)+";"})}function j(a,c){return m.encodeNamed(a,c,b)}return b=c(b)||d,a=g(a.replace(/\+/g,",")),a.named&&a.numeric?f:a.named?b?j:m.encodeNamed:a.numeric?m.encodeNumeric:m.encodeRaw},decode:function(a){return a.replace(k,function(a,c){return c?(c="x"===c.charAt(0).toLowerCase()?parseInt(c.substr(1),16):parseInt(c,10),c>65535?(c-=65536,String.fromCharCode(55296+(c>>10),56320+(1023&c))):l[c]||String.fromCharCode(c)):f[a]||d[a]||b(a)})}};return m}),g("1h",["9"],function(a){function b(c){function d(){return J.createDocumentFragment()}function e(a,b){x(N,a,b)}function f(a,b){x(O,a,b)}function g(a){e(a.parentNode,U(a))}function h(a){e(a.parentNode,U(a)+1)}function i(a){f(a.parentNode,U(a))}function j(a){f(a.parentNode,U(a)+1)}function k(a){a?(I[R]=I[Q],I[S]=I[P]):(I[Q]=I[R],I[P]=I[S]),I.collapsed=N}function l(a){g(a),j(a)}function m(a){e(a,0),f(a,1===a.nodeType?a.childNodes.length:a.nodeValue.length)}function n(a,b){var c=I[Q],d=I[P],e=I[R],f=I[S],g=b.startContainer,h=b.startOffset,i=b.endContainer,j=b.endOffset;return 0===a?w(c,d,g,h):1===a?w(e,f,g,h):2===a?w(e,f,i,j):3===a?w(c,d,i,j):void 0}function o(){y(M)}function p(){return y(K)}function q(){return y(L)}function r(a){var b,d,e=this[Q],f=this[P];3!==e.nodeType&&4!==e.nodeType||!e.nodeValue?(e.childNodes.length>0&&(d=e.childNodes[f]),d?e.insertBefore(a,d):3==e.nodeType?c.insertAfter(a,e):e.appendChild(a)):f?f>=e.nodeValue.length?c.insertAfter(a,e):(b=e.splitText(f),e.parentNode.insertBefore(a,b)):e.parentNode.insertBefore(a,e)}function s(a){var b=I.extractContents();I.insertNode(a),a.appendChild(b),I.selectNode(a)}function t(){return T(new b(c),{startContainer:I[Q],startOffset:I[P],endContainer:I[R],endOffset:I[S],collapsed:I.collapsed,commonAncestorContainer:I.commonAncestorContainer})}function u(a,b){var c;if(3==a.nodeType)return a;if(b<0)return a;for(c=a.firstChild;c&&b>0;)--b,c=c.nextSibling;return c?c:a}function v(){return I[Q]==I[R]&&I[P]==I[S]}function w(a,b,d,e){var f,g,h,i,j,k;if(a==d)return b==e?0:b0&&I.collapse(a):I.collapse(a),I.collapsed=v(),I.commonAncestorContainer=c.findCommonAncestor(I[Q],I[R])}function y(a){var b,c,d,e,f,g,h,i=0,j=0;if(I[Q]==I[R])return z(a);for(b=I[R],c=b.parentNode;c;b=c,c=c.parentNode){if(c==I[Q])return A(b,a);++i}for(b=I[Q],c=b.parentNode;c;b=c,c=c.parentNode){if(c==I[R])return B(b,a);++j}for(d=j-i,e=I[Q];d>0;)e=e.parentNode,d--;for(f=I[R];d<0;)f=f.parentNode,d++;for(g=e.parentNode,h=f.parentNode;g!=h;g=g.parentNode,h=h.parentNode)e=g,f=h;return C(e,f,a)}function z(a){var b,c,e,f,g,h,i,j,k;if(a!=M&&(b=d()),I[P]==I[S])return b;if(3==I[Q].nodeType){if(c=I[Q].nodeValue,e=c.substring(I[P],I[S]),a!=L&&(f=I[Q],j=I[P],k=I[S]-I[P],0===j&&k>=f.nodeValue.length-1?f.parentNode.removeChild(f):f.deleteData(j,k),I.collapse(N)),a==M)return;return e.length>0&&b.appendChild(J.createTextNode(e)),b}for(f=u(I[Q],I[P]),g=I[S]-I[P];f&&g>0;)h=f.nextSibling,i=G(f,a),b&&b.appendChild(i),--g,f=h;return a!=L&&I.collapse(N),b}function A(a,b){var c,e,f,g,h,i;if(b!=M&&(c=d()),e=D(a,b),c&&c.appendChild(e),f=U(a),g=f-I[P],g<=0)return b!=L&&(I.setEndBefore(a),I.collapse(O)),c;for(e=a.previousSibling;g>0;)h=e.previousSibling,i=G(e,b),c&&c.insertBefore(i,c.firstChild),--g,e=h;return b!=L&&(I.setEndBefore(a),I.collapse(O)),c}function B(a,b){var c,e,f,g,h,i;for(b!=M&&(c=d()),f=E(a,b),c&&c.appendChild(f),e=U(a),++e,g=I[S]-e,f=a.nextSibling;f&&g>0;)h=f.nextSibling,i=G(f,b),c&&c.appendChild(i),--g,f=h;return b!=L&&(I.setStartAfter(a),I.collapse(N)),c}function C(a,b,c){var e,f,g,h,i,j,k;for(c!=M&&(f=d()),e=E(a,c),f&&f.appendChild(e),g=U(a),h=U(b),++g,i=h-g,j=a.nextSibling;i>0;)k=j.nextSibling,e=G(j,c),f&&f.appendChild(e),j=k,--i;return e=D(b,c),f&&f.appendChild(e),c!=L&&(I.setStartAfter(a),I.collapse(N)),f}function D(a,b){var c,d,e,f,g,h=u(I[R],I[S]-1),i=h!=I[R];if(h==a)return F(h,i,O,b);for(c=h.parentNode,d=F(c,O,O,b);c;){for(;h;)e=h.previousSibling,f=F(h,i,O,b),b!=M&&d.insertBefore(f,d.firstChild),i=N,h=e;if(c==a)return d;h=c.previousSibling,c=c.parentNode,g=F(c,O,O,b),b!=M&&g.appendChild(d),d=g}}function E(a,b){var c,d,e,f,g,h=u(I[Q],I[P]),i=h!=I[Q];if(h==a)return F(h,i,N,b);for(c=h.parentNode,d=F(c,O,N,b);c;){for(;h;)e=h.nextSibling,f=F(h,i,N,b),b!=M&&d.appendChild(f),i=N,h=e;if(c==a)return d;h=c.nextSibling,c=c.parentNode,g=F(c,O,N,b),b!=M&&g.appendChild(d),d=g}}function F(a,b,d,e){var f,g,h,i,j;if(b)return G(a,e);if(3==a.nodeType){if(f=a.nodeValue,d?(i=I[P],g=f.substring(i),h=f.substring(0,i)):(i=I[S],g=f.substring(0,i),h=f.substring(i)),e!=L&&(a.nodeValue=h),e==M)return;return j=c.clone(a,O),j.nodeValue=g,j}if(e!=M)return c.clone(a,O)}function G(a,b){return b!=M?b==L?c.clone(a,N):a:void a.parentNode.removeChild(a)}function H(){return c.create("body",null,q()).outerText}var I=this,J=c.doc,K=0,L=1,M=2,N=!0,O=!1,P="startOffset",Q="startContainer",R="endContainer",S="endOffset",T=a.extend,U=c.nodeIndex;return T(I,{startContainer:J,startOffset:0,endContainer:J,endOffset:0,collapsed:N,commonAncestorContainer:J,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:e,setEnd:f,setStartBefore:g,setStartAfter:h,setEndBefore:i,setEndAfter:j,collapse:k,selectNode:l,selectNodeContents:m,compareBoundaryPoints:n,deleteContents:o,extractContents:p,cloneContents:q,insertNode:r,surroundContents:s,cloneRange:t,toStringIE:H}),I}return b.prototype.toString=function(){return this.toStringIE()},b}),h("4r",Array),h("4s",Error),g("3t",["4r","4s"],function(a,b){var c=function(){},d=function(a,b){return function(){return a(b.apply(null,arguments))}},e=function(a){return function(){return a}},f=function(a){return a},g=function(a,b){return a===b},h=function(b){for(var c=new a(arguments.length-1),d=1;d-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e=b.length&&c(d)}};0===b.length?c([]):a.each(b,function(a,b){a.get(f(b))})})};return{par:b}}),g("3v",["3s","3u","4w"],function(a,b,c){var d=function(a){return c.par(a,b.nu)},e=function(b,c){var e=a.map(b,c);return d(e)},f=function(a,b){return function(c){return b(c).bind(a)}};return{par:d,mapM:e,compose:f}}),g("3w",["3t","4q"],function(a,b){var c=function(d){var e=function(a){return d===a},f=function(a){return c(d)},g=function(a){return c(d)},h=function(a){return c(a(d))},i=function(a){a(d)},j=function(a){return a(d)},k=function(a,b){return b(d)},l=function(a){return a(d)},m=function(a){return a(d)},n=function(){return b.some(d)};return{is:e,isValue:a.constant(!0),isError:a.constant(!1),getOr:a.constant(d),getOrThunk:a.constant(d),getOrDie:a.constant(d),or:f,orThunk:g,fold:k,map:h,each:i,bind:j,exists:l,forall:m,toOption:n}},d=function(c){var e=function(a){return a()},f=function(){return a.die(c)()},g=function(a){return a},h=function(a){return a()},i=function(a){return d(c)},j=function(a){return d(c)},k=function(a,b){return a(c)};return{is:a.constant(!1),isValue:a.constant(!1),isError:a.constant(!0),getOr:a.identity,getOrThunk:e,getOrDie:f,or:g,orThunk:h,fold:k,map:i,each:a.noop,bind:j,exists:a.constant(!1),forall:a.constant(!0),toOption:b.none}};return{value:c,error:d}}),g("1i",["3s","3t","3u","3v","3w","5","9"],function(a,b,c,d,e,f,g){"use strict";return function(h,i){function j(a){h.getElementsByTagName("head")[0].appendChild(a)}function k(a,b,c){function d(){for(var a=t.passed,b=a.length;b--;)a[b]();t.status=2,t.passed=[],t.failed=[]}function e(){for(var a=t.failed,b=a.length;b--;)a[b]();t.status=3,t.passed=[],t.failed=[]}function i(){var a=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(a&&a[1]<536)}function k(a,b){a()||((new Date).getTime()-s0)return r=h.createElement("style"), +r.textContent='@import "'+a+'"',p(),void j(r);o()}j(q),q.href=a}}var l,m=0,n={};i=i||{},l=i.maxLoadTime||5e3;var o=function(a){return c.nu(function(c){k(a,b.compose(c,b.constant(e.value(a))),b.compose(c,b.constant(e.error(a))))})},p=function(a){return a.fold(b.identity,b.identity)},q=function(b,c,e){d.par(a.map(b,o)).get(function(b){var d=a.partition(b,function(a){return a.isValue()});d.fail.length>0?e(d.fail.map(p)):c(d.pass.map(p))})};return{load:k,loadAll:q}}}),g("j",["9"],function(a){function b(b,c){return b=a.trim(b),b?b.split(c||" "):[]}function c(a){function c(a,c,d){function e(a,b){var c,d,e={};for(c=0,d=a.length;c
                              "},postRender:function(){var a,b=this;return b.items().exec("postRender"),b._super(),b._layout.postRender(b),b.state.set("rendered",!0),b.settings.style&&b.$el.css(b.settings.style),b.settings.border&&(a=b.borderBox,b.$el.css({"border-top-width":a.top,"border-right-width":a.right,"border-bottom-width":a.bottom,"border-left-width":a.left})),b.parent()||(b.keyboardNav=new e({root:b})),b},initLayoutRect:function(){var a=this,b=a._super();return a._layout.recalc(a),b},recalc:function(){var a=this,b=a._layoutRect,c=a._lastRect;if(!c||c.w!=b.w||c.h!=b.h)return a._layout.recalc(a),b=a.layoutRect(),a._lastRect={x:b.x,y:b.y,w:b.w,h:b.h},!0},reflow:function(){var b;if(i.remove(this),this.visible()){for(a.repaintControls=[],a.repaintControls.map={},this.recalc(),b=a.repaintControls.length;b--;)a.repaintControls[b].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),a.repaintControls=[]}return this}})}),g("2f",["a"],function(a){"use strict";function b(a){var b,c,d,e,f,g,h,i,j=Math.max;return b=a.documentElement,c=a.body,d=j(b.scrollWidth,c.scrollWidth),e=j(b.clientWidth,c.clientWidth),f=j(b.offsetWidth,c.offsetWidth),g=j(b.scrollHeight,c.scrollHeight),h=j(b.clientHeight,c.clientHeight),i=j(b.offsetHeight,c.offsetHeight),{width:d
                              ").css({position:"absolute",top:0,left:0,width:p.width,height:p.height,zIndex:2147483647,opacity:1e-4,cursor:o}).appendTo(n.body),a(n).on("mousemove touchmove",k).on("mouseup touchend",j),e.start(d)},k=function(a){return c(a),a.button!==h?j(a):(a.deltaX=a.screenX-l,a.deltaY=a.screenY-m,a.preventDefault(),void e.drag(a))},j=function(b){c(b),a(n).off("mousemove touchmove",k).off("mouseup touchend",j),g.remove(),e.stop&&e.stop(b)},this.destroy=function(){a(f()).off()},a(f()).on("mousedown touchstart",i)}}),g("2g",["a","2f"],function(a,b){"use strict";return{init:function(){var a=this;a.on("repaint",a.renderScroll)},renderScroll:function(){function c(){function b(b,g,h,i,j,k){var l,m,n,o,p,q,r,s,t;if(m=e.getEl("scroll"+b)){if(s=g.toLowerCase(),t=h.toLowerCase(),a(e.getEl("absend")).css(s,e.layoutRect()[i]-1),!j)return void a(m).css("display","none");a(m).css("display","block"),l=e.getEl("body"),n=e.getEl("scroll"+b+"t"),o=l["client"+h]-2*f,o-=c&&d?m["client"+k]:0,p=l["scroll"+h],q=o/p,r={},r[s]=l["offset"+g]+f,r[t]=o,a(m).css(r),r={},r[s]=l["scroll"+g]*q,r[t]=o*q,a(n).css(r)}}var c,d,g;g=e.getEl("body"),c=g.scrollWidth>g.clientWidth,d=g.scrollHeight>g.clientHeight,b("h","Left","Width","contentW",c,"Height"),b("v","Top","Height","contentH",d,"Width")}function d(){function c(c,d,g,h,i){var j,k=e._id+"-scroll"+c,l=e.classPrefix;a(e.getEl()).append('
                              '),e.draghelper=new b(k+"t",{start:function(){j=e.getEl("body")["scroll"+d],a("#"+k).addClass(l+"active")},drag:function(a){var b,k,l,m,n=e.layoutRect();k=n.contentW>n.innerW,l=n.contentH>n.innerH,m=e.getEl("body")["client"+g]-2*f,m-=k&&l?e.getEl("scroll"+c)["client"+i]:0,b=m/e.getEl("body")["scroll"+g],e.getEl("body")["scroll"+d]=j+a["delta"+h]/b},stop:function(){a("#"+k).removeClass(l+"active")}})}e.classes.add("scroll"),c("v","Top","Height","Y","Width"),c("h","Left","Width","X","Height")}var e=this,f=2;e.settings.autoScroll&&(e._hasScroll||(e._hasScroll=!0,d(),e.on("wheel",function(a){var b=e.getEl("body");b.scrollLeft+=10*(a.deltaX||0),b.scrollTop+=10*a.deltaY,c()}),a(e.getEl("body")).on("scroll",c)),c())}}}),g("2h",["2e","2g"],function(a,b){"use strict";return a.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[b],renderHtml:function(){var a=this,b=a._layout,c=a.settings.html;return a.preRender(),b.preRender(a),"undefined"==typeof c?c='
                              '+b.renderHtml(a)+"
                              ":("function"==typeof c&&(c=c.call(a)),a._hasBody=!1),'
                              '+(a._preBodyHtml||"")+c+"
                              "; +}})}),g("2i",["4h"],function(a){"use strict";function b(b,c,d){var e,f,g,h,i,j,k,l,m,n;return m=a.getViewPort(),f=a.getPos(c),g=f.x,h=f.y,b.state.get("fixed")&&"static"==a.getRuntimeStyle(document.body,"position")&&(g-=m.x,h-=m.y),e=b.getEl(),n=a.getSize(e),i=n.width,j=n.height,n=a.getSize(c),k=n.width,l=n.height,d=(d||"").split(""),"b"===d[0]&&(h+=l),"r"===d[1]&&(g+=k),"c"===d[0]&&(h+=Math.round(l/2)),"c"===d[1]&&(g+=Math.round(k/2)),"b"===d[3]&&(h-=j),"r"===d[4]&&(g-=i),"c"===d[3]&&(h-=Math.round(j/2)),"c"===d[4]&&(g-=Math.round(i/2)),{x:g,y:h,w:i,h:j}}return{testMoveRel:function(c,d){for(var e=a.getViewPort(),f=0;f0&&g.x+g.w0&&g.y+g.he.x&&g.x+g.we.y&&g.y+g.hb?(a=b-c,a<0?0:a):a}var e=this;if(e.settings.constrainToViewport){var f=a.getViewPort(window),g=e.layoutRect();b=d(b,f.w+f.x,g.w),c=d(c,f.h+f.y,g.h)}return e.state.get("rendered")?e.layoutRect({x:b,y:c}).repaint():(e.settings.x=b,e.settings.y=c),e.fire("move",{x:b,y:c}),e}}}),g("2j",["4h"],function(a){"use strict";return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(b,c){if(b<=1||c<=1){var d=a.getWindowSize();b=b<=1?b*d.w:b,c=c<=1?c*d.h:c}return this._layoutRect.autoResize=!1,this.layoutRect({minW:b,minH:c,w:b,h:c}).reflow()},resizeBy:function(a,b){var c=this,d=c.layoutRect();return c.resizeTo(d.w+a,d.h+b)}}}),g("2k",["2h","2i","2j","4h","a","5"],function(a,b,c,d,e,f){"use strict";function g(a,b){for(;a;){if(a==b)return!0;a=a.parent()}}function h(a){for(var b=s.length;b--;){var c=s[b],d=c.getParentCtrl(a.target);if(c.settings.autohide){if(d&&(g(d,c)||c.parent()===d))continue;a=c.fire("autohide",{target:a.target}),a.isDefaultPrevented()||c.hide()}}}function i(){o||(o=function(a){2!=a.button&&h(a)},e(document).on("click touchstart",o))}function j(){p||(p=function(){var a;for(a=s.length;a--;)l(s[a])},e(window).on("scroll",p))}function k(){if(!q){var a=document.documentElement,b=a.clientWidth,c=a.clientHeight;q=function(){document.all&&b==a.clientWidth&&c==a.clientHeight||(b=a.clientWidth,c=a.clientHeight,u.hideAll())},e(window).on("resize",q)}}function l(a){function b(b,c){for(var d,e=0;ec&&(a.fixed(!1).layoutRect({y:a._autoFixY}).repaint(),b(!1,a._autoFixY-c)):(a._autoFixY=a.layoutRect().y,a._autoFixY
                              ').appendTo(b.getContainerElm())),f.setTimeout(function(){c.addClass(d+"in"),e(b.getEl()).addClass(d+"in")}),r=!0),m(!0,b)}}),b.on("show",function(){b.parents().each(function(a){if(a.state.get("fixed"))return b.fixed(!0),!1})}),a.popover&&(b._preBodyHtml='
                              ',b.classes.add("popover").add("bottom").add(b.isRtl()?"end":"start")),b.aria("label",a.ariaLabel),b.aria("labelledby",b._id),b.aria("describedby",b.describedBy||b._id+"-none")},fixed:function(a){var b=this;if(b.state.get("fixed")!=a){if(b.state.get("rendered")){var c=d.getViewPort();a?b.layoutRect().y-=c.y:b.layoutRect().y+=c.y}b.classes.toggle("fixed",a),b.state.set("fixed",a)}return b},show:function(){var a,b=this,c=b._super();for(a=s.length;a--&&s[a]!==b;);return a===-1&&s.push(b),c},hide:function(){return n(this),m(!1,this),this._super()},hideAll:function(){u.hideAll()},close:function(){var a=this;return a.fire("close").isDefaultPrevented()||(a.remove(),m(!1,a)),a},remove:function(){n(this),this._super()},postRender:function(){var a=this;return a.settings.bodyRole&&this.getEl("body").setAttribute("role",a.settings.bodyRole),a._super()}});return u.hideAll=function(){for(var a=s.length;a--;){var b=s[a];b&&b.settings.autohide&&(b.hide(),s.splice(a,1))}},u}),g("1z",["2k","2h","4h","a","2f","4i","6","5"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){var b,c="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",e=d("meta[name=viewport]")[0];g.overrideViewPort!==!1&&(e||(e=document.createElement("meta"),e.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(e)),b=e.getAttribute("content"),b&&"undefined"!=typeof n&&(n=b),e.setAttribute("content",a?c:n))}function j(a,b){k()&&b===!1&&d([document.documentElement,document.body]).removeClass(a+"fullscreen")}function k(){for(var a=0;aa.w&&(d=a.x-Math.max(0,b/2),f.layoutRect({w:b,x:d}),e=!0)),g&&(g.layoutRect({w:f.layoutRect().innerW}).recalc(),b=g.layoutRect().minW+a.deltaW,b>a.w&&(d=a.x-Math.max(0,b-a.w),f.layoutRect({w:b,x:d}),e=!0)),e&&f.recalc()},initLayoutRect:function(){var a,b=this,d=b._super(),e=0;if(b.settings.title&&!b._fullscreen){a=b.getEl("head");var f=c.getSize(a);d.headerW=f.width,d.headerH=f.height,e+=d.headerH}b.statusbar&&(e+=b.statusbar.layoutRect().h),d.deltaH+=e,d.minH+=e,d.h+=e;var g=c.getWindowSize();return d.x=b.settings.x||Math.max(0,g.w/2-d.w/2),d.y=b.settings.y||Math.max(0,g.h/2-d.h/2),d},renderHtml:function(){var a=this,b=a._layout,c=a._id,d=a.classPrefix,e=a.settings,f="",g="",h=e.html;return a.preRender(),b.preRender(a),e.title&&(f='
                              '+a.encode(e.title)+'
                              '),e.url&&(h=''),"undefined"==typeof h&&(h=b.renderHtml(a)),a.statusbar&&(g=a.statusbar.renderHtml()),'
                              '+f+'
                              '+h+"
                              "+g+"
                              "},fullscreen:function(a){var b,e,g=this,i=document.documentElement,j=g.classPrefix;if(a!=g._fullscreen)if(d(window).on("resize",function(){var a;if(g._fullscreen)if(b)g._timer||(g._timer=h.setTimeout(function(){var a=c.getWindowSize();g.moveTo(0,0).resizeTo(a.w,a.h),g._timer=0},50));else{a=(new Date).getTime();var d=c.getWindowSize();g.moveTo(0,0).resizeTo(d.w,d.h),(new Date).getTime()-a>50&&(b=!0)}}),e=g.layoutRect(),g._fullscreen=a,a){g._initial={x:e.x,y:e.y,w:e.w,h:e.h},g.borderBox=f.parseBox("0"),g.getEl("head").style.display="none",e.deltaH-=e.headerH+2,d([i,document.body]).addClass(j+"fullscreen"),g.classes.add("fullscreen");var k=c.getWindowSize();g.moveTo(0,0).resizeTo(k.w,k.h)}else g.borderBox=f.parseBox(g.settings.border),g.getEl("head").style.display="",e.deltaH+=e.headerH,d([i,document.body]).removeClass(j+"fullscreen"),g.classes.remove("fullscreen"),g.moveTo(g._initial.x,g._initial.y).resizeTo(g._initial.w,g._initial.h);return g.reflow()},postRender:function(){var a,b=this;setTimeout(function(){b.classes.add("in"),b.fire("open")},0),b._super(),b.statusbar&&b.statusbar.postRender(),b.focus(),this.dragHelper=new e(b._id+"-dragh",{start:function(){a={x:b.layoutRect().x,y:b.layoutRect().y}},drag:function(c){b.moveTo(a.x+c.deltaX,a.y+c.deltaY)}}),b.on("submit",function(a){a.isDefaultPrevented()||b.close()}),m.push(b),i(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var a,b=this;for(b.dragHelper.destroy(),b._super(),b.statusbar&&this.statusbar.remove(),j(b.classPrefix,!1),a=m.length;a--;)m[a]===b&&m.splice(a,1);i(m.length>0)},getContentWindow:function(){var a=this.getEl().getElementsByTagName("iframe")[0];return a?a.contentWindow:null}});return l(),o}),g("20",["1z"],function(a){"use strict";var b=a.extend({init:function(a){a={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(a)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(c){function d(a,b,c){return{type:"button",text:a,subtype:c?"primary":"",onClick:function(a){a.control.parents()[1].close(),f(b)}}}var e,f=c.callback||function(){};switch(c.buttons){case b.OK_CANCEL:e=[d("Ok",!0,!0),d("Cancel",!1)];break;case b.YES_NO:case b.YES_NO_CANCEL:e=[d("Yes",1,!0),d("No",0)],c.buttons==b.YES_NO_CANCEL&&e.push(d("Cancel",-1));break;default:e=[d("Ok",!0,!0)]}return new a({padding:20,x:c.x,y:c.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:e,title:c.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:c.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:c.onClose,onCancel:function(){f(!1)}}).renderTo(document.body).reflow()},alert:function(a,c){return"string"==typeof a&&(a={text:a}),a.callback=c,b.msgBox(a)},confirm:function(a,c){return"string"==typeof a&&(a={text:a}),a.callback=c,a.buttons=b.OK_CANCEL,b.msgBox(a)}}});return b}),g("10",["1z","20"],function(a,b){return function(c){function d(){if(h.length)return h[h.length-1]}function e(a){c.fire("OpenWindow",{win:a})}function f(a){c.fire("CloseWindow",{win:a})}var g=this,h=[];g.windows=h,c.on("remove",function(){for(var a=h.length;a--;)h[a].close()}),g.open=function(b,d){var g;return c.editorManager.setActive(c),b.title=b.title||" ",b.url=b.url||b.file,b.url&&(b.width=parseInt(b.width||320,10),b.height=parseInt(b.height||240,10)),b.body&&(b.items={defaults:b.defaults,type:b.bodyType||"form",items:b.body,data:b.data,callbacks:b.commands}),b.url||b.buttons||(b.buttons=[{text:"Ok",subtype:"primary",onclick:function(){g.find("form")[0].submit()}},{text:"Cancel",onclick:function(){g.close()}}]),g=new a(b),h.push(g),g.on("close",function(){for(var a=h.length;a--;)h[a]===g&&h.splice(a,1);h.length||c.focus(),f(g)}),b.data&&g.on("postRender",function(){this.find("*").each(function(a){var c=a.name();c in b.data&&a.value(b.data[c])})}),g.features=b||{},g.params=d||{},1===h.length&&c.nodeChanged(),g=g.renderTo().reflow(),e(g),g},g.alert=function(a,d,g){var h;h=b.alert(a,function(){d?d.call(g||this):c.focus()}),h.on("close",function(){f(h)}),e(h)},g.confirm=function(a,c,d){var g;g=b.confirm(a,function(a){c.call(d||this,a)}),g.on("close",function(){f(g)}),e(g)},g.close=function(){d()&&d().close()},g.getParams=function(){return d()?d().params:null},g.setParams=function(a){d()&&(d().params=a)},g.getWindows=function(){return h}}}),g("2l",["2b","2i"],function(a,b){return a.extend({Mixins:[b],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var a=this,b=a.classPrefix;return'"},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.getEl().lastChild.innerHTML=a.encode(b.value)}),a._super()},repaint:function(){var a,b,c=this;a=c.getEl().style,b=c._layoutRect,a.left=b.x+"px",a.top=b.y+"px",a.zIndex=131070}})}),g("2m",["2b","2l"],function(a,b){"use strict";var c,d=a.extend({init:function(a){var b=this;b._super(a),a=b.settings,b.canFocus=!0,a.tooltip&&d.tooltips!==!1&&(b.on("mouseenter",function(c){var d=b.tooltip().moveTo(-65535);if(c.control==b){var e=d.text(a.tooltip).show().testMoveRel(b.getEl(),["bc-tc","bc-tl","bc-tr"]);d.classes.toggle("tooltip-n","bc-tc"==e),d.classes.toggle("tooltip-nw","bc-tl"==e),d.classes.toggle("tooltip-ne","bc-tr"==e),d.moveRel(b.getEl(),e)}else d.hide()}),b.on("mouseleave mousedown click",function(){b.tooltip().hide()})),b.aria("label",a.ariaLabel||a.tooltip)},tooltip:function(){return c||(c=new b({type:"tooltip"}),c.renderTo()),c},postRender:function(){var a=this,b=a.settings;a._super(),a.parent()||!b.width&&!b.height||(a.initLayoutRect(),a.repaint()),b.autofocus&&a.focus()},bindStates:function(){function a(a){c.aria("disabled",a),c.classes.toggle("disabled",a)}function b(a){c.aria("pressed",a),c.classes.toggle("active",a)}var c=this;return c.state.on("change:disabled",function(b){a(b.value)}),c.state.on("change:active",function(a){b(a.value)}),c.state.get("disabled")&&a(!0),c.state.get("active")&&b(!0),c._super()},remove:function(){this._super(),c&&(c.remove(),c=null)}});return d}),g("2n",["2m"],function(a){"use strict";return a.extend({Defaults:{value:0},init:function(a){var b=this;b._super(a),b.classes.add("progress"),b.settings.filter||(b.settings.filter=function(a){return Math.round(a)})},renderHtml:function(){var a=this,b=a._id,c=this.classPrefix;return'
                              0%
                              '},postRender:function(){var a=this;return a._super(),a.value(a.settings.value),a},bindStates:function(){function a(a){a=b.settings.filter(a),b.getEl().lastChild.innerHTML=a+"%",b.getEl().firstChild.firstChild.style.width=a+"%"}var b=this;return b.state.on("change:value",function(b){a(b.value)}),a(b.state.get("value")),b._super()}})}),g("21",["2b","2i","2n","5"],function(a,b,c,d){return a.extend({Mixins:[b],Defaults:{classes:"widget notification"},init:function(a){var b=this;b._super(a),a.text&&b.text(a.text),a.icon&&(b.icon=a.icon),a.color&&(b.color=a.color),a.type&&b.classes.add("notification-"+a.type),a.timeout&&(a.timeout<0||a.timeout>0)&&!a.closeButton?b.closeButton=!1:(b.classes.add("has-close"),b.closeButton=!0),a.progressBar&&(b.progressBar=new c),b.on("click",function(a){a.target.className.indexOf(b.classPrefix+"close")!=-1&&b.close()})},renderHtml:function(){var a=this,b=a.classPrefix,c="",d="",e="",f="";return a.icon&&(c=''),a.color&&(f=' style="background-color: '+a.color+'"'),a.closeButton&&(d=''),a.progressBar&&(e=a.progressBar.renderHtml()),'"},postRender:function(){var a=this;return d.setTimeout(function(){a.$el.addClass(a.classPrefix+"in")}),a._super()},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.getEl().childNodes[1].innerHTML=b.value}),a.progressBar&&a.progressBar.bindStates(),a._super()},close:function(){var a=this;return a.fire("close").isDefaultPrevented()||a.remove(),a},repaint:function(){var a,b,c=this;a=c.getEl().style,b=c._layoutRect,a.left=b.x+"px",a.top=b.y+"px",a.zIndex=65534}})}),g("11",["21","5","9"],function(a,b,c){return function(d){function e(){if(m.length)return m[m.length-1]}function f(){b.requestAnimationFrame(function(){g(),h()})}function g(){for(var a=0;a0){var a=m.slice(0,1)[0],b=d.inline?d.getElement():d.getContentAreaContainer();if(a.moveRel(b,"tc-tc"),m.length>1)for(var c=1;c0&&(c.timer=setTimeout(function(){c.close()},b.timeout)),c.on("close",function(){var a=m.length;for(c.timer&&d.getWin().clearTimeout(c.timer);a--;)m[a]===c&&m.splice(a,1);h()}),c.renderTo(),h()):c=e,c}},l.close=function(){e()&&e().close()},l.getNotifications=function(){return m},d.on("SkinLoaded",function(){var a=d.settings.service_message;a&&d.notificationManager.open({text:a,type:"warning",timeout:0,icon:""})})}}),g("12",["z","e","9"],function(a,b,c){function d(a,b){return"selectionchange"==b?a.getDoc():!a.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(b)?a.getDoc().documentElement:a.settings.event_root?(a.eventRoot||(a.eventRoot=g.select(a.settings.event_root)[0]),a.eventRoot):a.getBody()}function e(a,b){function c(a){return!a.hidden&&!a.readonly}var e,h;if(a.delegates||(a.delegates={}),!a.delegates[b]&&!a.removed)if(e=d(a,b),a.settings.event_root){if(f||(f={},a.editorManager.on("removeEditor",function(){var b;if(!a.editorManager.activeEditor&&f){for(b in f)a.dom.unbind(d(a,b));f=null}})),f[b])return;h=function(d){for(var e=d.target,f=a.editorManager.editors,h=f.length;h--;){var i=f[h].getBody();(i===e||g.isChildOf(e,i))&&c(f[h])&&f[h].fire(b,d)}},f[b]=h,g.bind(e,b,h)}else h=function(d){c(a)&&a.fire(b,d)},g.bind(e,b,h),a.delegates[b]=h}var f,g=b.DOM,h={bindPendingEventDelegates:function(){var a=this;c.each(a._pendingNativeEvents,function(b){e(a,b)})},toggleNativeEvent:function(a,b){var c=this;"focus"!=a&&"blur"!=a&&(b?c.initialized?e(c,a):c._pendingNativeEvents?c._pendingNativeEvents.push(a):c._pendingNativeEvents=[a]:c.initialized&&(c.dom.unbind(d(c,a),a,c.delegates[a]),delete c.delegates[a]))},unbindAllNativeEvents:function(){var a,b=this;if(b.delegates){for(a in b.delegates)b.dom.unbind(d(b,a),a,b.delegates[a]);delete b.delegates}b.inline||(b.getBody().onload=null,b.dom.unbind(b.getWin()),b.dom.unbind(b.getDoc())),b.dom.unbind(b.getBody()),b.dom.unbind(b.getContainer())}};return h=c.extend({},a,h)}),g("13",["9","6"],function(a,b){var c=a.each,d=a.explode,e={f9:120,f10:121,f11:122},f=a.makeMap("alt,ctrl,shift,meta,access");return function(g){function h(a){var g,h,i={};c(d(a,"+"),function(a){a in f?i[a]=!0:/^[0-9]{2,}$/.test(a)?i.keyCode=parseInt(a,10):(i.charCode=a.charCodeAt(0),i.keyCode=e[a]||a.toUpperCase().charCodeAt(0))}),g=[i.keyCode];for(h in f)i[h]?g.push(h):i[h]=!1;return i.id=g.join(","),i.access&&(i.alt=!0,b.mac?i.ctrl=!0:i.shift=!0),i.meta&&(b.mac?i.meta=!0:(i.ctrl=!0,i.meta=!1)),i}function i(b,c,e,f){var i;return i=a.map(d(b,">"),h),i[i.length-1]=a.extend(i[i.length-1],{func:e,scope:f||g}),a.extend(i[0],{desc:g.translate(c),subpatterns:i.slice(1)})}function j(a){return a.altKey||a.ctrlKey||a.metaKey}function k(a){return"keydown"===a.type&&a.keyCode>=112&&a.keyCode<=123}function l(a,b){return!!b&&(b.ctrl==a.ctrlKey&&b.meta==a.metaKey&&(b.alt==a.altKey&&b.shift==a.shiftKey&&(!!(a.keyCode==b.keyCode||a.charCode&&a.charCode==b.charCode)&&(a.preventDefault(),!0))))}function m(a){return a.func?a.func.call(a.scope):null}var n=this,o={},p=[];g.on("keyup keypress keydown",function(a){!j(a)&&!k(a)||a.isDefaultPrevented()||(c(o,function(b){if(l(a,b))return p=b.subpatterns.slice(0),"keydown"==a.type&&m(b),!0}),l(a,p[0])&&(1===p.length&&"keydown"==a.type&&m(p[0]),p.shift()))}),n.add=function(b,e,f,h){var j;return j=f,"string"==typeof f?f=function(){g.execCommand(j,!1,null)}:a.isArray(j)&&(f=function(){g.execCommand(j[0],j[1],j[2])}),c(d(a.trim(b.toLowerCase())),function(a){var b=i(a,e,f,h);o[b.id]=b}),!0},n.remove=function(a){var b=i(a);return!!o[b.id]&&(delete o[b.id],!0)}}}),h("4k",window),g("26",["g"],function(a){var b=a.PluginManager,c=function(a,c){for(var d in b.urls){var e=b.urls[d]+"/plugin"+c+".js";if(e===a)return d}return null},d=function(a,b){var d=c(b,a.suffix);return d?"Failed to load plugin: "+d+" from url "+b:"Failed to load plugin url: "+b},e=function(a,b){a.notificationManager.open({type:"error",text:b})},f=function(a,b){a._skinLoaded?e(a,b):a.on("SkinLoaded",function(){e(a,b)})},g=function(a,b){f(a,"Failed to upload image: "+b)},h=function(a,b){f(a,d(a,b))},i=function(a,b){f(a,"Failed to load content css: "+b[0])},j=function(a){var b=window.console;b&&!window.test&&(b.error?b.error.apply(b,arguments):b.log.apply(b,arguments))};return{pluginLoadError:h,uploadError:g,displayError:f,contentCssError:i,initError:j}}),g("60",["3t","1k"],function(a,b){var c=function(a){return a.dom.select("*[data-mce-caret]")[0]},d=function(a){a.selection.setRng(a.selection.getRng())},e=function(a,c){c.hasAttribute("data-mce-caret")&&(b.showCaretContainerBlock(c),d(a),a.selection.scrollIntoView(c))},f=function(a,d){var f=c(a);if(f)return"compositionstart"===d.type?(d.preventDefault(),d.stopPropagation(),void e(f)):void(b.hasContent(f)&&e(a,f))},g=function(b){b.on("keyup compositionstart",a.curry(f,b))};return{setup:g}}),g("6g",["4","9","1s"],function(a,b,c){return function(c,d){function e(a,b){return a?a.replace(/\/$/,"")+"/"+b.replace(/^\//,""):b}function f(a,b,c,f){var g,h;g=new XMLHttpRequest,g.open("POST",d.url),g.withCredentials=d.credentials,g.upload.onprogress=function(a){f(a.loaded/a.total*100)},g.onerror=function(){c("Image upload failed due to a XHR Transport error. Code: "+g.status)},g.onload=function(){var a;return g.status<200||g.status>=300?void c("HTTP Error: "+g.status):(a=JSON.parse(g.responseText),a&&"string"==typeof a.location?void b(e(d.basePath,a.location)):void c("Invalid JSON: "+g.responseText))},h=new FormData,h.append("file",a.blob(),a.filename()),g.send(h)}function g(){return new a(function(a){a([])})}function h(a,b){return{url:b,blobInfo:a,status:!0}}function i(a,b){return{url:"",blobInfo:a,status:!1,error:b}}function j(a,c){b.each(p[a],function(a){a(c)}),delete p[a]}function k(b,d,e){return c.markPending(b.blobUri()),new a(function(a){var f,g,k=function(){};try{var l=function(){f&&(f.close(),g=k)},m=function(d){l(),c.markUploaded(b.blobUri(),d),j(b.blobUri(),h(b,d)),a(h(b,d))},n=function(d){l(),c.removeFailed(b.blobUri()),j(b.blobUri(),i(b,d)),a(i(b,d))};g=function(a){a<0||a>100||(f||(f=e()),f.progressBar.value(a))},d(b,m,n,g)}catch(c){a(i(b,c.message))}})}function l(a){return a===f}function m(b){var c=b.blobUri();return new a(function(a){p[c]=p[c]||[],p[c].push(a)})}function n(e,f){return e=b.grep(e,function(a){return!c.isUploaded(a.blobUri())}),a.all(b.map(e,function(a){return c.isPending(a.blobUri())?m(a):k(a,d.handler,f)}))}function o(a,b){return!d.url&&l(d.handler)?g():n(a,b)}var p={};return d=b.extend({credentials:!1,handler:f},d),{upload:o}}}),g("71",["4"],function(a){function b(b){return new a(function(a,c){var d=function(){c("Cannot convert "+b+" to Blob. Resource might not exist or is inaccessible.")};try{var e=new XMLHttpRequest;e.open("GET",b,!0),e.responseType="blob",e.onload=function(){200==this.status?a(this.response):d()},e.onerror=d,e.send()}catch(a){d()}})}function c(a){var b,c;return a=decodeURIComponent(a).split(","),c=/data:([^;]+)/.exec(a[0]),c&&(b=c[1]),{type:b,data:a[1]}}function d(b){return new a(function(a){var d,e,f;b=c(b);try{d=atob(b.data)}catch(b){return void a(new Blob([]))}for(e=new Uint8Array(d.length),f=0;f0&&b.moveEnd("character",f),b.select()}catch(a){}a.nodeChanged()}}},c=function(c){c.settings.forced_root_block&&c.on("NodeChange",a.curry(b,c))};return{setup:c}}),g("76",["1g","1j","3y"],function(a,b,c){function d(e){function f(b){return a.map(b,function(a){return a=c.clone(a),a.node=e,a})}if(a.isArray(e))return a.reduce(e,function(a,b){return a.concat(d(b))},[]);if(b.isElement(e))return f(e.getClientRects());if(b.isText(e)){var g=e.ownerDocument.createRange();return g.setStart(e,0),g.setEnd(e,e.data.length),f(g.getClientRects())}}return{getClientRects:d}}),g("6p",["1s","1g","1j","76","3y","59","3x"],function(a,b,c,d,e,f,g){function h(a,b){return Math.abs(a.left-b)}function i(a,b){return Math.abs(a.right-b)}function j(a,c){function d(a,b){return a>=b.left&&a<=b.right}return b.reduce(a,function(a,b){var e,f;return e=Math.min(h(a,c),i(a,c)),f=Math.min(h(b,c),i(b,c)),d(c,b)?b:d(c,a)?a:f==e&&p(b.node)?b:f=a.top&&e<=a.bottom}),g=j(f,c),g&&(g=j(l(a,g),c),g&&p(g.node))?n(g,c):null}var p=c.isContentEditableFalse,q=f.findNode,r=a.curry;return{findClosestClientRect:j,findLineNodeRects:l,closestCaret:o}}),g("7b",["1s","1g","76","3x","59","4d","1n","3y"],function(a,b,c,d,e,f,g,h){function i(a,b,c,f){for(;f=e.findNode(f,a,d.isEditableCaretCandidate,b);)if(c(f))return}function j(a,d,e,f,g,h){function j(f){var h,i,j;for(j=c.getClientRects(f),a==-1&&(j=j.reverse()),h=0;h0&&d(i,b.last(n))&&m++,i.line=m,g(i))return!0;n.push(i)}}var k,l,m=0,n=[];return(l=b.last(h.getClientRects()))?(k=h.getNode(),j(k),i(a,f,j,k),n):n}function k(a,b){return b.line>a}function l(a,b){return b.line===a}function m(a,c,d,e){function i(c){return 1==a?b.last(c.getClientRects()):b.last(c.getClientRects())}var j,k,l,m,n,o,p=new f(c),q=[],r=0;1==a?(j=p.next,k=h.isBelow,l=h.isAbove,m=g.after(e)):(j=p.prev,k=h.isAbove,l=h.isBelow,m=g.before(e)),o=i(m);do if(m.isVisible()&&(n=i(m),!l(n,o))){if(q.length>0&&k(n,b.last(q))&&r++,n=h.clone(n),n.position=m,n.line=r,d(n))return q;q.push(n)}while(m=j(m));return q}var n=a.curry,o=n(j,-1,h.isAbove,h.isBelow),p=n(j,1,h.isBelow,h.isAbove);return{upUntil:o,downUntil:p,positionsUntil:m,isAboveLine:n(k),isLine:n(l)}}),g("6r",["1n","59","1j","1s"],function(a,b,c,d){var e=c.isContentEditableTrue,f=c.isContentEditableFalse,g=function(a,b,c,d){return b._selectionOverrides.showCaret(a,c,d)},h=function(a){var b=a.ownerDocument.createRange();return b.selectNode(a),b},i=function(a,b){var c;return c=a.fire("BeforeObjectSelected",{target:b}),c.isDefaultPrevented()?null:h(b)},j=function(c,h){var i,j;return h=b.normalizeRange(1,c.getBody(),h),i=a.fromRangeStart(h),f(i.getNode())?g(1,c,i.getNode(),!i.isAtEnd()):f(i.getNode(!0))?g(1,c,i.getNode(!0),!1):(j=c.dom.getParent(i.getNode(),d.or(f,e)),f(j)?g(1,c,j,!1):null)},k=function(a,b){var c;return b&&b.collapsed?(c=j(a,b),c?c:b):b};return{showCaret:g,selectNode:i,renderCaretAtRange:j,renderRangeCaret:k}}),g("73",["1k","1n","59","4d","6p","7b","1j","h","6","6r","1g","1s"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=g.isContentEditableFalse,n=h.getSelectedNode,o=c.isAfterContentEditableFalse,p=c.isBeforeContentEditableFalse,q=function(a,b){for(;b=a(b);)if(b.isVisible())return b;return b},r=function(a,b){var d=c.isInSameBlock(a,b);return!(d||!g.isBr(a.getNode()))||d},s=function(b){return a.isCaretContainerBlock(b.startContainer)},t=function(a,d,e){return e=c.normalizeRange(a,d,e),a===-1?b.fromRangeStart(e):b.fromRangeEnd(e)},u=function(a,b,c,d,e){var f,g,h,i;return!e.collapsed&&(f=n(e),m(f))?j.showCaret(a,b,f,a===-1):(i=s(e),g=t(a,b.getBody(),e),d(g)?j.selectNode(b,g.getNode(a===-1)):(g=c(g))?d(g)?j.showCaret(a,b,g.getNode(a===-1),1===a):(h=c(g),d(h)&&r(g,h)?j.showCaret(a,b,h.getNode(a===-1),1===a):i?j.renderRangeCaret(b,g.toRange()):null):i?e:null)},v=function(a,b,c,d){var g,h,i,l,q,r,s,u,v;if(v=n(d),g=t(a,b.getBody(),d),h=c(b.getBody(),f.isAboveLine(1),g),i=k.filter(h,f.isLine(1)),q=k.last(g.getClientRects()),p(g)&&(v=g.getNode()),o(g)&&(v=g.getNode(!0)),!q)return null;if(r=q.left,l=e.findClosestClientRect(i,r),l&&m(l.node))return s=Math.abs(r-l.left),u=Math.abs(r-l.right),j.showCaret(a,b,l.node,s=11)&&(b.innerHTML='
                              '),b},x=function(a,c,e){var f,g,h,i=new d(a.getBody()),j=l.curry(q,i.next),k=l.curry(q,i.prev);if(e.collapsed&&a.settings.forced_root_block){if(f=a.dom.getParent(e.startContainer,"PRE"),!f)return;g=1===c?j(b.fromRangeStart(e)):k(b.fromRangeStart(e)),g||(h=w(a),1===c?a.$(f).after(h):a.$(f).before(h),a.selection.select(h,!0),a.selection.collapse())}},y=function(a,b){var c,e=new d(a.getBody()),f=l.curry(q,e.next),g=l.curry(q,e.prev),h=b?1:-1,i=b?f:g,j=b?p:o,k=a.selection.getRng();return(c=u(h,a,i,j,k))?c:(c=x(a,h,k),c?c:null)},z=function(a,b){var c,d=b?1:-1,e=b?f.downUntil:f.upUntil,g=a.selection.getRng();return(c=v(d,a,e,g))?c:(c=x(a,d,g),c?c:null)},A=function(a,b){return function(){var c=y(a,b);return!!c&&(a.selection.setRng(c),!0)}},B=function(a,b){return function(){var c=z(a,b);return!!c&&(a.selection.setRng(c),!0)}};return{moveH:A,moveV:B}}),g("7c",["5l","4r","4s"],function(a,b,c){var d=function(a,b){return b},e=function(b,c){var d=a.isObject(b)&&a.isObject(c);return d?g(b,c):c},f=function(a){return function(){for(var d=new b(arguments.length),e=0;e'},l=function(a,b){return a.nodeName===b||a.previousSibling&&a.previousSibling.nodeName===b},m=function(a,b){return b&&a.isBlock(b)&&!/^(TD|TH|CAPTION|FORM)$/.test(b.nodeName)&&!/^(fixed|absolute)/i.test(b.style.position)&&"true"!==a.getContentEditable(b)},n=function(a,b,c){var d;a.isBlock(c)&&(d=b.getRng(),c.appendChild(a.create("span",null,"\xa0")),b.select(c),c.lastChild.outerHTML="",b.setRng(d))},o=function(a,b,c){var d,e=c,f=[];if(e){for(;e=e.firstChild;){if(a.isBlock(e))return;1!=e.nodeType||b[e.nodeName.toLowerCase()]||f.push(e)}for(d=f.length;d--;)e=f[d],!e.hasChildNodes()||e.firstChild==e.lastChild&&""===e.firstChild.nodeValue?a.remove(e):i(e)&&a.remove(e)}},p=function(a,c,d){return b.isText(c)===!1?d:a?1===d&&c.data.charAt(d-1)===f.ZWSP?0:d:d===c.data.length-1&&c.data.charAt(d)===f.ZWSP?c.data.length:d},q=function(a){var b=a.cloneRange();return b.setStart(a.startContainer,p(!0,a.startContainer,a.startOffset)),b.setEnd(a.endContainer,p(!1,a.endContainer,a.endOffset)),b},r=function(a){for(;a;){if(1===a.nodeType||3===a.nodeType&&a.data&&/[\r\n\s]/.test(a.data))return a;a=a.nextSibling}},s=function(b){function f(f){function x(a){var b,c,f,h,j=a;if(a){if(e.ie&&e.ie<9&&N&&N.firstChild&&N.firstChild==N.lastChild&&"BR"==N.firstChild.tagName&&g.remove(N.firstChild),/^(LI|DT|DD)$/.test(a.nodeName)){var k=r(a.firstChild);k&&/^(UL|OL|DL)$/.test(k.nodeName)&&a.insertBefore(g.doc.createTextNode("\xa0"),a.firstChild)}if(f=g.createRng(),e.ie||a.normalize(),a.hasChildNodes()){for(b=new d(a,a);c=b.current();){if(3==c.nodeType){f.setStart(c,0),f.setEnd(c,0);break}if(w[c.nodeName.toLowerCase()]){f.setStartBefore(c),f.setEndBefore(c);break}j=c,c=b.next()}c||(f.setStart(j,0),f.setEnd(j,0))}else"BR"==a.nodeName?a.nextSibling&&g.isBlock(a.nextSibling)?((!O||O<9)&&(h=g.create("br"),a.parentNode.insertBefore(h,a)),f.setStartBefore(a),f.setEndBefore(a)):(f.setStartAfter(a),f.setEndAfter(a)):(f.setStart(a,0),f.setEnd(a,0));i.setRng(f),g.remove(h),i.scrollIntoView(a)}}function y(a){var b=s.forced_root_block;b&&b.toLowerCase()===a.tagName.toLowerCase()&&g.setAttribs(a,s.forced_root_block_attrs)}function z(a){var b,c,d,e=L,f=u.getTextInlineElements();if(a||"TABLE"==T||"HR"==T?(b=g.create(a||V),y(b)):b=N.cloneNode(!1),d=b,s.keep_styles===!1)g.setAttrib(b,"style",null),g.setAttrib(b,"class",null);else do if(f[e.nodeName]){if("_mce_caret"==e.id)continue;c=e.cloneNode(!1),g.setAttrib(c,"id",""),b.hasChildNodes()?(c.appendChild(b.firstChild),b.appendChild(c)):(d=c,b.appendChild(c))}while((e=e.parentNode)&&e!=K);return h||(d.innerHTML='
                              '),b}function A(a){var b,c,e,f;if(f=p(a,L,M),3==L.nodeType&&(a?f>0:fL.childNodes.length-1,L=L.childNodes[Math.min(M,L.childNodes.length-1)]||L,M=W&&3==L.nodeType?L.nodeValue.length:0),K=F(L)){if(t.beforeChange(),!g.isBlock(K)&&K!=g.getRoot())return void(V&&!P||D());if((V&&!P||!V&&P)&&(L=B(L,M)),N=g.getParent(L,g.isBlock),S=N?g.getParent(N.parentNode,g.isBlock):null,T=N?N.nodeName.toUpperCase():"",U=S?S.nodeName.toUpperCase():"","LI"!=U||f.ctrlKey||(N=S,T=U),b.undoManager.typing&&(b.undoManager.typing=!1,b.undoManager.add()),/^(LI|DT|DD)$/.test(T)){if(!V&&P)return void D();if(g.isEmpty(N))return void C()}if("PRE"==T&&s.br_in_pre!==!1){if(!P)return void D()}else if(!V&&!P&&"LI"!=T||V&&P)return void D();V&&N===b.getBody()||(V=V||"P",a.isCaretContainerBlock(N)?(Q=a.showCaretContainerBlock(N),g.isEmpty(N)&&k(N),x(Q)):A()?H():A(!0)?(Q=N.parentNode.insertBefore(z(),N),n(g,i,Q),x(l(N,"HR")?Q:N)):(J=q(I).cloneRange(),J.setEndAfter(N),R=J.extractContents(),E(R),Q=R.firstChild,g.insertAfter(R,N),o(g,v,Q),G(N),g.isEmpty(N)&&k(N),Q.normalize(),g.isEmpty(Q)?(g.remove(Q),H()):x(Q)),g.setAttrib(Q,"id",""),b.fire("NewBlock",{newBlock:Q}),t.typing=!1,t.add())}}}var g=b.dom,i=b.selection,s=b.settings,t=b.undoManager,u=b.schema,v=u.getNonEmptyElements(),w=u.getMoveCaretBeforeOnEnterElements();b.on("keydown",function(a){13==a.keyCode&&f(a)!==!1&&a.preventDefault()})};return{setup:s}}),g("75",["3t","1n","1j","5e"],function(a,b,c,d){var e=function(a,b){return i(a)&&c.isText(b.container())},f=function(a,b){var c=b.container(),d=b.offset();c.insertData(d,"\xa0"),a.selection.setCursorLocation(c,d+1)},g=function(a,b,c){return!!e(c,b)&&(f(a,b),!0)},h=function(c){var e=b.fromRangeStart(c.selection.getRng()),f=d.readLocation(c.getBody(),e);return f.map(a.curry(g,c,e)).getOr(!1)},i=function(b){return b.fold(a.constant(!1),a.constant(!0),a.constant(!0),a.constant(!1))},j=function(a){return!!a.selection.isCollapsed()&&h(a)};return{insertAtSelection:j}}),g("6n",["3s","75","74","p"],function(a,b,c,d){var e=function(e,f){var g=c.match([{keyCode:d.SPACEBAR,action:c.action(b.insertAtSelection,e)}],f);a.find(g,function(a){return a.action()}).each(function(a){f.preventDefault()})},f=function(a){a.on("keydown",function(b){b.isDefaultPrevented()===!1&&e(a,b)})};return{setup:f}}),g("63",["6k","5f","6l","6m","6n"],function(a,b,c,d,e){var f=function(f){var g=b.setupSelectedState(f);a.setup(f,g),c.setup(f,g),d.setup(f),e.setup(f)};return{setup:f}}),g("64",["h","6","5"],function(a,b,c){return function(d){function e(a){var b,c;if(c=d.$(a).parentsUntil(d.getBody()).add(a),c.length===g.length){for(b=c.length;b>=0&&c[b]===g[b];b--);if(b===-1)return g=c,!0}return g=c,!1}var f,g=[];"onselectionchange"in d.getDoc()||d.on("NodeChange Click MouseUp KeyUp Focus",function(b){var c,e;c=d.selection.getRng(),e={startContainer:c.startContainer,startOffset:c.startOffset,endContainer:c.endContainer,endOffset:c.endOffset},"nodechange"!=b.type&&a.compareRanges(e,f)||d.fire("SelectionChange"),f=e}),d.on("contextmenu",function(){d.fire("SelectionChange")}),d.on("SelectionChange",function(){var a=d.selection.getStart(!0);!b.range&&d.selection.isCollapsed()||!e(a)&&d.dom.isChildOf(a,d.getBody())&&d.nodeChanged({selectionChange:!0})}),d.on("MouseUp",function(a){a.isDefaultPrevented()||("IMG"==d.selection.getNode().nodeName?c.setEditorTimeout(d,function(){d.nodeChanged()}):d.nodeChanged())}),this.nodeChanged=function(a){var b,c,e,f=d.selection;d.initialized&&f&&!d.settings.disable_nodechange&&!d.readonly&&(e=d.getBody(),b=f.getStart(!0)||e,b.ownerDocument==d.getDoc()&&d.dom.isChildOf(b,e)||(b=e),c=[],d.dom.getParent(b,function(a){return a===e||void c.push(a)}),a=a||{},a.element=b,a.parents=c,d.fire("NodeChange",a))}}}),g("6o",["1k","5x","1n","a","1j","h","3y","5"],function(a,b,c,d,e,f,g,h){var i=e.isContentEditableFalse,j=function(a){return a&&/^(TD|TH)$/i.test(a.nodeName)};return function(c,e){function f(a,b){var d,e,f,h,i,j=g.collapse(a.getBoundingClientRect(),b);return"BODY"==c.tagName?(d=c.ownerDocument.documentElement,e=c.scrollLeft||d.scrollLeft,f=c.scrollTop||d.scrollTop):(i=c.getBoundingClientRect(),e=c.scrollLeft-i.left,f=c.scrollTop-i.top),j.left+=e,j.right+=e,j.top+=f,j.bottom+=f,j.width=1,h=a.offsetWidth-a.clientWidth,h>0&&(b&&(h*=-1),j.left+=h,j.right+=h),j}function k(){var b,e,f,g,h;for(b=d("*[contentEditable=false]",c),g=0;g
                              ').css(h).appendTo(c),b&&r.addClass("mce-visual-caret-before"),n(),k=g.ownerDocument.createRange(),k.setStart(s,0),k.setEnd(s,0),k):(s=a.insertInline(g,b),k=g.ownerDocument.createRange(),i(s.nextSibling)?(k.setStart(s,0),k.setEnd(s,0)):(k.setStart(s,1),k.setEnd(s,1)),k)}function m(){k(),s&&(b.remove(s),s=null),r&&(r.remove(),r=null),clearInterval(q)}function n(){q=h.setInterval(function(){d("div.mce-visual-caret",c).toggleClass("mce-visual-caret-hidden")},500)}function o(){h.clearInterval(q)}function p(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var q,r,s;return{show:l,hide:m,getCss:p,destroy:o}}}),g("77",[],function(){var a=function(a){var b,c,d,e;return e=a.getBoundingClientRect(),b=a.ownerDocument,c=b.documentElement,d=b.defaultView,{top:e.top+d.pageYOffset-c.clientTop,left:e.left+d.pageXOffset-c.clientLeft}},b=function(b){return b.inline?a(b.getBody()):{left:0,top:0}},c=function(a){var b=a.getBody();return a.inline?{left:b.scrollLeft,top:b.scrollTop}:{left:0,top:0}},d=function(a){var b=a.getBody(),c=a.getDoc().documentElement,d={left:b.scrollLeft,top:b.scrollTop},e={left:b.scrollLeft||c.scrollLeft,top:b.scrollTop||c.scrollTop};return a.inline?d:e},e=function(b,c){if(c.target.ownerDocument!==b.getDoc()){var e=a(b.getContentAreaContainer()),f=d(b);return{left:c.pageX-e.left+f.left,top:c.pageY-e.top+f.top}}return{left:c.pageX,top:c.pageY}},f=function(a,b,c){return{pageX:c.left-a.left+b.left,pageY:c.top-a.top+b.top}},g=function(a,d){return f(b(a),c(a),e(a,d))};return{calc:g}}),g("6q",["1j","1g","1s","5","e","77"],function(a,b,c,d,e,f){var g=a.isContentEditableFalse,h=a.isContentEditableTrue,i=function(a,b){return g(b)&&b!==a},j=function(a,b,c){return b!==c&&!a.dom.isChildOf(b,c)&&!g(b)},k=function(a){var b=a.cloneNode(!0);return b.removeAttribute("data-mce-selected"),b},l=function(a,b,c,d){var e=b.cloneNode(!0);a.dom.setStyles(e,{width:c,height:d}),a.dom.setAttrib(e,"data-mce-selected",null);var f=a.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return a.dom.setStyles(f,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:c,height:d}),a.dom.setStyles(e,{margin:0,boxSizing:"border-box"}),f.appendChild(e),f},m=function(a,b){a.parentNode!==b&&b.appendChild(a)},n=function(a,b,c,d,e,f){var g=0,h=0;a.style.left=b.pageX+"px",a.style.top=b.pageY+"px",b.pageX+c>e&&(g=b.pageX+c-e),b.pageY+d>f&&(h=b.pageY+d-f),a.style.width=c-g+"px",a.style.height=d-h+"px"},o=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},p=function(a){return 0===a.button},q=function(a){return a.element},r=function(a,b){return{pageX:b.pageX-a.relX,pageY:b.pageY+5}},s=function(a,d){return function(e){if(p(e)){var f=b.find(d.dom.getParents(e.target),c.or(g,h));if(i(d.getBody(),f)){var j=d.dom.getPos(f),k=d.getBody(),m=d.getDoc().documentElement;a.element=f,a.screenX=e.screenX,a.screenY=e.screenY,a.maxX=(d.inline?k.scrollWidth:m.offsetWidth)-2,a.maxY=(d.inline?k.scrollHeight:m.offsetHeight)-2,a.relX=e.pageX-j.x,a.relY=e.pageY-j.y,a.width=f.offsetWidth,a.height=f.offsetHeight,a.ghost=l(d,f,a.width,a.height)}}}},t=function(a,b){var c=d.throttle(function(a,c){b._selectionOverrides.hideFakeCaret(),b.selection.placeCaretAt(a,c)},0);return function(d){var e=Math.max(Math.abs(d.screenX-a.screenX),Math.abs(d.screenY-a.screenY));if(q(a)&&!a.dragging&&e>10){var g=b.fire("dragstart",{target:a.element});if(g.isDefaultPrevented())return;a.dragging=!0,b.focus()}if(a.dragging){var h=r(a,f.calc(b,d));m(a.ghost,b.getBody()),n(a.ghost,h,a.width,a.height,a.maxX,a.maxY),c(d.clientX,d.clientY)}}},u=function(a){var b=a.getSel().getRangeAt(0),c=b.startContainer;return 3===c.nodeType?c.parentNode:c},v=function(a,b){return function(c){if(a.dragging&&j(b,u(b.selection),a.element)){var d=k(a.element),e=b.fire("drop",{targetClone:d,clientX:c.clientX,clientY:c.clientY});e.isDefaultPrevented()||(d=e.targetClone,b.undoManager.transact(function(){o(a.element),b.insertContent(b.dom.getOuterHTML(d)),b._selectionOverrides.hideFakeCaret()}))}x(a)}},w=function(a,b){return function(){x(a),a.dragging&&b.fire("dragend")}},x=function(a){a.dragging=!1,a.element=null,o(a.ghost)},y=function(a){var b,c,d,f,g,h,i={};b=e.DOM,h=document,c=s(i,a),d=t(i,a),f=v(i,a),g=w(i,a),a.on("mousedown",c),a.on("mousemove",d),a.on("mouseup",f),b.bind(h,"mousemove",d),b.bind(h,"mouseup",g),a.on("remove",function(){b.unbind(h,"mousemove",d),b.unbind(h,"mouseup",g)})},z=function(a){a.on("drop",function(b){var c="undefined"!=typeof b.clientX?a.getDoc().elementFromPoint(b.clientX,b.clientY):null;(g(c)||g(a.dom.getContentEditableParent(c)))&&b.preventDefault()})},A=function(a){y(a),z(a)};return{init:A}});g("65",["1k","1n","59","4d","6o","6p","1j","6q","6","3y","6r","1g","5","1s","p"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(g){function n(a){return g.dom.hasClass(a,"mce-offscreen-selection")}function p(){var a=g.dom.get(M);return a?a.getElementsByTagName("*")[0]:a}function u(a){return g.dom.isBlock(a)}function v(a){a&&g.selection.setRng(a)}function w(){return g.selection.getRng()}function x(a,b){g.selection.scrollIntoView(a,b)}function y(a,b,c){var d;return d=g.fire("ShowCaret",{target:b,direction:a,before:c}),d.isDefaultPrevented()?null:(x(b,a===-1),L.show(c,b))}function z(a,d){return d=c.normalizeRange(a,K,d),a==-1?b.fromRangeStart(d):b.fromRangeEnd(d)}function A(b){b.hasAttribute("data-mce-caret")&&(a.showCaretContainerBlock(b),v(w()),x(b[0]))}function B(){function a(a){for(var b=g.getBody();a&&a!=b;){if(q(a)||r(a))return a;a=a.parentNode}return null}function c(a,b,c){return!c.collapsed&&l.reduce(c.getClientRects(),function(c,d){return c||j.containsXY(d,a,b)},!1)}function e(b){var c=!1;b.on("touchstart",function(){c=!1}),b.on("touchmove",function(){c=!0}),b.on("touchend",function(d){var e=a(d.target);r(e)&&(c||(d.preventDefault(),F(k.selectNode(b,e))))})}g.on("mouseup",function(){var a=w();a.collapsed&&v(k.renderCaretAtRange(g,a))}),g.on("click",function(b){var c;c=a(b.target),c&&(r(c)&&(b.preventDefault(),g.focus()),q(c)&&g.dom.isChildOf(c,g.selection.getNode())&&G())}),g.on("blur NewBlock",function(){G(),I()});var u=function(a){var c=new d(a);if(!a.firstChild)return!1;var e=b.before(a.firstChild),f=c.next(e);return f&&!t(f)&&!s(f)},x=function(a,b){var c=g.dom.getParent(a,g.dom.isBlock),d=g.dom.getParent(b,g.dom.isBlock);return c===d},z=function(a,b){var c=g.dom.getParent(a,g.dom.isBlock),d=g.dom.getParent(b,g.dom.isBlock);return c&&!x(c,d)&&u(c)};e(g),g.on("mousedown",function(b){var d;if(d=a(b.target))r(d)?(b.preventDefault(),F(k.selectNode(g,d))):(G(),q(d)&&b.shiftKey||c(b.clientX,b.clientY,g.selection.getRng())||g.selection.placeCaretAt(b.clientX,b.clientY));else{G(),I();var e=f.closestCaret(K,b.clientX,b.clientY);e&&(z(b.target,e.node)||(b.preventDefault(),g.getBody().focus(),v(y(1,e.node,e.before))))}}),g.on("keypress",function(a){if(!o.modifierPressed(a))switch(a.keyCode){default:r(g.selection.getNode())&&a.preventDefault()}}),g.on("getSelectionRange",function(a){var b=a.range;if(J){if(!J.parentNode)return void(J=null);b=b.cloneRange(),b.selectNode(J),a.range=b}}),g.on("setSelectionRange",function(a){var b;b=F(a.range,a.forward),b&&(a.range=b)}),g.on("AfterSetSelectionRange",function(a){var b=a.range;E(b)||I(),n(b.startContainer.parentNode)||G()}),g.on("focus",function(){m.setEditorTimeout(g,function(){g.selection.setRng(k.renderRangeCaret(g,g.selection.getRng()))},0)}),g.on("copy",function(a){var b=a.clipboardData;if(!a.isDefaultPrevented()&&a.clipboardData&&!i.ie){var c=p();c&&(a.preventDefault(),b.clearData(),b.setData("text/html",c.outerHTML),b.setData("text/plain",c.outerText))}}),h.init(g)}function C(){var a=g.contentStyles,b=".mce-content-body";a.push(L.getCss()),a.push(b+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+b+" *[contentEditable=false] {cursor: default;}"+b+" *[contentEditable=true] {cursor: text;}")}function D(b){return a.isCaretContainer(b)||a.startsWithCaretContainer(b)||a.endsWithCaretContainer(b)}function E(a){return D(a.startContainer)||D(a.endContainer)}function F(a,b){var c,d,e,f,h,j,k,l,m,n,o=g.$,p=g.dom;if(!a)return null;if(a.collapsed){if(!E(a))if(b===!1){if(l=z(-1,a),r(l.getNode(!0)))return y(-1,l.getNode(!0),!1);if(r(l.getNode()))return y(-1,l.getNode(),!l.isAtEnd())}else{if(l=z(1,a),r(l.getNode()))return y(1,l.getNode(),!l.isAtEnd());if(r(l.getNode(!0)))return y(1,l.getNode(!0),!1)}return null}return f=a.startContainer,h=a.startOffset,j=a.endOffset,3==f.nodeType&&0==h&&r(f.parentNode)&&(f=f.parentNode,h=p.nodeIndex(f),f=f.parentNode),1!=f.nodeType?null:(j==h+1&&(c=f.childNodes[h]),r(c)?(m=n=c.cloneNode(!0),k=g.fire("ObjectSelected",{target:c,targetClone:m}),k.isDefaultPrevented()?null:(m=k.targetClone,d=o("#"+M),0===d.length&&(d=o('
                              ').attr("id",M),d.appendTo(g.getBody())),a=g.dom.createRng(),m===n&&i.ie?(d.empty().append('

                              \xa0

                              ').append(m),a.setStartAfter(d[0].firstChild.firstChild),a.setEndAfter(m)):(d.empty().append("\xa0").append(m).append("\xa0"),a.setStart(d[0].firstChild,1),a.setEnd(d[0].lastChild,0)),d.css({top:p.getPos(c,g.getBody()).y}),d[0].focus(),e=g.selection.getSel(),e.removeAllRanges(),e.addRange(a),g.$("*[data-mce-selected]").removeAttr("data-mce-selected"),c.setAttribute("data-mce-selected",1),J=c,I(),a)):null)}function G(){J&&(J.removeAttribute("data-mce-selected"),g.$("#"+M).remove(),J=null)}function H(){L.destroy(),J=null}function I(){L.hide()}var J,K=g.getBody(),L=new e(g.getBody(),u),M="sel-"+g.dom.uniqueId();return i.ceFalse&&(B(),C()),{showCaret:y,showBlockCaretContainer:A,hideFakeCaret:I,destroy:H}}var q=g.isContentEditableTrue,r=g.isContentEditableFalse,s=c.isAfterContentEditableFalse,t=c.isBeforeContentEditableFalse;return p});g("6s",["e"],function(a){function b(b,c,d){for(var e=[];c&&c!=b;c=c.parentNode)e.push(a.nodeIndex(c,d));return e}function c(a,b){var c,d,e;for(d=a,c=b.length-1;c>=0;c--){if(e=d.childNodes,b[c]>e.length-1)return null;d=e[b[c]]}return d}return{create:b,resolve:c}}),g("66",["p","h","c","6s","i","d","6","9","5","1k","1n","4d"],function(a,b,c,d,e,f,g,h,i,j,k,l){return function(c){function d(a,b){try{c.getDoc().execCommand(a,!1,b)}catch(a){}}function m(){var a=c.getDoc().documentMode;return a?a:6}function n(a){return a.isDefaultPrevented()}function o(a){var b,d;a.dataTransfer&&(c.selection.isCollapsed()&&"IMG"==a.target.tagName&&_.select(a.target),b=c.selection.getContent(),b.length>0&&(d=ga+escape(c.id)+","+escape(b),a.dataTransfer.setData(ha,d)))}function p(a){var b;return a.dataTransfer&&(b=a.dataTransfer.getData(ha),b&&b.indexOf(ga)>=0)?(b=b.substr(ga.length).split(","),{id:unescape(b[0]),html:unescape(b[1])}):null}function q(a,b){c.queryCommandSupported("mceInsertClipboardContent")?c.execCommand("mceInsertClipboardContent",!1,{content:a,internal:b}):c.execCommand("mceInsertContent",!1,a)}function r(){function a(a){var b=$.create("body"),c=a.cloneContents();return b.appendChild(c),_.serializer.serialize(b,{format:"html"})}function d(d){if(!d.setStart){if(d.item)return!1;var e=d.duplicate();return e.moveToElementText(c.getBody()),b.compareRanges(d,e)}var f=a(d),g=$.createRng();g.selectNode(c.getBody());var h=a(g);return f===h}c.on("keydown",function(a){var b,e,f=a.keyCode;if(!n(a)&&(f==Z||f==Y)){if(b=c.selection.isCollapsed(),e=c.getBody(),b&&!$.isEmpty(e))return;if(!b&&!d(c.selection.getRng()))return;a.preventDefault(),c.setContent(""),e.firstChild&&$.isBlock(e.firstChild)?c.selection.setCursorLocation(e.firstChild,0):c.selection.setCursorLocation(e,0),c.nodeChanged()}})}function s(){c.shortcuts.add("meta+a",null,"SelectAll")}function t(){c.settings.content_editable||$.bind(c.getDoc(),"mousedown mouseup",function(a){var b;if(a.target==c.getDoc().documentElement)if(b=_.getRng(),c.getBody().focus(),"mousedown"==a.type){if(j.isCaretContainer(b.startContainer))return;_.placeCaretAt(a.clientX,a.clientY)}else _.setRng(b)})}function u(){c.on("keydown",function(a){if(!n(a)&&a.keyCode===Y){if(!c.getBody().getElementsByTagName("hr").length)return;if(_.isCollapsed()&&0===_.getRng(!0).startOffset){var b=_.getNode(),d=b.previousSibling;if("HR"==b.nodeName)return $.remove(b),void a.preventDefault();d&&d.nodeName&&"hr"===d.nodeName.toLowerCase()&&($.remove(d),a.preventDefault())}}})}function v(){window.Range.prototype.getClientRects||c.on("mousedown",function(a){ +if(!n(a)&&"HTML"===a.target.nodeName){var b=c.getBody();b.blur(),i.setEditorTimeout(c,function(){b.focus()})}})}function w(){c.on("click",function(a){var b=a.target;/^(IMG|HR)$/.test(b.nodeName)&&"false"!==$.getContentEditableParent(b)&&(a.preventDefault(),c.selection.select(b),c.nodeChanged()),"A"==b.nodeName&&$.hasClass(b,"mce-item-anchor")&&(a.preventDefault(),_.select(b))})}function x(){function a(){var a=$.getAttribs(_.getStart().cloneNode(!1));return function(){var b=_.getStart();b!==c.getBody()&&($.setAttrib(b,"style",null),X(a,function(a){b.setAttributeNode(a.cloneNode(!0))}))}}function b(){return!_.isCollapsed()&&$.getParent(_.getStart(),$.isBlock)!=$.getParent(_.getEnd(),$.isBlock)}c.on("keypress",function(d){var e;if(!n(d)&&(8==d.keyCode||46==d.keyCode)&&b())return e=a(),c.getDoc().execCommand("delete",!1,null),e(),d.preventDefault(),!1}),$.bind(c.getDoc(),"cut",function(d){var e;!n(d)&&b()&&(e=a(),i.setEditorTimeout(c,function(){e()}))})}function y(){document.body.setAttribute("role","application")}function z(){c.on("keydown",function(a){if(!n(a)&&a.keyCode===Y&&_.isCollapsed()&&0===_.getRng(!0).startOffset){var b=_.getNode().previousSibling;if(b&&b.nodeName&&"table"===b.nodeName.toLowerCase())return a.preventDefault(),!1}})}function A(){m()>7||(d("RespectVisibilityInDesign",!0),c.contentStyles.push(".mceHideBrInPre pre br {display: none}"),$.addClass(c.getBody(),"mceHideBrInPre"),ba.addNodeFilter("pre",function(a){for(var b,c,d,f,g=a.length;g--;)for(b=a[g].getAll("br"),c=b.length;c--;)d=b[c],f=d.prev,f&&3===f.type&&"\n"!=f.value.charAt(f.value-1)?f.value+="\n":d.parent.insert(new e("#text",3),d,!0).value="\n"}),ca.addNodeFilter("pre",function(a){for(var b,c,d,e,f=a.length;f--;)for(b=a[f].getAll("br"),c=b.length;c--;)d=b[c],e=d.prev,e&&3==e.type&&(e.value=e.value.replace(/\r?\n$/,""))}))}function B(){$.bind(c.getBody(),"mouseup",function(){var a,b=_.getNode();"IMG"==b.nodeName&&((a=$.getStyle(b,"width"))&&($.setAttrib(b,"width",a.replace(/[^0-9%]+/g,"")),$.setStyle(b,"width","")),(a=$.getStyle(b,"height"))&&($.setAttrib(b,"height",a.replace(/[^0-9%]+/g,"")),$.setStyle(b,"height","")))})}function C(){c.on("keydown",function(b){var d,e,f,g,h;if(!n(b)&&b.keyCode==a.BACKSPACE&&(d=_.getRng(),e=d.startContainer,f=d.startOffset,g=$.getRoot(),h=e,d.collapsed&&0===f)){for(;h&&h.parentNode&&h.parentNode.firstChild==h&&h.parentNode!=g;)h=h.parentNode;"BLOCKQUOTE"===h.tagName&&(c.formatter.toggle("blockquote",null,h),d=$.createRng(),d.setStart(e,0),d.setEnd(e,0),_.setRng(d))}})}function D(){function a(){U(),d("StyleWithCSS",!1),d("enableInlineTableEditing",!1),aa.object_resizing||d("enableObjectResizing",!1)}aa.readonly||c.on("BeforeExecCommand MouseDown",a)}function E(){function a(){X($.select("a"),function(a){var b=a.parentNode,c=$.getRoot();if(b.lastChild===a){for(;b&&!$.isBlock(b);){if(b.parentNode.lastChild!==b||b===c)return;b=b.parentNode}$.add(b,"br",{"data-mce-bogus":1})}})}c.on("SetContent ExecCommand",function(b){"setcontent"!=b.type&&"mceInsertLink"!==b.command||a()})}function F(){aa.forced_root_block&&c.on("init",function(){d("DefaultParagraphSeparator",aa.forced_root_block)})}function G(){c.on("keydown",function(a){var b;n(a)||a.keyCode!=Y||(b=c.getDoc().selection.createRange(),b&&b.item&&(a.preventDefault(),c.undoManager.beforeChange(),$.remove(b.item(0)),c.undoManager.add()))})}function H(){var a;m()>=10&&(a="",X("p div h1 h2 h3 h4 h5 h6".split(" "),function(b,c){a+=(c>0?",":"")+b+":empty"}),c.contentStyles.push(a+"{padding-right: 1px !important}"))}function I(){m()<9&&(ba.addNodeFilter("noscript",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.firstChild,c&&b.attr("data-mce-innertext",c.value)}),ca.addNodeFilter("noscript",function(a){for(var b,c,d,g=a.length;g--;)b=a[g],c=a[g].firstChild,c?c.value=f.decode(c.value):(d=b.attributes.map["data-mce-innertext"],d&&(b.attr("data-mce-innertext",null),c=new e("#text",3),c.value=d,c.raw=!0,b.append(c)))}))}function J(){function a(a,b){var c=h.createTextRange();try{c.moveToPoint(a,b)}catch(a){c=null}return c}function b(b){var d;b.button?(d=a(b.x,b.y),d&&(d.compareEndPoints("StartToStart",e)>0?d.setEndPoint("StartToStart",e):d.setEndPoint("EndToEnd",e),d.select())):c()}function c(){var a=g.selection.createRange();e&&!a.item&&0===a.compareEndPoints("StartToEnd",a)&&e.select(),$.unbind(g,"mouseup",c),$.unbind(g,"mousemove",b),e=d=0}var d,e,f,g=$.doc,h=g.body;g.documentElement.unselectable=!0,$.bind(g,"mousedown contextmenu",function(h){if("HTML"===h.target.nodeName){if(d&&c(),f=g.documentElement,f.scrollHeight>f.clientHeight)return;d=1,e=a(h.x,h.y),e&&($.bind(g,"mouseup",c),$.bind(g,"mousemove",b),$.getRoot().focus(),e.select())}})}function K(){c.on("keyup focusin mouseup",function(b){65==b.keyCode&&a.metaKeyPressed(b)||_.normalize()},!0)}function L(){c.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function M(){c.inline||c.on("keydown",function(){document.activeElement==document.body&&c.getWin().focus()})}function N(){c.inline||(c.contentStyles.push("body {min-height: 150px}"),c.on("click",function(a){var b;if("HTML"==a.target.nodeName){if(g.ie>11)return void c.getBody().focus();b=c.selection.getRng(),c.getBody().focus(),c.selection.setRng(b),c.selection.normalize(),c.nodeChanged()}}))}function O(){g.mac&&c.on("keydown",function(b){!a.metaKeyPressed(b)||b.shiftKey||37!=b.keyCode&&39!=b.keyCode||(b.preventDefault(),c.selection.getSel().modify("move",37==b.keyCode?"backward":"forward","lineboundary"))})}function P(){d("AutoUrlDetect",!1)}function Q(){c.on("click",function(a){var b=a.target;do if("A"===b.tagName)return void a.preventDefault();while(b=b.parentNode)}),c.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function R(){c.on("init",function(){c.dom.bind(c.getBody(),"submit",function(a){a.preventDefault()})})}function S(){ba.addNodeFilter("br",function(a){for(var b=a.length;b--;)"Apple-interchange-newline"==a[b].attr("class")&&a[b].remove()})}function T(){c.on("dragstart",function(a){o(a)}),c.on("drop",function(a){if(!n(a)){var d=p(a);if(d&&d.id!=c.id){a.preventDefault();var e=b.getCaretRangeFromPoint(a.x,a.y,c.getDoc());_.setRng(e),q(d.html,!0)}}})}function U(){}function V(){var a;return!da||c.removed?0:(a=c.selection.getSel(),!a||!a.rangeCount||0===a.rangeCount)}function W(){function b(a){var b=new l(a.getBody()),c=a.selection.getRng(),d=k.fromRangeStart(c),e=k.fromRangeEnd(c),f=b.prev(d),g=b.next(e);return!a.selection.isCollapsed()&&(!f||f.isAtStart()&&d.isEqual(f))&&(!g||g.isAtEnd()&&d.isEqual(g))}c.on("keypress",function(d){!n(d)&&!_.isCollapsed()&&d.charCode>31&&!a.metaKeyPressed(d)&&b(c)&&(d.preventDefault(),c.setContent(String.fromCharCode(d.charCode)),c.selection.select(c.getBody(),!0),c.selection.collapse(!1),c.nodeChanged())}),c.on("keydown",function(a){var d=a.keyCode;n(a)||d!=Z&&d!=Y||b(c)&&(a.preventDefault(),c.setContent(""),c.nodeChanged())})}var X=h.each,Y=a.BACKSPACE,Z=a.DELETE,$=c.dom,_=c.selection,aa=c.settings,ba=c.parser,ca=c.serializer,da=g.gecko,ea=g.ie,fa=g.webkit,ga="data:text/mce-internal,",ha=ea?"Text":"URL";return C(),r(),g.windowsPhone||K(),fa&&(W(),t(),w(),F(),R(),z(),S(),g.iOS?(M(),N(),Q()):s()),ea&&g.ie<11&&(u(),y(),A(),B(),G(),H(),I(),J()),g.ie>=11&&(N(),z()),g.ie&&(s(),P(),T()),da&&(W(),u(),v(),x(),D(),E(),L(),O(),z()),{refreshContentEditable:U,isHidden:V}}}),g("5i",["1y","4k","60","e","s","o","61","26","62","t","l","i","j","63","64","65","u","5","66","9"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){var u=d.DOM,v=function(a){var b=new k(a.settings,a.schema);return b.addAttributeFilter("src,href,style,tabindex",function(b,c){for(var d,e,f,g=b.length,h=a.dom;g--;)if(d=b[g],e=d.attr(c),f="data-mce-"+c,!d.attributes.map[f]){if(0===e.indexOf("data:")||0===e.indexOf("blob:"))continue;"style"===c?(e=h.serializeStyle(h.parseStyle(e),d.name),e.length||(e=null),d.attr(f,e),d.attr(c,e)):"tabindex"===c?(d.attr(f,e),d.attr(c,null)):d.attr(f,a.convertURL(e,c,d.name))}}),b.addNodeFilter("script",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("type")||"no/type",0!==c.indexOf("mce-")&&b.attr("type","mce-"+c)}),b.addNodeFilter("#cdata",function(a){for(var b,c=a.length;c--;)b=a[c],b.type=8,b.name="#comment",b.value="[CDATA["+b.value+"]]"}),b.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(b){for(var c,d=b.length,e=a.schema.getNonEmptyElements();d--;)c=b[d],c.isEmpty(e)&&0===c.getAll("br").length&&(c.append(new l("br",1)).shortEnded=!0)}),b},w=function(a){a.settings.auto_focus&&r.setEditorTimeout(a,function(){var b;b=a.settings.auto_focus===!0?a:a.editorManager.get(a.settings.auto_focus),b.destroyed||b.focus()},100)},x=function(a){a.bindPendingEventDelegates(),a.initialized=!0,a.fire("init"),a.focus(!0),a.nodeChanged({initial:!0}),a.execCallback("init_instance_callback",a),w(a)},y=function(k,l){var r,w,y=k.settings,z=k.getElement(),A=k.getDoc();y.inline||(k.getElement().style.visibility=k.orgVisibility),l||y.content_editable||(A.open(),A.write(k.iframeHTML),A.close()),y.content_editable&&(k.on("remove",function(){var a=this.getBody();u.removeClass(a,"mce-content-body"),u.removeClass(a,"mce-edit-focus"),u.setAttrib(a,"contentEditable",null)}),u.addClass(z,"mce-content-body"),k.contentDocument=A=y.content_document||a,k.contentWindow=y.content_window||b,k.bodyElement=z,y.content_document=y.content_window=null,y.root_name=z.nodeName.toLowerCase()),r=k.getBody(),r.disabled=!0,k.readonly=y.readonly,k.readonly||(k.inline&&"static"===u.getStyle(r,"position",!0)&&(r.style.position="relative"),r.contentEditable=k.getParam("content_editable_state",!0)),r.disabled=!1,k.editorUpload=new g(k),k.schema=new m(y),k.dom=new d(A,{keep_values:!0,url_converter:k.convertURL,url_converter_scope:k,hex_colors:y.force_hex_style_colors,class_filter:y.class_filter,update_styles:!0,root_element:k.inline?k.getBody():null,collect:y.content_editable,schema:k.schema,onSetAttrib:function(a){k.fire("SetAttrib",a)}}),k.parser=v(k),k.serializer=new f(y,k),k.selection=new e(k.dom,k.getWin(),k.serializer,k),k.formatter=new j(k),k.undoManager=new q(k),k._nodeChangeDispatcher=new o(k),k._selectionOverrides=new p(k),c.setup(k),n.setup(k),i.setup(k),k.fire("PreInit"),y.browser_spellcheck||y.gecko_spellcheck||(A.body.spellcheck=!1,u.setAttrib(r,"spellcheck","false")),k.quirks=new s(k),k.fire("PostRender"),y.directionality&&(r.dir=y.directionality),y.nowrap&&(r.style.whiteSpace="nowrap"),y.protect&&k.on("BeforeSetContent",function(a){t.each(y.protect,function(b){a.content=a.content.replace(b,function(a){return""})})}),k.on("SetContent",function(){k.addVisual(k.getBody())}),y.padd_empty_editor&&k.on("PostProcess",function(a){a.content=a.content.replace(/^(]*>( | |\s|\u00a0|
                              |)<\/p>[\r\n]*|
                              [\r\n]*)$/,"")}),k.load({initial:!0,format:"html"}),k.startContent=k.getContent({format:"raw"}),k.on("compositionstart compositionend",function(a){k.composing="compositionstart"===a.type}),k.contentStyles.length>0&&(w="",t.each(k.contentStyles,function(a){w+=a+"\r\n"}),k.dom.addStyle(w)),k.dom.styleSheetLoader.loadAll(k.contentCSS,function(a){x(k)},function(a){x(k),h.contentCssError(k,a)})};return{initContentBody:y}}),g("4m",["g"],function(a){return a.PluginManager}),g("4n",["g"],function(a){return a.ThemeManager}),g("4l",["1y","4k","e","6","5i","4m","4n","9","25"],function(a,b,c,d,e,f,g,h,i){var j=c.DOM,k=function(a,b,c){var d,e,g=f.get(c);if(d=f.urls[c]||a.documentBaseUrl.replace(/\/$/,""),c=h.trim(c),g&&h.inArray(b,c)===-1){if(h.each(f.dependencies(c),function(c){k(a,b,c)}),a.plugins[c])return;e=new g(a,d,a.$),a.plugins[c]=e,e.init&&(e.init(a,d),b.push(c))}},l=function(a){var b=[];h.each(a.settings.plugins.replace(/\-/g,"").split(/[ ,]/),function(c){k(a,b,c)})},m=function(a){var b,c=a.settings;c.theme&&("function"!=typeof c.theme?(c.theme=c.theme.replace(/-/,""),b=g.get(c.theme),a.theme=new b(a,g.urls[c.theme]),a.theme.init&&a.theme.init(a,g.urls[c.theme]||a.documentBaseUrl.replace(/\/$/,""),a.$)):a.theme=c.theme)},n=function(a){var b,c,d,e,f,g=a.settings,h=a.getElement();return g.render_ui&&a.theme&&(a.orgDisplay=h.style.display,"function"!=typeof g.theme?(b=g.width||j.getStyle(h,"width")||"100%",c=g.height||j.getStyle(h,"height")||h.offsetHeight,d=g.min_height||100,e=/^[0-9\.]+(|px)$/i,e.test(""+b)&&(b=Math.max(parseInt(b,10),100)),e.test(""+c)&&(c=Math.max(parseInt(c,10),d)),f=a.theme.renderUI({targetNode:h,width:b,height:c,deltaWidth:g.delta_width,deltaHeight:g.delta_height}),g.content_editable||(c=(f.iframeHeight||c)+("number"==typeof c?f.deltaHeight||0:""),c",f.document_base_url!=a.documentBaseUrl&&(a.iframeHTML+=''),!d.caretAfter&&f.ie7_compat&&(a.iframeHTML+=''),a.iframeHTML+='',c=f.body_id||"tinymce",c.indexOf("=")!=-1&&(c=a.getParam("body_id","","hash"),c=c[a.id]||c),e=f.body_class||"",e.indexOf("=")!=-1&&(e=a.getParam("body_class","","hash"),e=e[a.id]||""),f.content_security_policy&&(a.iframeHTML+=''),a.iframeHTML+='
                              ';var g=j.create("iframe",{id:a.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:a.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:b.height,display:"block"}});g.onload=function(){g.onload=null,a.fire("load")};var h=o(a,g);return a.contentAreaContainer=b.iframeContainer,a.iframeElement=g,j.add(b.iframeContainer,g),h},q=function(a){var b,c=a.settings,d=a.getElement();if(a.rtl=c.rtl_ui||a.editorManager.i18n.rtl,a.editorManager.i18n.setCode(c.language),c.aria_label=c.aria_label||j.getAttrib(d,"aria-label",a.getLang("aria.rich_text_area")),a.fire("ScriptsLoaded"),m(a),l(a),b=n(a),c.content_css&&h.each(h.explode(c.content_css),function(b){a.contentCSS.push(a.documentBaseURI.toAbsolute(b))}),c.content_style&&a.contentStyles.push(c.content_style),c.content_editable)return e.initContentBody(a);var f=p(a,b);b.editorContainer&&(j.get(b.editorContainer).style.display=a.orgDisplay,a.hidden=j.isHidden(b.editorContainer)),a.getElement().style.display="none",j.setAttrib(a.id,"aria-hidden",!0),f||e.initContentBody(a)};return{init:q}}),g("22",["4k","e","7","f","6","26","4l","11","4m","4n","9","10"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=b.DOM,n=function(a,b){var c=a.settings,e=d.ScriptLoader;if(c.language&&"en"!=c.language&&!c.language_url&&(c.language_url=a.editorManager.baseURL+"/langs/"+c.language+".js"),c.language_url&&e.add(c.language_url),c.theme&&"function"!=typeof c.theme&&"-"!=c.theme.charAt(0)&&!j.urls[c.theme]){var h=c.theme_url;h=h?a.documentBaseURI.toAbsolute(h):"themes/"+c.theme+"/theme"+b+".js",j.load(c.theme,h)}k.isArray(c.plugins)&&(c.plugins=c.plugins.join(" ")),k.each(c.external_plugins,function(a,b){i.load(b,a),c.plugins+=" "+b}),k.each(c.plugins.split(/[ ,]/),function(a){if(a=k.trim(a),a&&!i.urls[a])if("-"===a.charAt(0)){a=a.substr(1,a.length);var c=i.dependencies(a);k.each(c,function(a){var c={prefix:"plugins/",resource:a,suffix:"/plugin"+b+".js"};a=i.createUrl(c,a),i.load(a.resource,a)})}else i.load(a,{prefix:"plugins/",resource:a,suffix:"/plugin"+b+".js"})}),e.loadQueue(function(){a.removed||g.init(a)},a,function(b){f.pluginLoadError(a,b[0]),a.removed||g.init(a)})},o=function(b){function d(){m.unbind(a,"ready",d),b.render()}var f=b.settings,g=b.id;if(!c.Event.domLoaded)return void m.bind(a,"ready",d);if(b.getElement()&&e.contentEditable){f.inline?b.inline=!0:(b.orgVisibility=b.getElement().style.visibility,b.getElement().style.visibility="hidden");var i=b.getElement().form||m.getParent(g,"form");i&&(b.formElement=i,f.hidden_input&&!/TEXTAREA|INPUT/i.test(b.getElement().nodeName)&&(m.insertAfter(m.create("input",{type:"hidden",name:g}),g),b.hasHiddenInput=!0),b.formEventDelegate=function(a){b.fire(a.type,a)},m.bind(i,"submit reset",b.formEventDelegate),b.on("reset",function(){b.setContent(b.startContent,{format:"raw"})}),!f.submit_patch||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return b.editorManager.triggerSave(),b.setDirty(!1),i._mceOldSubmit(i)})),b.windowManager=new l(b),b.notificationManager=new h(b),"xml"===f.encoding&&b.on("GetContent",function(a){a.save&&(a.content=m.encode(a.content))}),f.add_form_submit_trigger&&b.on("submit",function(){b.initialized&&b.save()}),f.add_unload_trigger&&(b._beforeUnload=function(){!b.initialized||b.destroyed||b.isHidden()||b.save({format:"raw",no_events:!0,set_dirty:!1})},b.editorManager.on("BeforeUnload",b._beforeUnload)),b.editorManager.add(b),n(b,b.suffix)}};return{render:o}}),g("23",[],function(){function a(a,b,c){try{a.getDoc().execCommand(b,!1,c)}catch(a){}}function b(a){var b,c;return b=a.getBody(),c=function(b){a.dom.getParents(b.target,"a").length>0&&b.preventDefault()},a.dom.bind(b,"click",c),{unbind:function(){a.dom.unbind(b,"click",c)}}}function c(c,d){c._clickBlocker&&(c._clickBlocker.unbind(),c._clickBlocker=null),d?(c._clickBlocker=b(c),c.selection.controlSelection.hideResizeRect(),c.readonly=!0,c.getBody().contentEditable=!1):(c.readonly=!1,c.getBody().contentEditable=!0,a(c,"StyleWithCSS",!1),a(c,"enableInlineTableEditing",!1),a(c,"enableObjectResizing",!1),c.focus(),c.nodeChanged())}function d(a,b){var d=a.readonly?"readonly":"design";b!=d&&(a.initialized?c(a,"readonly"==b):a.on("init",function(){c(a,"readonly"==b)}),a.fire("SwitchMode",{mode:b}))}return{setMode:d}}),g("24",[],function(){var a=function(a,b,c){var d=a.sidebars?a.sidebars:[];d.push({name:b,settings:c}),a.sidebars=d};return{add:a}}),g("14",["g","a","e","v","12","6","n","22","23","13","24","9","w","25"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){function o(c,e,g){var h,i,k,l=this;h=l.documentBaseUrl=g.documentBaseURL,i=g.baseURI,k=g.defaultSettings,e=q({id:c,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:h,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:l.convertURL,url_converter_scope:l,ie7_compat:!0},k,e),k&&k.external_plugins&&e.external_plugins&&(e.external_plugins=q({},k.external_plugins,e.external_plugins)),l.settings=e,a.language=e.language||"en",a.languageLoad=e.language_load,a.baseURL=g.baseURL,l.id=e.id=c,l.setDirty(!1),l.plugins={},l.documentBaseURI=new m(e.document_base_url||h,{base_uri:i}),l.baseURI=i,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new j(l),l.loadedCSS={},l.editorCommands=new d(l),l.suffix=g.suffix,l.editorManager=g,l.inline=e.inline,l.settings.content_editable=l.inline,e.cache_suffix&&(f.cacheSuffix=e.cache_suffix.replace(/^[\?\&]+/,"")),e.override_viewport===!1&&(f.overrideViewPort=!1),g.fire("SetupEditor",l),l.execCallback("setup",l),l.$=b.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})}var p=c.DOM,q=l.extend,r=l.each,s=l.trim,t=l.resolve,u=f.gecko,v=f.ie;return o.prototype={render:function(){h.render(this)},focus:function(a){function b(a){return g.dom.getParent(a,function(a){return"true"===g.dom.getContentEditable(a)})}var c,d,e,g=this,h=g.selection,i=g.settings.content_editable,j=g.getDoc(),k=g.getBody();if(!g.removed){if(!a){if(c=h.getRng(),c.item&&(d=c.item(0)),g.quirks.refreshContentEditable(),e=b(h.getNode()),g.$.contains(k,e))return e.focus(),h.normalize(),void g.editorManager.setActive(g);if(i||(f.opera||g.getBody().focus(),g.getWin().focus()),u||i){if(k.setActive)try{k.setActive()}catch(a){k.focus()}else k.focus();i&&h.normalize()}d&&d.ownerDocument==j&&(c=j.body.createControlRange(),c.addElement(d),c.select())}g.editorManager.setActive(g)}},execCallback:function(a){var b,c=this,d=c.settings[a];if(d)return c.callbackLookup&&(b=c.callbackLookup[a])&&(d=b.func,b=b.scope),"string"==typeof d&&(b=d.replace(/\.\w+$/,""),b=b?t(b):0,d=t(d),c.callbackLookup=c.callbackLookup||{},c.callbackLookup[a]={func:d,scope:b}),d.apply(b||c,Array.prototype.slice.call(arguments,1))},translate:function(a){var b=this.settings.language||"en",c=this.editorManager.i18n;return a?(a=c.data[b+"."+a]||a.replace(/\{\#([^\}]+)\}/g,function(a,d){return c.data[b+"."+d]||"{#"+d+"}"}),this.editorManager.translate(a)):""},getLang:function(a,b){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+a]||(void 0!==b?b:"{#"+a+"}")},getParam:function(a,b,c){var d,e=a in this.settings?this.settings[a]:b;return"hash"===c?(d={},"string"==typeof e?r(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),function(a){a=a.split("="),a.length>1?d[s(a[0])]=s(a[1]):d[s(a[0])]=s(a)}):d=e,d):e},nodeChanged:function(a){this._nodeChangeDispatcher.nodeChanged(a)},addButton:function(a,b){var c=this;b.cmd&&(b.onclick=function(){c.execCommand(b.cmd)}),b.text||b.icon||(b.icon=a),c.buttons=c.buttons||{},b.tooltip=b.tooltip||b.title,c.buttons[a]=b},addSidebar:function(a,b){return k.add(this,a,b)},addMenuItem:function(a,b){var c=this;b.cmd&&(b.onclick=function(){c.execCommand(b.cmd)}),c.menuItems=c.menuItems||{},c.menuItems[a]=b},addContextToolbar:function(a,b){var c,d=this;d.contextToolbars=d.contextToolbars||[],"string"==typeof a&&(c=a,a=function(a){return d.dom.is(a,c)}),d.contextToolbars.push({id:n.uuid("mcet"),predicate:a,items:b})},addCommand:function(a,b,c){this.editorCommands.addCommand(a,b,c)},addQueryStateHandler:function(a,b,c){this.editorCommands.addQueryStateHandler(a,b,c)},addQueryValueHandler:function(a,b,c){this.editorCommands.addQueryValueHandler(a,b,c)},addShortcut:function(a,b,c,d){this.shortcuts.add(a,b,c,d)},execCommand:function(a,b,c,d){return this.editorCommands.execCommand(a,b,c,d)},queryCommandState:function(a){return this.editorCommands.queryCommandState(a)},queryCommandValue:function(a){return this.editorCommands.queryCommandValue(a)},queryCommandSupported:function(a){return this.editorCommands.queryCommandSupported(a)},show:function(){var a=this;a.hidden&&(a.hidden=!1,a.inline?a.getBody().contentEditable=!0:(p.show(a.getContainer()),p.hide(a.id)),a.load(),a.fire("show"))},hide:function(){var a=this,b=a.getDoc();a.hidden||(v&&b&&!a.inline&&b.execCommand("SelectAll"),a.save(),a.inline?(a.getBody().contentEditable=!1,a==a.editorManager.focusedEditor&&(a.editorManager.focusedEditor=null)):(p.hide(a.getContainer()),p.setStyle(a.id,"display",a.orgDisplay)),a.hidden=!0,a.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(a,b){this.fire("ProgressState",{state:a,time:b})},load:function(a){var b,c=this,d=c.getElement();return c.removed?"":d?(a=a||{},a.load=!0,b=c.setContent(void 0!==d.value?d.value:d.innerHTML,a),a.element=d,a.no_events||c.fire("LoadContent",a),a.element=d=null,b):void 0},save:function(a){var b,c,d=this,e=d.getElement();if(e&&d.initialized&&!d.removed)return a=a||{},a.save=!0,a.element=e,b=a.content=d.getContent(a),a.no_events||d.fire("SaveContent",a),"raw"==a.format&&d.fire("RawSaveContent",a),b=a.content,/TEXTAREA|INPUT/i.test(e.nodeName)?e.value=b:(d.inline||(e.innerHTML=b),(c=p.getParent(d.id,"form"))&&r(c.elements,function(a){if(a.name==d.id)return a.value=b,!1})),a.element=e=null,a.set_dirty!==!1&&d.setDirty(!1),b},setContent:function(a,b){var c,d,e=this,f=e.getBody();return b=b||{},b.format=b.format||"html",b.set=!0,b.content=a,b.no_events||e.fire("BeforeSetContent",b),a=b.content,0===a.length||/^\s+$/.test(a)?(d=v&&v<11?"":'
                              ',"TABLE"==f.nodeName?a=""+d+"":/^(UL|OL)$/.test(f.nodeName)&&(a="
                            • "+d+"
                            • "),c=e.settings.forced_root_block,c&&e.schema.isValidChild(f.nodeName.toLowerCase(),c.toLowerCase())?(a=d,a=e.dom.createHTML(c,e.settings.forced_root_block_attrs,a)):v||a||(a='
                              '),e.dom.setHTML(f,a),e.fire("SetContent",b)):("raw"!==b.format&&(a=new g({validate:e.validate},e.schema).serialize(e.parser.parse(a,{isRootContent:!0}))),b.content=s(a),e.dom.setHTML(f,b.content),b.no_events||e.fire("SetContent",b)),b.content},getContent:function(a){var b,c=this,d=c.getBody();return c.removed?"":(a=a||{},a.format=a.format||"html",a.get=!0,a.getInner=!0,a.no_events||c.fire("BeforeGetContent",a),b="raw"==a.format?l.trim(c.serializer.getTrimmedContent()):"text"==a.format?d.innerText||d.textContent:c.serializer.serialize(d,a),"text"!=a.format?a.content=s(b):a.content=b,a.no_events||c.fire("GetContent",a),a.content)},insertContent:function(a,b){b&&(a=q({content:a},b)),this.execCommand("mceInsertContent",!1,a)},isDirty:function(){return!this.isNotDirty},setDirty:function(a){var b=!this.isNotDirty;this.isNotDirty=!a,a&&a!=b&&this.fire("dirty")},setMode:function(a){i.setMode(this,a)},getContainer:function(){var a=this;return a.container||(a.container=p.get(a.editorContainer||a.id+"_parent")),a.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=p.get(this.id)),this.targetElm},getWin:function(){var a,b=this;return b.contentWindow||(a=b.iframeElement,a&&(b.contentWindow=a.contentWindow)),b.contentWindow},getDoc:function(){var a,b=this;return b.contentDocument||(a=b.getWin(),a&&(b.contentDocument=a.document)),b.contentDocument},getBody:function(){var a=this.getDoc();return this.bodyElement||(a?a.body:null)},convertURL:function(a,b,c){var d=this,e=d.settings;return e.urlconverter_callback?d.execCallback("urlconverter_callback",a,c,!0,b):!e.convert_urls||c&&"LINK"==c.nodeName||0===a.indexOf("file:")||0===a.length?a:e.relative_urls?d.documentBaseURI.toRelative(a):a=d.documentBaseURI.toAbsolute(a,e.remove_script_host)},addVisual:function(a){var b,c=this,d=c.settings,e=c.dom;a=a||c.getBody(),void 0===c.hasVisual&&(c.hasVisual=d.visual),r(e.select("table,a",a),function(a){var f;switch(a.nodeName){case"TABLE":return b=d.visual_table_class||"mce-item-table",f=e.getAttrib(a,"border"),void(f&&"0"!=f||!c.hasVisual?e.removeClass(a,b):e.addClass(a,b));case"A":return void(e.getAttrib(a,"href",!1)||(f=e.getAttrib(a,"name")||a.id,b=d.visual_anchor_class||"mce-item-anchor",f&&c.hasVisual?e.addClass(a,b):e.removeClass(a,b)))}}),c.fire("VisualAid",{element:a,hasVisual:c.hasVisual})},remove:function(){var a=this;a.removed||(a.save(),a.removed=1,a.unbindAllNativeEvents(),a.hasHiddenInput&&p.remove(a.getElement().nextSibling),a.inline||(v&&v<10&&a.getDoc().execCommand("SelectAll",!1,null),p.setStyle(a.id,"display",a.orgDisplay),a.getBody().onload=null),a.fire("remove"),a.editorManager.remove(a),p.remove(a.getContainer()),a._selectionOverrides.destroy(),a.editorUpload.destroy(),a.destroy())},destroy:function(a){var b,c=this;if(!c.destroyed){if(!a&&!c.removed)return void c.remove();a||(c.editorManager.off("beforeunload",c._beforeUnload),c.theme&&c.theme.destroy&&c.theme.destroy(),c.selection.destroy(),c.dom.destroy()),b=c.formElement,b&&(b._mceOldSubmit&&(b.submit=b._mceOldSubmit,b._mceOldSubmit=null),p.unbind(b,"submit reset",c.formEventDelegate)),c.contentAreaContainer=c.formElement=c.container=c.editorContainer=null,c.bodyElement=c.contentDocument=c.contentWindow=null,c.iframeElement=c.targetElm=null,c.selection&&(c.selection=c.selection.win=c.selection.dom=c.selection.dom.doc=null),c.destroyed=1}},uploadImages:function(a){return this.editorUpload.uploadImages(a)},_scanForImages:function(){return this.editorUpload.scanForImages()}},q(o.prototype,e),o}),g("15",["9"],function(a){"use strict";var b={},c="en";return{setCode:function(a){a&&(c=a,this.rtl=!!this.data[a]&&"rtl"===this.data[a]._dir)},getCode:function(){return c},rtl:!1,add:function(a,c){var d=b[a];d||(b[a]=d={});for(var e in c)d[e]=c[e];this.setCode(a)},translate:function(d){function e(b){return a.is(b,"function")?Object.prototype.toString.call(b):f(b)?"":""+b}function f(b){return""===b||null===b||a.is(b,"undefined")}function g(b){return b=e(b),a.hasOwn(h,b)?e(h[b]):b}var h=b[c]||{};if(f(d))return"";if(a.is(d,"object")&&a.hasOwn(d,"raw"))return e(d.raw);if(a.is(d,"array")){var i=d.slice(1);d=g(d[0]).replace(/\{([0-9]+)\}/g,function(b,c){return a.hasOwn(i,c)?e(i[c]):b})}return g(d).replace(/{context:\w+}$/,"")},data:b}}),g("16",["e","5","6"],function(a,b,c){function d(a){function d(){try{return document.activeElement}catch(a){return document.body}}function j(a,b){if(b&&b.startContainer){if(!a.isChildOf(b.startContainer,a.getRoot())||!a.isChildOf(b.endContainer,a.getRoot()))return;return{startContainer:b.startContainer,startOffset:b.startOffset,endContainer:b.endContainer,endOffset:b.endOffset}}return b}function l(a,b){var c;return b.startContainer?(c=a.getDoc().createRange(),c.setStart(b.startContainer,b.startOffset),c.setEnd(b.endContainer,b.endOffset)):c=b,c}function m(m){var n=m.editor;n.on("init",function(){(n.inline||c.ie)&&("onbeforedeactivate"in document&&c.ie<9?n.dom.bind(n.getBody(),"beforedeactivate",function(a){if(a.target==n.getBody())try{n.lastRng=n.selection.getRng()}catch(a){}}):n.on("nodechange mouseup keyup",function(a){var b=d();"nodechange"==a.type&&a.selectionChange||(b&&b.id==n.id+"_ifr"&&(b=n.getBody()),n.dom.isChildOf(b,n.getBody())&&(n.lastRng=n.selection.getRng()))}),c.webkit&&!e&&(e=function(){var b=a.activeEditor;if(b&&b.selection){var c=b.selection.getRng();c&&!c.collapsed&&(n.lastRng=c)}},h.bind(document,"selectionchange",e)))}),n.on("setcontent",function(){n.lastRng=null}),n.on("mousedown",function(){n.selection.lastFocusBookmark=null}),n.on("focusin",function(){var b,c=a.focusedEditor;n.selection.lastFocusBookmark&&(b=l(n,n.selection.lastFocusBookmark),n.selection.lastFocusBookmark=null,n.selection.setRng(b)),c!=n&&(c&&c.fire("blur",{focusedEditor:n}),a.setActive(n),a.focusedEditor=n,n.fire("focus",{blurredEditor:c}),n.focus(!0)),n.lastRng=null}),n.on("focusout",function(){b.setEditorTimeout(n,function(){var b=a.focusedEditor;i(n,d())||b!=n||(n.fire("blur",{focusedEditor:null}),a.focusedEditor=null,n.selection&&(n.selection.lastFocusBookmark=null))})}),f||(f=function(b){var c,d=a.activeEditor;c=b.target,d&&c.ownerDocument===document&&(d.selection&&c!==d.getBody()&&k(n,c)&&(d.selection.lastFocusBookmark=j(d.dom,d.lastRng)),c===document.body||i(d,c)||a.focusedEditor!==d||(d.fire("blur",{focusedEditor:null}),a.focusedEditor=null))},h.bind(document,"focusin",f)),n.inline&&!g&&(g=function(b){var c=a.activeEditor,d=c.dom;if(c.inline&&d&&!d.isChildOf(b.target,c.getBody())){var e=c.selection.getRng();e.collapsed||(c.lastRng=e)}},h.bind(document,"mouseup",g)); +}function n(b){a.focusedEditor==b.editor&&(a.focusedEditor=null),a.activeEditor||(h.unbind(document,"selectionchange",e),h.unbind(document,"focusin",f),h.unbind(document,"mouseup",g),e=f=g=null)}a.on("AddEditor",m),a.on("RemoveEditor",n)}var e,f,g,h=a.DOM,i=function(a,b){var c=a?a.settings.custom_ui_selector:"",e=h.getParent(b,function(b){return d.isEditorUIElement(b)||!!c&&a.dom.is(b,c)});return null!==e},j=function(a){return a.inline===!0},k=function(a,b){return j(a)===!1||a.dom.isChildOf(b,a.getBody())===!1};return d.isEditorUIElement=function(a){return a.className.toString().indexOf("mce-")!==-1},d._isUIElement=i,d}),g("27",["9"],function(a){var b=a.each,c=a.explode,d=function(a){a.on("AddEditor",function(a){var d=a.editor;d.on("preInit",function(){function a(a,c){b(c,function(b,c){b&&h.setStyle(a,c,b)}),h.rename(a,"span")}function e(a){h=d.dom,i.convert_fonts_to_spans&&b(h.select("font,u,strike",a.node),function(a){f[a.nodeName.toLowerCase()](h,a)})}var f,g,h,i=d.settings;i.inline_styles&&(g=c(i.font_size_legacy_values),f={font:function(b,c){a(c,{backgroundColor:c.style.backgroundColor,color:c.color,fontFamily:c.face,fontSize:g[parseInt(c.size,10)-1]})},u:function(b,c){"html4"===d.settings.schema&&a(c,{textDecoration:"underline"})},strike:function(b,c){a(c,{textDecoration:"line-through"})}},d.on("PreProcess SetContent",e))})})};return{register:d}}),g("17",["g","a","e","14","6","26","16","27","15","z","4","9","w"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(a){v(s.editors,function(b){"scroll"===a.type?b.fire("ScrollWindow",a):b.fire("ResizeWindow",a)})}function o(a,c){c!==y&&(c?b(window).on("resize scroll",n):b(window).off("resize scroll",n),y=c)}function p(a){var b,c=s.editors;delete c[a.id];for(var d=0;d0&&v(u(b),function(a){var b;(b=t.get(a))?c.push(b):v(document.forms,function(b){v(b.elements,function(b){b.name===a&&(a="mce_editor_"+x++,t.setAttrib(b,"id",a),c.push(b))})})});break;case"textareas":case"specific_textareas":v(t.select("textarea"),function(b){a.editor_deselector&&i(b,a.editor_deselector)||a.editor_selector&&!i(b,a.editor_selector)||c.push(b)})}return c}function m(){function e(a,b,c){var e=new d(a,b,p);n.push(e),e.on("init",function(){++k===i.length&&r(n)}),e.targetElm=e.targetElm||c,e.render()}var i,k=0,n=[];return t.unbind(window,"ready",m),h("onpageload"),i=b.unique(j(a)),a.types?void v(a.types,function(b){l.each(i,function(c){return!t.is(c,b.selector)||(e(g(c),w({},a,b),c),!1)})}):(l.each(i,function(a){q(p.get(a.id))}),i=l.grep(i,function(a){return!p.get(a.id)}),void(0===i.length?r([]):v(i,function(b){c(a,b)?f.initError("Could not initialize inline editor on invalid inline target element",b):e(g(b),a,b)})))}var n,o,p=this;o=l.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var r=function(a){n=a};return p.settings=a,t.bind(window,"ready",m),new k(function(a){n?a(n):r=function(b){a(b)}})},get:function(a){return arguments.length?a in this.editors?this.editors[a]:null:this.editors},add:function(a){var b=this,c=b.editors;return c[a.id]=a,c.push(a),o(c,!0),b.activeEditor=a,b.fire("AddEditor",{editor:a}),r||(r=function(){b.fire("BeforeUnload")},t.bind(window,"beforeunload",r)),a},createEditor:function(a,b){return this.add(new d(a,b,this))},remove:function(a){var b,c,d=this,e=d.editors;{if(a)return"string"==typeof a?(a=a.selector||a,void v(t.select(a),function(a){c=e[a.id],c&&d.remove(c)})):(c=a,e[c.id]?(p(c)&&d.fire("RemoveEditor",{editor:c}),e.length||t.unbind(window,"beforeunload",r),c.remove(),o(e,e.length>0),c):null);for(b=e.length-1;b>=0;b--)d.remove(e[b])}},execCommand:function(a,b,c){var e=this,f=e.get(c);switch(a){case"mceAddEditor":return e.get(c)||new d(c,e.settings,e).render(),!0;case"mceRemoveEditor":return f&&f.remove(),!0;case"mceToggleEditor":return f?(f.isHidden()?f.show():f.hide(),!0):(e.execCommand("mceAddEditor",0,c),!0)}return!!e.activeEditor&&e.activeEditor.execCommand(a,b,c)},triggerSave:function(){v(this.editors,function(a){a.save()})},addI18n:function(a,b){i.add(a,b)},translate:function(a){return i.translate(a)},setActive:function(a){var b=this.activeEditor;this.activeEditor!=a&&(b&&b.fire("deactivate",{relatedTarget:a}),a.fire("activate",{relatedTarget:b})),this.activeEditor=a}},w(s,j),s.setup(),h.register(s),s}),g("18",["z","9"],function(a,b){var c={send:function(a){function d(){!a.async||4==e.readyState||f++>1e4?(a.success&&f<1e4&&200==e.status?a.success.call(a.success_scope,""+e.responseText,e,a):a.error&&a.error.call(a.error_scope,f>1e4?"TIMED_OUT":"GENERAL",e,a),e=null):setTimeout(d,10)}var e,f=0;if(a.scope=a.scope||this,a.success_scope=a.success_scope||a.scope,a.error_scope=a.error_scope||a.scope,a.async=a.async!==!1,a.data=a.data||"",c.fire("beforeInitialize",{settings:a}),e=new XMLHttpRequest){if(e.overrideMimeType&&e.overrideMimeType(a.content_type),e.open(a.type||(a.data?"POST":"GET"),a.url,a.async),a.crossDomain&&(e.withCredentials=!0),a.content_type&&e.setRequestHeader("Content-Type",a.content_type),a.requestheaders&&b.each(a.requestheaders,function(a){e.setRequestHeader(a.key,a.value)}),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e=c.fire("beforeSend",{xhr:e,settings:a}).xhr,e.send(a.data),!a.async)return d();setTimeout(d,10)}}};return b.extend(c,a),c}),g("19",[],function(){function a(b,c){var d,e,f,g;if(c=c||'"',null===b)return"null";if(f=typeof b,"string"==f)return e="\bb\tt\nn\ff\rr\"\"''\\\\",c+b.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){return'"'===c&&"'"===a?a:(d=e.indexOf(b),d+1?"\\"+e.charAt(d+1):(a=b.charCodeAt().toString(16),"\\u"+"0000".substring(a.length)+a))})+c;if("object"==f){if(b.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(b)){for(d=0,e="[";d0?",":"")+a(b[d],c);return e+"]"}e="{";for(g in b)b.hasOwnProperty(g)&&(e+="function"!=typeof b[g]?(e.length>1?","+c:c)+g+c+":"+a(b[g],c):"");return e+"}"}return""+b}return{serialize:a,parse:function(a){try{return window[String.fromCharCode(101)+"val"]("("+a+")")}catch(a){}}}}),g("1a",["19","18","9"],function(a,b,c){function d(a){this.settings=e({},a),this.count=0}var e=c.extend;return d.sendRPC=function(a){return(new d).send(a)},d.prototype={send:function(c){var d=c.error,f=c.success;c=e(this.settings,c),c.success=function(b,e){b=a.parse(b),"undefined"==typeof b&&(b={error:"JSON Parse error."}),b.error?d.call(c.error_scope||c.scope,b.error,e):f.call(c.success_scope||c.scope,b.result)},c.error=function(a,b){d&&d.call(c.error_scope||c.scope,a,b)},c.data=a.serialize({id:c.id||"c"+this.count++,method:c.method,params:c.params}),c.content_type="application/json",b.send(c)}},d}),g("1b",["e"],function(a){return{callbacks:{},count:0,send:function(b){var c=this,d=a.DOM,e=void 0!==b.count?b.count:c.count,f="tinymce_jsonp_"+e;c.callbacks[e]=function(a){d.remove(f),delete c.callbacks[e],b.callback(a)},d.add(d.doc.body,"script",{id:f,src:b.url,type:"text/javascript"}),c.count++}}}),g("1c",[],function(){function a(){g=[];for(var a in f)g.push(a);d.length=g.length}function b(){function b(a){var b,c;return c=void 0!==a?j+a:d.indexOf(",",j),c===-1||c>d.length?null:(b=d.substring(j,c),j=c+1,b)}var c,d,g,j=0;if(f={},i){e.load(h),d=e.getAttribute(h)||"";do{var k=b();if(null===k)break;if(c=b(parseInt(k,32)||0),null!==c){if(k=b(),null===k)break;g=b(parseInt(k,32)||0),c&&(f[c]=g)}}while(null!==c);a()}}function c(){var b,c="";if(i){for(var d in f)b=f[d],c+=(c?",":"")+d.length.toString(32)+","+d+","+b.length.toString(32)+","+b;e.setAttribute(h,c);try{e.save(h)}catch(a){}a()}}var d,e,f,g,h,i;try{if(window.localStorage)return localStorage}catch(a){}return h="tinymce",e=document.documentElement,i=!!e.addBehavior,i&&e.addBehavior("#default#userData"),d={key:function(a){return g[a]},getItem:function(a){return a in f?f[a]:null},setItem:function(a,b){f[a]=""+b,c()},removeItem:function(a){delete f[a],c()},clear:function(){f={},c()}},b(),d}),g("1d",["e","7","f","g","9","6"],function(a,b,c,d,e,f){var g=function(g){g.DOM=a.DOM,g.ScriptLoader=c.ScriptLoader,g.PluginManager=d.PluginManager,g.ThemeManager=d.ThemeManager,g.dom=g.dom||{},g.dom.Event=b.Event,e.each("trim isArray is toArray makeMap each map grep inArray extend create walk createNS resolve explode _addCacheSuffix".split(" "),function(a){g[a]=e[a]}),e.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(a){g[a]=f[a.substr(2).toLowerCase()]})};return{register:g}}),g("1e",[],function(){function a(a){function e(a,e,f){var g,h,i,j,k,l;return g=0,h=0,i=0,a/=255,e/=255,f/=255,k=b(a,b(e,f)),l=c(a,c(e,f)),k==l?(i=k,{h:0,s:0,v:100*i}):(j=a==k?e-f:f==k?a-e:f-a,g=a==k?3:f==k?1:5,g=60*(g-j/(l-k)),h=(l-k)/l,i=l,{h:d(g),s:d(100*h),v:d(100*i)})}function f(a,e,f){var g,h,i,j;if(a=(parseInt(a,10)||0)%360,e=parseInt(e,10)/100,f=parseInt(f,10)/100,e=c(0,b(e,1)),f=c(0,b(f,1)),0===e)return void(l=m=n=d(255*f));switch(g=a/60,h=f*e,i=h*(1-Math.abs(g%2-1)),j=f-h,Math.floor(g)){case 0:l=h,m=i,n=0;break;case 1:l=i,m=h,n=0;break;case 2:l=0,m=h,n=i;break;case 3:l=0,m=i,n=h;break;case 4:l=i,m=0,n=h;break;case 5:l=h,m=0,n=i;break;default:l=m=n=0}l=d(255*(l+j)),m=d(255*(m+j)),n=d(255*(n+j))}function g(){function a(a){return a=parseInt(a,10).toString(16),a.length>1?a:"0"+a}return"#"+a(l)+a(m)+a(n)}function h(){return{r:l,g:m,b:n}}function i(){return e(l,m,n)}function j(a){var b;return"object"==typeof a?"r"in a?(l=a.r,m=a.g,n=a.b):"v"in a&&f(a.h,a.s,a.v):(b=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(a))?(l=parseInt(b[1],10),m=parseInt(b[2],10),n=parseInt(b[3],10)):(b=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(a))?(l=parseInt(b[1],16),m=parseInt(b[2],16),n=parseInt(b[3],16)):(b=/#([0-F])([0-F])([0-F])/gi.exec(a))&&(l=parseInt(b[1]+b[1],16),m=parseInt(b[2]+b[2],16),n=parseInt(b[3]+b[3],16)),l=l<0?0:l>255?255:l,m=m<0?0:m>255?255:m,n=n<0?0:n>255?255:n,k}var k=this,l=0,m=0,n=0;a&&j(a),k.toRgb=h,k.toHsv=i,k.toHex=g,k.parse=j}var b=Math.min,c=Math.max,d=Math.round;return a}),g("2o",["x","9"],function(a,b){"use strict";return a.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(a){this.settings=b.extend({},this.Defaults,a)},preRender:function(a){a.bodyClasses.add(this.settings.containerClass)},applyClasses:function(a){var b,c,d,e,f=this,g=f.settings;b=g.firstControlClass,c=g.lastControlClass,a.each(function(a){a.classes.remove(b).remove(c).add(g.controlClass),a.visible()&&(d||(d=a),e=a)}),d&&d.classes.add(b),e&&e.classes.add(c)},renderHtml:function(a){var b=this,c="";return b.applyClasses(a.items()),a.items().each(function(a){c+=a.renderHtml()}),c},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),g("2p",["2o"],function(a){"use strict";return a.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(a){a.items().filter(":visible").each(function(a){var b=a.settings;a.layoutRect({x:b.x,y:b.y,w:b.w,h:b.h}),a.recalc&&a.recalc()})},renderHtml:function(a){return'
                              '+this._super(a)}})}),g("2q",["2m"],function(a){"use strict";return a.extend({Defaults:{classes:"widget btn",role:"button"},init:function(a){var b,c=this;c._super(a),a=c.settings,b=c.settings.size,c.on("click mousedown",function(a){a.preventDefault()}),c.on("touchstart",function(a){c.fire("click",a),a.preventDefault()}),a.subtype&&c.classes.add(a.subtype),b&&c.classes.add("btn-"+b),a.icon&&c.icon(a.icon)},icon:function(a){return arguments.length?(this.state.set("icon",a),this):this.state.get("icon")},repaint:function(){var a,b=this.getEl().firstChild;b&&(a=b.style,a.width=a.height="100%"),this._super()},renderHtml:function(){var a,b=this,c=b._id,d=b.classPrefix,e=b.state.get("icon"),f=b.state.get("text"),g="";return a=b.settings.image,a?(e="none","string"!=typeof a&&(a=window.getSelection?a[0]:a[1]),a=" style=\"background-image: url('"+a+"')\""):a="",f&&(b.classes.add("btn-has-text"),g=''+b.encode(f)+""),e=e?d+"ico "+d+"i-"+e:"",'
                              "},bindStates:function(){function a(a){var e=c("span."+d,b.getEl());a?(e[0]||(c("button:first",b.getEl()).append(''),e=c("span."+d,b.getEl())),e.html(b.encode(a))):e.remove(),b.classes.toggle("btn-has-text",!!a)}var b=this,c=b.$,d=b.classPrefix+"txt";return b.state.on("change:text",function(b){a(b.value)}),b.state.on("change:icon",function(c){var d=c.value,e=b.classPrefix;b.settings.icon=d,d=d?e+"ico "+e+"i-"+b.settings.icon:"";var f=b.getEl().firstChild,g=f.getElementsByTagName("i")[0];d?(g&&g==f.firstChild||(g=document.createElement("i"),f.insertBefore(g,f.firstChild)),g.className=d):g&&f.removeChild(g),a(b.state.get("text"))}),b._super()}})}),g("2r",["2e"],function(a){"use strict";return a.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var a=this,b=a._layout;return a.classes.add("btn-group"),a.preRender(),b.preRender(a),'
                              '+(a.settings.html||"")+b.renderHtml(a)+"
                              "}})}),g("2s",["2m"],function(a){"use strict";return a.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(a){var b=this;b._super(a),b.on("click mousedown",function(a){a.preventDefault()}),b.on("click",function(a){a.preventDefault(),b.disabled()||b.checked(!b.checked())}),b.checked(b.settings.checked)},checked:function(a){return arguments.length?(this.state.set("checked",a),this):this.state.get("checked")},value:function(a){return arguments.length?this.checked(a):this.checked()},renderHtml:function(){var a=this,b=a._id,c=a.classPrefix;return'
                              '+a.encode(a.state.get("text"))+"
                              "},bindStates:function(){function a(a){b.classes.toggle("checked",a),b.aria("checked",a)}var b=this;return b.state.on("change:text",function(a){b.getEl("al").firstChild.data=b.translate(a.value)}),b.state.on("change:checked change:value",function(c){b.fire("change"),a(c.value)}),b.state.on("change:icon",function(a){var c=a.value,d=b.classPrefix;if("undefined"==typeof c)return b.settings.icon;b.settings.icon=c,c=c?d+"ico "+d+"i-"+b.settings.icon:"";var e=b.getEl().firstChild,f=e.getElementsByTagName("i")[0];c?(f&&f==e.firstChild||(f=document.createElement("i"),e.insertBefore(f,e.firstChild)),f.className=c):f&&e.removeChild(f)}),b.state.get("checked")&&a(!0),b._super()}})}),g("2t",["2m","2c","4h","a","p","9"],function(a,b,c,d,e,f){"use strict";return a.extend({init:function(a){var b=this;b._super(a),a=b.settings,b.classes.add("combobox"),b.subinput=!0,b.ariaTarget="inp",a.menu=a.menu||a.values,a.menu&&(a.icon="caret"),b.on("click",function(c){var e=c.target,f=b.getEl();if(d.contains(f,e)||e==f)for(;e&&e!=f;)e.id&&e.id.indexOf("-open")!=-1&&(b.fire("action"),a.menu&&(b.showMenu(),c.aria&&b.menu.items()[0].focus())),e=e.parentNode}),b.on("keydown",function(a){var c;13==a.keyCode&&"INPUT"===a.target.nodeName&&(a.preventDefault(),b.parents().reverse().each(function(a){if(a.toJSON)return c=a,!1}),b.fire("submit",{data:c.toJSON()}))}),b.on("keyup",function(a){if("INPUT"==a.target.nodeName){var c=b.state.get("value"),d=a.target.value;d!==c&&(b.state.set("value",d),b.fire("autocomplete",a))}}),b.on("mouseover",function(a){var c=b.tooltip().moveTo(-65535);if(b.statusLevel()&&a.target.className.indexOf(b.classPrefix+"status")!==-1){var d=b.statusMessage()||"Ok",e=c.text(d).show().testMoveRel(a.target,["bc-tc","bc-tl","bc-tr"]);c.classes.toggle("tooltip-n","bc-tc"==e),c.classes.toggle("tooltip-nw","bc-tl"==e),c.classes.toggle("tooltip-ne","bc-tr"==e),c.moveRel(a.target,e)}})},statusLevel:function(a){return arguments.length>0&&this.state.set("statusLevel",a),this.state.get("statusLevel")},statusMessage:function(a){return arguments.length>0&&this.state.set("statusMessage",a),this.state.get("statusMessage")},showMenu:function(){var a,c=this,d=c.settings;c.menu||(a=d.menu||[],a.length?a={type:"menu",items:a}:a.type=a.type||"menu",c.menu=b.create(a).parent(c).renderTo(c.getContainerElm()),c.fire("createmenu"),c.menu.reflow(),c.menu.on("cancel",function(a){a.control===c.menu&&c.focus()}),c.menu.on("show hide",function(a){a.control.items().each(function(a){a.active(a.value()==c.value())})}).fire("show"),c.menu.on("select",function(a){c.value(a.control.value())}),c.on("focusin",function(a){"INPUT"==a.target.tagName.toUpperCase()&&c.menu.hide()}),c.aria("expanded",!0)),c.menu.show(),c.menu.layoutRect({w:c.layoutRect().w}),c.menu.moveRel(c.getEl(),c.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var a,b,e=this,f=e.getEl(),g=e.getEl("open"),h=e.layoutRect(),i=0,j=f.firstChild;e.statusLevel()&&"none"!==e.statusLevel()&&(i=parseInt(c.getRuntimeStyle(j,"padding-right"),10)-parseInt(c.getRuntimeStyle(j,"padding-left"),10)),a=g?h.w-c.getSize(g).width-10:h.w-10;var k=document;return k.all&&(!k.documentMode||k.documentMode<=8)&&(b=e.layoutRect().h-2+"px"),d(j).css({width:a-i,lineHeight:b}),e._super(),e},postRender:function(){var a=this;return d(this.getEl("inp")).on("change",function(b){a.state.set("value",b.target.value),a.fire("change",b)}),a._super()},renderHtml:function(){var a,b,c=this,d=c._id,e=c.settings,f=c.classPrefix,g=c.state.get("value")||"",h="",i="",j="";return"spellcheck"in e&&(i+=' spellcheck="'+e.spellcheck+'"'),e.maxLength&&(i+=' maxlength="'+e.maxLength+'"'),e.size&&(i+=' size="'+e.size+'"'),e.subtype&&(i+=' type="'+e.subtype+'"'),j='',c.disabled()&&(i+=' disabled="disabled"'),a=e.icon,a&&"caret"!=a&&(a=f+"ico "+f+"i-"+e.icon),b=c.state.get("text"),(a||b)&&(h='
                              ",c.classes.add("has-open")),'
                              '+j+h+"
                              "},value:function(a){return arguments.length?(this.state.set("value",a),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(a,c){var d=this;if(0===a.length)return void d.hideMenu();var e=function(a,b){return function(){d.fire("selectitem",{title:b,value:a})}};d.menu?d.menu.items().remove():d.menu=b.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(d).renderTo(),f.each(a,function(a){d.menu.add({text:a.title,url:a.previewUrl,match:c,classes:"menu-item-ellipsis",onclick:e(a.value,a.title)})}),d.menu.renderNew(),d.hideMenu(),d.menu.on("cancel",function(a){a.control.parent()===d.menu&&(a.stopPropagation(),d.focus(),d.hideMenu())}),d.menu.on("select",function(){d.focus()});var g=d.layoutRect().w;d.menu.layoutRect({w:g,minW:0,maxW:g}),d.menu.reflow(),d.menu.show(),d.menu.moveRel(d.getEl(),d.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var a=this;a.state.on("change:value",function(b){a.getEl("inp").value!=b.value&&(a.getEl("inp").value=b.value)}),a.state.on("change:disabled",function(b){a.getEl("inp").disabled=b.value}),a.state.on("change:statusLevel",function(b){var d=a.getEl("status"),e=a.classPrefix,f=b.value;c.css(d,"display","none"===f?"none":""),c.toggleClass(d,e+"i-checkmark","ok"===f),c.toggleClass(d,e+"i-warning","warn"===f),c.toggleClass(d,e+"i-error","error"===f),a.classes.toggle("has-status","none"!==f),a.repaint()}),c.on(a.getEl("status"),"mouseleave",function(){a.tooltip().hide()}),a.on("cancel",function(b){a.menu&&a.menu.visible()&&(b.stopPropagation(),a.hideMenu())});var b=function(a,b){b&&b.items().length>0&&b.items().eq(a)[0].focus()};return a.on("keydown",function(c){var d=c.keyCode;"INPUT"===c.target.nodeName&&(d===e.DOWN?(c.preventDefault(),a.fire("autocomplete"),b(0,a.menu)):d===e.UP&&(c.preventDefault(),b(-1,a.menu)))}),a._super()},remove:function(){d(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}})}),g("2u",["2t"],function(a){"use strict";return a.extend({init:function(a){var b=this;a.spellcheck=!1,a.onaction&&(a.icon="none"),b._super(a),b.classes.add("colorbox"),b.on("change keyup postrender",function(){b.repaintColor(b.value())})},repaintColor:function(a){var b=this.getEl("open"),c=b?b.getElementsByTagName("i")[0]:null;if(c)try{c.style.background=a}catch(a){}},bindStates:function(){var a=this;return a.state.on("change:value",function(b){a.state.get("rendered")&&a.repaintColor(b.value)}),a._super()}})}),g("2v",["2q","2k"],function(a,b){"use strict";return a.extend({showPanel:function(){var a=this,c=a.settings;if(a.active(!0),a.panel)a.panel.show();else{var d=c.panel;d.type&&(d={layout:"grid",items:d}),d.role=d.role||"dialog",d.popover=!0,d.autohide=!0,d.ariaRoot=!0,a.panel=new b(d).on("hide",function(){a.active(!1)}).on("cancel",function(b){b.stopPropagation(),a.focus(),a.hidePanel()}).parent(a).renderTo(a.getContainerElm()),a.panel.fire("show"),a.panel.reflow()}a.panel.moveRel(a.getEl(),c.popoverAlign||(a.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var a=this;a.panel&&a.panel.hide()},postRender:function(){var a=this;return a.aria("haspopup",!0),a.on("click",function(b){b.control===a&&(a.panel&&a.panel.visible()?a.hidePanel():(a.showPanel(),a.panel.focus(!!b.aria)))}),a._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),g("2w",["2v","e"],function(a,b){"use strict";var c=b.DOM;return a.extend({init:function(a){this._super(a),this.classes.add("colorbutton")},color:function(a){return a?(this._color=a,this.getEl("preview").style.backgroundColor=a,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var a=this,b=a._id,c=a.classPrefix,d=a.state.get("text"),e=a.settings.icon?c+"ico "+c+"i-"+a.settings.icon:"",f=a.settings.image?" style=\"background-image: url('"+a.settings.image+"')\"":"",g="";return d&&(a.classes.add("btn-has-text"),g=''+a.encode(d)+""),'
                              '},postRender:function(){var a=this,b=a.settings.onclick;return a.on("click",function(d){d.aria&&"down"==d.aria.key||d.control!=a||c.getParent(d.target,"."+a.classPrefix+"open")||(d.stopImmediatePropagation(),b.call(a,d))}),delete a.settings.onclick,a._super()}})}),g("2x",["2m","2f","4h","1e"],function(a,b,c,d){"use strict";return a.extend({Defaults:{classes:"widget colorpicker"},init:function(a){this._super(a)},postRender:function(){function a(a,b){var d,e,f=c.getPos(a);return d=b.pageX-f.x,e=b.pageY-f.y,d=Math.max(0,Math.min(d/a.clientWidth,1)),e=Math.max(0,Math.min(e/a.clientHeight,1)),{x:d,y:e}}function e(a,b){var e=(360-a.h)/360;c.css(j,{top:100*e+"%"}),b||c.css(l,{left:a.s+"%",top:100-a.v+"%"}),k.style.background=new d({s:100,v:100,h:a.h}).toHex(),m.color().parse({s:a.s,v:a.v,h:a.h})}function f(b){var c;c=a(k,b),h.s=100*c.x,h.v=100*(1-c.y),e(h),m.fire("change")}function g(b){var c;c=a(i,b),h=n.toHsv(),h.h=360*(1-c.y),e(h,!0),m.fire("change")}var h,i,j,k,l,m=this,n=m.color();i=m.getEl("h"),j=m.getEl("hp"),k=m.getEl("sv"),l=m.getEl("svp"),m._repaint=function(){h=n.toHsv(),e(h)},m._super(),m._svdraghelper=new b(m._id+"-sv",{start:f,drag:f}),m._hdraghelper=new b(m._id+"-h",{start:g,drag:g}),m._repaint()},rgb:function(){return this.color().toRgb()},value:function(a){var b=this;return arguments.length?(b.color().parse(a),void(b._rendered&&b._repaint())):b.color().toHex()},color:function(){return this._color||(this._color=new d),this._color},renderHtml:function(){function a(){var a,b,c,d,g="";for(c="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",d=f.split(","),a=0,b=d.length-1;a
                              ';return g}var b,c=this,d=c._id,e=c.classPrefix,f="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",g="background: -ms-linear-gradient(top,"+f+");background: linear-gradient(to bottom,"+f+");";return b='
                              '+a()+'
                              ','
                              '+b+"
                              "}})}),g("2y",["2m"],function(a){"use strict";return a.extend({init:function(a){var b=this;a.delimiter||(a.delimiter="\xbb"),b._super(a),b.classes.add("path"),b.canFocus=!0,b.on("click",function(a){var c,d=a.target;(c=d.getAttribute("data-index"))&&b.fire("select",{value:b.row()[c],index:c})}),b.row(b.settings.row)},focus:function(){var a=this;return a.getEl().firstChild.focus(),a},row:function(a){return arguments.length?(this.state.set("row",a),this):this.state.get("row")},renderHtml:function(){var a=this;return'
                              '+a._getDataPathHtml(a.state.get("row"))+"
                              "},bindStates:function(){var a=this;return a.state.on("change:row",function(b){a.innerHtml(a._getDataPathHtml(b.value))}),a._super()},_getDataPathHtml:function(a){var b,c,d=this,e=a||[],f="",g=d.classPrefix;for(b=0,c=e.length;b0?'":"")+'
                              '+e[b].name+"
                              ";return f||(f='
                              \xa0
                              '),f}})}),g("2z",["2y"],function(a){return a.extend({postRender:function(){function a(a){if(1===a.nodeType){if("BR"==a.nodeName||a.getAttribute("data-mce-bogus"))return!0;if("bookmark"===a.getAttribute("data-mce-type"))return!0}return!1}var b=this,c=b.settings.editor;return c.settings.elementpath!==!1&&(b.on("select",function(a){c.focus(),c.selection.select(this.row()[a.index].element),c.nodeChanged()}),c.on("nodeChange",function(d){for(var e=[],f=d.parents,g=f.length;g--;)if(1==f[g].nodeType&&!a(f[g])){var h=c.fire("ResolveName",{name:f[g].nodeName.toLowerCase(),target:f[g]});if(h.isDefaultPrevented()||e.push({name:h.name,element:f[g]}),h.isPropagationStopped())break}b.row(e)})),b._super()}})}),g("30",["2e"],function(a){"use strict";return a.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var a=this,b=a._layout,c=a.classPrefix;return a.classes.add("formitem"),b.preRender(a),'
                              '+(a.settings.title?'
                              '+a.settings.title+"
                              ":"")+'
                              '+(a.settings.html||"")+b.renderHtml(a)+"
                              "}})}),g("31",["2e","30","9"],function(a,b,c){"use strict";return a.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var a=this,d=a.items();a.settings.formItemDefaults||(a.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),d.each(function(d){var e,f=d.settings.label;f&&(e=new b(c.extend({items:{type:"label",id:d._id+"-l",text:f,flex:0,forId:d._id,disabled:d.disabled()}},a.settings.formItemDefaults)),e.type="formitem",d.aria("labelledby",d._id+"-l"),"undefined"==typeof d.settings.flex&&(d.settings.flex=1),a.replace(d,e),e.add(d))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var a=this;a._super(),a.fromJSON(a.settings.data)},bindStates:function(){function a(){var a,c,d,e=0,f=[];if(b.settings.labelGapCalc!==!1)for(d="children"==b.settings.labelGapCalc?b.find("formitem"):b.items(),d.filter("formitem").each(function(a){var b=a.items()[0],c=b.getEl().clientWidth;e=c>e?c:e,f.push(b)}),c=b.settings.labelGap||0,a=f.length;a--;)f[a].settings.minWidth=e+c}var b=this;b._super(),b.on("show",a),a()}})}),g("32",["31"],function(a){"use strict";return a.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var a=this,b=a._layout,c=a.classPrefix;return a.preRender(),b.preRender(a),'
                              '+(a.settings.title?''+a.settings.title+"":"")+'
                              '+(a.settings.html||"")+b.renderHtml(a)+"
                              "}})}),g("4o",["e","1j","1g","1s","9","25"],function(a,b,c,d,e,f){ +var g=e.trim,h=function(a,b,c,d,e){return{type:a,title:b,url:c,level:d,attach:e}},i=function(a){for(;a=a.parentNode;){var c=a.contentEditable;if(c&&"inherit"!==c)return b.isContentEditableTrue(a)}return!1},j=function(b,c){return a.DOM.select(b,c)},k=function(a){return a.innerText||a.textContent},l=function(a){return a.id?a.id:f.uuid("h")},m=function(a){return a&&"A"===a.nodeName&&(a.id||a.name)},n=function(a){return m(a)&&p(a)},o=function(a){return a&&/^(H[1-6])$/.test(a.nodeName)},p=function(a){return i(a)&&!b.isContentEditableFalse(a)},q=function(a){return o(a)&&p(a)},r=function(a){return o(a)?parseInt(a.nodeName.substr(1),10):0},s=function(a){var b=l(a),c=function(){a.id=b};return h("header",k(a),"#"+b,r(a),c)},t=function(a){var b=a.id||a.name,c=k(a);return h("anchor",c?c:"#"+b,"#"+b,0,d.noop)},u=function(a){return c.map(c.filter(a,q),s)},v=function(a){return c.map(c.filter(a,n),t)},w=function(a){var b=j("h1,h2,h3,h4,h5,h6,a:not([href])",a);return b},x=function(a){return g(a.title).length>0},y=function(a){var b=w(a);return c.filter(u(b).concat(v(b)),x)};return{find:y}}),g("33",["4k","4o","17","2t","1g","1s","9"],function(a,b,c,d,e,f,g){"use strict";var h=function(){return a.tinymce?a.tinymce.activeEditor:c.activeEditor},i={},j=5,k=function(a){return{title:a.title,value:{title:{raw:a.title},url:a.url,attach:a.attach}}},l=function(a){return g.map(a,k)},m=function(a,b){return{title:a,value:{title:a,url:b,attach:f.noop}}},n=function(a,b){var c=e.find(b,function(b){return b.url===a});return!c},o=function(a,b,c){var d=b in a?a[b]:c;return d===!1?null:d},p=function(a,b,c,d){var h={title:"-"},j=function(a){var d=e.filter(a[c],function(a){return n(a,b)});return g.map(d,function(a){return{title:a,value:{title:a,url:a,attach:f.noop}}})},k=function(a){var c=e.filter(b,function(b){return b.type==a});return l(c)},p=function(){var a=k("anchor"),b=o(d,"anchor_top","#top"),c=o(d,"anchor_bottom","#bottom");return null!==b&&a.unshift(m("",b)),null!==c&&a.push(m("",c)),a},q=function(a){return e.reduce(a,function(a,b){var c=0===a.length||0===b.length;return c?a.concat(b):a.concat(h,b)},[])};return d.typeahead_urls===!1?[]:"file"===c?q([r(a,j(i)),r(a,k("header")),r(a,p())]):r(a,j(i))},q=function(a,b){var c=i[b];/^https?/.test(a)&&(c?e.indexOf(c,a)===-1&&(i[b]=c.slice(0,j).concat(a)):i[b]=[a])},r=function(a,b){var c=a.toLowerCase(),d=g.grep(b,function(a){return a.title.toLowerCase().indexOf(c)!==-1});return 1===d.length&&d[0].title===a?[]:d},s=function(a){var b=a.title;return b.raw?b.raw:b},t=function(a,c,d,e){var f=function(f){var g=b.find(d),h=p(f,g,e,c);a.showAutoComplete(h,f)};a.on("autocomplete",function(){f(a.value())}),a.on("selectitem",function(b){var c=b.value;a.value(c.url);var d=s(c);"image"===e?a.fire("change",{meta:{alt:d,attach:c.attach}}):a.fire("change",{meta:{text:d,attach:c.attach}}),a.focus()}),a.on("click",function(b){0===a.value().length&&"INPUT"===b.target.nodeName&&f("")}),a.on("PostRender",function(){a.getRoot().on("submit",function(b){b.isDefaultPrevented()||q(a.value(),e)})})},u=function(a){var b=a.status,c=a.message;return"valid"===b?{status:"ok",message:c}:"unknown"===b?{status:"warn",message:c}:"invalid"===b?{status:"warn",message:c}:{status:"none",message:""}},v=function(a,b,c){var d=b.filepicker_validator_handler;if(d){var e=function(b){return 0===b.length?void a.statusLevel("none"):void d({url:b,type:c},function(b){var c=u(b);a.statusMessage(c.message),a.statusLevel(c.status)})};a.state.on("change:value",function(a){e(a.value)})}};return d.extend({init:function(b){var c,d,e,f=this,i=h(),j=i.settings,k=b.filetype;b.spellcheck=!1,e=j.file_picker_types||j.file_browser_callback_types,e&&(e=g.makeMap(e,/[, ]/)),e&&!e[k]||(d=j.file_picker_callback,!d||e&&!e[k]?(d=j.file_browser_callback,!d||e&&!e[k]||(c=function(){d(f.getEl("inp").id,f.value(),k,a)})):c=function(){var a=f.fire("beforecall").meta;a=g.extend({filetype:k},a),d.call(i,function(a,b){f.value(a).fire("change",{meta:b})},f.value(),a)}),c&&(b.icon="browse",b.onaction=c),f._super(b),t(f,j,i.getBody(),k),v(f,j,k)}})}),g("34",["2p"],function(a){"use strict";return a.extend({recalc:function(a){var b=a.layoutRect(),c=a.paddingBox;a.items().filter(":visible").each(function(a){a.layoutRect({x:c.left,y:c.top,w:b.innerW-c.right-c.left,h:b.innerH-c.top-c.bottom}),a.recalc&&a.recalc()})}})}),g("35",["2p"],function(a){"use strict";return a.extend({recalc:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=[],O=Math.max,P=Math.min;for(d=a.items().filter(":visible"),e=a.layoutRect(),f=a.paddingBox,g=a.settings,m=a.isRtl()?g.direction||"row-reversed":g.direction,h=g.align,i=a.isRtl()?g.pack||"end":g.pack,j=g.spacing||0,"row-reversed"!=m&&"column-reverse"!=m||(d=d.set(d.toArray().reverse()),m=m.split("-")[0]),"column"==m?(z="y",x="h",y="minH",A="maxH",C="innerH",B="top",D="deltaH",E="contentH",J="left",H="w",F="x",G="innerW",I="minW",K="right",L="deltaW",M="contentW"):(z="x",x="w",y="minW",A="maxW",C="innerW",B="left",D="deltaW",E="contentW",J="top",H="h",F="y",G="innerH",I="minH",K="bottom",L="deltaH",M="contentH"),l=e[C]-f[B]-f[B],w=k=0,b=0,c=d.length;b0&&(k+=q,o[A]&&N.push(n),o.flex=q),l-=o[y],r=f[J]+o[I]+f[K],r>w&&(w=r);if(u={},l<0?u[y]=e[y]-l+e[D]:u[y]=e[C]-l+e[D],u[I]=w+e[L],u[E]=e[C]-l,u[M]=w,u.minW=P(u.minW,e.maxW),u.minH=P(u.minH,e.maxH),u.minW=O(u.minW,e.startMinWidth),u.minH=O(u.minH,e.startMinHeight),!e.autoResize||u.minW==e.minW&&u.minH==e.minH){for(t=l/k,b=0,c=N.length;bs?(l-=o[A]-o[y],k-=o.flex,o.flex=0,o.maxFlexSize=s):o.maxFlexSize=0;for(t=l/k,v=f[B],u={},0===k&&("end"==i?v=l+f[B]:"center"==i?(v=Math.round(e[C]/2-(e[C]-l)/2)+f[B],v<0&&(v=f[B])):"justify"==i&&(v=f[B],j=Math.floor(l/(d.length-1)))),u[F]=f[J],b=0,c=d.length;b0&&(r+=o.flex*t),u[x]=r,u[z]=v,n.layoutRect(u),n.recalc&&n.recalc(),v+=r+j}else if(u.w=u.minW,u.h=u.minH,a.layoutRect(u),this.recalc(a),null===a._lastRect){var Q=a.parent();Q&&(Q._lastRect=null,Q.recalc())}}})}),g("36",["2o"],function(a){return a.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(a){a.items().filter(":visible").each(function(a){a.recalc&&a.recalc()})},isNative:function(){return!0}})}),g("4p",["3t","4q","42","44","e"],function(a,b,c,d,e){var f=function(a,c,d){for(;d!==c;){if(d.style[a]){var e=d.style[a];return""!==e?b.some(e):b.none()}d=d.parentNode}return b.none()},g=function(a){return/[0-9.]+px$/.test(a)?Math.round(72*parseInt(a,10)/96)+"pt":a},h=function(a){return a.replace(/[\'\"]/g,"").replace(/,\s+/g,",")},i=function(a,c){return b.from(e.DOM.getStyle(c,a,!0))},j=function(a){return function(e,g){return b.from(g).map(c.fromDom).filter(d.isElement).bind(function(b){return f(a,e,b.dom()).or(i(a,b.dom()))}).getOr("")}};return{getFontSize:j("fontSize"),getFontFamily:a.compose(h,j("fontFamily")),toPt:g}}),g("37",["2b","2m","2k","9","1g","e","17","6","4p"],function(a,b,c,d,e,f,g,h,i){function j(a){a.settings.ui_container&&(h.container=f.DOM.select(a.settings.ui_container)[0])}function k(b){b.on("ScriptsLoaded",function(){b.rtl&&(a.rtl=!0)})}function l(a){function b(b,c){return function(){var d=this;a.on("nodeChange",function(e){var f=a.formatter,g=null;m(e.parents,function(a){if(m(b,function(b){if(c?f.matchNode(a,c,{value:b.value})&&(g=b.value):f.matchNode(a,b.value)&&(g=b.value),g)return!1}),g)return!1}),d.value(g)})}}function e(b){return function(){var c=this,d=function(a){return a?a.split(",")[0]:""};a.on("nodeChange",function(e){var f,g=null;f=i.getFontFamily(a.getBody(),e.element),m(b,function(a){a.value.toLowerCase()===f.toLowerCase()&&(g=a.value)}),m(b,function(a){g||d(a.value).toLowerCase()!==d(f).toLowerCase()||(g=a.value)}),c.value(g),!g&&f&&c.text(d(f))})}}function f(b){return function(){var c=this;a.on("nodeChange",function(d){var e,f,g=null;e=i.getFontSize(a.getBody(),d.element),f=i.toPt(e),m(b,function(a){a.value===e?g=e:a.value===f&&(g=f)}),c.value(g),g||c.text(f)})}}function g(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}function h(){function b(a){var c=[];if(a)return m(a,function(a){var f={text:a.title,icon:a.icon};if(a.items)f.menu=b(a.items);else{var g=a.format||"custom"+d++;a.format||(a.name=g,e.push(a)),f.format=g,f.cmd=a.cmd}c.push(f)}),c}function c(){var c;return c=b(a.settings.style_formats_merge?a.settings.style_formats?f.concat(a.settings.style_formats):f:a.settings.style_formats||f)}var d=0,e=[],f=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return a.on("init",function(){m(e,function(b){a.formatter.register(b.name,b)})}),{type:"menu",items:c(),onPostRender:function(b){a.fire("renderFormatsMenu",{control:b.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return a.formatter.getCssText(this.settings.format)},onPostRender:function(){var b=this;b.parent().on("show",function(){var c,d;c=b.settings.format,c&&(b.disabled(!a.formatter.canApply(c)),b.active(a.formatter.match(c))),d=b.settings.cmd,d&&b.active(a.queryCommandState(d))})},onclick:function(){this.settings.format&&o(this.settings.format),this.settings.cmd&&a.execCommand(this.settings.cmd)}}}}function j(b){return function(){var c=this;a.formatter?a.formatter.formatChanged(b,function(a){c.active(a)}):a.on("init",function(){a.formatter.formatChanged(b,function(a){c.active(a)})})}}function k(b){return function(){function c(){var c="redo"==b?"hasRedo":"hasUndo";return!!a.undoManager&&a.undoManager[c]()}var d=this;d.disabled(!c()),a.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){d.disabled(a.readonly||!c())})}}function l(){var b=this;a.on("VisualAid",function(a){b.active(a.hasVisual)}),b.active(a.hasVisual)}function o(b){b.control&&(b=b.control.value()),b&&a.execCommand("mceToggleFormat",!1,b)}function p(b){var c=b.length;return d.each(b,function(b){b.menu&&(b.hidden=0===p(b.menu));var d=b.format;d&&(b.hidden=!a.formatter.canApply(d)),b.hidden&&c--}),c}function q(b){var c=b.items().length;return b.items().each(function(b){b.menu&&b.visible(q(b.menu)>0),!b.menu&&b.settings.menu&&b.visible(p(b.settings.menu)>0);var d=b.settings.format;d&&b.visible(a.formatter.canApply(d)),b.visible()||c--}),c}var r;r=h(),m({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(b,c){a.addButton(c,{tooltip:b,onPostRender:j(c),onclick:function(){o(c)}})}),m({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(b,c){a.addButton(c,{tooltip:b[0],cmd:b[1]})}),m({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(b,c){a.addButton(c,{tooltip:b[0],cmd:b[1],onPostRender:j(c)})});var s=function(a){var b=a;return b.length>0&&"-"===b[0].text&&(b=b.slice(1)),b.length>0&&"-"===b[b.length-1].text&&(b=b.slice(0,b.length-1)),b},t=function(b){var c,e;if("string"==typeof b)e=b.split(" ");else if(d.isArray(b))return n(d.map(b,t));return c=d.grep(e,function(b){return"|"===b||b in a.menuItems}),d.map(c,function(b){return"|"===b?{text:"-"}:a.menuItems[b]})},u=function(b){var c=[{text:"-"}],e=d.grep(a.menuItems,function(a){return a.context===b});return d.each(e,function(a){"before"==a.separator&&c.push({text:"|"}),a.prependToContext?c.unshift(a):c.push(a),"after"==a.separator&&c.push({text:"|"})}),c},v=function(a){return s(a.insert_button_items?t(a.insert_button_items):u("insert"))};a.addButton("undo",{tooltip:"Undo",onPostRender:k("undo"),cmd:"undo"}),a.addButton("redo",{tooltip:"Redo",onPostRender:k("redo"),cmd:"redo"}),a.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),a.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:k("undo"),cmd:"undo"}),a.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:k("redo"),cmd:"redo"}),a.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:l,cmd:"mceToggleVisualAid"}),a.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),a.addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(v(a.settings)),this.menu.renderNew()}}),m({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(b,c){a.addMenuItem(c,{text:b[0],icon:c,shortcut:b[2],cmd:b[1]})}),a.on("mousedown",function(){c.hideAll()}),a.addButton("styleselect",{type:"menubutton",text:"Formats",menu:r,onShowMenu:function(){a.settings.style_formats_autohide&&q(this.menu)}}),a.addButton("formatselect",function(){var c=[],d=g(a.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return m(d,function(b){c.push({text:b[0],value:b[1],textStyle:function(){return a.formatter.getCssText(b[1])}})}),{type:"listbox",text:d[0][0],values:c,fixedWidth:!0,onselect:o,onPostRender:b(c)}}),a.addButton("fontselect",function(){var b="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",c=[],d=g(a.settings.font_formats||b);return m(d,function(a){c.push({text:{raw:a[0]},value:a[1],textStyle:a[1].indexOf("dings")==-1?"font-family:"+a[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:c,fixedWidth:!0,onPostRender:e(c),onselect:function(b){b.control.settings.value&&a.execCommand("FontName",!1,b.control.settings.value)}}}),a.addButton("fontsizeselect",function(){var b=[],c="8pt 10pt 12pt 14pt 18pt 24pt 36pt",d=a.settings.fontsize_formats||c;return m(d.split(" "),function(a){var c=a,d=a,e=a.split("=");e.length>1&&(c=e[0],d=e[1]),b.push({text:c,value:d})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:b,fixedWidth:!0,onPostRender:f(b),onclick:function(b){b.control.settings.value&&a.execCommand("FontSize",!1,b.control.settings.value)}}}),a.addMenuItem("formats",{text:"Formats",menu:r})}var m=d.each,n=function(a){return e.reduce(a,function(a,b){return a.concat(b)},[])};return g.on("AddEditor",function(a){var b=a.editor;k(b),l(b),j(b)}),a.translate=function(a){return g.translate(a)},b.tooltips=!h.iOS,{}}),g("38",["2p"],function(a){"use strict";return a.extend({recalc:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=[],F=[];b=a.settings,e=a.items().filter(":visible"),f=a.layoutRect(),d=b.columns||Math.ceil(Math.sqrt(e.length)),c=Math.ceil(e.length/d),s=b.spacingH||b.spacing||0,t=b.spacingV||b.spacing||0,u=b.alignH||b.align,v=b.alignV||b.align,q=a.paddingBox,C="reverseRows"in b?b.reverseRows:a.isRtl(),u&&"string"==typeof u&&(u=[u]),v&&"string"==typeof v&&(v=[v]);for(l=0;lE[l]?y:E[l],F[m]=z>F[m]?z:F[m];for(A=f.innerW-q.left-q.right,w=0,l=0;l0?s:0),A-=(l>0?s:0)+E[l];for(B=f.innerH-q.top-q.bottom,x=0,m=0;m0?t:0),B-=(m>0?t:0)+F[m];if(w+=q.left+q.right,x+=q.top+q.bottom,i={},i.minW=w+(f.w-f.innerW),i.minH=x+(f.h-f.innerH),i.contentW=i.minW-f.deltaW,i.contentH=i.minH-f.deltaH,i.minW=Math.min(i.minW,f.maxW),i.minH=Math.min(i.minH,f.maxH),i.minW=Math.max(i.minW,f.startMinWidth),i.minH=Math.max(i.minH,f.startMinHeight),!f.autoResize||i.minW==f.minW&&i.minH==f.minH){f.autoResize&&(i=a.layoutRect(i),i.contentW=i.minW-f.deltaW,i.contentH=i.minH-f.deltaH);var G;G="start"==b.packV?0:B>0?Math.floor(B/c):0;var H=0,I=b.flexWidths;if(I)for(l=0;l'},src:function(a){this.getEl().src=a},html:function(a,c){var d=this,e=this.getEl().contentWindow.document.body;return e?(e.innerHTML=a,c&&c()):b.setTimeout(function(){d.html(a)}),this}})}),g("3a",["2m"],function(a){"use strict";return a.extend({init:function(a){var b=this;b._super(a),b.classes.add("widget").add("infobox"),b.canFocus=!1},severity:function(a){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(a)},help:function(a){this.state.set("help",a)},renderHtml:function(){var a=this,b=a.classPrefix;return'
                              '+a.encode(a.state.get("text"))+'
                              '},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.getEl("body").firstChild.data=a.encode(b.value),a.state.get("rendered")&&a.updateLayoutRect()}),a.state.on("change:help",function(b){a.classes.toggle("has-help",b.value),a.state.get("rendered")&&a.updateLayoutRect()}),a._super()}})}),g("3b",["2m","4h"],function(a,b){"use strict";return a.extend({init:function(a){var b=this;b._super(a),b.classes.add("widget").add("label"),b.canFocus=!1,a.multiline&&b.classes.add("autoscroll"),a.strong&&b.classes.add("strong")},initLayoutRect:function(){var a=this,c=a._super();if(a.settings.multiline){var d=b.getSize(a.getEl());d.width>c.maxW&&(c.minW=c.maxW,a.classes.add("multiline")),a.getEl().style.width=c.minW+"px",c.startMinH=c.h=c.minH=Math.min(c.maxH,b.getSize(a.getEl()).height)}return c},repaint:function(){var a=this;return a.settings.multiline||(a.getEl().style.lineHeight=a.layoutRect().h+"px"),a._super()},severity:function(a){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(a)},renderHtml:function(){var a,b,c=this,d=c.settings.forId,e=c.settings.html?c.settings.html:c.encode(c.state.get("text"));return!d&&(b=c.settings.forName)&&(a=c.getRoot().find("#"+b)[0],a&&(d=a._id)),d?'":''+e+""},bindStates:function(){var a=this;return a.state.on("change:text",function(b){a.innerHtml(a.encode(b.value)),a.state.get("rendered")&&a.updateLayoutRect()}),a._super()}})}),g("3c",["2e"],function(a){"use strict";return a.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(a){var b=this;b._super(a),b.classes.add("toolbar")},postRender:function(){var a=this;return a.items().each(function(a){a.classes.add("toolbar-item")}),a._super()}})}),g("3d",["3c"],function(a){"use strict";return a.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),g("3e",["2q","2c","3d"],function(a,b,c){"use strict";function d(a,b){for(;a;){if(b===a)return!0;a=a.parentNode}return!1}var e=a.extend({init:function(a){var b=this;b._renderOpen=!0,b._super(a),a=b.settings,b.classes.add("menubtn"),a.fixedWidth&&b.classes.add("fixed-width"),b.aria("haspopup",!0),b.state.set("menu",a.menu||b.render())},showMenu:function(a){var c,d=this;return d.menu&&d.menu.visible()&&a!==!1?d.hideMenu():(d.menu||(c=d.state.get("menu")||[],c.length?c={type:"menu",items:c}:c.type=c.type||"menu",c.renderTo?d.menu=c.parent(d).show().renderTo():d.menu=b.create(c).parent(d).renderTo(),d.fire("createmenu"),d.menu.reflow(),d.menu.on("cancel",function(a){a.control.parent()===d.menu&&(a.stopPropagation(),d.focus(),d.hideMenu())}),d.menu.on("select",function(){d.focus()}),d.menu.on("show hide",function(a){a.control==d.menu&&d.activeMenu("show"==a.type),d.aria("expanded","show"==a.type)}).fire("show")),d.menu.show(),d.menu.layoutRect({w:d.layoutRect().w}),d.menu.moveRel(d.getEl(),d.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),void d.fire("showmenu"))},hideMenu:function(){var a=this;a.menu&&(a.menu.items().each(function(a){a.hideMenu&&a.hideMenu()}),a.menu.hide())},activeMenu:function(a){this.classes.toggle("active",a)},renderHtml:function(){var a,b=this,d=b._id,e=b.classPrefix,f=b.settings.icon,g=b.state.get("text"),h="";return a=b.settings.image,a?(f="none","string"!=typeof a&&(a=window.getSelection?a[0]:a[1]),a=" style=\"background-image: url('"+a+"')\""):a="",g&&(b.classes.add("btn-has-text"),h=''+b.encode(g)+""),f=b.settings.icon?e+"ico "+e+"i-"+f:"",b.aria("role",b.parent()instanceof c?"menuitem":"button"),'
                              '},postRender:function(){var a=this;return a.on("click",function(b){b.control===a&&d(b.target,a.getEl())&&(a.focus(),a.showMenu(!b.aria),b.aria&&a.menu.items().filter(":visible")[0].focus())}),a.on("mouseenter",function(b){var c,d=b.control,f=a.parent();d&&f&&d instanceof e&&d.parent()==f&&(f.items().filter("MenuButton").each(function(a){a.hideMenu&&a!=d&&(a.menu&&a.menu.visible()&&(c=!0),a.hideMenu())}),c&&(d.focus(),d.showMenu()))}),a._super()},bindStates:function(){var a=this;return a.state.on("change:menu",function(){a.menu&&a.menu.remove(),a.menu=null}),a._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return e}),g("3f",["2m","2c","6","5"],function(a,b,c,d){"use strict";return a.extend({Defaults:{border:0,role:"menuitem"},init:function(a){var b,c=this;c._super(a),a=c.settings,c.classes.add("menu-item"),a.menu&&c.classes.add("menu-item-expand"),a.preview&&c.classes.add("menu-item-preview"),b=c.state.get("text"),"-"!==b&&"|"!==b||(c.classes.add("menu-item-sep"),c.aria("role","separator"),c.state.set("text","-")),a.selectable&&(c.aria("role","menuitemcheckbox"),c.classes.add("menu-item-checkbox"),a.icon="selected"),a.preview||a.selectable||c.classes.add("menu-item-normal"),c.on("mousedown",function(a){a.preventDefault()}),a.menu&&!a.ariaHideMenu&&c.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var a,c=this,d=c.settings,e=c.parent();if(e.items().each(function(a){a!==c&&a.hideMenu()}),d.menu){a=c.menu,a?a.show():(a=d.menu,a.length?a={type:"menu",items:a}:a.type=a.type||"menu",e.settings.itemDefaults&&(a.itemDefaults=e.settings.itemDefaults),a=c.menu=b.create(a).parent(c).renderTo(),a.reflow(),a.on("cancel",function(b){b.stopPropagation(),c.focus(),a.hide()}),a.on("show hide",function(a){a.control.items&&a.control.items().each(function(a){a.active(a.settings.selected)})}).fire("show"),a.on("hide",function(b){b.control===a&&c.classes.remove("selected")}),a.submenu=!0),a._parentMenu=e,a.classes.add("menu-sub");var f=a.testMoveRel(c.getEl(),c.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);a.moveRel(c.getEl(),f),a.rel=f,f="menu-sub-"+f,a.classes.remove(a._lastRel).add(f),a._lastRel=f,c.classes.add("selected"),c.aria("expanded",!0)}},hideMenu:function(){var a=this;return a.menu&&(a.menu.items().each(function(a){a.hideMenu&&a.hideMenu()}),a.menu.hide(),a.aria("expanded",!1)),a},renderHtml:function(){function a(a){var b,d,e={};for(e=c.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},a=a.split("+"),b=0;b").replace(new RegExp(b("]mce~match!"),"g"),"")}var f=this,g=f._id,h=f.settings,i=f.classPrefix,j=f.state.get("text"),k=f.settings.icon,l="",m=h.shortcut,n=f.encode(h.url),o="";return k&&f.parent().classes.add("menu-has-icons"),h.image&&(l=" style=\"background-image: url('"+h.image+"')\""),m&&(m=a(m)),k=i+"ico "+i+"i-"+(f.settings.icon||"none"),o="-"!==j?'\xa0":"",j=e(f.encode(d(j))),n=e(f.encode(d(n))),'
                              '+o+("-"!==j?''+j+"":"")+(m?'
                              '+m+"
                              ":"")+(h.menu?'
                              ':"")+(n?'":"")+"
                              "},postRender:function(){var a=this,b=a.settings,c=b.textStyle;if("function"==typeof c&&(c=c.call(this)),c){var e=a.getEl("text");e&&e.setAttribute("style",c)}return a.on("mouseenter click",function(c){c.control===a&&(b.menu||"click"!==c.type?(a.showMenu(),c.aria&&a.menu.focus(!0)):(a.fire("select"),d.requestAnimationFrame(function(){a.parent().hideAll()})))}),a._super(),a},hover:function(){var a=this;return a.parent().items().each(function(a){a.classes.remove("selected")}),a.classes.toggle("selected",!0),a},active:function(a){return"undefined"!=typeof a&&this.aria("checked",a),this._super(a)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),g("3g",["a","2b","5"],function(a,b,c){"use strict";return function(d,e){var f,g,h=this,i=b.classPrefix;h.show=function(b,j){function k(){f&&(a(d).append('
                              '),j&&j())}return h.hide(),f=!0,b?g=c.setTimeout(k,b):k(),h},h.hide=function(){var a=d.lastChild;return c.clearTimeout(g),a&&a.className.indexOf("throbber")!=-1&&a.parentNode.removeChild(a),f=!1,h}}}),g("3h",["2k","3f","3g","9"],function(a,b,c,d){"use strict";return a.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(a){var b=this;if(a.autohide=!0,a.constrainToViewport=!0,"function"==typeof a.items&&(a.itemsFactory=a.items,a.items=[]),a.itemDefaults)for(var c=a.items,e=c.length;e--;)c[e]=d.extend({},a.itemDefaults,c[e]);b._super(a),b.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var a=this;a.hideAll(),a.fire("select")},load:function(){function a(){e.throbber&&(e.throbber.hide(),e.throbber=null)}var b,d,e=this;d=e.settings.itemsFactory,d&&(e.throbber||(e.throbber=new c(e.getEl("body"),!0),0===e.items().length?(e.throbber.show(),e.fire("loading")):e.throbber.show(100,function(){e.items().remove(),e.fire("loading")}),e.on("hide close",a)),e.requestTime=b=(new Date).getTime(),e.settings.itemsFactory(function(c){return 0===c.length?void e.hide():void(e.requestTime===b&&(e.getEl().style.width="",e.getEl("body").style.width="",a(),e.items().remove(),e.getEl("body").innerHTML="",e.add(c),e.renderNew(),e.fire("loaded")))}))},hideAll:function(){var a=this;return this.find("menuitem").exec("hideMenu"),a._super()},preRender:function(){var a=this;return a.items().each(function(b){var c=b.settings;if(c.icon||c.image||c.selectable)return a._hasIcons=!0,!1}),a.settings.itemsFactory&&a.on("postrender",function(){a.settings.itemsFactory&&a.load()}),a._super()}})}),g("3i",["3e","3h"],function(a,b){"use strict";return a.extend({init:function(a){function b(c){for(var f=0;f0&&(e=c[0].text,g.state.set("value",c[0].value)),g.state.set("menu",c)),g.state.set("text",a.text||e),g.classes.add("listbox"),g.on("select",function(b){var c=b.control;f&&(b.lastControl=f),a.multiple?c.active(!c.active()):g.value(b.control.value()),f=c})},bindStates:function(){function a(a,c){a instanceof b&&a.items().each(function(a){a.hasMenus()||a.active(a.value()===c)})}function c(a,b){var d;if(a)for(var e=0;e
                              '},postRender:function(){var a=this;a._super(),a.resizeDragHelper=new b(this._id,{start:function(){a.fire("ResizeStart")},drag:function(b){"both"!=a.settings.direction&&(b.deltaX=0),a.fire("Resize",b)},stop:function(){a.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),g("3l",["2m"],function(a){"use strict";function b(a){var b="";if(a)for(var c=0;c'+a[c]+"";return b}return a.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[] +},init:function(a){var b=this;b._super(a),b.settings.size&&(b.size=b.settings.size),b.settings.options&&(b._options=b.settings.options),b.on("keydown",function(a){var c;13==a.keyCode&&(a.preventDefault(),b.parents().reverse().each(function(a){if(a.toJSON)return c=a,!1}),b.fire("submit",{data:c.toJSON()}))})},options:function(a){return arguments.length?(this.state.set("options",a),this):this.state.get("options")},renderHtml:function(){var a,c=this,d="";return a=b(c._options),c.size&&(d=' size = "'+c.size+'"'),'"},bindStates:function(){var a=this;return a.state.on("change:options",function(c){a.getEl().innerHTML=b(c.value)}),a._super()}})}),g("3m",["2m","2f","4h"],function(a,b,c){"use strict";function d(a,b,c){return ac&&(a=c),a}function e(a,b,c){a.setAttribute("aria-"+b,c)}function f(a,b){var d,f,g,h,i,j;"v"==a.settings.orientation?(h="top",g="height",f="h"):(h="left",g="width",f="w"),j=a.getEl("handle"),d=(a.layoutRect()[f]||100)-c.getSize(j)[g],i=d*((b-a._minValue)/(a._maxValue-a._minValue))+"px",j.style[h]=i,j.style.height=a.layoutRect().h+"px",e(j,"valuenow",b),e(j,"valuetext",""+a.settings.previewFilter(b)),e(j,"valuemin",a._minValue),e(j,"valuemax",a._maxValue)}return a.extend({init:function(a){var b=this;a.previewFilter||(a.previewFilter=function(a){return Math.round(100*a)/100}),b._super(a),b.classes.add("slider"),"v"==a.orientation&&b.classes.add("vertical"),b._minValue=a.minValue||0,b._maxValue=a.maxValue||100,b._initValue=b.state.get("value")},renderHtml:function(){var a=this,b=a._id,c=a.classPrefix;return'
                              '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function a(a,b,c){return(c+a)/(b-a)}function e(a,b,c){return c*(b-a)-a}function f(b,c){function f(f){var g;g=n.value(),g=e(b,c,a(b,c,g)+.05*f),g=d(g,b,c),n.value(g),n.fire("dragstart",{value:g}),n.fire("drag",{value:g}),n.fire("dragend",{value:g})}n.on("keydown",function(a){switch(a.keyCode){case 37:case 38:f(-1);break;case 39:case 40:f(1)}})}function g(a,e,f){var g,h,i,o,p;n._dragHelper=new b(n._id,{handle:n._id+"-handle",start:function(a){g=a[j],h=parseInt(n.getEl("handle").style[k],10),i=(n.layoutRect()[m]||100)-c.getSize(f)[l],n.fire("dragstart",{value:p})},drag:function(b){var c=b[j]-g;o=d(h+c,0,i),f.style[k]=o+"px",p=a+o/i*(e-a),n.value(p),n.tooltip().text(""+n.settings.previewFilter(p)).show().moveRel(f,"bc tc"),n.fire("drag",{value:p})},stop:function(){n.tooltip().hide(),n.fire("dragend",{value:p})}})}var h,i,j,k,l,m,n=this;h=n._minValue,i=n._maxValue,"v"==n.settings.orientation?(j="screenY",k="top",l="height",m="h"):(j="screenX",k="left",l="width",m="w"),n._super(),f(h,i,n.getEl("handle")),g(h,i,n.getEl("handle"))},repaint:function(){this._super(),f(this,this.value())},bindStates:function(){var a=this;return a.state.on("change:value",function(b){f(a,b.value)}),a._super()}})}),g("3n",["2m"],function(a){"use strict";return a.extend({renderHtml:function(){var a=this;return a.classes.add("spacer"),a.canFocus=!1,'
                              '}})}),g("3o",["3e","4h","a"],function(a,b,c){return a.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var a,d,e=this,f=e.getEl(),g=e.layoutRect();return e._super(),a=f.firstChild,d=f.lastChild,c(a).css({width:g.w-b.getSize(d).width,height:g.h-2}),c(d).css({height:g.h-2}),e},activeMenu:function(a){var b=this;c(b.getEl().lastChild).toggleClass(b.classPrefix+"active",a)},renderHtml:function(){var a,b=this,c=b._id,d=b.classPrefix,e=b.state.get("icon"),f=b.state.get("text"),g="";return a=b.settings.image,a?(e="none","string"!=typeof a&&(a=window.getSelection?a[0]:a[1]),a=" style=\"background-image: url('"+a+"')\""):a="",e=b.settings.icon?d+"ico "+d+"i-"+e:"",f&&(b.classes.add("btn-has-text"),g=''+b.encode(f)+""),'
                              '},postRender:function(){var a=this,b=a.settings.onclick;return a.on("click",function(a){var c=a.target;if(a.control==this)for(;c;){if(a.aria&&"down"!=a.aria.key||"BUTTON"==c.nodeName&&c.className.indexOf("open")==-1)return a.stopImmediatePropagation(),void(b&&b.call(this,a));c=c.parentNode}}),delete a.settings.onclick,a._super()}})}),g("3p",["36"],function(a){"use strict";return a.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),g("3q",["2h","a","4h"],function(a,b,c){"use strict";return a.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(a){var c;this.activeTabId&&(c=this.getEl(this.activeTabId),b(c).removeClass(this.classPrefix+"active"),c.setAttribute("aria-selected","false")),this.activeTabId="t"+a,c=this.getEl("t"+a),c.setAttribute("aria-selected","true"),b(c).addClass(this.classPrefix+"active"),this.items()[a].show().fire("showtab"),this.reflow(),this.items().each(function(b,c){a!=c&&b.hide()})},renderHtml:function(){var a=this,b=a._layout,c="",d=a.classPrefix;return a.preRender(),b.preRender(a),a.items().each(function(b,e){var f=a._id+"-t"+e;b.aria("role","tabpanel"),b.aria("labelledby",f),c+='"}),'
                              '+c+'
                              '+b.renderHtml(a)+"
                              "},postRender:function(){var a=this;a._super(),a.settings.activeTab=a.settings.activeTab||0,a.activateTab(a.settings.activeTab),this.on("click",function(b){var c=b.target.parentNode;if(c&&c.id==a._id+"-head")for(var d=c.childNodes.length;d--;)c.childNodes[d]==b.target&&a.activateTab(d)})},initLayoutRect:function(){var a,b,d,e=this;b=c.getSize(e.getEl("head")).width,b=b<0?0:b,d=0,e.items().each(function(a){b=Math.max(b,a.layoutRect().minW),d=Math.max(d,a.layoutRect().minH)}),e.items().each(function(a){a.settings.x=0,a.settings.y=0,a.settings.w=b,a.settings.h=d,a.layoutRect({x:0,y:0,w:b,h:d})});var f=c.getSize(e.getEl("head")).height;return e.settings.minWidth=b,e.settings.minHeight=d+f,a=e._super(),a.deltaH+=f,a.innerH=a.h-a.deltaH,a}})}),g("3r",["2m","9","4h"],function(a,b,c){return a.extend({init:function(a){var b=this;b._super(a),b.classes.add("textbox"),a.multiline?b.classes.add("multiline"):(b.on("keydown",function(a){var c;13==a.keyCode&&(a.preventDefault(),b.parents().reverse().each(function(a){if(a.toJSON)return c=a,!1}),b.fire("submit",{data:c.toJSON()}))}),b.on("keyup",function(a){b.state.set("value",a.target.value)}))},repaint:function(){var a,b,c,d,e,f=this,g=0;a=f.getEl().style,b=f._layoutRect,e=f._lastRepaintRect||{};var h=document;return!f.settings.multiline&&h.all&&(!h.documentMode||h.documentMode<=8)&&(a.lineHeight=b.h-g+"px"),c=f.borderBox,d=c.left+c.right+8,g=c.top+c.bottom+(f.settings.multiline?8:0),b.x!==e.x&&(a.left=b.x+"px",e.x=b.x),b.y!==e.y&&(a.top=b.y+"px",e.y=b.y),b.w!==e.w&&(a.width=b.w-d+"px",e.w=b.w),b.h!==e.h&&(a.height=b.h-g+"px",e.h=b.h),f._lastRepaintRect=e,f.fire("repaint",{},!1),f},renderHtml:function(){var a,d,e=this,f=e.settings;return a={id:e._id,hidefocus:"1"},b.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(b){a[b]=f[b]}),e.disabled()&&(a.disabled="disabled"),f.subtype&&(a.type=f.subtype),d=c.create(f.multiline?"textarea":"input",a),d.value=e.state.get("value"),d.className=e.classes,d.outerHTML},value:function(a){return arguments.length?(this.state.set("value",a),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var a=this;a.getEl().value=a.state.get("value"),a._super(),a.$el.on("change",function(b){a.state.set("value",b.target.value),a.fire("change",b)})},bindStates:function(){var a=this;return a.state.on("change:value",function(b){a.getEl().value!=b.value&&(a.getEl().value=b.value)}),a.state.on("change:disabled",function(b){a.getEl().disabled=b.value}),a._super()},remove:function(){this.$el.off(),this._super()}})}),g("1f",["28","29","2a","2b","2c","2d","2e","2f","2g","2h","2i","2j","2k","1z","20","2l","2m","2n","21","2o","2p","2q","2r","2s","2t","2u","2v","2w","2x","2y","2z","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","3g","3h","3i","3j","3k","3l","3m","3n","3o","3p","3q","3r"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea){"use strict";var fa=function(a,b){e.add(a.split(".").pop(),b)},ga=function(a,b,c){var d,e;for(e=b.split(/[.\/]/),d=0;d'',')'=>'',','=>'-','"'=>'',':'=>'-',';'=>'-','№'=>'N', +'…'=>'','—'=>'-','('=>'',')'=>'',','=>'-','"'=>'',':'=>'-',';'=>'-','№'=>'N', '&'=>'and','%'=>'','\''=>'','«'=>'','»'=>'','À'=>'A','À'=>'A','Á'=>'A','Á'=>'A','Â'=>'A','Â'=>'A','Ã'=>'A', 'Ã'=>'A','Ä'=>'e','Ä'=>'A','Å'=>'A','Å'=>'A','Æ'=>'e','Æ'=>'E','Ā'=>'A','Ą'=>'A','Ă'=>'A', 'Ç'=>'C','Ç'=>'C','Ć'=>'C','Č'=>'C','Ĉ'=>'C','Ċ'=>'C','Ď'=>'D','Đ'=>'D','È'=>'E','È'=>'E', diff --git a/assets/snippets/DocLister/core/DocLister.abstract.php b/assets/snippets/DocLister/core/DocLister.abstract.php old mode 100755 new mode 100644 index aa6ada6cbd..0376a40b46 --- a/assets/snippets/DocLister/core/DocLister.abstract.php +++ b/assets/snippets/DocLister/core/DocLister.abstract.php @@ -238,7 +238,7 @@ public function __construct($modx, $cfg = array(), $startTime = null) } $this->config->setConfig($cfg); - $this->table = $this->getTable($this->getCFGDef('table', 'site_content')); + $this->table = $this->getTable(empty($this->table) ? $this->getCFGDef('table', 'site_content') : $this->table); $this->idField = $this->getCFGDef('idField', 'id'); $this->parentField = $this->getCFGDef('parentField', 'parent'); @@ -581,7 +581,7 @@ public function render($tpl = '') $out = $this->_render($tpl); } - $this->outData = DLTemplate::getInstance($this->modx)->parseDocumentSource($out); + if ($out) $this->outData = DLTemplate::getInstance($this->modx)->parseDocumentSource($out); $this->debug->debugEnd('render'); return $this->outData; @@ -1009,7 +1009,7 @@ protected function uniformPrepare(&$data, $i = 0) { $class = array(); - $iterationName = ($i % 2 == 0) ? 'Odd' : 'Even'; + $iterationName = ($i % 2 == 1) ? 'Odd' : 'Even'; $tmp = strtolower($iterationName); $class[] = $this->getCFGDef($tmp . 'Class', $tmp); @@ -1091,6 +1091,11 @@ public function getJSON($data, $fields, $array = array()) $return['rows'][] = APIHelpers::getkey($item, $key, $item); } $return['total'] = $this->getChildrenCount(); + }elseif ('simple' == $this->getCFGDef('JSONformat', 'old')) { + $return = array(); + foreach ($out as $key => $item) { + $return[] = APIHelpers::getkey($item, $key, $item); + } } else { $return = $out; } diff --git a/assets/snippets/DocLister/core/controller/onetable.php b/assets/snippets/DocLister/core/controller/onetable.php old mode 100755 new mode 100644 index fba1975628..987820a8a7 --- a/assets/snippets/DocLister/core/controller/onetable.php +++ b/assets/snippets/DocLister/core/controller/onetable.php @@ -19,7 +19,7 @@ class onetableDocLister extends DocLister /** * @var string */ - protected $table = 'site_content'; + protected $table = ''; /** * @var string @@ -131,8 +131,6 @@ public function _render($tpl = '') } } $out = $this->renderWrap($out); - } else { - $out = 'none TPL'; } return $this->toPlaceholders($out); diff --git a/assets/snippets/DocLister/core/controller/shopkeeper.php b/assets/snippets/DocLister/core/controller/shopkeeper.php old mode 100755 new mode 100644 index d26ca2bb7f..db87d95b78 --- a/assets/snippets/DocLister/core/controller/shopkeeper.php +++ b/assets/snippets/DocLister/core/controller/shopkeeper.php @@ -134,8 +134,6 @@ public function _render($tpl = '') $out = ($noneTPL != '') ? $this->parseChunk($noneTPL, $sysPlh) : ''; } $out = $this->renderWrap($out); - } else { - $out = 'no template'; } return $this->toPlaceholders($out); diff --git a/assets/snippets/DocLister/core/controller/site_content.php b/assets/snippets/DocLister/core/controller/site_content.php old mode 100755 new mode 100644 index ac6a30cb07..e628c242b9 --- a/assets/snippets/DocLister/core/controller/site_content.php +++ b/assets/snippets/DocLister/core/controller/site_content.php @@ -46,7 +46,7 @@ public function getDocs($tvlist = '') if ($tvlist == '') { $tvlist = $this->getCFGDef('tvList', ''); } - + $this->extTV->getAllTV_Name(); if ($this->extPaginate = $this->getExtender('paginate')) { @@ -148,10 +148,14 @@ public function _render($tpl = '') } } - $item['date'] = (isset($item[$date]) && $date != 'createdon' && $item[$date] != 0 && $item[$date] == (int)$item[$date]) ? $item[$date] : $item['createdon']; - $item['date'] = $item['date'] + $this->modx->config['server_offset_time']; - if ($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M') != '') { - $item['date'] = strftime($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'), $item['date']); + if (isset($item[$date])) { + $_date = is_numeric($item[$date]) && $item[$date] == (int)$item[$date] ? $item[$date] : strtotime($item[$date]); + if ($_date !== false) { + $_date = $_date + $this->modx->config['server_offset_time']; + if ($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M') != '') { + $item['date'] = strftime($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'), $_date); + } + } } $findTpl = $this->renderTPL; @@ -185,8 +189,6 @@ public function _render($tpl = '') $out = ($noneTPL != '') ? $this->parseChunk($noneTPL, $sysPlh) : ''; } $out = $this->renderWrap($out); - } else { - $out = 'no template'; } return $this->toPlaceholders($out); @@ -225,9 +227,15 @@ public function getJSON($data, $fields, $array = array()) $row['summary'] = $this->getSummary($this->_docs[$num], $extSummary, 'introtext', 'content'); } if (array('1') == $fields || in_array('date', $fields)) { - $tmp = (isset($this->_docs[$num][$date]) && $date != 'createdon' && $this->_docs[$num][$date] != 0 && $this->_docs[$num][$date] == (int)$this->_docs[$num][$date]) ? $this->_docs[$num][$date] : $this->_docs[$num]['createdon']; - $row['date'] = strftime($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'), - $tmp + $this->modx->config['server_offset_time']); + if (isset($this->_docs[$num][$date])) { + $_date = is_numeric($this->_docs[$num][$date]) && $this->_docs[$num][$date] == (int)$this->_docs[$num][$date] ? $this->_docs[$num][$date] : strtotime($this->_docs[$num][$date]); + if ($_date !== false) { + $_date = $_date + $this->modx->config['server_offset_time']; + if ($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M') != '') { + $row['date'] = strftime($this->getCFGDef('dateFormat', '%d.%b.%y %H:%M'), $_date); + } + } + } } if (array('1') == $fields || in_array(array('menutitle', 'pagetitle'), $fields)) { $row['title'] = ($row['menutitle'] == '' ? $row['pagetitle'] : $row['menutitle']); @@ -268,6 +276,8 @@ public function getChildrenCount() $out = 0; $sanitarInIDs = $this->sanitarIn($this->IDs); if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) { + $q_true = $this->getCFGDef('ignoreEmpty', '0'); + $q_true = $q_true ? $q_true : $this->getCFGDef('idType', 'parents') == 'parents'; $where = $this->getCFGDef('addWhereList', ''); $where = sqlHelper::trimLogicalOp($where); $where = ($where ? $where . ' AND ' : '') . $this->_filters['where']; @@ -281,6 +291,9 @@ public function getChildrenCount() if (!$this->getCFGDef('showNoPublish', 0)) { $whereArr[] = "c.deleted=0 AND c.published=1"; } + else{ + $q_true = 1; + } $tbl_site_content = $this->getTable('site_content', 'c'); @@ -315,6 +328,8 @@ public function getChildrenCount() $from = $tbl_site_content . " " . $this->_filters['join']; $where = sqlHelper::trimLogicalOp($where); + $q_true = $q_true ? $q_true : trim($where) != 'WHERE'; + if (trim($where) != 'WHERE') { $where .= " AND "; } @@ -329,8 +344,15 @@ public function getChildrenCount() $sort = $this->SortOrderSQL("if(c.pub_date=0,c.createdon,c.pub_date)"); list($from) = $this->injectSortByTV($from, $sort); - $rs = $this->dbQuery("SELECT count(*) FROM (SELECT count(*) FROM {$from} {$where} {$group}) as `tmp`"); - $out = $this->modx->db->getValue($rs); + $q_true = $q_true ? $q_true : $group != 'GROUP BY c.id'; + + if ( $q_true ){ + $rs = $this->dbQuery("SELECT count(*) FROM (SELECT count(*) FROM {$from} {$where} {$group}) as `tmp`"); + $out = $this->modx->db->getValue($rs); + } + else { + $out = count($this->IDs); + } } return $out; diff --git a/assets/snippets/DocLister/core/extender/e.extender.inc b/assets/snippets/DocLister/core/extender/e.extender.inc old mode 100755 new mode 100644 index 1756581b8c..e672fb4d4e --- a/assets/snippets/DocLister/core/extender/e.extender.inc +++ b/assets/snippets/DocLister/core/extender/e.extender.inc @@ -23,9 +23,18 @@ class e_DL_Extender extends extDocLister if (is_scalar($eFields)) { $eFields = explode(",", $eFields); } + $sanitarTagsFields = array(); + if ($sanitarTags = $this->DocLister->getCFGDef('sanitarTags',0)) { + if (is_numeric($sanitarTags) && is_array($eFields)) { + $sanitarTagsFields = $eFields; + } elseif (is_scalar($sanitarTags)) { + $sanitarTagsFields = explode(",", $sanitarTags); + } + } if (is_array($eFields)) { foreach ($eFields as $field) { $val = APIHelpers::getkey($out, $field, ''); + if (in_array($field, $sanitarTagsFields)) $val = APIHelpers::sanitarTag($val); $out['e.' . $field] = APIHelpers::e($val); } } diff --git a/assets/snippets/DocLister/core/extender/paginate.extender.inc b/assets/snippets/DocLister/core/extender/paginate.extender.inc old mode 100755 new mode 100644 index da4e18b1a4..17dde0e9ae --- a/assets/snippets/DocLister/core/extender/paginate.extender.inc +++ b/assets/snippets/DocLister/core/extender/paginate.extender.inc @@ -51,6 +51,13 @@ class paginate_DL_Extender extends extDocLister default: $paginate = 'pages'; $requestName = $this->getRequestName('page'); + if ( + isset($_GET[$requestName]) + && intval($_GET[$requestName]) <= 1 + && !$this->DocLister->getCFGDef('noRedirect',0) + ) { + $this->modx->sendRedirect($this->getUrl()); + } $start = (isset($_GET[$requestName]) && intval($_GET[$requestName]) > 1) ? (intval($_GET[$requestName]) - 1) : 0; $this->_pages['current'] = $start + 1; $this->DocLister->config->setConfig(array('start' => $start * $display)); @@ -97,7 +104,7 @@ class paginate_DL_Extender extends extDocLister $to = ($this->currentPage() == $this->totalPage()) ? $from - 1 + $tmp - ($this->currentPage() - 1) * $display : $from - 1 + $display; $this->DocLister->toPlaceholders($to, 1, "to"); } else { - $this->modx->sendRedirect($this->getUrl('page')); + $this->modx->sendRedirect($this->getUrl()); } } @@ -184,13 +191,26 @@ class paginate_DL_Extender extends extDocLister switch ($this->DocLister->getCFGDef('paginate', '')) { case 'offset': $requestName = 'start'; + $url = $this->buildUrl($url, $requestName, $params); break; case 'pages': default: $requestName = 'page'; + $call = $this->DocLister->getCFGDef('makePaginateUrl', ''); + if((is_object($call) && ($call instanceof Closure)) || is_callable($call)){ + $url = call_user_func($call, compact('url', 'params'), $this->modx, $this->DocLister, $this); + }else{ + $url = $this->buildUrl($url, $requestName, $params); + } break; } } + + + return $url; + } + + public function buildUrl($url, $requestName, $params){ if ($requestName != '' && is_array($params)) { $q = http_build_query(array_merge($params, array($this->getRequestName($requestName) => null))); $url = explode("?", $url, 2); @@ -199,10 +219,9 @@ class paginate_DL_Extender extends extDocLister $url .= "?" . $q; } } - return $url; } - + /** * Имя REQUEST переменной в пагинаторе * diff --git a/assets/snippets/DocLister/core/extender/prepare.extender.inc b/assets/snippets/DocLister/core/extender/prepare.extender.inc old mode 100755 new mode 100644 index 8c70377289..4a566a3224 --- a/assets/snippets/DocLister/core/extender/prepare.extender.inc +++ b/assets/snippets/DocLister/core/extender/prepare.extender.inc @@ -85,6 +85,9 @@ class prepare_DL_Extender extends extDocLister public function callPrepare($name, array $params, $ret = null) { $out = null; + if (empty($name)) { + return $params['data']; + } if ((is_object($name) && ($name instanceof Closure)) || is_callable($name)) { $data = call_user_func($name, $params['data'], $params['modx'], $params['_DocLister'], $params['_extDocLister']); diff --git a/assets/snippets/DocLister/core/extender/tv.extender.inc b/assets/snippets/DocLister/core/extender/tv.extender.inc old mode 100755 new mode 100644 index 588f2a7dd1..61e22d3822 --- a/assets/snippets/DocLister/core/extender/tv.extender.inc +++ b/assets/snippets/DocLister/core/extender/tv.extender.inc @@ -67,7 +67,12 @@ class tv_DL_Extender extends extDocLister */ public function getTVnames() { - return $this->modx->_TVnames; + $out = array(); + foreach ($this->modx->_TVnames as $name => $tv) { + $out[$name] = $tv['id']; + } + + return $out; } /** @@ -78,13 +83,15 @@ class tv_DL_Extender extends extDocLister { if (empty($this->modx->_TVnames) || $reload) { $from = $this->DocLister->getTable('site_tmplvars'); - $rs = $this->DocLister->dbQuery("SELECT id, name FROM {$from}"); + $rs = $this->DocLister->dbQuery("SELECT `id`, `name`, `type` FROM {$from}"); $rows = $this->modx->db->makeArray($rs); - $out = array(); + foreach ($rows as $item) { - $out[$item['name']] = $item['id']; + $this->modx->_TVnames[$item['name']] = array( + "id" => $item['id'], + "type" => $item['type'] + ); } - $this->modx->_TVnames = $out; } return $this->getTVnames(); @@ -203,7 +210,7 @@ class tv_DL_Extender extends extDocLister foreach ($tvlist as $tv) { $tv = trim($tv); if (isset($this->modx->_TVnames[$tv])) { - $out[$this->modx->_TVnames[$tv]] = $tv; + $out[$this->modx->_TVnames[$tv]['id']] = $tv; } } diff --git a/assets/snippets/DocLister/lib/DLFixedPrepare.class.php b/assets/snippets/DocLister/lib/DLFixedPrepare.class.php index 1263dd5698..a2b15f3840 100755 --- a/assets/snippets/DocLister/lib/DLFixedPrepare.class.php +++ b/assets/snippets/DocLister/lib/DLFixedPrepare.class.php @@ -21,7 +21,7 @@ public static function buildMenu(array $data = array(), DocumentParser $modx, $_ $params['parents'] = $data['id']; $params['idType'] = 'parents'; $params['documents'] = ''; - $data['dl.submenu'] = $modx->runSnippet('DLBuildMenu', $params); + $data['dl.submenu'] = ($data['isfolder']) ? $modx->runSnippet('DLBuildMenu', $params) : ''; } else { $data['dl.submenu'] = ''; } diff --git a/assets/snippets/DocLister/snippet.DLBuildMenu.php b/assets/snippets/DocLister/snippet.DLBuildMenu.php old mode 100755 new mode 100644 index 3e1eb9a6b3..2027976b14 --- a/assets/snippets/DocLister/snippet.DLBuildMenu.php +++ b/assets/snippets/DocLister/snippet.DLBuildMenu.php @@ -11,6 +11,16 @@ $p = array(); } +if ( isset( $p['config'] ) ) { + require_once MODX_BASE_PATH . 'assets/lib/Helpers/Config.php'; + + $helper = new \Helpers\Config( $p ); + $helper->setPath( '/assets/snippets/DocLister/' ); + $helper->loadConfig( $p['config'] ); + + $p = array_merge( $helper->getConfig(), $p ); +} + /** Текущий уровень вложенности */ $p['currentDepth'] = $currentDepth = \APIhelpers::getkey($p, 'currentDepth', 1); diff --git a/assets/snippets/DocLister/snippet.DLcrumbs.php b/assets/snippets/DocLister/snippet.DLcrumbs.php old mode 100755 new mode 100644 index df9306d734..33f3c5cfc4 --- a/assets/snippets/DocLister/snippet.DLcrumbs.php +++ b/assets/snippets/DocLister/snippet.DLcrumbs.php @@ -10,6 +10,17 @@ } $_out = ''; +if ( isset( $modx->event->params['config'] ) ) { + require_once MODX_BASE_PATH . 'assets/lib/Helpers/Config.php'; + + $helper = new \Helpers\Config( $modx->event->params ); + $helper->setPath( '/assets/snippets/DocLister/' ); + $helper->loadConfig( $modx->event->params['config'] ); + + $modx->event->params = array_merge( $helper->getConfig(), $modx->event->params ); + extract( $modx->event->params ); +} + $_parents = array(); $hideMain = (!isset($hideMain) || (int)$hideMain == 0); if ($hideMain) { diff --git a/assets/snippets/FormLister/__autoload.php b/assets/snippets/FormLister/__autoload.php new file mode 100644 index 0000000000..3195891a4f --- /dev/null +++ b/assets/snippets/FormLister/__autoload.php @@ -0,0 +1,67 @@ + '/../../lib/APIHelpers.class.php', + 'AssetsHelper' => '/../../lib/Helpers/Assets.php', + 'DLTemplate' => '/../DocLister/lib/DLTemplate.class.php', + 'DLphx' => '/../DocLister/lib/DLphx.class.php', + 'DrewM\\MailChimp\\Batch' => '/lib/MailChimp/Batch.php', + 'DrewM\\MailChimp\\MailChimp' => '/lib/MailChimp/MailChimp.php', + 'FormLister\\Activate' => '/core/controller/Activate.php', + 'FormLister\\CaptchaInterface' => '/lib/captcha/Captcha.php', + 'FormLister\\Content' => '/core/controller/Content.php', + 'FormLister\\Core' => '/core/FormLister.abstract.php', + 'FormLister\\DeleteContent' => '/core/controller/DeleteContent.php', + 'FormLister\\DeleteUser' => '/core/controller/DeleteUser.php', + 'FormLister\\FileValidator' => '/lib/FileValidator.php', + 'FormLister\\Form' => '/core/controller/Form.php', + 'FormLister\\Login' => '/core/controller/Login.php', + 'FormLister\\MailChimp' => '/core/controller/MailChimp.php', + 'FormLister\\Profile' => '/core/controller/Profile.php', + 'FormLister\\Register' => '/core/controller/Register.php', + 'FormLister\\Reminder' => '/core/controller/Reminder.php', + 'FormLister\\Validator' => '/lib/Validator.php', + 'Formatter\\HtmlFormatter' => '/../../lib/Formatter/HtmlFormatter.php', + 'Formatter\\SqlFormatter' => '/../../lib/Formatter/SqlFormatter.php', + 'Helpers\\Collection' => '/../../lib/Helpers/Collection.php', + 'Helpers\\Config' => '/../../lib/Helpers/Config.php', + 'Helpers\\Debug' => '/lib/Debug.php', + 'Helpers\\FS' => '/../../lib/Helpers/FS.php', + 'Helpers\\Lexicon' => '/lib/Lexicon.php', + 'Helpers\\Mailer' => '/../../lib/Helpers/Mailer.php', + 'Helpers\\PHPThumb' => '/../../lib/Helpers/PHPThumb.php', + 'Helpers\\Video' => '/../../lib/Helpers/Video.php', + 'MODxAPI' => '/../../lib/MODxAPI/MODx.php', + 'MODxAPIhelpers' => '/../../lib/MODxAPI/MODx.php', + 'ModxCaptcha' => '/lib/captcha/modxCaptcha/modxCaptcha.php', + 'ModxCaptchaWrapper' => '/lib/captcha/modxCaptcha/wrapper.php', + 'ReCaptchaWrapper' => '/lib/captcha/reCaptcha/wrapper.php', + 'SmsCaptchaWrapper' => '/lib/captcha/smsCaptcha/wrapper.php', + 'SmsModel' => '/lib/captcha/smsCaptcha/model.php', + 'SummaryText' => '/../../lib/class.summary.php', + 'autoTable' => '/../../lib/MODxAPI/autoTable.abstract.php', + 'jsonHelper' => '/../DocLister/lib/jsonHelper.class.php', + 'modCategories' => '/../../lib/MODxAPI/modCategories.php', + 'modChunk' => '/../../lib/MODxAPI/modChunk.php', + 'modModule' => '/../../lib/MODxAPI/modModule.php', + 'modPlugin' => '/../../lib/MODxAPI/modPlugin.php', + 'modResource' => '/../../lib/MODxAPI/modResource.php', + 'modSnippet' => '/../../lib/MODxAPI/modSnippet.php', + 'modTV' => '/../../lib/MODxAPI/modTV.php', + 'modTemplate' => '/../../lib/MODxAPI/modTemplate.php', + 'modUsers' => '/../../lib/MODxAPI/modUsers.php', + 'sqlHelper' => '/../DocLister/lib/sqlHelper.class.php', + 'xNop' => '/../DocLister/lib/xnop.class.php' + ); + } + if (isset($classes[$class])) { + require dirname(__FILE__) . $classes[$class]; + } +} +spl_autoload_register('autoloade366e6fef0b0abb40d30844d932018e7', true); +// @codeCoverageIgnoreEnd diff --git a/assets/snippets/FormLister/config/core/default.json b/assets/snippets/FormLister/config/core/default.json new file mode 100644 index 0000000000..9db5c941e2 --- /dev/null +++ b/assets/snippets/FormLister/config/core/default.json @@ -0,0 +1,7 @@ +{ + "errorClass":" has-error", + "requiredClass":" has-warning", + "subject":"Новое сообщение", + "messagesOuterTpl":"@CODE:
                              [+messages+]
                              ", + "errorTpl":"@CODE:[+message+]" +} \ No newline at end of file diff --git a/assets/snippets/FormLister/core/FormLister.abstract.php b/assets/snippets/FormLister/core/FormLister.abstract.php new file mode 100644 index 0000000000..01ef022b74 --- /dev/null +++ b/assets/snippets/FormLister/core/FormLister.abstract.php @@ -0,0 +1,1215 @@ + сообщение) + * messages - сообщения + * status - для api-режима, результат использования формы + * @var array + */ + private $formData = array( + 'fields' => array(), + 'errors' => array(), + 'messages' => array(), + 'files' => array(), + 'status' => false + ); + + /** + * Разрешает обработку формы + * @var bool + */ + private $valid = true; + + protected $validator = null; + + /** + * Массив с правилами валидации полей + * @var array + */ + protected $rules = array(); + + /** + * Массив с именами полей, которые можно отправлять в форме + * По умолчанию все поля разрешены + * @var array + */ + public $allowedFields = array(); + + /** + * Значения для пустых элементов управления, например чекбоксов + * @var array + */ + public $forbiddenFields = array(); + + protected $placeholders = array(); + + protected $emptyFormControls = array(); + + /** + * @var Lexicon|null + */ + protected $lexicon = null; + + public $captcha = null; + + protected $gpc_seed = ''; + protected $gpc_fields = array(); + + + /** + * Core constructor. + * @param \DocumentParser $modx + * @param array $cfg + */ + public function __construct(\DocumentParser $modx, $cfg = array()) + { + $this->modx = $modx; + $this->config = new Config(); + $this->config->setPath(dirname(__DIR__)); + $this->fs = FS::getInstance(); + if (isset($cfg['config'])) { + $this->config->loadConfig($cfg['config']); + } + $this->config->setConfig($cfg); + if (isset($cfg['debug'])) { + $this->debug = new Debug($modx, array( + 'caller' => 'FormLister\\\\' . $cfg['controller'] + )); + } + $this->lexicon = new Lexicon($modx, array( + 'langDir' => 'assets/snippets/FormLister/core/lang/' + )); + $this->formid = $this->getCFGDef('formid'); + switch (strtolower($this->getCFGDef('formMethod', 'post'))) { + case 'post': + $this->_rq = $_POST; + break; + case 'get': + $this->_rq = $_GET; + break; + default: + $this->_rq = $_REQUEST; + } + if ($this->getCFGDef('removeGpc', 0)) { + $this->setGpcSeed(); + } + } + + /** + * Установка значений в formData, загрузка пользовательских лексиконов + * Установка шаблона формы + * Загрузка капчи + */ + public function initForm() + { + $lexicon = $this->getCFGDef('lexicon'); + if ($lexicon) { + $_lexicon = $this->config->loadArray($lexicon); + if (is_array($_lexicon)) { + $lang = $this->lexicon->fromArray($_lexicon); + } else { + $lang = $this->lexicon->loadLang($lexicon, $this->getCFGDef('lang'), + $this->getCFGDef('langDir')); + } + if ($lang) { + $this->log('Custom lexicon loaded', array('lexicon' => $lang)); + } + } + $this->allowedFields = array_merge($this->allowedFields, + $this->config->loadArray($this->getCFGDef('allowedFields'))); + $this->forbiddenFields = array_merge($this->forbiddenFields, + $this->config->loadArray($this->getCFGDef('forbiddenFields'))); + $this->emptyFormControls = array_merge($this->emptyFormControls, + $this->config->loadArray($this->getCFGDef('emptyFormControls'), '')); + $this->setRequestParams(); + $this->setExternalFields($this->getCFGDef('defaultsSources', 'array')); + $this->renderTpl = $this->getCFGDef('formTpl'); //Шаблон по умолчанию + $this->initCaptcha(); + $this->runPrepare('prepare'); + + return $this; + } + + /** + * Загружает в formData данные не из формы + * @param string $sources список источников + * @param string $arrayParam название параметра с данными + * @return $this + */ + public function setExternalFields($sources = 'array', $arrayParam = 'defaults') + { + $keepDefaults = $this->getCFGDef('keepDefaults', 0); + $submitted = $this->isSubmitted(); + if ($submitted && !$keepDefaults) { + return $this; + } + $sources = array_filter($this->config->loadArray($sources, ';')); + $prefix = ''; + foreach ($sources as $source) { + $fields = array(); + $_source = explode(':', $source); + switch ($_source[0]) { + //Массив значений указывается в параметре defaults + case 'array': + if ($arrayParam) { + $fields = $this->config->loadArray($this->getCFGDef('defaults')); + } + break; + //Массив значений указывается в произвольном параметре + case 'param': { + if (!empty($_source[1])) { + $fields = $this->config->loadArray($this->getCFGDef($_source[1])); + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + break; + } + //Массив значений указывается в параметре сессии + case 'session': + if (isset($_SESSION[$_source[1]]) && !empty($_source[1]) && is_array($_SESSION[$_source[1]])) { + $fields = $_SESSION[$_source[1]]; + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + break; + //Значение поля берется из плейсхолдера MODX + case 'plh': + if (!empty($_source[1])) { + $fields = array(); + $keys = explode(',', $source[1]); + foreach ($keys as $key) { + if (isset($this->modx->placeholders[$key])) { + $fields[$key] = $this->modx->placeholders[$key]; + } + } + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + break; + //Массив значений берется из плейсхолдера MODX + case 'aplh': + if (isset($this->modx->placeholders[$_source[1]]) && !empty($_source[1]) && is_array($this->modx->placeholders[$_source[1]])) { + $fields = $this->modx->placeholders[$_source[1]]; + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + break; + //Загружает в форму массив конфигурации MODX + case 'config': + $fields = $this->modx->config; + if (isset($_source[1])) { + $prefix = $_source[1]; + } + break; + //Загружает значения из кук (перечисляются через запятую) + case 'cookie': + if (!empty($_source[1])) { + $fields = array(); + $keys = explode(',', $source[1]); + foreach ($keys as $key) { + if (isset($_COOKIE[$key])) { + $fields[$key] = $_COOKIE[$key]; + } + } + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + break; + case 'user': + case 'document': + //Загружает поля документа + if ($_source[0] == 'document') { + $_source[0] = '\modResource'; + if ($this->modx->documentIdentifier) { + if (isset($_source[1])) { + $_source[2] = $source[1]; + } + $_source[1] = $this->modx->documentIdentifier; + } else { + break; + } + } else { + //Загружает данные авторизованного пользователя, user:web:user + if (!empty($_source[1])) { + $_source[0] = '\modUsers'; + $_source[1] = $this->modx->getLoginUserID($_source[1]); + if (!$_source[1]) { + break; + } + } + } + //Загружает данные из произвольной модели MODxAPI + default: + if (!empty($_source[0])) { + $classname = $_source[0]; + if (!is_null($model = $this->loadModel($classname)) && isset($_source[1])) { + /** @var \autoTable $data */ + if ($data = $model->edit($_source[1])->getID()) { + $fields = $model->toArray(); + if (isset($_source[2])) { + $prefix = $_source[2]; + } + } + } + } + } + if (is_array($fields)) { + if (!is_numeric($keepDefaults)) { + $allowed = $submitted ? $this->config->loadArray($keepDefaults) : array(); + $fields = $this->filterFields($fields, $allowed); + } + $this->setFields($fields, $prefix); + if ($fields) { + $this->log('Set external fields from ' . $_source[0], $fields); + } + } + } + + return $this; + } + + /** + * Сохранение массива $_REQUEST + */ + public function setRequestParams() + { + $this->removeGpc($this->_rq); + $this->setFields($this->_rq); + if ($emptyFields = $this->emptyFormControls) { + foreach ($emptyFields as $field => $value) { + if (!isset($this->_rq[$field])) { + $this->setField($field, $value); + } + } + } + $this->log('Set fields from $_REQUEST', $this->_rq); + + return $this; + } + + /** + * Фильтрация полей по спискам разрешенных и запрещенных + * @param array $fields + * @param array $allowedFields + * @param array $forbiddenFields + * @return array + */ + public function filterFields($fields = array(), $allowedFields = array(), $forbiddenFields = array()) + { + $out = array(); + foreach ($fields as $key => $value) { + //список рарешенных полей существует и поле в него входит; или списка нет, тогда пофиг + $allowed = !empty($allowedFields) ? in_array($key, $allowedFields) : true; + //поле входит в список запрещенных полей + $forbidden = !empty($forbiddenFields) ? in_array($key, $forbiddenFields) : false; + if (($allowed && !$forbidden) && ($value !== '' || $this->getCFGDef('allowEmptyFields', 1))) { + $out[$key] = $value; + } + } + + return $out; + } + + /** + * @return bool + */ + public function isSubmitted() + { + $out = $this->formid && ($this->getField('formid') === $this->formid); + + return $out; + } + + /** + * Получение информации из конфига + * + * @param string $name имя параметра в конфиге + * @param mixed $def значение по умолчанию, если в конфиге нет искомого параметра + * @return mixed значение из конфига + */ + public function getCFGDef($name, $def = null) + { + return $this->config->getCFGDef($name, $def); + } + + /** + * Сценарий работы + * Если форма отправлена, то проверяем данные + * Если проверка успешна, то обрабатываем данные + * Выводим шаблон + * + * @return string + */ + public function render() + { + if ($this->isSubmitted()) { + $this->validateForm(); + if ($this->isValid()) { + $this->runPrepare('prepareProcess'); + if ($this->isValid()) { + $this->process(); + $this->log('Form procession complete', $this->getFormData()); + } + } + } + + return $this->renderForm(); + } + + /** + * Готовит данные для вывода в шаблоне + * @param bool $convertArraysToStrings + * @return array + */ + public function prerenderForm($convertArraysToStrings = false) + { + $plh = array_merge( + $this->fieldsToPlaceholders($this->getFormData('fields'), 'value', + $this->getFormData('status') || $convertArraysToStrings), + $this->controlsToPlaceholders(), + $this->errorsToPlaceholders(), + array('form.messages' => $this->renderMessages()) + ); + + return $plh; + } + + /** + * Вывод шаблона + * + * @return null|string + */ + public function renderForm() + { + $api = $this->getCFGDef('api', 0); + $plh = $this->getCFGDef('skipPrerender', 0) ? $this->getFormData('fields') : $this->prerenderForm(); + $this->log('Render output', array('template' => $this->renderTpl, 'data' => $plh)); + $form = $this->parseChunk($this->renderTpl, $plh); + /* + * Если api = 0, то возвращается шаблон + * Если api = 1, то возвращаются данные формы + * Если api = 2, то возвращаются данные формы и шаблон + */ + if (!$api) { + $out = $form; + } else { + $out = $this->getFormData(); + if ($api == 2) { + $out['output'] = $form; + } + $out = json_encode($out); + } + $this->log('Output', $out); + + return $out; + } + + /** + * Загружает данные в formData + * @param array $fields массив полей + * @param string $prefix добавляет префикс к имени поля + * @return $this + */ + public function setFields($fields = array(), $prefix = '') + { + foreach ($fields as $key => $value) { + if (is_int($key)) { + continue; + } + if ($prefix) { + $key = "{$prefix}.{$key}"; + } + $this->setField($key, $value); + } + + return $this; + } + + /** + * Возвращает результат проверки формы + * @return bool + */ + public function validateForm() + { + $validator = $this->getCFGDef('validator', '\FormLister\Validator'); + $validator = $this->loadModel($validator , '', array()); + $fields = $this->getFormData('fields'); + $rules = $this->getValidationRules(); + $this->rules = array_merge($this->rules, $rules); + $this->log('Prepare to validate fields', array('fields' => $fields, 'rules' => $this->rules)); + $result = $this->validate($validator, $this->rules, $fields); + if ($result !== true) { + foreach ($result as $item) { + $this->addError($item[0], $item[1], $item[2]); + } + $this->log('Validation errors', $this->getFormData('errors')); + } + + return $this->isValid(); + } + + /** + * Возвращает результаты выполнения правил валидации + * @param object $validator + * @param array $rules + * @param array $fields + * @return bool|array + */ + public function validate($validator, $rules, $fields) + { + if (empty($rules) || is_null($validator)) { + return true; + } //если правил нет, то не проверяем + //применяем правила + $errors = array(); + foreach ($rules as $field => $ruleSet) { + $skipFlag = substr($field, 0, 1) == '!' ? true : false; + if ($skipFlag) { + $field = substr($field, 1); + } + $value = \APIHelpers::getkey($fields, $field); + if ($skipFlag && empty($value)) { + continue; + } + foreach ($ruleSet as $rule => $description) { + $inverseFlag = substr($rule, 0, 1) == '!' ? true : false; + if ($inverseFlag) { + $rule = substr($rule, 1); + } + $result = true; + if (is_array($description)) { + if (isset($description['params'])) { + if (is_array($description['params'])) { + $params = $description['params']; + $params = array_merge(array($value), $params); + } else { + $params = array($value, $description['params']); + } + } + $message = isset($description['message']) ? $description['message'] : ''; + } else { + $params = array($value, $description); + $message = $description; + } + if (method_exists($validator, $rule)) { + $result = call_user_func_array(array($validator, $rule), $params); + } else { + if (isset($description['function'])) { + $rule = $description['function']; + if (is_callable($rule)) { + array_unshift($params, $this); + $result = call_user_func_array($rule, $params); + } + } + } + if (is_string($result)) { + $message = $result; + $result = false; + } + if ($inverseFlag) { + $result = !$result; + } + if (!$result) { + $errors[] = array( + $field, + $rule, + $message + ); + break; + } + } + } + + return $errors; + } + + /** + * Возвращает массив formData или его часть + * @param string $section + * @return array + */ + public function getFormData($section = '') + { + if ($section && isset($this->formData[$section])) { + $out = $this->formData[$section]; + } else { + $out = $this->formData; + } + + return $out; + } + + /** + * Устанавливает статус формы, если true, то форма успешно обработана + * @param bool $status + * @return $this + */ + public function setFormStatus($status) + { + $this->formData['status'] = (bool)$status; + + return $this; + } + + /** + * Возращвет статус формы + * @return bool + */ + public function getFormStatus() + { + return $this->formData['status']; + } + + /** + * Возвращает значение поля из formData + * @param $field + * @return string + */ + public function getField($field) + { + return \APIhelpers::getkey($this->formData['fields'], $field); + } + + /** + * Сохраняет значение поля в formData + * @param string $field имя поля + * @param $value + * @return $this + */ + public function setField($field, $value) + { + if ($value !== '' || $this->getCFGDef('allowEmptyFields', 1)) { + $this->formData['fields'][$field] = $value; + } + + return $this; + } + + /** + * @param string $placeholder + * @param $value + * @return $this + */ + public function setPlaceholder($placeholder, $value) + { + $this->placeholders[$placeholder] = $value; + + return $this; + } + + /** + * @param $placeholder + * @return mixed + */ + public function getPlaceholder($placeholder) + { + return \APIhelpers::getkey($this->placeholders, $placeholder); + } + + /** + * Удаляет поле из formData + * @param string $field + * @return $this + */ + public function unsetField($field) + { + if (isset($this->formData['fields'][$field])) { + unset($this->formData['fields'][$field]); + } + + return $this; + } + + /** + * Добавляет в formData информацию об ошибке + * @param string $field имя поля + * @param string $type тип ошибки + * @param string $message сообщение об ошибке + * @return $this + */ + public function addError($field, $type, $message) + { + $this->formData['errors'][$field][$type] = $message; + + return $this; + } + + /** + * Добавляет сообщение в formData + * @param string $message + * @return $this + */ + public function addMessage($message = '') + { + if ($message) { + $this->formData['messages'][] = $message; + } + + return $this; + } + + /** + * Готовит данные для вывода в шаблон + * @param array $fields массив с данными + * @param string $suffix добавляет суффикс к имени поля + * @param bool $split преобразование массивов в строки + * @return array + */ + public function fieldsToPlaceholders($fields = array(), $suffix = '', $split = false) + { + $plh = array(); + if (is_array($fields)) { + $plh = $fields; + $sanitarTagFields = $this->getRemoveGpcFields(); + foreach ($fields as $field => $value) { + if ($split && is_array($value)) { + $arraySplitter = $this->getCFGDef($field . '.arraySplitter', + $this->getCFGDef('arraySplitter', '; ')); + $value = implode($arraySplitter, $value); + } + if (in_array($field, $sanitarTagFields)) { + $value = \APIhelpers::sanitarTag($value); + } + $field = array($field, $suffix); + $field = implode('.', array_filter($field)); + $plh[$field] = \APIhelpers::e($value); + } + } + if (!empty($this->placeholders)) { + $plh = array_merge($plh, $this->placeholders); + } + + return $plh; + } + + /** + * Готовит сообщения об ошибках для вывода в шаблон + * @return array + */ + public function errorsToPlaceholders() + { + $plh = array(); + foreach ($this->getFormData('errors') as $field => $error) { + foreach ($error as $type => $message) { + $classType = ($type == 'required') ? 'required' : 'error'; + $plh[$field . '.error'] = $this->parseChunk($this->getCFGDef('errorTpl', + '@CODE:
                              [+message+]
                              '), array('message' => $message)); + $plh[$field . '.' . $classType . 'Class'] = $this->getCFGDef($field . '.' . $classType . 'Class', + $this->getCFGDef($classType . 'Class', $classType)); + } + } + + return $plh; + } + + /** + * Обработка чекбоксов, селектов, радио-кнопок перед выводом в шаблон + * @return array + */ + public function controlsToPlaceholders() + { + $plh = array(); + $formControls = $this->config->loadArray($this->getCFGDef('formControls')); + foreach ($formControls as $field) { + $value = $this->getField($field); + if ($value === '') { + continue; + } elseif (is_array($value)) { + foreach ($value as $_value) { + $plh["s.{$field}.{$_value}"] = 'selected'; + $plh["c.{$field}.{$_value}"] = 'checked'; + } + } else { + $plh["s.{$field}.{$value}"] = 'selected'; + $plh["c.{$field}.{$value}"] = 'checked'; + } + } + + return $plh; + } + + /** + * Загрузка правил валидации + * @param string $param + * @return array|mixed|\xNop + */ + public function getValidationRules($param = 'rules') + { + $rules = $this->getCFGDef($param); + $rules = $this->config->loadArray($rules, ''); + + return is_array($rules) ? $rules : array(); + } + + /** + * Готовит сообщения из formData для вывода в шаблон + * @return string + */ + public function renderMessages() + { + $out = ''; + $formMessages = $this->getFormData('messages'); + $formErrors = $this->getFormData('errors'); + + $requiredMessages = $errorMessages = array(); + if ($formErrors) { + foreach ($formErrors as $field => $error) { + $type = key($error); + if ($type == 'required') { + $requiredMessages[] = $error[$type]; + } else { + $errorMessages[] = $error[$type]; + } + } + } + $wrapper = $this->getCFGDef('messagesTpl', '@CODE:
                              [+messages+]
                              '); + $formMessages = array_filter($formMessages); + $formErrors = array_filter($formErrors); + if (!empty($formMessages) || !empty($formErrors)) { + $out = $this->parseChunk($wrapper, + array( + 'messages' => $this->renderMessagesGroup( + $formMessages, + 'messagesOuterTpl', + 'messagesSplitter'), + 'required' => $this->renderMessagesGroup( + $requiredMessages, + 'messagesRequiredOuterTpl', + 'messagesRequiredSplitter'), + 'errors' => $this->renderMessagesGroup( + $errorMessages, + 'messagesErrorOuterTpl', + 'messagesErrorSplitter'), + )); + } + + return $out; + } + + /** + * @param array $messages + * @param string $wrapper + * @param string $splitter + * @return string + */ + public function renderMessagesGroup($messages, $wrapper, $splitter) + { + $out = ''; + if (is_array($messages) && !empty($messages)) { + $out = implode($this->getCFGDef($splitter, '
                              '), $messages); + $wrapperChunk = $this->getCFGDef($wrapper, '@CODE: [+messages+]'); + $out = $this->parseChunk($wrapperChunk, array('messages' => $out)); + } + + return $out; + } + + /** + * @param $name + * @param $data + * @param bool $parseDocumentSource + * @return string + */ + public function parseChunk($name, $data, $parseDocumentSource = false) + { + $parseDocumentSource = $parseDocumentSource || $this->getCFGDef('parseDocumentSource', 0); + $rewriteUrls = $this->getCFGDef('rewriteUrls', 0); + $DLTemplate = \DLTemplate::getInstance($this->modx) + ->setTemplatePath($this->getCFGDef('templatePath')) + ->setTemplateExtension($this->getCFGDef('templateExtension')) + ->setTwigTemplateVars(array( + 'FormLister' => $this, + 'errors' => $this->getFormData('errors'), + 'messages' => $this->getFormData('messages'), + 'plh' => $this->placeholders + ) + ); + $out = $DLTemplate->parseChunk($name, $data, $parseDocumentSource); + if ($this->lexicon->isReady()) { + $out = $this->lexicon->parseLang($out); + } + if (!$parseDocumentSource && $rewriteUrls) { + $out = $this->modx->rewriteUrls($out); + } + if ($this->getCFGDef('removeEmptyPlaceholders', 0)) { + preg_match_all('~\[(\+|\*|\(|%)([^:\+\[\]]+)([^\[\]]*?)(\1|\)|%)\]~s', $out, $matches); + if ($matches[0]) { + $out = str_replace($matches[0], '', $out); + } + } + + return $out; + } + + /** + * Загружает класс капчи + */ + public function initCaptcha() + { + if ($captcha = $this->getCFGDef('captcha')) { + $captcha = preg_replace('/[^a-zA-Z]/', '', $captcha); + $className = ucfirst($captcha . 'Wrapper'); + $cfg = $this->config->loadArray($this->getCFGDef('captchaParams', array())); + $cfg['id'] = $this->getFormId(); + $captcha = $this->loadModel($className, MODX_BASE_PATH . "assets/snippets/FormLister/lib/captcha/{$captcha}/wrapper.php",array($this->modx, $cfg)); + + if (!is_null($captcha) && $captcha instanceof CaptchaInterface) { + $captcha->init(); + $this->rules[$this->getCFGDef('captchaField', 'vericode')] = array( + "captcha" => array( + "function" => "{$className}::validate", + "params" => array($captcha) + ) + ); + $this->captcha = $captcha; + $this->setPlaceholder('captcha', $captcha->getPlaceholder()); + } + + } + + return $this; + } + + /** + * @return \DocumentParser|null + */ + public function getMODX() + { + return $this->modx; + } + + /** + * @return mixed|string + */ + public function getFormId() + { + return $this->formid; + } + + /** + * @return bool + */ + public function isValid() + { + $this->setValid(!count($this->getFormData('errors'))); + + return $this->valid; + } + + /** + * Вызов prepare-сниппетов + * @param string $paramName + * @return $this + */ + public function runPrepare($paramName = 'prepare') + { + if (($prepare = $this->getCFGDef($paramName)) != '') { + $names = $this->config->loadArray($prepare); + foreach ($names as $item) { + $this->callPrepare($item, array( + 'modx' => $this->modx, + 'data' => $this->getFormData('fields'), + 'FormLister' => $this, + 'name' => $paramName + )); + } + $this->log('Prepare finished', $this->getFormData('fields')); + } + + return $this; + } + + /** + * @param $name + * @param array $params + * @return $this + */ + public function callPrepare($name, $params = array()) + { + if (!empty($name)) { + if ((is_object($name) && ($name instanceof \Closure)) || is_callable($name)) { + call_user_func_array($name, $params); + } else { + $this->modx->runSnippet($name, $params); + } + } + + return $this; + } + + /** + * В api-режиме редирект не выполняется, но ссылка доступна в formData + * @param string $param имя параметра с id документа для редиректа + * @param array $_query + */ + public function redirect($param = 'redirectTo', $_query = array()) + { + if ($redirect = $this->getCFGDef($param, 0)) { + $redirect = $this->config->loadArray($redirect); + $query = $header = ''; + if (isset($redirect[0])) { + $page = $redirect[0]; + $query = http_build_query($_query); + } else { + if (isset($redirect['query']) && is_array($redirect['query'])) { + $query = http_build_query(array_merge($redirect['query'], $_query)); + } + if (isset($redirect['header'])) { + $header = $redirect['header']; + } + $page = isset($redirect['page']) ? $redirect['page'] : 0; + } + if (is_numeric($page)) { + $redirect = $this->modx->makeUrl($page, '', $query, 'full'); + } else { + $redirect = $page . (empty($query) ? '' : '?' . $query); + } + $this->setField($param, $redirect); + $this->log('Redirect (' . $param . ') to' . $redirect, array('data' => $this->getFormData('fields'))); + $this->sendRedirect($redirect, $header); + } + } + + /** + * @param $url + * @param $header + */ + public function sendRedirect($url, $header = 'HTTP/1.1 307 Temporary Redirect') { + if (!$this->getCFGDef('api', 0)) { + $header = $header ? $header : 'HTTP/1.1 307 Temporary Redirect'; + $this->modx->sendRedirect($url, 0, 'REDIRECT_HEADER', $header); + } + } + + /** + * Обработка формы, определяется контроллерами + * + * @return mixed + */ + abstract public function process(); + + /** + * @param boolean $valid + * @return Core + */ + public function setValid($valid) + { + $this->valid &= $valid; + + return $this; + } + + /** + * @param array $files + * @return Core + */ + public function setFiles($files) + { + if (is_array($files)) { + $this->formData['files'] = $files; + } + + return $this; + } + + /** + * @param string $message + * @param array $data + * @return Core + */ + public function log($message, $data = array()) + { + if (!is_null($this->debug)) { + $this->debug->log($message, $data); + } + + return $this; + } + + /** + * @param $model + * @param string $path + * @return object + */ + public function loadModel($model, $path = '', $init = '') + { + $out = null; + if (!class_exists($model) && $path && $this->fs->checkFile($path)) { + include_once(MODX_BASE_PATH . $this->fs->relativePath($path)); + } + if (class_exists($model)) { + if (!is_array($init)) { + $init = array($this->modx); + } + $out = new $model(...$init); + } + + return $out; + } + + /** + * @param array $_files + * @param array $allowed + * @param bool $flag + * @return array + */ + public function filesToArray(array $_files, array $allowed, $flag = true) + { + $files = array(); + foreach ($_files as $name => $file) { + if (!in_array($name, $allowed) && !is_int($name)) { + continue; + } + if ($flag) { + $sub_name = $file['name']; + } else { + $sub_name = $name; + } + if (is_array($sub_name)) { + foreach (array_keys($sub_name) as $key) { + $files[$name][$key] = array( + 'name' => $file['name'][$key], + 'type' => $file['type'][$key], + 'tmp_name' => $file['tmp_name'][$key], + 'error' => $file['error'][$key], + 'size' => $file['size'][$key], + ); + $files[$name] = $this->filesToArray($files[$name], $allowed, false); + } + } else { + $files[$name] = $file; + } + } + + return $files; + } + + /** + * Возвращает сообщения об ошибках для указанного поля + * @param string $field + * @return array + */ + public function getErrorMessage($field) + { + $out = array(); + if (!empty($field) && isset($this->formData['errors'][$field]) && is_array($this->formData['errors'][$field])) { + $out = array_values($this->formData['errors'][$field]); + } + + return $out; + } + + /** + * @return string + */ + protected function setGpcSeed() + { + $this->gpc_seed = 'sanitize_seed_' . base_convert(md5(realpath(MODX_MANAGER_PATH . 'includes/protect.inc.php')), + 16, 36); + + return $this; + } + + /** + * Remove fucking modX_sanitize_gpc + * + * @param $target + * @param int $count + * @return mixed + */ + protected function removeGpc(&$target, $count = 0) + { + $removeFields = $this->getRemoveGpcFields(); + foreach ($target as $key => $value) { + if (!in_array($key, $removeFields)) { + continue; + } + if (is_array($value)) { + $count++; + if (10 < $count) { + echo 'GPC Array nested too deep!'; + exit; + } + $this->removeGpc($value, $count); + $count--; + } else { + $value = str_replace($this->gpc_seed, '', $value); + $value = str_replace('sanitized_by_modxgpc_fields; + if (($removeGpc = $this->getCFGDef('removeGpc', 0)) && empty($out)) { + if (is_numeric($removeGpc)) { + $out = array_keys($this->_rq); + } else { + $fields = $this->config->loadArray($removeGpc); + foreach ($fields as $field) { + if (isset($this->_rq[$field])) { + $out[] = $field; + } + } + } + $this->gpc_fields = $out; + } + + return $out; + } +} diff --git a/assets/snippets/FormLister/core/controller/Activate.php b/assets/snippets/FormLister/core/controller/Activate.php new file mode 100644 index 0000000000..259bf48a6f --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Activate.php @@ -0,0 +1,159 @@ +user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $lang = $this->lexicon->loadLang('activate'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + $userField = $this->getCFGDef('userField', 'email'); + $this->userField = $userField; + if (!isset($_REQUEST['formid']) && !isset($_REQUEST[$userField]) && (isset($_REQUEST['hash']) && !empty($_REQUEST['hash']) && isset($_REQUEST['id']) && !empty($_REQUEST['id']))) { + $this->setField('hash', $_REQUEST['hash']); + $this->setField('id', (int)$_REQUEST['id']); + $this->mode = 'activate'; + } + $this->log('Activate mode is ' . $this->mode); + } + + /** + * @return string + */ + public function render() + { + if ($this->modx->getLoginUserID('web')) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('activate.default_skipTpl')); + $this->setValid(false); + } + + if ($this->mode == 'activate') { + $this->renderActivate(); + } + + return parent::render(); + } + + /** + * @return bool + */ + public function renderActivate() + { + $hash = $this->getField('hash'); + $uid = $this->getField('id'); + if ($hash && $hash == $this->getUserHash($uid)) { + $this->process(); + } else { + $this->addMessage($this->lexicon->getMsg('activate.update_failed')); + $this->setValid(false); + } + } + + /** + * @param $uid + * @return bool|string + */ + public function getUserHash($uid) + { + if (is_null($this->user)) { + $hash = false; + } else { + $userdata = $this->user->edit($uid)->toArray(); + $hash = $userdata['id'] && $userdata['logincount'] < 0 ? md5(json_encode($userdata)) : false; + } + + return $hash; + } + + /** + * + */ + public function process() + { + switch ($this->mode) { + /** + * Задаем хэш, отправляем пользователю ссылку для активации + */ + case "hash": + $uid = $this->getField($this->userField); + $password = $this->getField('password'); + if (($hash = $this->getUserHash($uid)) && ($password && $this->user->get('password') == $this->user->getPassword($password))) { + $this->setFields($this->user->toArray()); + if (!$password) { + $password = \APIhelpers::genPass($this->getCFGDef('passwordLength', 6)); + $this->user->set('password', $password)->save(true); + $this->setField('user.password', $password); + } + $url = $this->getCFGDef('activateTo', $this->modx->config['site_start']); + $this->setField('activate.url', $this->modx->makeUrl($url, "", + http_build_query(array('id' => $this->getField('id'), 'hash' => $hash)), + 'full')); + $this->mailConfig['to'] = $this->user->get('email'); + parent::process(); + } else { + $this->addMessage($this->lexicon->getMsg('activate.no_activation')); + } + break; + /** + * Отправляем пользователю письмо для активации, если указан шаблон такого письма + */ + case "activate": + $uid = $this->getField('id'); + $hash = $this->getField('hash'); + if ($hash && $hash == $this->getUserHash($uid)) { + $result = $this->user->edit($uid)->set('logincount', 0)->save(true); + $this->log('Activate user', array('user' => $uid, 'result' => $result)); + if (!$result) { + $this->addMessage($this->lexicon->getMsg('activate.update_failed')); + } else { + $this->setFields($this->user->toArray()); + $this->postProcess(); + } + } else { + $this->addMessage($this->lexicon->getMsg('activate.update_failed')); + parent::process(); + } + break; + } + } + + /** + * + */ + public function postProcess() + { + $this->setFormStatus(true); + switch ($this->mode) { + case "hash": + $this->renderTpl = $this->getCFGDef('successTpl', + $this->lexicon->getMsg('activate.default_successTpl')); + break; + case "activate": + $this->redirect(); + $this->renderTpl = $this->getCFGDef('activateSuccessTpl', + $this->lexicon->getMsg('activate.default_activateSuccessTpl')); + } + } +} diff --git a/assets/snippets/FormLister/core/controller/Content.php b/assets/snippets/FormLister/core/controller/Content.php new file mode 100644 index 0000000000..e679b72d4d --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Content.php @@ -0,0 +1,287 @@ +lexicon->loadLang('content'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + $this->content = $this->loadModel( + $this->getCFGDef('model', '\modResource'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modResource.php') + ); + if (is_null($this->content)) { + return; + } + $this->user = $this->loadModel( + $this->getCFGDef('userModel', '\modUsers'), + $this->getCFGDef('userModelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $idField = $this->getCFGDef('idField', 'id'); + $id = $this->getCFGDef($idField); + if ($idField) { + if ($id) { + $this->mode = 'edit'; + $this->id = $id; + } elseif (isset($_REQUEST[$idField]) && is_scalar($_REQUEST[$idField]) && (int)$_REQUEST[$idField] > 0) { + $this->id = (int)$_REQUEST[$idField]; + $this->mode = 'edit'; + } + } + $data = array(); + if ($this->mode == 'edit') { + $data = $this->content->edit($this->id)->toArray('', '', '_', false); + $this->mailConfig['noemail'] = 1; + if ($ds = $this->getCFGDef('defaultsSources')) { + $defaultsSources = "{$ds};param:contentdata"; + } else { + $defaultsSources = "param:contentdata"; + } + $this->config->setConfig(array( + 'defaultsSources' => $defaultsSources, + 'contentdata' => $data, + 'formTpl' => $this->getCFGDef('editTpl', $this->getCFGDef('formTpl')), + 'successTpl' => $this->getCFGDef('editSuccessTpl'), + 'onlyUsers' => 1 + )); + } + $this->log('Content mode is ' . $this->mode, array('data' => $data)); + } + + /** + * @return string + */ + public function render() + { + $uid = (int)$this->modx->getLoginUserID('web'); + $ownerField = $this->getCFGDef('ownerField', 'aid'); + $mode = $this->mode; + $flag = true; + + if ($mode == 'create') { + if ($this->getCFGDef('onlyUsers', 1)) { + if (!$uid) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', + $this->lexicon->getMsg('create.default_skipTpl')); + $flag = false; + } elseif (!$this->checkUserGroups($uid, $this->getCFGDef('userGroups'))) { + $this->redirect('badGroupTo'); + $this->renderTpl = $this->getCFGDef('badGroupTpl', + $this->lexicon->getMsg('create.default_badGroupTpl')); + $flag = false; + } + } + $this->owner = $uid; + } + + if ($mode == 'edit') { + if (!$uid) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipEditTpl', + $this->lexicon->getMsg('edit.default_skipEditTpl')); + $flag = false; + } elseif (!$this->checkUserGroups($uid, $this->getCFGDef('userGroups'))) { + $this->redirect('badGroupTo'); + $this->renderTpl = $this->getCFGDef('badGroupTpl', + $this->lexicon->getMsg('edit.default_badGroupTpl')); + $flag = false; + } else { + $cid = is_null($this->content) ? false : $this->content->getID(); + if ($cid) { + $owner = $this->content->get($ownerField); + if ($this->getCFGDef('onlyAuthors', 1) && $owner && $owner != $uid) { + $this->redirect('badOwnerTo'); + $this->renderTpl = $this->getCFGDef('badOwnerTpl', + $this->lexicon->getMsg('edit.default_badOwnerTpl')); + $flag = false; + } + $this->owner = $uid; + } else { + $this->redirect('badRecordTo'); + $this->renderTpl = $this->getCFGDef('badRecordTpl', + $this->lexicon->getMsg('edit.default_badRecordTpl')); + $flag = false; + } + } + + if ($flag && !$this->isSubmitted()) { + $fields = $this->getContentFields(); + $this->setFields($fields); + } + } + + $this->setValid($flag); + + return parent::render(); + } + + /** + * + */ + public function process() + { + $fields = $this->getContentFields(); + $ownerField = $this->getCFGDef('ownerField', 'aid'); + $result = false; + if ($fields && !is_null($this->content)) { + $clearCache = $this->getCFGDef('clearCache', false); + switch ($this->mode) { + case 'create': + if ($this->checkSubmitProtection() || $this->checkSubmitLimit()) { + return; + } + if ($this->owner || !$this->getCFGDef('onlyUsers',1)) { + $fields[$ownerField] = $this->owner; + $result = $this->content->create($fields)->save(true, $clearCache); + } + if ($result) { + $url = ''; + + $evtOut = $this->modx->invokeEvent('OnMakeDocUrl', array( + 'invokedBy' => __CLASS__, + 'id' => $result, + 'data' => $this->getFormData('fields') + )); + if (is_array($evtOut) && count($evtOut) > 0) { + $url = array_pop($evtOut); + } + if ($url) { + $this->setField('content.url', $url); + } + $this->log('Created record', array('data' => $fields, 'result' => $result)); + } + break; + case 'edit': + $result = $this->content->fromArray($fields)->save(true, $clearCache); + if ($result) { + $this->log('Update record', array('data' => $fields, 'result' => $result)); + } + break; + } + } + if (!$result) { + $this->log('Save failed', array('model' => get_class($this->content), 'data' => $fields)); + $this->addMessage($this->lexicon->getMsg('edit.update_failed')); + } else { + $this->content->close(); + $this->setFields($this->content->edit($result)->toArray('', '', '_', false)); + if ($this->getCFGDef('contentFields')) { + $this->setFields($this->getContentFields(true)); + } + if ($this->owner) { + $this->setFields($this->user->edit($this->owner)->toArray(), 'user'); + } + $this->runPrepare('preparePostProcess'); + $this->log('Update form data', array('data' => $this->getFormData('fields'))); + if ($this->mode == 'create') { + parent::process(); + } else { + $this->postProcess(); + } + } + } + + /** + * + */ + public function postProcess() + { + $this->setFormStatus(true); + $this->runPrepare('prepareAfterProcess'); + if ($this->mode == 'create') { + if ($this->getCFGDef('editAfterCreate', 0)) { + $idField = $this->getCFGDef('idField'); + $this->redirect('redirectTo', + array( + $idField => $this->getField($idField) + ) + ); + } else { + $this->redirect(); + } + $this->renderTpl = $this->getCFGDef('successTpl', $this->lexicon->getMsg('create.default_successTpl')); + } else { + if ($successTpl = $this->getCFGDef('successTpl')) { + $this->renderTpl = $successTpl; + } else { + $this->addMessage($this->lexicon->getMsg('edit.update_success')); + } + } + } + + /** + * @param bool $flip + * @return array + */ + public function getContentFields($flip = false) + { + $fields = array(); + $contentFields = $this->config->loadArray($this->getCFGDef('contentFields')); + if (!$contentFields) { + $fields = $this->filterFields($this->getFormData('fields'), $this->allowedFields, $this->forbiddenFields); + } else { + if ($flip || ($this->mode == 'edit' && !$this->isSubmitted())) { + $contentFields = array_flip($contentFields); + } + foreach ($contentFields as $field => $formField) { + $formField = $this->getField($formField); + if ($formField !== '' || $this->getCFGDef('allowEmptyFields', 1)) { + $fields[$field] = $formField; + } + } + } + + return $fields; + } + + /** + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * @param $uid + * @param string $groups + * @return bool + */ + public function checkUserGroups($uid, $groups = '') + { + $flag = true; + if (is_scalar($groups) && !empty($groups) && !is_null($this->user)) { + $groups = explode(';', $groups); + if (!empty($groups)) { + $userGroups = $this->user->getUserGroups($uid); + $flag = !empty(array_intersect($groups, $userGroups)); + } + } + $this->log('Check user groups', array('result' => $flag)); + + return $flag; + } +} diff --git a/assets/snippets/FormLister/core/controller/DeleteContent.php b/assets/snippets/FormLister/core/controller/DeleteContent.php new file mode 100644 index 0000000000..8f74ef71bd --- /dev/null +++ b/assets/snippets/FormLister/core/controller/DeleteContent.php @@ -0,0 +1,90 @@ +content = $this->loadModel( + $this->getCFGDef('model', '\modResource'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modResource.php') + ); + $this->user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $lang = $this->lexicon->loadLang('deleteContent'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + $idField = $this->getCFGDef('idField','id'); + if (isset($_REQUEST[$idField])) { + $this->id = (int)$_REQUEST[$idField]; + } + $this->config->setConfig(array( + 'ignoreMailerResult' => 1, + 'protectSubmit' => 0, + 'submitLimit' => 0 + )); + } + + /** + * @return string + */ + public function render() + { + $flag = false; + $uid = $this->modx->getLoginUserID('web'); + if (!$uid) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('deleteContent.default_skipTpl')); + } elseif (!$this->id || !$this->content->edit($this->id)->getID() || $this->content->get('deleted')) { + $this->redirect('badRecordTo'); + $this->renderTpl = $this->getCFGDef('badRecordTpl', + $this->lexicon->getMsg('deleteContent.default_badRecordTpl')); + } elseif ($uid != $this->content->edit($this->id)->get($this->getCFGDef('ownerField','aid'))) { + $this->renderTpl = $this->getCFGDef('badOwnerTpl', + $this->lexicon->getMsg('deleteContent.default_badOwnerTpl')); + } else { + $flag = true; + $this->setFields($this->content->edit($this->id)->toArray()); + $this->setFields($this->user->edit($uid)->toArray(),'user'); + }; + $this->setValid($flag); + + return parent::render(); + } + + + /** + * + */ + public function process() + { + $result = $this->content->delete($this->id, true); + if ($result) { + parent::process(); + } else { + return $this->addMessage($this->lexicon->getMsg('deleteContent.delete_failed')); + } + } + + public function postProcess() + { + parent::postProcess(); + $this->renderTpl = $this->getCFGDef('successTpl', $this->lexicon->getMsg('deleteContent.default_successTpl')); + } +} diff --git a/assets/snippets/FormLister/core/controller/DeleteUser.php b/assets/snippets/FormLister/core/controller/DeleteUser.php new file mode 100644 index 0000000000..72224c4221 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/DeleteUser.php @@ -0,0 +1,97 @@ +lexicon->loadLang('deleteUser'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + $uid = $modx->getLoginUserId('web'); + $userdata = array(); + if ($uid) { + $this->user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + if ($ds = $this->getCFGDef('defaultsSources')) { + $defaultsSources = "{$ds};param:userdata"; + } else { + $defaultsSources = "param:userdata"; + } + if (!is_null($this->user)) { + $userdata = $this->user->edit($uid)->toArray(); + unset($userdata['password']); + } + $this->config->setConfig(array( + 'defaultsSources' => $defaultsSources, + 'userdata' => $userdata, + 'ignoreMailerResult' => 1, + 'keepDefaults' => 1, + 'protectSubmit' => 0, + 'submitLimit' => 0 + )); + } + } + + /** + * @return string + */ + public function render() + { + if (!$uid = $this->modx->getLoginUserID('web')) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('deleteUser.default_skipTpl')); + $this->setValid(false); + }; + + return parent::render(); // TODO: Change the autogenerated stub + } + + + /** + * + */ + public function process() + { + $uid = $this->modx->getLoginUserID('web'); + if (!is_null($this->user)) { + $password = $this->getField('password'); + if ($this->user->testAuth($uid, $password, true)) { + $result = $this->user->delete($uid, true); + if ($result) { + $this->user->logout(); + parent::process(); + } else { + return $this->addMessage($this->lexicon->getMsg('deleteUser.delete_failed')); + } + } else { + + } + } + + return $this->addMessage($this->lexicon->getMsg('deleteUser.delete_failed')); + } + + /** + * + */ + public function postProcess() + { + parent::postProcess(); + $this->renderTpl = $this->getCFGDef('successTpl', $this->lexicon->getMsg('deleteUser.default_successTpl')); + } +} diff --git a/assets/snippets/FormLister/core/controller/Form.php b/assets/snippets/FormLister/core/controller/Form.php new file mode 100644 index 0000000000..d1ca1b3db2 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Form.php @@ -0,0 +1,426 @@ +getCFGDef('attachments')) { + $this->setFiles($this->filesToArray($_FILES, $this->config->loadArray($files))); + } + $this->mailConfig = array( + 'isHtml' => $this->getCFGDef('isHtml', 1), + 'to' => $this->getCFGDef('to'), + 'from' => $this->getCFGDef('from', $this->modx->config['emailsender']), + 'fromName' => $this->getCFGDef('fromName', $this->modx->config['site_name']), + 'subject' => $this->getCFGDef('subject'), + 'replyTo' => $this->getCFGDef('replyTo'), + 'cc' => $this->getCFGDef('cc'), + 'bcc' => $this->getCFGDef('bcc'), + 'noemail' => $this->getCFGDef('noemail', false) + ); + $lang = $this->lexicon->loadLang('form'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + } + + /** + * Проверка повторной отправки формы + * @return bool + */ + public function checkSubmitProtection() + { + $result = false; + if ($this->isSubmitted() && $this->getCFGDef('protectSubmit', 1)) { + $hash = $this->getFormHash(); + if (isset($_SESSION[$this->formid . '_hash']) && $_SESSION[$this->formid . '_hash'] == $hash && $hash != '') { + $result = true; + $this->addMessage($this->lexicon->getMsg('form.protectSubmit')); + $this->log('Submit protection enabled'); + } + } + + return $result; + } + + /** + * Проверка повторной отправки в течение определенного времени, в секундах + * @return bool + */ + public function checkSubmitLimit() + { + $submitLimit = $this->getCFGDef('submitLimit', 60); + $result = false; + if ($this->isSubmitted() && $submitLimit > 0) { + if (time() < $submitLimit + $_SESSION[$this->formid . '_limit']) { + $result = true; + $this->addMessage('[%form.submitLimit%] ' . + ($submitLimit >= 60 + ? round($submitLimit / 60, 0) . ' [%form.minutes%].' + : $submitLimit . ' [%form.seconds%].' + )); + $this->log('Submit limit enabled'); + } else { + unset($_SESSION[$this->formid . '_limit']); + } //time expired + } + + return $result; + } + + /** + * @return $this + */ + public function setSubmitProtection() + { + if ($this->getCFGDef('protectSubmit', 1)) { + $_SESSION[$this->formid . '_hash'] = $this->getFormHash(); + } //hash is set earlier + if ($this->getCFGDef('submitLimit', 60) > 0) { + $_SESSION[$this->formid . '_limit'] = time(); + } + + return $this; + } + + /** + * @return array|string + */ + public function getFormHash() + { + $hash = array(); + $protectSubmit = $this->getCFGDef('protectSubmit', 1); + if (!is_numeric($protectSubmit)) { //supplied field names + $protectSubmit = $this->config->loadArray($protectSubmit); + foreach ($protectSubmit as $field) { + $hash[] = $this->getField(trim($field)); + } + } else //all required fields + { + foreach ($this->rules as $field => $rules) { + foreach ($rules as $rule => $description) { + if ($rule == 'required') { + $hash[] = $this->getField($field); + } + } + } + } + if ($hash) { + $hash = md5(json_encode($hash)); + } + + return $hash; + } + + /** + * @return bool + */ + public function validateForm() + { + parent::validateForm(); + if (!$this->getCFGDef('attachments')) { + return $this->isValid(); + } + $validator = $this->getCFGDef('fileValidator', '\FormLister\FileValidator'); + $validator = $this->loadModel($validator, '', array()); + $fields = $this->getFormData('files'); + $rules = $this->getValidationRules('fileRules'); + $this->fileRules = array_merge($this->fileRules, $rules); + $this->log('Prepare to validate files', array('fields' => $fields, 'rules' => $this->fileRules)); + $result = $this->validate($validator, $this->fileRules, $fields); + if ($result !== true) { + foreach ($result as $item) { + $this->addError($item[0], $item[1], $item[2]); + } + $this->log('File validation errors', $this->getFormData('errors')); + } + + return $this->isValid(); + } + + /** + * Формирует текст письма для отправки + * Если основной шаблон письма не задан, то формирует список полей формы + * @param string $tplParam имя параметра с шаблоном письма + * @return null|string + */ + public function renderReport($tplParam = 'reportTpl') + { + $tpl = $this->getCFGDef($tplParam); + if (empty($tpl) && $tplParam == 'reportTpl') { + $tpl = '@CODE:'; + foreach ($this->getFormData('fields') as $key => $value) { + $tpl .= "[+{$key}+]: [+{$key}.value+]" . PHP_EOL; + } + } + $out = $this->parseChunk($tpl, $this->prerenderForm(true)); + + return $out; + } + + /** + * Получает тему письма из шаблона или строки + * @return mixed|null|string + */ + public function renderSubject() + { + $subject = $this->getCFGDef('subjectTpl'); + if (!empty($subject)) { + $subject = $this->parseChunk($subject, $this->prerenderForm(true)); + } else { + $subject = $this->getCFGDef('subject'); + } + + return $subject; + } + + /** + * @return array + */ + public function getAttachments() + { + $attachments = array(); + foreach ($this->getFormData('files') as $files) { + if (is_null($files[0])) { + $files = array($files); + } + foreach ($files as $file) { + if ($file['error'] === 0) { + $attachments[] = array('filepath' => $file['tmp_name'], 'filename' => $file['name']); + } + } + } + + $userfiles = $this->config->loadArray($this->getCFGDef('attachFiles')); + foreach ($userfiles as $field => $files) { + if (is_null($files[0])) { + $files = array($files); + } + foreach ($files as $file) { + if (isset($file['filepath']) && isset($file['filename'])) { + $attachments[] = array( + 'filepath' => MODX_BASE_PATH . $file['filepath'], + 'filename' => $file['filename'] + ); + } + } + } + + return $attachments; + } + + /** + * @return $this + */ + public function setFileFields() + { + $fields = array(); + foreach ($this->getFormData('files') as $field => $files) { + if (is_null($files[0])) { + $files = array($files); + } + foreach ($files as $file) { + if ($file['error'] === 0) { + $fields[$field][] = $file['name']; + } + } + } + + $userfiles = $this->config->loadArray($this->getCFGDef('attachFiles')); + foreach ($userfiles as $field => $files) { + if (is_null($files[0])) { + $files = array($files); + } + foreach ($files as $file) { + if (isset($file['filename']) && isset($file['filepath'])) { + $fields[$field][] = $file['filename']; + } + } + } + + if (!empty($fields)) { + $this->setFields($fields); + } + + return $this; + } + + /** + * Оправляет письмо + * @return mixed + */ + public function sendReport() + { + $mailer = new Mailer($this->modx, array_merge( + $this->mailConfig, + array('subject' => $this->renderSubject()) + )); + $attachments = $this->getAttachments(); + if ($attachments) { + $mailer->attachFiles($attachments); + $this->log('Attachments', $attachments); + $field = array(); + foreach ($attachments as $file) { + $field[] = $file['filename']; + } + $this->setField('attachments', $field); + } + $report = $this->renderReport(); + $out = $mailer->send($report) || $this->getCFGDef('ignoreMailerResult',0); + $this->log('Mail report', array('report' => $report, 'mailer_config' => $mailer->config, 'result' => $out)); + + return $out; + } + + /** + * Оправляет копию письма на указанный адрес + * @return mixed + */ + public function sendAutosender() + { + $to = $this->getCFGDef('autosender'); + if (empty($to)) { + $out = true; + } else { + $mailer = new Mailer($this->modx, $this->getMailSendConfig($to, 'autosenderFromName')); + $report = $this->renderReport('automessageTpl'); + $out = $mailer->send($report); + $this->log('Mail autosender report', array( + 'report' => $report, + 'mailer_config' => $mailer->config, + 'result' => $out + ) + ); + } + + return $out; + } + + /** + * Отправляет копию письма на адрес из поля email + * @return mixed + */ + public function sendCCSender() + { + $to = $this->getField($this->getCFGDef('ccSenderField', 'email')); + if (empty($to)) { + $out = true; + } else { + if ($this->getCFGDef('ccSender', 0)) { + $mailer = new Mailer($this->modx, $this->getMailSendConfig($to, 'ccSenderFromName')); + $report = $this->renderReport('ccSenderTpl'); + $out = $mailer->send($report); + $this->log('Mail CC report', + array('report' => $report, 'mailer_config' => $mailer->config, 'result' => $out)); + } else { + $out = true; + } + } + + return $out; + } + + /** + * @return string + */ + public function render() + { + if ($this->isSubmitted() && $this->checkSubmitLimit()) { + return $this->renderForm(); + } + + return parent::render(); + } + + /** + * + */ + public function process() + { + $this->setField('form.date', date($this->getCFGDef('dateFormat', $this->lexicon->getMsg('form.dateFormat')))); + $this->setFileFields(); + //если защита сработала, то ничего не отправляем + if ($this->checkSubmitProtection()) { + return; + } + if ($this->sendReport()) { + $this->sendCCSender(); + $this->sendAutosender(); + $this->setSubmitProtection()->postProcess(); + } else { + $this->addMessage($this->lexicon->getMsg('form.formFailed')); + } + } + + /** + * + */ + public function postProcess() + { + $this->setFormStatus(true); + if ($this->getCFGDef('deleteAttachments',0)) { + $this->deleteAttachments(); + } + $this->runPrepare('prepareAfterProcess'); + $this->redirect(); + $this->renderTpl = $this->getCFGDef('successTpl', $this->lexicon->getMsg('form.default_successTpl')); + } + + /** + * @param string $to + * @param string $fromParam + * @return array + */ + public function getMailSendConfig($to, $fromParam) + { + return array_merge( + $this->mailConfig, + array( + 'subject' => $this->renderSubject(), + 'to' => $to, + 'fromName' => $this->getCFGDef($fromParam, $this->modx->config['site_name']) + ) + ); + } + + /** + * @return $this + */ + public function deleteAttachments() + { + $files = $this->getAttachments(); + foreach ($files as $file) { + $this->fs->delete($file['filepath']); + } + + return $this; + } +} diff --git a/assets/snippets/FormLister/core/controller/Login.php b/assets/snippets/FormLister/core/controller/Login.php new file mode 100644 index 0000000000..2e7884fc85 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Login.php @@ -0,0 +1,100 @@ +user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $this->requestUri = $this->modx->config['site_url'].ltrim($_SERVER['REQUEST_URI'],'/'); + $this->context = $this->getCFGDef('context','web'); + $lang = $this->lexicon->loadLang('login'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + } + + /** + * @return string + */ + public function render() + { + if ($this->modx->getLoginUserID($this->context)) { + $this->redirect(); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('login.default_skipTpl')); + $this->setValid(false); + }; + + return parent::render(); + } + + + /** + * + */ + public function process() + { + if (is_null($this->user)) { + $this->addMessage($this->lexicon->getMsg('login.user_failed')); + + return; + } + $login = $this->getField($this->getCFGDef('loginField', 'username')); + $password = $this->getField($this->getCFGDef('passwordField', 'password')); + $remember = $this->getField($this->getCFGDef('rememberField', 'rememberme')); + if ($this->user->checkBlock($login)) { + $this->addMessage($this->lexicon->getMsg('login.user_blocked')); + + return; + } + $this->user->edit($login); + + if ($this->getCFGDef('checkActivation',0) && $this->user->get('logincount') < 0) { + $this->addMessage($this->lexicon->getMsg('login.user_notactivated')); + + return; + } + + $auth = $this->user->testAuth($login, $password, false, true); + if (!$auth) { + $this->addMessage($this->lexicon->getMsg('login.user_failed')); + + return; + } + if ($remember) { + $remember = $this->getCFGDef('cookieLifetime', 60 * 60 * 24 * 365 * 5); + } + $loginCookie = $this->getCFGDef('cookieName','WebLoginPE'); + $this->user->authUser($login, $remember, $loginCookie, true); + $this->setFormStatus(true); + if (isset($this->modx->documentIdentifier) && $this->modx->documentIdentifier == $this->modx->config['unauthorized_page']) { + $uaPage = $this->modx->makeUrl($this->modx->config['unauthorized_page'],"","","full"); + if (array_shift(explode('?',$this->requestUri)) != $uaPage) { + $this->setField('redirectTo', $this->requestUri); + $this->sendRedirect($this->requestUri); + } else { + $this->redirect(); + } + } else { + $this->redirect(); + } + $this->setFields($this->user->toArray()); + $this->renderTpl = $this->getCFGDef('successTpl'); + } +} diff --git a/assets/snippets/FormLister/core/controller/MailChimp.php b/assets/snippets/FormLister/core/controller/MailChimp.php new file mode 100644 index 0000000000..0956179f00 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/MailChimp.php @@ -0,0 +1,53 @@ +lexicon->loadLang('mailchimp'); + } + + /** + * @return bool + */ + public function process() + { + $errorMessage = $this->lexicon->getMsg('mc.subscription_failed'); + if (!$this->getCFGDef('apiKey')) { + $this->addMessage($errorMessage); + + return false; + } + $MailChimp = new \DrewM\MailChimp\MailChimp($this->getCFGDef('apiKey')); + $list_id = $this->getCFGDef('listId'); + if (!$list_id) { + $this->addMessage($errorMessage); + + return false; + } + + $MailChimp->post("lists/$list_id/members", array( + 'email_address' => $this->getField('email'), + 'merge_fields' => array('NAME' => $this->getField('name')), + 'status' => 'pending', + )); + if (!$MailChimp->getLastError()) { + $this->addMessage($errorMessage); + } else { + $this->setFormStatus(true); + $this->renderTpl = $this->getCFGDef('successTpl', $this->lexicon->getMsg('mc.default_successTpl')); + + return true; + } + } +} diff --git a/assets/snippets/FormLister/core/controller/Profile.php b/assets/snippets/FormLister/core/controller/Profile.php new file mode 100644 index 0000000000..395d9e17f2 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Profile.php @@ -0,0 +1,167 @@ +lexicon->loadLang('profile'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + $uid = $modx->getLoginUserId('web'); + if ($uid) { + $user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $this->user = $user->edit($uid); + if ($ds = $this->getCFGDef('defaultsSources')) { + $defaultsSources = "{$ds};param:userdata"; + } else { + $defaultsSources = "param:userdata"; + } + $this->config->setConfig(array( + 'defaultsSources' => $defaultsSources, + 'userdata' => $this->user->toArray() + )); + } + } + + /** + * @return string + */ + public function render() + { + if (is_null($this->user) || !$this->user->getID()) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('profile.default_skipTpl')); + $this->setValid(false); + } + + return parent::render(); + } + + + /** + * @param string $param + * @return array|mixed|\xNop + */ + public function getValidationRules($param = 'rules') + { + $rules = parent::getValidationRules($param); + $password = $this->getField('password'); + var_dump($rules); + if (empty($password)) { + $this->forbiddenFields[] = 'password'; + if (isset($rules['password'])) { + unset($rules['password']); + } + if (isset($rules['repeatPassword'])) { + unset($rules['repeatPassword']); + } + } else { + if (isset($rules['repeatPassword']['equals'])) { + $rules['repeatPassword']['equals']['params'] = $this->getField('password'); + } + } + + return $rules; + } + + /** + * @param $fl + * @param $value + * @return bool + */ + public static function uniqueEmail($fl, $value) + { + $result = true; + if (!is_null($fl->user) && ($fl->user->get("email") !== $value)) { + $fl->user->set('email', $value); + $result = $fl->user->checkUnique('web_user_attributes', 'email', 'internalKey'); + } + + return $result; + } + + /** + * @param $fl + * @param $value + * @return bool + */ + public static function uniqueUsername($fl, $value) + { + $result = true; + if (!is_null($fl->user) && ($fl->user->get("email") !== $value)) { + $fl->user->set('username', $value); + $result = $fl->user->checkUnique('web_users', 'username'); + } + + return $result; + } + + /** + * + */ + public function process() + { + if ($this->user->get('username') == $this->user->get('email') && !empty($this->getField('email')) && empty($this->getField('username'))) { + $this->setField('username', $this->getField('email')); + if (!empty($this->allowedFields)) $this->allowedFields[] = 'username'; + if (!empty($this->forbiddenFields)) { + $_forbidden = array_flip($this->forbiddenFields); + unset($_forbidden['username']); + $this->forbiddenFields = array_keys($_forbidden); + } + } + + $newpassword = $this->getField('password'); + $password = $this->user->get('password'); + if (!empty($newpassword) && ($password !== $this->user->getPassword($newpassword))) { + if (!empty($this->allowedFields)) $this->allowedFields[] = 'password'; + if (!empty($this->forbiddenFields)) { + $_forbidden = array_flip($this->forbiddenFields); + unset($_forbidden['password']); + $this->forbiddenFields = array_keys($_forbidden); + } + } + $fields = $this->filterFields($this->getFormData('fields'), $this->allowedFields, $this->forbiddenFields); + $result = $this->user->fromArray($fields)->save(true); + $this->log('Update profile', array('data' => $fields, 'result' => $result)); + if ($result) { + $this->setFormStatus(true); + $this->user->close(); + $this->setFields($this->user->edit($result)->toArray()); + $this->setField('user.password',$newpassword); + $this->runPrepare('preparePostProcess'); + if (!empty($newpassword) && ($password !== $this->user->getPassword($newpassword))) { + $this->user->logOut('WebLoginPE', true); + $this->redirect('exitTo'); + } + $this->redirect(); + if ($successTpl = $this->getCFGDef('successTpl')) { + $this->renderTpl = $successTpl; + } else { + $this->addMessage($this->lexicon->getMsg('profile.update_success')); + } + } else { + $this->addMessage($this->lexicon->getMsg('profile.update_failed')); + } + } +} diff --git a/assets/snippets/FormLister/core/controller/Register.php b/assets/snippets/FormLister/core/controller/Register.php new file mode 100644 index 0000000000..a3b9a120e6 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Register.php @@ -0,0 +1,190 @@ +user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $lang = $this->lexicon->loadLang('register'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + } + + /** + * @return string + */ + public function render() + { + if ($this->modx->getLoginUserID('web')) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('register.default_skipTpl')); + $this->setValid(false); + }; + + return parent::render(); + } + + + /** + * @param string $param + * @return array|mixed|\xNop + */ + public function getValidationRules($param = 'rules') + { + $rules = parent::getValidationRules($param); + if (isset($rules['password']) && isset($rules['repeatPassword']) && !empty($this->getField('password'))) { + if (isset($rules['repeatPassword']['equals'])) { + $rules['repeatPassword']['equals']['params'] = $this->getField('password'); + } + } + + return $rules; + } + + /** + * Custom validation rule + * Проверяет уникальность email + * @param $fl + * @param $value + * @return bool + */ + public static function uniqueEmail($fl, $value) + { + $result = true; + if (!is_null($fl->user)) { + $fl->user->set('email', $value); + $result = $fl->user->checkUnique('web_user_attributes', 'email', 'internalKey'); + } + + return $result; + } + + /** + * Custom validation rule + * Проверяет уникальность имени пользователя + * @param $fl + * @param $value + * @return bool + */ + public static function uniqueUsername($fl, $value) + { + $result = true; + if (!is_null($fl->user)) { + $fl->user->set('username', $value); + $result = $fl->user->checkUnique('web_users', 'username'); + } + + return $result; + } + + /** + * + */ + public function process() + { + if (!empty($this->allowedFields)) { + $this->allowedFields[] = 'username'; + $this->allowedFields[] = 'password'; + $this->allowedFields[] = 'email'; + } + if (!empty($this->forbiddenFields)) { + $_forbidden = array_flip($this->forbiddenFields); + unset($_forbidden['username'],$_forbidden['password'],$_forbidden['email']); + $this->forbiddenFields = array_keys($_forbidden); + } + + //регистрация без логина, по емейлу + if ($this->getField('username') == '') { + $this->setField('username', $this->getField('email')); + } + if ($this->checkSubmitProtection()) { + return; + } + //регистрация со случайным паролем + if ($this->getField('password') == '' && !isset($this->rules['password'])) { + $this->setField('password', \APIhelpers::genPass($this->getCFGDef('passwordLength', 6))); + } + $password = $this->getField('password'); + $fields = $this->filterFields($this->getFormData('fields'), $this->allowedFields, $this->forbiddenFields); + $checkActivation = $this->getCFGDef('checkActivation',0); + if ($checkActivation) $fields['logincount'] = -1; + $this->user->create($fields); + $this->addWebUserToGroups(0, $this->config->loadArray($this->getCFGDef('userGroups'))); + $result = $this->user->save(true); + $this->log('Register user', array('data' => $fields, 'result' => $result)); + if (!$result) { + $this->addMessage($this->lexicon->getMsg('register.registration_failed')); + } else { + if ($checkActivation) { + $fields = $this->user->edit($result)->toArray(); + $hash = md5(json_encode($fields)); + $query = http_build_query(array( + 'id' => $result, + 'hash' => $hash + )); + $url = $this->getCFGDef('activateTo',$this->modx->config['site_start']); + $this->setField('activate.url', $this->modx->makeUrl($url, "", + $query, 'full')); + } + $this->user->close(); + $this->setFields($this->user->edit($result)->toArray()); + $this->setField('user.password',$password); + $this->runPrepare('preparePostProcess'); + parent::process(); + } + } + + /** + * + */ + public function postProcess() + { + $this->redirect(); + $this->setFormStatus(true); //результат отправки писем значения не имеет + $this->renderTpl = $this->getCFGDef('successTpl', $this->lexicon->getMsg('register.default_successTpl')); + } + + /** + * Добавляет пользователя в группы + * @param int $uid + * @param array $groups + * @return $this + */ + public function addWebUserToGroups($uid = 0, $groups = array()) + { + if (!$groups) { + return $this; + } + foreach ($groups as &$group) { + $group = $this->modx->db->escape(trim($group)); + } + $groups = "'" . implode("','", $groups) . "'"; + $groupNames = $this->modx->db->query("SELECT `id` FROM " . $this->modx->getFullTableName('webgroup_names') . " WHERE `name` IN (" . $groups . ")"); + $webGroups = $this->modx->db->getColumn('id',$groupNames); + if ($webGroups) { + $this->user->setUserGroups($uid, $webGroups); + } + + return $this; + } +} diff --git a/assets/snippets/FormLister/core/controller/Reminder.php b/assets/snippets/FormLister/core/controller/Reminder.php new file mode 100644 index 0000000000..36a933d194 --- /dev/null +++ b/assets/snippets/FormLister/core/controller/Reminder.php @@ -0,0 +1,198 @@ +user = $this->loadModel( + $this->getCFGDef('model', '\modUsers'), + $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php') + ); + $lang = $this->lexicon->loadLang('reminder'); + if ($lang) { + $this->log('Lexicon loaded', array('lexicon' => $lang)); + } + $hashField = $this->getCFGDef('hashField', 'hash'); + $uidField = $this->getCFGDef('uidField', 'id'); + $userField = $this->getCFGDef('userField', 'email'); + $this->hashField = $hashField; + $this->uidField = $uidField; + $this->userField = $userField; + if ((isset($_REQUEST[$hashField]) && !empty($_REQUEST[$hashField])) && (isset($_REQUEST[$uidField]) && !empty($_REQUEST[$uidField]))) { + $this->setFields($_REQUEST); + $this->mode = 'reset'; + $this->config->setConfig(array( + 'rules' => $this->getCFGDef('resetRules'), + 'reportTpl' => $this->getCFGDef('resetReportTpl'), + 'submitLimit' => 0 + )); + } + $this->log('Reminder mode is ' . $this->mode); + } + + /** + * @return string + */ + public function render() + { + if ($this->modx->getLoginUserID('web')) { + $this->redirect('exitTo'); + $this->renderTpl = $this->getCFGDef('skipTpl', $this->lexicon->getMsg('reminder.default_skipTpl')); + $this->setValid(false); + } + + if ($this->mode == 'reset') { + $this->renderReset(); + } + + return parent::render(); + } + + + /** + * + */ + public function renderReset() + { + $hash = $this->getField($this->hashField); + $uid = $this->getField($this->uidField); + if ($hash && $hash == $this->getUserHash($uid)) { + if ($this->getCFGDef('resetTpl')) { + $this->setField('user.hash', $hash); + $this->setField('user.id', $uid); + $this->renderTpl = $this->getCFGDef('resetTpl'); + + return; + } + $this->process(); + } else { + $this->addMessage($this->lexicon->getMsg('reminder.update_failed')); + } + } + + /** + * @param string $param + * @return array|mixed|\xNop + */ + public function getValidationRules($param = 'rules') + { + $rules = parent::getValidationRules($param); + if (isset($rules['password']) && isset($rules['repeatPassword']) && !empty($this->getField('password'))) { + if (isset($rules['repeatPassword']['equals'])) { + $rules['repeatPassword']['equals']['params'] = $this->getField('password'); + } + } + + return $rules; + } + + /** + * @param $uid + * @return bool|string + */ + public function getUserHash($uid) + { + if (is_null($this->user)) { + $hash = false; + } else { + $userdata = $this->user->edit($uid)->toArray(); + $hash = $userdata['id'] ? md5(json_encode($userdata)) : false; + } + + return $hash; + } + + /** + * + */ + public function process() + { + switch ($this->mode) { + /** + * Задаем хэш, отправляем пользователю ссылку для восстановления пароля + */ + case "hash": + $uid = $this->getField($this->userField); + if ($hash = $this->getUserHash($uid)) { + $this->setFields($this->user->toArray()); + $url = $this->getCFGDef('resetTo', $this->modx->config['site_start']); + $this->setField('reset.url', $this->modx->makeUrl($url, "", + http_build_query(array($this->uidField => $this->getField($this->uidField), + $this->hashField => $hash + )), + 'full')); + $this->mailConfig['to'] = $this->user->get('email'); + parent::process(); + } else { + $this->addMessage($this->lexicon->getMsg('reminder.users_only')); + } + break; + /** + * Если пароль не задан, то создаем пароль + * Отправляем пользователю письмо с паролем, если указан шаблон такого письма + * Если не указан, то запрещаем отправку письма, пароль будет показан на экране + */ + case "reset": + $uid = $this->getField($this->uidField); + $hash = $this->getField($this->hashField); + if ($hash && $hash == $this->getUserHash($uid)) { + if ($this->getField('password') == '' && !isset($this->rules['password'])) { + $this->setField('password', \APIhelpers::genPass($this->getCFGDef('passwordLength', 6))); + } + $fields = $this->filterFields($this->getFormData('fields'), array($this->userField, 'password')); + $result = $this->user->edit($uid)->fromArray($fields)->save(true); + $this->log('Update password', array('data' => $fields, 'result' => $result)); + if (!$result) { + $this->addMessage($this->lexicon->getMsg('reminder.update_failed')); + } else { + $this->setField('newpassword', $this->getField('password')); + $this->setFields($this->user->toArray()); + if ($this->getCFGDef('resetReportTpl')) { + $this->mailConfig['to'] = $this->getField('email'); + } + parent::process(); + } + } else { + $this->addMessage($this->lexicon->getMsg('reminder.update_failed')); + parent::process(); + } + break; + } + } + + /** + * + */ + public function postProcess() + { + $this->setFormStatus(true); + switch ($this->mode) { + case "hash": + $this->renderTpl = $this->getCFGDef('successTpl', + $this->lexicon->getMsg('reminder.default_successTpl')); + break; + case "reset": + $this->redirect(); + $this->renderTpl = $this->getCFGDef('resetSuccessTpl', + $this->lexicon->getMsg('reminder.default_resetSuccessTpl')); + } + } +} diff --git a/assets/snippets/FormLister/core/lang/english/activate.inc.php b/assets/snippets/FormLister/core/lang/english/activate.inc.php new file mode 100644 index 0000000000..66eaebc8ee --- /dev/null +++ b/assets/snippets/FormLister/core/lang/english/activate.inc.php @@ -0,0 +1,17 @@ +[+activate.url+]'; +$_lang['activate.no_activation'] = 'This user account need no activation or cannot be activated.'; +$_lang['activate.update_failed'] = 'Failed to proceed.'; +$_lang['activate.default_successTpl'] = '@CODE:The link to activate your account has been mailed.'; +$_lang['activate.default_resetSuccessTpl'] = '@CODE:Your account is activated.'; + +return $_lang; diff --git a/assets/snippets/FormLister/core/lang/english/content.inc.php b/assets/snippets/FormLister/core/lang/english/content.inc.php new file mode 100644 index 0000000000..e73e199844 --- /dev/null +++ b/assets/snippets/FormLister/core/lang/english/content.inc.php @@ -0,0 +1,20 @@ +[+reset.url+]'; +$_lang['reminder.users_only'] = 'Only registered users can restore passwords.'; +$_lang['reminder.update_failed'] = 'Failed to proceed.'; +$_lang['reminder.default_successTpl'] = '@CODE:The link to restore your password has been mailed.'; +$_lang['reminder.default_resetSuccessTpl'] = '@CODE:New password has been mailed.'; + +return $_lang; diff --git a/assets/snippets/FormLister/core/lang/russian-UTF8/activate.inc.php b/assets/snippets/FormLister/core/lang/russian-UTF8/activate.inc.php new file mode 100644 index 0000000000..e495c39cd3 --- /dev/null +++ b/assets/snippets/FormLister/core/lang/russian-UTF8/activate.inc.php @@ -0,0 +1,19 @@ +[+reset.url+]'; +$_lang['activate.no_activation'] = 'Эта учетная запись не требует активации или не может быть активирована.'; +$_lang['activate.update_failed'] = 'Не удалось выполнить операцию.'; +$_lang['activate.default_successTpl'] = '@CODE:Вам отправлено письмо со ссылкой для активации учетной записи.'; +$_lang['activate.default_activateSuccessTpl'] = '@CODE:Учетная запись успешно активирована.'; + +return $_lang; diff --git a/assets/snippets/FormLister/core/lang/russian-UTF8/content.inc.php b/assets/snippets/FormLister/core/lang/russian-UTF8/content.inc.php new file mode 100644 index 0000000000..17fac4eaec --- /dev/null +++ b/assets/snippets/FormLister/core/lang/russian-UTF8/content.inc.php @@ -0,0 +1,22 @@ +[+reset.url+]'; +$_lang['reminder.users_only'] = 'Только зарегистрированные пользователи могут восстанавливать пароли.'; +$_lang['reminder.update_failed'] = 'Не удалось выполнить операцию.'; +$_lang['reminder.default_successTpl'] = '@CODE:Вам отправлено письмо со ссылкой для восстановления пароля.'; +$_lang['reminder.default_resetSuccessTpl'] = '@CODE:Вам отправлено письмо с новым паролем.'; + +return $_lang; diff --git a/assets/snippets/FormLister/docs/history.md b/assets/snippets/FormLister/docs/history.md new file mode 100644 index 0000000000..76eb972dfc --- /dev/null +++ b/assets/snippets/FormLister/docs/history.md @@ -0,0 +1,118 @@ +## History +### 1.7.2 +* [Enhancement] Параметр &context в контроллере Login для поддержки модели modManagers (Login). +* [Fix] Ошибка в обработке параметра редиректа (Core). + +### 1.7.1 +* [Enhancement] Сниппет записывает в лог, если не задан параметр formid или не удалось загрузить класс контроллера. +* [Refactor] Плагин userHelper по умолчанию отключен. +* [Refactor] По умолчанию загружается лексикон english. +* [Fix] Ошибка в формате даты для лексикона english/form. + +### 1.7.0 +* [Refactor] Изменен метод loadModel, добавлена возможность указывать параметры, передаваемые в конструктор модели (Core). +* [Fix] Ошибка в лексиконе контроллера DeleteContent. +* [Fix] Создание записей анонимными пользователями если &onlyUsers=`0` (Content). +* [Refactor] Убраны include/require, для загрузки классов подключается файл assets/snippets/FormLister/__autoload.php. Модели MODxAPI загружаются этим же загрузчиком. +* [Refactor] Создание записи в логе, если не удалось сохранить данные (Content). +* [Refactor] Изменена обработка поля для запоминания авторизации: теперь время для автологина задается в параметре cookieLifetime (по умолчанию 5 лет, в секундах), а не значением поля (Login). +* [Refactor] Имя куки для автологина можно задать с помощью параметра cookieName, по умолчанию WebLoginPE (Login). +* [Refactor] В контроллере Login сначала проверяется, активирована ли учетная запись, а потом уже возможность авторизации (Login). +* [Enhancement] Блокировка пользователей после определенного числа неудачных попыток авторизации в плагине userHelper. + +### 1.6.2 +* [Fix] Неверное объявление метода в классах капчи. + +### 1.6.1 +* [Refactor] Переделан автологин в плагине userHelper. + +### 1.6.0 +* [Enhancement] Параметр rewriteUrls для обработки ссылок в шаблонах. Игнорируется, если задан параметр parseDocumentSource (Core). +* [Enhancement] Если страница с вызовом контроллера Login указана в конфигурации, как страница "Доступ запрещен", то после успешной авторизации будет произведен редирект на запрашиваемую страницу (Login). +* [Enhancement] Новый параметр ignoreMailerResult (Form). +* [Fix] Неправильная проверка уникальности username в контроллере Profile. +* [Refactor] Для добавления пользователей в группы используется метод из modUsers (Register). +* [Refactor] Введенный пользователем пароль сохраняется в поле user.password (Register). +* [Refactor] Контроллеры Register, Profile и Content загружают данные из моделей после успешного выполнения; после этого можно выполнить сниппеты из параметра preparePostProcess. Сделано это потому что плагины на сохранение или сами модели могут менять данные. +* [Enhancement] Восстановление данных, испорченных в protect.inc.php. Если параметр removeGpc равен 1, то очищены будут все входящие поля. Можно указать в параметре имена полей через запятую. При выводе обработанных полей будут экранироваться тэги MODX (Core). +* [Refactor] В prepare-сниппеты передается переменная name с названием параметра в котором задан сниппет. Можно использовать один сниппет для всех случаев (Core). +* [Enhancement] Контроллер DeleteUser для удаления пользователей c запросом пароля. +* [Enhancement] Контроллер DeleteContent для удаления записей MODxAPI. +* [Enhancement] Контроллер Activate для активации учетных записей. +* [Enhancement] Контроллеры Register и Login могут работать с активацией учетных записей. +* [Enhancement] Вывод параметров data-badge и data-callback для рекапчи (ReCaptchaWrapper). +* [Enhancement] Параметр deleteAttachments для удаления файлов после отправки письма (Form). +* [Enhancement] Сохранение имен файлов в поля формы (Form). +* [Enhancement] Отправка файлов не из формы. Список файлов задается массивом в параметре attachFiles: {"field":{"filepath":"assets/images/logo.png","filename":"logo.png"}} (Form). +* [Refactor] Можно не задавать параметр contentFields, в этом случае в модель будут переданы поля формы (Content). +* [Refactor] Корректная обработка полей lastlogin и thislogin в плагине userHelper. +* [Fix] Неверно выбирался шаблон при восстановлении паролей (Reminder). +* [Enhancement] Дополнительная обработка чанков парсером MODX c помощью параметра parseDocumentSource (Core). +* [Enhancement] Возможность вырезать необработанные плейсхолдеры из чанков с помощью параметра removeEmptyPlaceholders (Core). +* [Enhancement] Параметр removeEmptyPlaceholders для удаления необработанных плейсхолдеров из чанков (возможные значения 0,1; по умолчанию - 0) (Core). +* [Fix] Из-за неправильной обработки параметра defaultsSources не загружались поля в контроллере Profile (Core). +* [Fix] Метод filterFields не учитывал значение параметра allowEmptyFields (Core). + +### 1.5.1 +Исправления ошибок. + +###1.5.0 +* [Refactor] Переделана загрузка внешних параметров с учетом того, что не все источники могут содержать массив: добавлен источник aplh для загрузки массива значений из плейсхолдера MODX, в источнике cookie можно указать несколько имен кук через запятую. Добавлен источник user для загрузки данных авторизованного веб-пользователя (user:web) или менеджера (user:mgr) (Core). Добавлен источник document для загрузки данных текущего или указанного документа. +* [Refactor] Валидация капчи вынесена в класс капчи (Core). +* [Refactor] Параметры капчи задаются массивом, там же указываются сообщения об ошибках (Core). +* [Refactor] Валидация капчи происходит в классе капчи. (Core). +* [Enhancement] reCaptcha2. +* [Enhancement] smsCaptcha. +* [Enhancement] Поддержка Twig: в шаблон передаются переменные FormLister, data, errors, messages. Добавлен метод getErrorMessage для получения в шаблоне сообщений об ошибках для указанного поля (Core). +* [Enhancement] Параметры редиректа можно задавать в виде массива с ключами page (id страницы), query (массив параметров запроса) и header (заголовок) (Core). +* [Enhancement] Если задан параметр redirectTo и параметр editAfterCreate равен 1, то в параметры редиректа будет добавлен идентификатор созданного документа (Core, Content). +* [Fix] Плагин userHelper теперь перенаправляет пользователя на текущую страницу без ?logout в ссылке. +* [Fix] Сопоставление имен полей формы и модели в параметре contentFields неправильно работало в режиме редактирования, если имена различались (Content). +* [Refactor] Пользовательские функции валидации могут вместо false возвращать сообщение об ошибке (Core). + +### 1.4.1 +* [Refactor] Больше рандома в modxCaptcha. + +### 1.4.0 +* [Refactor] Класс modxCaptchaWrapper больше не привязан к FormLister (Core, modxCaptchaWrapper). +* [Enhancement] Убрано принудительное отключение параметров submitLimit и protectSubmit (Content). +* [Refactor] Изменен алгоритм загрузки пользовательских лексиконов. Теперь в параметре lexicon можно указывать как имя файла, так и сразу массив c языковыми записями (Core, Lexicon). +* [Refactor] Загрузка полей отправленной формы происходит не из $_REQUEST, а согласно параметру formMethod (значение по умолчанию - 'post') (Core). +* [Enhancement] Метод loadArray можно использовать для обработки строк с разделителем (по умолчанию - ',') (Config). +* [Enhancement] Если значение параметра submitLimit меньше 60, то оно не пересчитывается в минуты (Form). + +### 1.3.0 +* [Enhancement] Поддержка события OnBeforeWebLogin. В плагине можно реализовать процедуру авторизации независимую от модели; установку полей и шаблона сообщения об успешной авторизации нужно также производить в плагине. Плагин должен вернуть true в случае успешной авторизации, иначе будет выполнена авторизация методами модели (Login). + +### 1.2.1 +* [Refactor] Метод isArray теперь protected (FileValidator). + +### 1.2.0 +* [Refactor] Переделан пропуск полей при преобразовании в плейсхолдеры. Теперь плейсхолдеры отделены от полей формы, для работы с ними следует использовать методы setPlaceholder и getPlaceholder. Выводятся через [+placeholder+]. +* [Bug] Сниппеты, указанные в prepareProcess, выполнялись независимо от результатов валидации. +* [Refactor] Изменена логика обработки правил валидации. Теперь все правила, которых нет в валидаторе, обрабатываются как custom. Это позволяет применять сразу несколько таких правил. +* [Enhancement] Возможность применять правила валидации только для заполненных полей. +* [Refactor] Информация о файлах размещается в массиве formData c помощью метода setFiles (Core, Form). +* [Refactor] Объект FS теперь публичный. +* [Refactor] Контроллер Profile наследуется от Form, а не от Core. + +### 1.1.0 +* [Refactor] Метод filesToArray перемещен в Core. +* [Enhancement] Возможность загрузки произвольных моделей в контроллерах, которые используют MODxAPI. Новые параметры - model и modelPath. +* [Refactor] Метод для загрузки моделей MODxAPI. +* [Enhancement] Возможность загружать произвольные модели MODxAPI в контроллерах. +* [Enhancement] Новое правило валидации - date, проверяет является ли значение поля датой в указанном формате (Validator). +* [Enhancement] Возможность пропускать поля при преобразовании в плейсхолдеры (Core). + +### 1.0.2 +* [Enhancement] Убрано значение по умолчанию свойства allowedFields в контроллерах Register и Profile. + +### 1.0.1 +* [Enhancement] Новое правило валидации файлов - optional, аналог правила required но выполняется также, если файл не загружен пользователем (FileValidator). +* [Enhancement] Правила валидации файлов allowed, minSize, sizeBetween считаются выполненными, если файл не загружен пользователем (код ошибки 4). Решает проблему с файловыми полями, для которых не задано правило required (FileValidator). +* [Bug] К письму прикреплялись не загруженные пользователем файлы, теперь прикрепляются только успешно загруженные (код ошибки 0) (Form). +* [Fix] Параметры из файлов перезаписывали параметры сниппета (Core). +* [Bug] Конфиг из файла не добавлялся в общий массив настроек (Helpers/Config). + +### 1.0.0 +Public release. diff --git "a/assets/snippets/FormLister/docs/ru/010_\320\232\320\276\320\275\321\202\321\200\320\276\320\273\320\273\320\265\321\200\321\213.md" "b/assets/snippets/FormLister/docs/ru/010_\320\232\320\276\320\275\321\202\321\200\320\276\320\273\320\273\320\265\321\200\321\213.md" new file mode 100644 index 0000000000..e566b9dae2 --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/010_\320\232\320\276\320\275\321\202\321\200\320\276\320\273\320\273\320\265\321\200\321\213.md" @@ -0,0 +1,50 @@ +## Контроллеры +Контроллер представляет собой класс, унаследованный от базового класса \FormLister\Core, который реализует: + +- загрузку классов для валидации и генерации капчи; +- работу с данными (под данными здесь и далее подразумеваются значения свойства formData, то есть не только значения массива $_REQUEST); +- работу с шаблоном формы и шаблоном успешной обработки. + +Схема работы: + +1. Загрузка данных из формы +2. Загрузка данных из внешних источников +3. Вызов сниппетов для обработки данных. +4. Валидация данных - если получены данные из формы; +3. Вызов сниппетов для обработки данных. +6. Итоговая обработка - если получены данные из формы и пройдена валидация. +7. Вывод. + +Итоговая обработка формы происходит в методе process() контроллера. После успешной обработки необходимо установить флаг результа обработки формы с помощью метода setFormStatus(), а также и указать в свойстве renderTpl шаблон для вывода информации с результатами обработки. + +Ниже перечислены базовые контроллеры. + +### Контроллер Form +Отправляет письма с данными формы. + +### Контроллер Login +Авторизует пользователя в контексте web. + +### Контроллер Register +Создает web-пользователя и отправляет соответствующие письма. + +### Контроллер Activate +Обрабатывает ссылку из письма с подтверждением регистрации или отправляет такое письмо. + +### Контроллер DeleteUser +Позволяет пользователям удалять свои учетные записи. Для подтверждения запрашивает пароль. + +### Контроллер Profile +Предназначен для редактирования данных web-пользователя. + +### Контроллер Reminder +Предназначен для восстановления паролей web-пользователями. + +### Контроллер Content +Позволяет создавать и изменять записи с помощью классов MODxAPI. + +### Контроллер DeleteContent +Позволяет пользователям удалять созданные ими записи. + +### Контроллер MailChimp +Добавляет пользователей в список рассылки сервиса MailChimp. Добавлен как пример расширения базового класса \FormLister\Core. diff --git "a/assets/snippets/FormLister/docs/ru/020_\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\321\213.md" "b/assets/snippets/FormLister/docs/ru/020_\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\321\213.md" new file mode 100644 index 0000000000..e0046780fa --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/020_\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\321\213.md" @@ -0,0 +1,291 @@ +## Общие параметры + +Эти параметры обрабатываются базовым классом FormLister. В контроллерах некоторые общие параметры могут иметь другое назначение. + +## Настройки +### controller +Задает класс для обработки данных. + +Возможные значения - имя php-файла с классом без расширения. + +Значение по умолчанию - Form. + +### dir +Папка в которой находится класс контроллера. + +Значение по умолчанию - assets/snippets/FormLister/core/controller/ + +### formid +Имя формы, обязательный параметр. + +В шаблоне формы обязательно должно быть скрытое поле с именем formid и значением, указанным в параметре. Форма считается отправленной, если в массиве $_REQUEST присутствует ключ с именем параметра, а его значение соответствует значению параметра. + +### formMethod +Возможные значения - post, get или request. + +Значение по умолчанию - post. + +### config +Загрузка параметров в формате json из файла. + +Возможные значения - имяфайла:папка, несколько значений разделяются точкой с запятой. + +#### Пример +myparams:core - загрузить параметры из файла assets/snippets/FormLister/config/core/myparams.json; myparams - загрузить параметры из файла assets/snippets/FormLister/config/custom/myparams.json; myparams:/assets/myfolder - загрузить параметры из файла assets/myfolder/myparams.json. + +Значение по умолчанию - пусто. + +### api +Определяет, в каком виде будут выводиться данные. + +Возможные значения: + +- 0: только html; +- 1: json-массив с данными формы; +- 2: json-массив с данными формы и html. + +### debug +Режим отладки. Вывод записывается в лог MODX. + +Возможные значения - 0, 1. + +Значение по умолчанию - 0. + +### saveObject +Сохраняет объект класса FormLister в плейсхолдер, который можно использовать в других сниппетах. Объект сохраняется только при успешной обработке формы. + +Возможные значения - имя плейсхолдера. + +Значение по умолчанию - пусто. + +### removeGpc +Убирает экранирование данных, которое выполняет MODX для символов {{, [[ и т.д. При этом экранируются тэги MODX при выводе. + +Возножные значения - 0, 1 или имена полей через запятую. + +Значение по умолчанию - 0. + +## Источники данных +### defaultsSources +Позволяет загружать дополнительные данные из внешних источников, например, для предварительного заполнения полей формы. По умолчанию внешние данные загружаются только при начальном выводе формы и не загружаются после отправки формы Это поведение может быть изменено с помощью параметра keepDefaults. + +Возможные значения: список источников, разделенных точкой с запятой. Загрузка данных производится в том порядке, в котором они указаны в списке. + +Источник может задаваться в формате "имя:ключ:префикс". Префикс, если указан, добавляется c точкой к имени поля - например, config.site_name. + +Возможные значения: + +- array: json или php-массив, значения задаются параметром defaults; +- param:имя параметра:префикс - значения задаются значением параметра из вызова сниппета (аналогично array, только значение задается не параметром defaults, а произвольным, также можно указать префикс); +- session:ключ массива:префикс - значения загружаются из массива $_SESSION; +- plh:ключи через запятую:префикс - загружаются значения из массива $modx->placeholders; +- aplh:имя плейсхолдера:префикс - загружаются значения из плейсхолдера, содержащего массив; +- config:префикс - загружаются значения из конфигурации MODX; +- cookie:ключи через запятую:префикс - загружаются значения из массива $_COOKIE; +- имя класса MODxAPI:ключ:префикс - ключ является аргументом метода edit(), класс должен быть заранее загружен; +- document:префикс - загружает данные из модели modResource для документа, в котором вызван сниппет. Ключ не указывается; +- user:ключ:префикс - загружает данные из модели modUsers для авторизованного пользователя. Тип пользователя уточняется в ключе (web или mgr). + +Значение по умолчанию - array. + +### defaults +Данные для источника array. + +Возможные значения: массив значений по умолчанию, в формате json или php. + +### keepDefaults +Позволяет повторно загружать данные из внешних источников после отправки формы. Если в параметре указан список полей, то загружены будут только указанные поля. + +Возможные значения: 1, 0, имена полей, разделенные запятой. + +Значение по умолчанию - 0. + +### allowEmptyFields +Разрешает задавать поля с пустыми значениями. + +Возможные значения - 0 или 1. + +Значение по умолчанию - 1. + +## Элементы управления +### formControls +Список полей с управляющими элементами формы (списки, чекбоксы, радио-кнопки). Необходимо для отслеживания состояния элементов. + +Возможные значения - имена полей, разделенные запятой. + +Значение по умолчанию - пусто. + +### emptyFormControls + +Этот параметр позволяет решить проблему неотмеченных чекбоксов, которые не включаются в массив полей при отправке формы: если в $_REQUEST отсутствует нужный элемент, то он создается согласно данному параметру. Необходимость в таком параметре возникла в связи с тем, что MODxAPI требует явно указывать изменяемые поля в методе fromArray(). Но можно использовать и в обычных формах, чтобы подставить в шаблон значение неотмеченного чекбокса. + +Возможные значения - массив: +``` +&emptyFormControls=`{ + "mycheckbox" : "Нет", + "published" : 0 +}` +``` + +## Обработка данных +### prepare, prepareProcess, prepareAfterProcess +Аналогично параметру prepare в DocLister. + +Сниппеты из параметра prepare выполняются после загрузки данных в форму, сниппеты из параметра prepareProcess - после прохождения валидации, сниппеты из параметра prepareAfterProcess - после успешного выполнения обработки. В сниппетах через переменную $FormLister доступен объект контроллера, а через массив $data - значения полей формы. Также доступна переменная $name, которая задержит имя параметра из которого взят сниппет (prepare, prepareProcess и т.д.); это позволяет использовать один и тот же сниппет для разных случаев. Для изменения данных следует использовать в prepare-сниппетах методы контроллера (setField, setFields и т.д.) + +Возможные значения - имена сниппетов, анонимные функции, статические методы загруженных классов. + +Значение по умолчанию - пусто. + +## Валидация +### validator +Имя класса для валидации данных. Класс должен быть предварительно загружен. + +Значение по умолчанию - \FormLister\Validator. + +### rules +Массив с правилами валидации. + +Значение по умолчанию - пусто. + +## Шаблоны +### formTpl +Шаблон формы. В шаблоне формы обязательно должно быть поле с именем formid и значением, указанным в параметре formid. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### arraySplitter + +Разделитель для преобразования массивов в строку. + +Значение по умолчанию - точка с запятой. + +### {field}.arraySplitter +Разделитель для преобразования массивов в строку, но для отдельного поля {field}. Например: groups.arraySplitter - разделитель для массива из поля groups. + +Если не задано, то используется значение параметра arraySplitter. + +### errorTpl +Шаблон для вывода сообщений валидатора. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию: +``` +@CODE:
                              [+message+]
                              +``` + +### requiredClass, errorClass +Имена классов для обозначения незаполненных (required) и неверно заполенных (error) полей. + +Значение по умолчанию - required и error соответственно. + +### {field}.requiredClass, {field}.errorClass +Позволяет задавать указанные выше классы для конкретных полей. + +По умолчанию используются значения параметров requiredClass и errorClass. + +### messagesTpl +Шаблон сообщений обработчика формы. В шаблоне выводятся группы сообщений (messages, required, error). + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию: +``` +@CODE:
                              [+messages+]
                              +``` + +### messagesOuterTpl +Шаблон-обертка для группы произвольных сообщений. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - +``` +@CODE: [+messages+] +``` + +### messagesRequiredOuterTpl +Шаблон-обертка для группы сообщений о незаполненных полях. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию: +``` +@CODE: [+messages+] +``` + +### messagesErrorOuterTpl +Шаблон-обертка для группы сообщений о неверно заполненных полях. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию: +``` +@CODE: [+messages+] +``` + +### messagesSplitter, messagesRequiredSplitter, messagesErrorSplitter +Разделитель сообщений в группе. + +Возможные значения - произвольная строка. + +Значение по умолчанию: +``` +
                              +``` + +### removeEmptyPlaceholders +Удаляет из шаблонов незаполненные прейслхолдеры. + +Возможные значения - 0 или 1. + +Значение по умолчанию - 0. + +### parseDocumentSource +Обрабатывает чанки MODX-парсером. + +Возможные значения - 0 или 1. + +Значение по умолчанию - 0. + +### rewriteUrls +Если параметр parseDocumentSource отключен, то парсит ссылки в шаблонах. + +Возможные значения - 0 или 1. + +Значение по умолчанию - 0. + +### skipPrerender +Позволяет отключить предварительную обработку полей формы (экранирование значений, преобразование массивов в строки, установка сообщений об ошибках). Можно включить, если для вывода не используется парсер MODX. + +Возможные значения - 0 или 1. + +Значение по умолчанию - 0. + +### templatePath, templateExtension +Путь к папке с файлами шаблонов и расширение файлов шаблонов. Эти параметры необходимо задавать при использовании плагина EvoTwig. + +Значение по умолчанию - пусто. + +## Перенаправление после обработки +### redirectTo +Id страницы, на которую нужно выполнить перенаправление после успешной обработки формы. В api-режиме перенаправление не выполняется, но в массиве данных формы сохраняется абсолютная ссылка на целевую страницу (поле "redirectTo"). + +Вместо числа можно указывать массив: +``` +&redirectTo=`{ + "page":10, + "query":{ + "foo":"bar" + }, + "header":"HTTP/1.1 307 Temporary Redirect" +}` +``` +Ключ page задает id станицы, в массиве query можно передать дополнительные get-параметры, значением ключа header может быть текст заголовка для перенаправления. + +Возможные значения - число или массив. + +Значение по умолчанию - пусто. diff --git "a/assets/snippets/FormLister/docs/ru/030_\320\222\320\260\320\273\320\270\320\264\320\260\321\206\320\270\321\217 \320\264\320\260\320\275\320\275\321\213\321\205.md" "b/assets/snippets/FormLister/docs/ru/030_\320\222\320\260\320\273\320\270\320\264\320\260\321\206\320\270\321\217 \320\264\320\260\320\275\320\275\321\213\321\205.md" new file mode 100644 index 0000000000..9efb7da81d --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/030_\320\222\320\260\320\273\320\270\320\264\320\260\321\206\320\270\321\217 \320\264\320\260\320\275\320\275\321\213\321\205.md" @@ -0,0 +1,132 @@ +## Валидация данных + +При валидации данных валидатор последовательно применяет к значению поля заданные правила, при возникновении ошибки в массив данных об ошибках добавляется запись и дальнейшая обработка формы прекращается. + +Валидация считается пройденной, если в массиве данных об ошибках отсутствуют записи. + +### Правила валидации +Список правил задается в виде массива. Ключом является имя поля, а значением - массив правил валидации. Правило валидации является методом класса-валидатора. В массиве правил ключом является имя правила (название метода валидации), значением может быть либо строка с сообщением об ошибке валидации правила, или же массив с описанием. В этом массиве в ключе params задаются необходимые для валидации значения, а в ключе message задается строка с сообщением об ошибке. + +Можно также использовать отрицание правил, если добавить перед именем правила восклицательный знак: "!numeric" - поле пройдет валидацию, если его значение не является числом. + +Если нужно реализовать проверку только заполненных полей, то перед именем поля в списке правил нужно добавить восклицательный знак. В этом случае если значение поля пустое, правила будут проигнорированы. + +``` +{ + "имя поля 1": { + "правило 1" : "сообщение об ошибке", + "правило 2" : "сообщение об ошибке" + }, + "имя поля 2": { + "правило 1" : "сообщение об ошибке", + "правило 2" : { + "params" : значение, + "message" : "сообщение об ошибке" + } + }, + "!имя поля 3":{ + "правило 1" : "сообщение об ошибке" + } +} +``` +Стандартным классом валидации (\FormLister\Validator) предусмотрены правила: + +- required: поле заполнено; +- date: значение поля является датой в заданном формате; +- min: значение поля больше заданного или равно ему; +- max: значение поля меньше заданного или равно ему; +- greater: значение поля строго меньше заданного; +- less: значение поля строго больше заданного; +- between: значение поля входит в диапазон; +- equals: значение поля равно заданному; +- in: значение поля входит в заданный массив значений; +- alpha: значение поля содержит только буквы; +- numeric: значение поля содержит только цифры; +- alphaNumeric: значение поля содержит только буквы и цифры; +- slug: значение поля является частью url; +- decimal: значение поля является десятичным числом; +- phone: значение поля является номером телефона; +- matches: значение поля удовлетворяет регулярному выражению; +- url: значение поля является ссылкой; +- email: значение поля является email-адресом; +- length: длина значения поля равна заданному; +- minLength: длина значения поля больше заданного или равна ему; +- maxLength: длина значения поля меньше заданного или равна ему; +- lengthBetween: длина значения поля входит в диапазон; +- minCount: размер массива больше заданного; +- maxCount: размер массива меньше заданного; +- countBetween: размер массива входит в диапазон. + +Если требуется задать два значения для правила, то их следует задавать как массив: +``` +&rules=`{ + "field" : { + "lengthBetween" : { + "params" : [10,20], + "message" : "Длина должна быть от 10 до 20" + } + } +}` +``` + +Для правила in (и других правил, использующих массив) массив значений следует задавать следующим образом: +``` +&rules=`{ + "field" : { + "in" : { + "params" : [ [10,20,30] ], + "message" : "Значение поля field должно быть равно 10, 20 или 30" + } + } +}` +``` + +Это нужно, чтобы массив был передан в функцию одним аргументом. + +Предусмотрена также возможность использовать для валидации функции или статические методы загруженного класса: +``` +&rules=`{ + "myfield":{ + "required":"Required field", + "custom":{ + "function":"\\Namespace\\Classname::myCustomRule", + "params":[10,20,30], + "message":"Custom check failed" + } + } +}` +``` + +Метод должен принимать первым аргументом экземпляр контроллера из которого вызывается правило, вторым аргументом - значение проверяемого поля, далее - параметры передаваемые в ключе описания params: +``` +public static function myCustomRule($fl,$value,$a,$b,$c) { + $result = $fl->getField('field1') == $a && $fl->getField('field2') == $b && $value == $c; + return $result; +} +``` +В примере правило будет пройдено, если значение поля field1 = 10, значение поля field2 = 20, а значение поля, к которму применяется правило, = 30. + +Метод должен вернуть true, false или текст сообщения об ошибке (в этом случае можно не указывать message в списке правил). + +В примере используется название правила "сustom", но можно использовать любое название правила, которого нет в классе валидации. Таким образом можно использовать несколько правил данного типа. + +### Результаты валидации +Данные об ошибках хранятся в виде массива и могут быть получены вызовом метода getFormData('errors'): +``` +{ + "имя поля 1": { + "имя нарушенного правила" : "сообщение об ошибке" + }, + "имя поля 2": { + "имя нарушенного правила" : "сообщение об ошибке" + } +} +``` +Для добавления данных в этот массив используется метод addError(имя поля, имя правила, сообщение об ошибке). Таким образом, можно влиять на итоговый результат валидации, вручную добавляя записи в этот массив. Можно также объявить валидацию непройденной по умолчанию, вызвав метод setValid(false). + +В шаблонах результаты валидации для каждого поля выводятся с помощью плейсхолдера [+имя поля.error+]. Общий результат может быть выведен в плейсхолдер [+form.messages+], который задается шаблоном messagesTpl. В свою очередь, в этом шаблоне можно использовать плейсхолдеры: + +- [+required+] - сообщения о незаполенных полях; +- [+errors+] - сообщения о неверно заполненных полях. + +Получить сообщения об ошибках для определенного поля можно с помощью метода getErrorMessage(имя поля). diff --git "a/assets/snippets/FormLister/docs/ru/035_\320\230\321\201\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\320\275\320\270\320\265 \320\272\320\260\320\277\321\207\320\270.md" "b/assets/snippets/FormLister/docs/ru/035_\320\230\321\201\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\320\275\320\270\320\265 \320\272\320\260\320\277\321\207\320\270.md" new file mode 100644 index 0000000000..99f61a25bf --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/035_\320\230\321\201\320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\320\275\320\270\320\265 \320\272\320\260\320\277\321\207\320\270.md" @@ -0,0 +1,175 @@ +## Использование капчи + +По умолчанию FormLister может использовать модицифированную капчу MODX и Google Recaptcha. Также в наличии SmsCaptcha - для отправки формы необходимо ввести код, полученный в смс-сообщении (отправку сообщения необходимо реализовывать отдельно). + +Для подключения необходимо указать имя папки с файлами капчи (папки находятся в assets/snippets/FormLister/lib/captcha/) в параметре &captcha. + +В параметре &captchaParams задаются в виде массива настройки капчи. Например: +``` +&captchaParams=`{ +"width":200, +"height":120 +}` +``` + +Имя поля, в которое пользователь вводит значение капчи, задается параметром captchaField (по умолчанию - vericode). Правило валидации для этого поля создается автоматически. + +Капча выводится в шаблоне формы с помощью плейсхолдера [+captcha+]. + +### modxCaptcha + +Модификация стандартной капчи MODX. + +Настройки: +* width и height - ширина и высота картинки с капчей (значение по умолчанию - 100 и 60); +* inline - формат вывода. Если значение параметра равно 1, то в плейсхолдер [+captcha+] выводится картинка в base64-формате. Если 0, то выводится ссылка на файл connector.php, генерирующий картинку. Значение по умолчанию - 1; +* connectorDir - путь к папке с файлом connector.php, если параметр inline равен 0. Значение по умолчанию - assets/snippets/FormLister/lib/captcha/modxCaptcha/; +* errorEmptyCode - текст сообщения об ошибке, если поле со значением капчи не заполнено. Значение по умолчанию - "Введите проверочный код"; +* errorCodeFailed - текст сообщения об ошибке, если введено неверное значение капчи. Значение по умолчанию - "Неверный проверочный код" + +### reCaptcha + +Капча Google reCAPTCHA V2. На странице с формой должен быть подключен скрипт: +``` + +``` + +Значение параметра captchaField должно быть "g-recaptcha-response" (см. [документацию](https://developers.google.com/recaptcha/docs/verify)). + +Настройки: +* secretKey, siteKey - ключи для доступа к api reCAPTCHA; +* size, theme, badge, callback, expired_callback, tabIndex, type - см. [документацию](https://developers.google.com/recaptcha/docs/display#render_param); +* errorCodeFailed - текст сообщения об ошибке, если пользователь не прошел проверку. Значение по умолчанию - "Вы не прошли проверку" + +### smsCaptcha + +Настройки: +* codeLifeTime - срок действия введенного кода, секунд. Если пользователь попытается ввести код до истечения срока, то будет выведено сообщение errorCodeUsed. Значение по умолчанию - 86400 (сутки); +* errorEmptyCode - сообщение об ошибке, если пользователь получил, но не ввел код. Значение по умолчанию - "Введите код авторизации"; +* errorCodeRequired - сообщение об ошибке, если пользователь не запросил код. Значение по умолчанию - "Получите код авторизации"; +* errorCodeFailed - сообщение об ошибке, если пользователь ввел неверный код авторизации. Значение по умолчанию - "Неверный код авторизации"; +* errorCodeExpired - сообщение об ошибке, если пользователь не ввел полученный код в течение заданного времени. Значение по умолчанию - "Код авторизации истек, получите новый"; +* errorCodeUsed - сообщение об ошибке, если пользователь уже вводил код для текущей формы. Значение по умолчанию - "Код авторизации уже использовался". + +Чтобы использовать эту капчу необходимо предварительно создать таблицу в базе данных: +``` +createTable(); +``` + +Для отправки кода необходимо создать отдельную форму и указать в параметре prepareProcess сниппет: + ``` +setValid(false); + $FormLister->addError('phone','phone','Неверный номер телефона'); +} else { + //загружаем класс для работы с таблицей + $sms = $FormLister->loadModel('SmsModel','assets/snippets/FormLister/lib/captcha/smsCaptcha/model.php'); + $flag = false; + //проверяем, есть ли в таблице запись для заданного номера и идентификатора формы + $data = $sms->getData('+'.$rawPhone,$formid); + if ($data->getID()) { + //если есть и код не истек + if ($sms->get('expires') > time()) { + //смотрим, использован ли код + if ($sms->get('active')) { + $FormLister->addMessage('Вы уже использовали код.'); + } else { + $FormLister->addMessage('Код уже был отправлен. Подождите несколько минут прежде чем запросить новый.'); + } + //если код истек, то удаляем запись и разрешаем выдать новый + } else { + $sms->delete($sms->getID()); + $flag = true; + } + } else { + $flag = true; + } + //если можно выдать новый код + if ($flag) { + $code = mt_rand(1000,9999); + + //здесь отправляется смс и результат помещается в переменную $result + /** + * + */ + $result = array('status'=>true); + + //проверяем отправлена ли смс + if (is_array($result) && $result['status']) { + //создаем запись в таблице, время жизни кода - 3 минуты + $result = $sms->create()->fromArray(array( + 'phone'=>('+'.$rawPhone), + 'formid'=>$formid, + 'expires'=>(time() + 60*3), + 'ip'=> \APIhelpers::getUserIP(), + 'code'=>$code + ))->save(); + //если получилось записать, то сохраняем в сессию номер телефона + if ($result) { + $_SESSION[$session_key] = '+'.$rawPhone; + } else { + $FormLister->setValid(false); + $FormLister->addMessage('Не удалось отправить смс'); + } + } else { + //если нельзя выдать код, то запрещаем дальнейшую обработку формы + $FormLister->setValid(false); + } +} +?> +``` + +Полностью вызов FormLister: +``` +[!FormLister? +&formid=`code` +&submitLimit=`0` +&protectSubmit=`0` +&rules=`{ +"phone":{ + "required":"Обязательно введите номер телефона", + "phone":"Введите номер правильно" +} +}` +&prepareProcess=`setSmsCaptcha` +&captcha=`modxCaptcha` +&formTpl=`@CODE: +
                              +
                              +
                              +
                              + + +
                              + +
                              + + [+phone.error+] +
                              +
                              +[+form.messages+] +
                              +
                              + +
                              +
                              + + + [+vericode.error+] +
                              +
                              +
                              +
                              ` +&successTpl=`@CODE:Код авторизации отправлен на номер [+phone.value+]. Срок действия кода - 3 минуты.` +!] +``` diff --git "a/assets/snippets/FormLister/docs/ru/040_\320\222\321\213\320\262\320\276\320\264 \320\264\320\260\320\275\320\275\321\213\321\205.md" "b/assets/snippets/FormLister/docs/ru/040_\320\222\321\213\320\262\320\276\320\264 \320\264\320\260\320\275\320\275\321\213\321\205.md" new file mode 100644 index 0000000000..f34644afbf --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/040_\320\222\321\213\320\262\320\276\320\264 \320\264\320\260\320\275\320\275\321\213\321\205.md" @@ -0,0 +1,38 @@ +## Вывод данных + +Для вывода в шаблоны данные экранируются, а массивы преобразовываются в строки. Кроме этого, для элементов управления устанавливаются специальные плейсхолдеры. + +Вывод неэкранированного значения поля: +[+имя поля+] + +Вывод значения поля: +``` +[+имя поля.value+] +``` + +Установка чекбокса: +``` +[+c.имя поля.значение поля+] +``` + +Установка выпадающего списка или радио-кнопки: +``` +[+s.имя поля.значение поля+] +``` + +Установка класса для незаполненного поля: +[+имя поля.requiredСlass+] + +Установка класса для неверно заполненного поля: +[+имя поля.errorClass+] + +Вывод сообщения об ошибке валидации: +[+имя поля.error+] + +Вывод сообщений обработчика: +[+form.messages+] + +Вывод значений из лексиконов: +[%ключ лексикона%] + +При использовании плагина EvoTwig в шаблонах доступны переменные FormLister (объект контроллера), errors (массив formData['errors']), messages (массив formData['messages']). diff --git "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260 \320\277\320\270\321\201\320\265\320\274.md" "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260 \320\277\320\270\321\201\320\265\320\274.md" new file mode 100644 index 0000000000..49b1b8e7a2 --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260 \320\277\320\270\321\201\320\265\320\274.md" @@ -0,0 +1,216 @@ +## Отправка писем + +Контроллер Form позволяет отправлять данные формы в письме. + +## Параметры отправки почты +### isHtml +Разрешает отправлять письмо в формате html. Проверка корректности кода письма возлагается на разработчика. + +Возможные значения - 1, 0. + +Значение по умолчанию - 1. + +### to +Адрес получателя. Если не указан, то письмо не отправляется, но считается успешно отправленным. + +Возможные значения - email-адрес. + +Значение по умолчанию - пусто. + +### from +Возможные значения - email-адрес. + +Значение по умолчанию - параметр конфигурации emailsender. + +### fromName +Имя отправителя. + +Возможное значение - строка. + +Значение по умолчанию - параметр конфигурации site_name. + +### replyTo +Заголовок replyTo. + +Возможные значения - email-адрес. + +Значение по умолчанию - пусто. + +### cc +Заголовок сс. + +Возможные значения - email-адрес. + +Значение по умолчанию - пусто. + +### bcc +Заголовок bcc. + +Возможные значения - email-адрес. + +Значение по умолчанию - пусто. + +### noemail +Если параметр задан, то письмо не отправляется, но считается успешно отправленным. + +Возможные значения - 1, 0. + +Значение по умолчанию - 0. + +### ignoreMailerResult +Если параметр задан, то письмо отправляется, но результат отправки игнорируется. + +Возможные значения - 1, 0. + +Значение по умолчанию - 0. + +### subject +Тема письма. + +Возможные значения - строка. + +Значение по умолчанию - пусто. + +### subjectTpl +Шаблон темы письма. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - значение параметра subject. + +### autosender +Адрес на который отправляется дополнительное письмо. + +Возможные значения - email-адрес. + +Значение по умолчанию - пусто. + +### autosenderFromName +Имя отправителя дополнительного письма. + +Возможные значения - строка. + +Значение по умолчанию - параметр конфигурации site_name. + +### ccSender +Если параметр задан, то на адрес указанный в поле формы отправляется письмо. + +Возможные значения - 1, 0. + +Значение по умолчанию - 0. + +### ccSenderField +Имя поля, в котором хранится адрес получателя. + +Возможные значения - имя поля формы. + +Значение по умолчанию - email. + +### ccSenderFromName +Имя отправителя письма на заданный в поле формы адрес. + +Возможные значения - строка. + +Значение по умолчанию - не указано. + +## Защита от повторной отправки +### protectSubmit +Защита от повторной отправки письма. + +Возможные значения - 1, 0 или список полей, по которым определяется уникальность письма. Если список не задан, то используются поля, обязательные для заполнения. + +Значение по умолчанию - 1. + +### submitLimit +Защита от частой отправки писем. + +Значение - число секунд между повторной отправкой. + +Значение по умолчанию - 60. + +## Шаблоны +### reportTpl +Основной шаблон письма. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - список полей и их значений. + +### automessageTpl +Шаблон дополнительного письма. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### ccSenderTpl +Шаблон письма на заданный в поле формы адрес. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### successTpl +Шаблон сообщения об успешной отправке писем. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +## Отправка файлов +### attachments +Имена полей, в которых хранятся файлы. Поддерживаются только поля с одним файлом (name="field" type="file") и поля с одномерным массивом файлов (name="field[]" type="file" multiple). + +Значение по умолчанию - пусто. + +### attachFiles +Позволяет отправить произвольные файлы. + +Возможные значения - массив: +``` +&attachFiles=`{ +"имя поля1":{ + "filepath":"assets/images/logo.png", + "filename":"logo.png" +}, +"имя поля2":[ + { + "filepath":"assets/images/file1.jpg", + "filename":"отчет.jpg" + }, + { + "filepath":"assets/images/file2.jpg", + "filename":"отчет2.jpg" + } +] +}` +``` +### deleteAttachments +Позволяет удалить файлы вложений после успешной отправки. + +Возможные значения - 0 или 1. + +Значение по умолчанию - 0. + +### fileValidator +Имя класса для валидации файлов. Если задано, то класс должен быть загружен заранее. + +Значение по умолчанию - \FormLister\FileValidator + +### fileRules +Правила валидации (см. раздел "Валидация данных"). Стандартный валидатор поддерживает правила: + +- required: файлы успешно отправлены; +- optional: аналогично required, но выполняется и в том случае, если пользователь не загружал файлы (то есть поле с файлами не является обязательным); +- allowed: расширение файла входит в заданный массив; +- images: расширение файла jpg, jpeg, gif, png, bmp; +- minSize: размер файла в килобайтах больше заданного; +- maxSize: размер файла в килобайтах меньше заданного; +- sizeBetween: размер файла в килобайтах входит в диапазон; +- minCount: количество файлов больше заданного; +- maxCount: количество файлов меньше заданного; +- countBetween: количество файлов входит в диапазон. + +Использовать конструкцию "!имя поля" в правилах валидации файлов нет смысла, так как значение поля с файлом не будет пустым, даже если файл не загружен. Следует использовать правило optional. + +В шаблоне письма reportTpl доступен плейсхолдер [+attachments.value+] со списком всех приложенных к письму файлов. Можно также вывести по отдельности: [+имя поля.value+]. Файлы отправляются только в письме c шаблоном reportTpl. diff --git "a/assets/snippets/FormLister/docs/ru/060_\320\220\320\262\321\202\320\276\321\200\320\270\320\267\320\260\321\206\320\270\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\320\265\320\270\314\206.md" "b/assets/snippets/FormLister/docs/ru/060_\320\220\320\262\321\202\320\276\321\200\320\270\320\267\320\260\321\206\320\270\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\320\265\320\270\314\206.md" new file mode 100644 index 0000000000..841e652207 --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/060_\320\220\320\262\321\202\320\276\321\200\320\270\320\267\320\260\321\206\320\270\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\320\265\320\270\314\206.md" @@ -0,0 +1,117 @@ +## Авторизация пользователей + +Контроллер Login позволяет авторизировать пользователей как по имени, так и по email. Кроме этого, можно дополнительно использовать плагин userHelper, который ведет учет количества логинов и времени последнего логина, а также реализует автологин и выход из учетной записи. + +## Параметры контроллера + +### model +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### modelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### loginField +Поле, содержащее имя пользователя. + +Возможные значения - имя поля. + +Значение по умолчанию - username. + +### passwordField +Поле, содержащее пароль пользователя. + +Возможные значения - имя поля. + +Значение по умолчанию - password. + +### rememberField +Поле для запоминания пользователя. Если значение поля приводится к true, то при успешной авторизации будет установлена кука с параметрами автологина. Имя куки и ее время жизни задаются параметрами cookieName и cookieLifetime. + +Можно также задать поле rememberme в параметре defaults, чтобы запоминание происходило без участия пользователя: +``` +&defaults=`{"rememberme":1}` +``` + +Возможные значения - имя поля. + +Значение по умолчанию - rememberme. + +### checkActivation +Включает проверку активации учетной записи пользователя (см. "Активация учетных записей"). + +Возможные значения - 0 или 1. + +Значение по умолчанию - 1. + +### context +Контекст авторизации. + +Возможные значения - mgr или web. + +Значение по умолчанию - web. + +### cookieName +Имя куки для хранения параметров автологина. + +Значение по умолчанию - WebLoginPE. + +### cookieLifetime +Время жизни вышеуказанной куки. + +Возможные значения - число секунд с момента последнего логина. + +Значение по умолчанию - 157680000 (5 лет). + +### redirectTo +Перенаправляет пользователя на страницу c указанным id после авторизации. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### exitTo +Перенаправляет уже авторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### successTpl +Шаблон сообщения об успешной авторизации. В шаблоне можно использовать данные пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Login с ключом [+login.default_successTpl+] + +### skipTpl +Шаблон сообщения о том, что пользователь уже авторизован. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Login с ключом [+login.default_skipTpl+] + +## Параметры плагина userHelper +### logoutKey +Имя GET-параметра для запуска выхода из учетной записи. Если в ссылке на страницу сайта указан параметр с соответствующим именем (например, http://sitename.ru/page.html?logout), будет произведен выход из учетной записи. + +Значение по умолчанию - logout. + +### cookieName +Имя куки для хранения параметров автологина. + +Значение по умолчанию - WebLoginPE. + +### cookieLifetime +Время жизни вышеуказанной куки. + +Возможные значения - число секунд с момента последнего логина. + +Значение по умолчанию - 157680000 (5 лет). diff --git "a/assets/snippets/FormLister/docs/ru/070_\320\240\320\265\320\263\320\270\321\201\321\202\321\200\320\260\321\206\320\270\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\320\265\320\270\314\206.md" "b/assets/snippets/FormLister/docs/ru/070_\320\240\320\265\320\263\320\270\321\201\321\202\321\200\320\260\321\206\320\270\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\320\265\320\270\314\206.md" new file mode 100644 index 0000000000..58843c8e7a --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/070_\320\240\320\265\320\263\320\270\321\201\321\202\321\200\320\260\321\206\320\270\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\320\265\320\270\314\206.md" @@ -0,0 +1,137 @@ +## Регистрация пользователей + +Контроллер Register позволяет регистрировать пользователей в заданные группы и отправлять уведомления о регистрации. Контроллер является расширением контроллера Form, соответственно можно использовать соответствующие параметры для отправки писем при регистрации. + +Имена полей в форме должны соответствовать полям модели [modUsers](http://docs.evolution-cms.com/Extras/Snippets/DocLister/MODxAPI). + +Если в форме не задано поле username, то ему присваивается значение поля email. Таким образом можно регистрировать пользователей только по email. + +Если в форме не задано поле password, то значение поля генерируется автоматически. То есть регистрацию пользователя можно свести к указанию email. + +При регистрации с паролем, в форме может присутствовать поле repeatPassword. Если заданы правила валидации для полей password и repeatPassword, то при наличии для поля repeatPassword правила equals, оно будет автоматически скорректировано для проверки равенства значений полей password и repeatPassword: +``` +"repeatPassword":{ + "required":"Введите пароль еще раз", + "equals":{ + "params" : "Этот ключ в описании правила можно не задавать, он будет сформирован контроллером автоматически", + "message":"Пароли не совпадают" + } +} +``` + +При регистрации следует проверять уникальность имени пользователя и email. В контроллере предусмотрены соответствующие правила: +``` +&rules=`{ + "username":{ + "required":"Введите имя пользователя", + "alphaNumeric":"Только буквы и цифры", + "custom":{ + "function":"\\FormLister\\Register::uniqueUsername", + "message":"Имя уже занято" + } + }, + "email":{ + "required":"Введите email", + "email":"Неверный email", + "custom":{ + "function":"\\FormLister\\Register::uniqueEmail", + "message":"Этот email уже использует другой пользователь" + } + } +}` +``` +В шаблонах доступны все поля модели для созданной записи. Дополнительно задается поле user.password с незашифрованным паролем. + +## Параметры +### model +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### modelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### allowedFields +Разрешенные для обработки поля. Поля, не указанные в списке, игнорируются. Поля username, email и password всегда разрешены. + +Если не задано, то разрешены все поля. + +Возможные значения - имена полей формы, разделенные запятой. + +Значение по умолчанию - пусто. + +### forbiddenFields +Запрещенные для обработки поля. Поля, указанные в списке, игнорируются. Поля username, email и password удаляются из списка запрещенных. + +Возможные значения - имена полей формы, разделенные запятой. + +Значение по умолчанию - пусто. + +### userGroups +Добавляет зарегистрированного пользователя в указанные группы. + +Возможные значения - имена групп, разделенные запятой (если имена содержат запятую в названии, то можно задать значение параметра массивом). + +Значение по умолчанию - пусто. + +### checkActivation +Включает проверку активации учетной записи пользователя (см. "Активация учетных записей"). При этом после сохранения записи будет установлено поле activate.url, содержащее ссылку на страницу с вызовом сниппета для активации учетной записи. + +Возможные значения - 1 или 0. + +Значение по умолчанию - 0. + +### activateTo +Если включена проверка активации, то в этом параметре необходимо указать id страницы, на которой вызывается сниппет для активации. + +Возможные значения - id страницы. + +Значение по умолчанию - значение $modx->config['site_start']. + +### preparePostProcess +Позволяет выполнить обработку данных после сохранения. + +Возможные значения - имена сниппетов, анонимные функции, статические методы загруженных классов. + +Значение по умолчанию - пусто. + +### redirectTo +Перенаправляет пользователя на указанную страницу после регистрации. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### exitTo +Перенаправляет уже авторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы. + +Значение по умолчанию - пусто. + +### skipTpl +Шаблон сообщения для уже авторизованного пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Register с ключом [+register.default_skipTpl+] + +### successTpl +Шаблон сообщения об успешной регистрации. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Register с ключом [+register.default_successTpl+] + +### passwordLength +Длина пароля (если создается автоматически). + +Возможные значения - число символов больше 6. + +Значение по умолчанию - 6. diff --git "a/assets/snippets/FormLister/docs/ru/075_\320\220\320\272\321\202\320\270\320\262\320\260\321\206\320\270\321\217 \321\203\321\207\320\265\321\202\320\275\321\213\321\205 \320\267\320\260\320\277\320\270\321\201\320\265\320\270\314\206.md" "b/assets/snippets/FormLister/docs/ru/075_\320\220\320\272\321\202\320\270\320\262\320\260\321\206\320\270\321\217 \321\203\321\207\320\265\321\202\320\275\321\213\321\205 \320\267\320\260\320\277\320\270\321\201\320\265\320\270\314\206.md" new file mode 100644 index 0000000000..ce0f37925c --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/075_\320\220\320\272\321\202\320\270\320\262\320\260\321\206\320\270\321\217 \321\203\321\207\320\265\321\202\320\275\321\213\321\205 \320\267\320\260\320\277\320\270\321\201\320\265\320\270\314\206.md" @@ -0,0 +1,84 @@ +## Активация учетных записей + +Контроллер Activate реализует активацию учетных записей. Таким образом появляется возможность требовать у пользователя подтверждение учетной записи путем перехода по специальной ссылке из письма, отправленного при регистрации. + +Если по какой-то причине пользователь не получил письмо, то c помощью контроллера Activate он может запросить его повторную отправку. + +Учетная запись пользователя считается неактивированной если в поле logincount записано -1. + +В вызовах сниппета для регистрации и авторизации пользователей должен присутствовать параметр &checkActivation=`1`. + +Поэтому если при регистрации пользователь указывал пароль самостоятельно, то нужно запрашивать пароль для отправки письма со ссылкой для активации. Иначе будет генерироваться новый пароль, потому что раз пользователь запрашивает письмо для активации вручную, значит письмо после регистрации он не получил и не знает созданный при регистрации пароль. + +В шаблонах доступны все поля модели для обрабатываемой записи. В шаблоне reportTpl задается поле user.password с незашифрованным паролем и поле activate.url со ссылкой для активации. + +## Параметры +### model +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### modelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### redirectTo +Перенаправляет пользователя на указанную страницу после активации. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### exitTo +Перенаправляет авторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### skipTpl +Шаблон сообщения для авторизованного пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Register с ключом [+register.default_skipTpl+] + +### reportTpl +Шаблон письма с информацией для активации учетной записи. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### reportTpl +Шаблон письма с информацией для активации учетной записи. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### successTpl +Шаблон сообщения об успешной отправке письма с данными для активации. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Activate с ключом [+activate.default_successTpl+] + +### activateSuccessTpl +Шаблон сообщения об успешной активации. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Activate с ключом [+activate.default_activateSuccessTpl+] + +### passwordLength +Длина создаваемого пароля. + +Возможные значения - число символов больше 6. + +Значение по умолчанию - 6. diff --git "a/assets/snippets/FormLister/docs/ru/080_\320\240\320\265\320\264\320\260\320\272\321\202\320\270\321\200\320\276\320\262\320\260\320\275\320\270\320\265 \320\277\321\200\320\276\321\204\320\270\320\273\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217.md" "b/assets/snippets/FormLister/docs/ru/080_\320\240\320\265\320\264\320\260\320\272\321\202\320\270\321\200\320\276\320\262\320\260\320\275\320\270\320\265 \320\277\321\200\320\276\321\204\320\270\320\273\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217.md" new file mode 100644 index 0000000000..1a6d503c7d --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/080_\320\240\320\265\320\264\320\260\320\272\321\202\320\270\321\200\320\276\320\262\320\260\320\275\320\270\320\265 \320\277\321\200\320\276\321\204\320\270\320\273\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217.md" @@ -0,0 +1,99 @@ +## Редактирование профиля пользователя + +Контроллер Profile позволяет авторизованным пользователям редактировать свои профили, в том числе менять пароль. + +При изменении профиля следует проверять уникальность email. В контроллере предусмотрено соответствующее правило: +``` +&rules=`{ + "email":{ + "required":"Введите email", + "email":"Неверный email", + "custom":{ + "function":"\\FormLister\\Profile::uniqueEmail", + "message":"Этот email уже использует другой пользователь" + } + } +}` +``` +Аналогично с полем username: +``` +&rules=`{ + "username":{ + "required":"Введите имя пользователя", + "alphaNumeric":"Только буквы и цифры", + "custom":{ + "function":"\\FormLister\\Profile::uniqueUsername", + "message":"Имя уже занято" + } + } +}` +``` + +Если поле с паролем пустое, то пароль остается прежний. После изменения пароля пользователь должен авторизоваться с новым паролем. Новый пароль сохраняется в поле user.password. + + +## Параметры +### model +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### modelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### allowedFields +Разрешенные для обработки поля. Поля, не указанные в списке, игнорируются. Если пользователь меняет пароль, то в разрешенные поля добавляется поле password. Если у пользователей совпадают поля e-mail и username, то при изменении e-mail будет изменено и поле username, если значение этого поля не задано. В этом случае поле username будет добавлено в список разрешенных. + +Если не задано, то разрешены все поля. + +Возможные значения - имена полей формы, разделенные запятой. + +Значение по умолчанию - пусто. + +### forbiddenFields +Запрещенные для обработки поля. Поля, указанные в списке, игнорируются. Поля password и username исключаются из списка по аналогии с allowedFields. + +Возможные значения - имена полей формы, разделенные запятой. + +Значение по умолчанию - пусто. + +### preparePostProcess +Позволяет выполнить обработку данных после сохранения. + +Возможные значения - имена сниппетов, анонимные функции, статические методы загруженных классов. + +Значение по умолчанию - пусто. + +### redirectTo +Перенаправляет пользователя на указанную страницу после сохранения профиля. + +Возможные значения - id целевой страницы. + +Значение по умолчанию - пусто. + +### exitTo +Перенаправляет неавторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### skipTpl +Шаблон сообщения для неавторизованного пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Profile с ключом [+profile.default_skipTpl+] + +### successTpl +Шаблон сообщения об успешном обновлении профиля. Если не задан, то генерируется сообщение об успешном сохранении формы. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. diff --git "a/assets/snippets/FormLister/docs/ru/085_\320\243\320\264\320\260\320\273\320\265\320\275\320\270\320\265 \320\277\321\200\320\276\321\204\320\270\320\273\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217.md" "b/assets/snippets/FormLister/docs/ru/085_\320\243\320\264\320\260\320\273\320\265\320\275\320\270\320\265 \320\277\321\200\320\276\321\204\320\270\320\273\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217.md" new file mode 100644 index 0000000000..bfe4041476 --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/085_\320\243\320\264\320\260\320\273\320\265\320\275\320\270\320\265 \320\277\321\200\320\276\321\204\320\270\320\273\321\217 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217.md" @@ -0,0 +1,50 @@ +## Удаление профиля пользователя + +Контроллер DeleteUser позволяет авторизованным пользователям удалять свои профили. Для подтверждения действия пользователю необходимо ввести свой пароль. + +Расширяет Form. + +В шаблонах доступны поля модели для удаляемой записи. + +## Параметры +### model +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### modelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### redirectTo +Перенаправляет пользователя на указанную страницу после сохранения профиля. + +Возможные значения - id целевой страницы. + +Значение по умолчанию - пусто. + +### exitTo +Перенаправляет неавторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### skipTpl +Шаблон сообщения для неавторизованного пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона deleteUser с ключом [+deleteUser.default_skipTpl+] + +### successTpl +Шаблон сообщения об успешном удалении профиля. Если не задан, то генерируется сообщение об успешном сохранении формы. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. diff --git "a/assets/snippets/FormLister/docs/ru/090_\320\222\320\276\321\201\321\201\321\202\320\260\320\275\320\276\320\262\320\273\320\265\320\275\320\270\320\265 \320\277\320\260\321\200\320\276\320\273\320\265\320\270\314\206 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" "b/assets/snippets/FormLister/docs/ru/090_\320\222\320\276\321\201\321\201\321\202\320\260\320\275\320\276\320\262\320\273\320\265\320\275\320\270\320\265 \320\277\320\260\321\200\320\276\320\273\320\265\320\270\314\206 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" new file mode 100644 index 0000000000..e9b507dd4f --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/090_\320\222\320\276\321\201\321\201\321\202\320\260\320\275\320\276\320\262\320\273\320\265\320\275\320\270\320\265 \320\277\320\260\321\200\320\276\320\273\320\265\320\270\314\206 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" @@ -0,0 +1,143 @@ +## Восстановление паролей пользователями + +Контроллер Reminder позволяет web-пользователям восстанавливать забытые пароли. Расширяет контроллер Form. + +Восстановление паролей происходит по следующей схеме: + +- пользователь вводит в форме свой идентификатор (им может быть имя пользователя или email); +- пользователь получает письмо, в котором содержится ссылка для восстановления; +- при переходе по ссылке пользователь получает возможность ввести новый пароль либо пароль будет сгенерирован автоматически; +- пользователю отправляется письмо с новым паролем и показыается сообщение (в сообщении можно также вывести новый пароль). + +Параметр to перезаписывается значением email пользователя. Обязательно должен быть задан параметр resetTo. + +## Параметры +### model +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### modelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### hashField +Имя поля для хранения хэша данных пользователя. + +Значение по умолчанию - hash. + +### userField +Имя поля для хранения идентификатора пользователя (имя пользователя или email). + +Значение по умолчанию - email. + +### uidField +Имя поля, которое используется для идентификации пользователя при переходе по ссылке. + +Значение по умолчанию - id. + +### exitTo +Перенаправляет авторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы. + +Значение по умолчанию - пусто. + +### resetTo +Страница, на которую будет указывать ссылка для восстановления паролей. Обязательный параметр. + +Возможные значения - id целевой страницы. + +Значение по умолчанию - id документа, в котором вызван контроллер. + +### redirectTo +Перенаправляет на указанную страницу после успешного восстановления пароля. + +Возможные значения - id целевой страницы. + +Значение по умолчанию - пусто. + +### skipTpl +Шаблон сообщения для авторизованного пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Reminder с ключом [+reminder.default_skipTpl+]. + +### formTpl +Шаблон формы для ввода идентификатора пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### resetTpl +Шаблон формы для ввода нового пароля. Если параметр не задан, то пароль будет сгенерирован автоматически. + +Поля для ввода паролей должны называться password и repeatPassword. В форме должны также присутствовать скрытые поля с именами из параметров uidField и hashField. Значение для поля hashField задается через плейсхолдер [+user.hash+]. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### successTpl +Шаблон сообщения об успешной отправке письма со ссылкой для восстановления пароля. В шаблоне можно выводить плейсхолдеры с данными пользователя (username, email и т.д.). + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Reminder с ключом [+reminder.default_successTpl+]. + +### resetSuccessTpl +Шаблон сообщения об успешном восстановлении пароля. В шаблоне можно выводить плейсхолдеры с данными пользователя (username, email и т.д.), а также новый пароль (newpassword). + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Reminder с ключом [+reminder.default_resetSuccessTpl+]. + +### reportTpl +Шаблон письма со ссылкой для восстановления пароля. В шаблоне можно выводить плейсхолдеры с данными пользователя (username, email и т.д.), а также новый пароль (newpassword). Ссылка для восстановлени пароля в письме задается через плейсхолдер [+reset.url+] + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Reminder с ключом [+reminder.default_reportTpl+].. + +### resetReportTpl +Шаблон письма об успешном восстановлении пароля. В шаблоне можно выводить плейсхолдеры с данными пользователя (username, email и т.д.), а также новый пароль (newpassword). Если не задан, то письмо пользователю отправляться не будет. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. + +### rules +Правила валидации для формы идентификации пользователя. + +Возможные значения - см. раздел "Валидация данных". + +Значение по умолчанию - пусто. + +### resetRules +Правила валидации для формы установки нового пароля. Если заданы правила валидации для полей password и repeatPassword, то при наличии для поля repeatPassword правила equals, оно будет автоматически скорректировано для проверки равенства значений полей password и repeatPassword: +``` +"repeatPassword":{ + "required":"Введите пароль еще раз", + "equals":{ + "params" : "Этот ключ в описании правила можно не задавать, он будет сформирован контроллером автоматически", + "message":"Пароли не совпадают" + } +} +``` +Возможные значения - см. раздел "Валидация данных". + +Значение по умолчанию - пусто. + +### passwordLength +Длина пароля (если создается автоматически). + +Возможные значения - число символов больше 6. + +Значение по умолчанию - 6. diff --git "a/assets/snippets/FormLister/docs/ru/100_\320\241\320\276\320\267\320\264\320\260\320\275\320\270\320\265 \320\270 \321\200\320\265\320\264\320\260\320\272\321\202\320\270\321\200\320\276\320\262\320\260\320\275\320\270\320\265 \320\264\320\276\320\272\321\203\320\274\320\265\320\275\321\202\320\276\320\262 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" "b/assets/snippets/FormLister/docs/ru/100_\320\241\320\276\320\267\320\264\320\260\320\275\320\270\320\265 \320\270 \321\200\320\265\320\264\320\260\320\272\321\202\320\270\321\200\320\276\320\262\320\260\320\275\320\270\320\265 \320\264\320\276\320\272\321\203\320\274\320\265\320\275\321\202\320\276\320\262 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" new file mode 100644 index 0000000000..d383e93f47 --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/100_\320\241\320\276\320\267\320\264\320\260\320\275\320\270\320\265 \320\270 \321\200\320\265\320\264\320\260\320\272\321\202\320\270\321\200\320\276\320\262\320\260\320\275\320\270\320\265 \320\264\320\276\320\272\321\203\320\274\320\265\320\275\321\202\320\276\320\262 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" @@ -0,0 +1,166 @@ +## Создание и редактирование документов пользователями + +Контроллер Content позволяет web-пользователям создавать и редактировать записи в таблицах MODxAPI. Расширяет контроллер Form, что позволяет отправлять письма после создания записи. При редактировании записей отправка почты отключена, при необходимости ее можно реализовать с помощью плагинов на событие сохранения (OnDocFormSave и т.п.). + +Данные формы передаются в объект MODxAPI как есть, соответственно разработчику нужно заботиться об их корректности самостоятельно. + +При редактировании записей можно запретить изменение отдельных полей, используя параметр keepDefaults. + +При создании новой записи вызывается событие OnMakeDocUrl, в которое передается id записи и массив data со значениями полей записи. Это позволяет вернуть ссылку на созданную запись, она будет доступна через плейсхолдер [+content.url+]. Ссылку можно использовать в письме c уведомлением о создании новой записи. + +Также можно использовать данные авторизованного пользователя, доступны через плейсхолдеры [+user.fullname+], [+user.email+] и т.д. + +## Параметры +### model +Класс MODxAPI. + +Возможные значения - имя класса MODxAPI. + +Значение по умолчанию - \modResource. + +### modelPath +Путь к файлу класса, если класс не загружается заранее. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modResource.php. + +### userModel +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### userModelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### onlyUsers +Разрешить добавление записей только для зарегистрированных пользователей. + +Возможные значения - 0, 1. + +Значение по умолчанию - 1. + +### userGroups +Группы пользователей, которым разрешено добавлять или изменять записи. + +Возможные значения - список групп через точку с запятой. + +Значение по умолчанию - пусто (разрешены любые группы). + +### onlyOwners +Разрешает редактирование записей только их авторами. Автор определяется по полю, указанному в параметре ownerField. + +Возможные значения - 0, 1. + +Значение по умолчанию - 1. + +### ownerField +Имя поля, определяющего владельца записи. Если работать с документами modResource, то это будет имя tv-параметра (в Evo не предусмотрено создание записей веб-пользователями). + +Возможные значения - имя поля. + +Значение по умолчанию - aid. + +### idField +Имя ключа массива $_REQUEST, по которому определяется id редактируемой записи. Если ключ не задан, то контроллер вызывается в режиме создания записей. Информацию о режиме контроллера можно получить с помощью метода getMode. + +В форме редактирования нужно предусмотреть скрытое поле с именем параметра, в котором будет сохраняться id записи. + +Значение по умолчанию - id. + +### contentFields +Задает сопоставление полей MODxAPI и полей формы. Можно не задавать, если имена полей совпадают. Если параметр не задан, то ограничить список передаваемых в модель полей можно с помощью параметров allowedFields и forbiddenFields. + +Возможные значения - массив вида: +``` +&contentFields=`{ + "поле MODxAPI":"поле формы", + "поле MODxAPI":"поле формы" +} +` +``` +Значение по умолчанию - пусто. + +### clearCache +Очищать кэш после сохранения записи. + +Возможные значения - 0, 1. + +Значение по умолчанию - 0. + +### redirectTo +Перенаправляет пользователя на указанную страницу после сохранения новой записи. В режиме редактирования не используется. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### editAfterCreate +Переправляет пользователя на страницу для редактирования созданной записи. Страница указывается в параметре redirectTo. + +Возможные значения - 1 или 0. + +Значение по умолчанию - 0. + +### editTpl +Шаблон формы для редактирования документа. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - значение параметра formTpl. + +### badOwnerTpl +Шаблон сообщения о том, что пользователь не является автором документа. Только режим редактирования. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Content с ключом [+edit.default_badOwnerTpl+]. + +### badGroupTpl, badGroupEditTpl +Шаблон сообщения о том, что пользователь не входит в группу пользователей которым разрешено создавать и редактировать документы. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Content с ключом +[+create.default_badGroupTpl+] или [+edit.default_badGroupTpl+]. + +### badRecordTpl +Шаблон сообщения о том, что пользователь не может редактировать запись: например, запись не существует. Только режим редактирования. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Content с ключом [+edit.default_badRecordTpl+]. + +### exitTo +Перенаправляет неавторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### skipTpl, skipEditTpl +Шаблон сообщения для неавторизованного пользователя. Для режима редактирования - skipEditTpl. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Content с ключом [+create.default_skipTpl+] (edit.default_skipEditTpl). + +### successTpl +Шаблон сообщения об успешном сохранении новой записи. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона Content с ключом [+create.default_successTpl+] + +### editSuccessTpl +Шаблон сообщения об успешном обновлении записи. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - пусто. diff --git "a/assets/snippets/FormLister/docs/ru/105_\320\243\320\264\320\260\320\273\320\265\320\275\320\270\320\265 \320\264\320\276\320\272\321\203\320\274\320\265\320\275\321\202\320\276\320\262 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" "b/assets/snippets/FormLister/docs/ru/105_\320\243\320\264\320\260\320\273\320\265\320\275\320\270\320\265 \320\264\320\276\320\272\321\203\320\274\320\265\320\275\321\202\320\276\320\262 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" new file mode 100644 index 0000000000..7cddeb4ad3 --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/105_\320\243\320\264\320\260\320\273\320\265\320\275\320\270\320\265 \320\264\320\276\320\272\321\203\320\274\320\265\320\275\321\202\320\276\320\262 \320\277\320\276\320\273\321\214\320\267\320\276\320\262\320\260\321\202\320\265\320\273\321\217\320\274\320\270.md" @@ -0,0 +1,97 @@ +## Удаление профиля пользователя + +Контроллер DeleteContent позволяет авторизованным пользователям удалять созданные ими документы. + +Расширяет Form. + +В шаблонах доступны поля модели для удаляемой записи. Информация о пользователе доступна в полях с префиксом user (user.fullname, user.email и т.д.) + +## Параметры +### model +Класс MODxAPI. + +Возможные значения - имя класса MODxAPI. + +Значение по умолчанию - \modResource. + +### modelPath +Путь к файлу класса, если класс не загружается заранее. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modResource.php. + +### userModel +Класс для работы с пользователями. + +Возможные значения - имя класса. + +Значение по умолчанию - \modUsers + +### userModelPath +Путь к файлу класса для работы с пользователями. + +Возможные значения - относительный путь к файлу. + +Значение по умолчанию - assets/lib/MODxAPI/modUsers.php + +### ownerField +Имя поля, определяющего владельца записи. Если работать с документами modResource, то это будет имя tv-параметра (в Evo не предусмотрено создание записей веб-пользователями). + +Возможные значения - имя поля. + +Значение по умолчанию - aid. + +### idField +Имя ключа массива $_REQUEST, по которому определяется id удаляемой записи. + +Значение по умолчанию - id. + +### redirectTo +Перенаправляет пользователя на указанную страницу после удаления записи. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### badOwnerTpl +Шаблон сообщения о том, что пользователь не является автором документа. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона deleteContent с ключом [+deleteContent.default_badOwnerTpl+]. + +### badRecordTpl +Шаблон сообщения о том, что пользователь не может удалить запись: например, запись не существует. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона deleteContent с ключом [+deleteContent.default_badRecordTpl+]. + +### skipTpl +Шаблон сообщения для неавторизованного пользователя. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона deleteContent с ключом [+deleteContent.default_skipTpl+]. + +### successTpl +Шаблон сообщения об успешном сохранении новой записи. + +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. + +Значение по умолчанию - запись из лексикона deleteContent с ключом [+deleteContent.default_successTpl+] + +### exitTo +Перенаправляет неавторизованного пользователя на указанную страницу. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. + +### badRecordTo +Перенаправление, если невозможно удалить запись. + +Возможные значения - id целевой страницы или массив. + +Значение по умолчанию - пусто. diff --git "a/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" "b/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" new file mode 100644 index 0000000000..dd64c0974b --- /dev/null +++ "b/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" @@ -0,0 +1,18 @@ +## Лексиконы + +Для использования лексиконов необходимо создать папку с полным названием языка (russian-UTF8, english и т.д.), в ней создать файл название_лексикона.inc.php: +``` + +``` +Для загрузки лексиконов при вызове сниппета следует указать параметры: + +* langDir - путь к папке с лексиконами; +* lang - язык лексикона (если не указано, то используется параметр конфигурации manager_language); +* lexicon - название лексикона, можно указать несколько названий через запятую. + +После этого в шаблонах можно использовать плейсхолдеры [%ключ%] для подстановки значений из загруженных языковых файлов. Кроме того поддерживаются лексиконы компонента EvoBabel. \ No newline at end of file diff --git a/assets/snippets/FormLister/lib/Debug.php b/assets/snippets/FormLister/lib/Debug.php new file mode 100644 index 0000000000..9c48be618c --- /dev/null +++ b/assets/snippets/FormLister/lib/Debug.php @@ -0,0 +1,84 @@ +modx = $modx; + $this->timeStart = microtime(true); + if (isset($cfg['caller'])) { + $this->caller = $cfg['caller']; + } + } + + /** + * @param $message + * @param array $data + */ + public function log($message, $data = array()) + { + if (is_array($data) && is_array($data[0])) { + $data = array_pop($data); + } + $this->log[] = array( + 'message' => $message, + 'data' => $this->dumpData($data, 'pre'), + 'time' => microtime(true) - $this->timeStart + ); + } + + /** + * @param $data + * @param string $wrap + * @param string $charset + * @return array|mixed|string + */ + public function dumpData($data, $wrap = '', $charset = 'UTF-8') + { + $out = \APIHelpers::sanitarTag(print_r($data, 1), $charset); + if (!empty($wrap) && is_string($wrap)) { + $out = "<{$wrap}>{$out}"; + } + + return $out; + } + + public function saveLog() + { + $out = ''; + foreach ($this->log as $entry) { + $out .= "

                              {$entry['message']}

                              "; + if ($entry['data']) { + $out .= $entry['data']; + } + $out .= "

                              Time: {$entry['time']}

                              "; + $out .= '
                              '; + } + $time = microtime(true) - $this->timeStart; + $out .= "

                              Total time: {$time}

                              "; + if ($out) { + $this->modx->logEvent(0, 1, $out, $this->caller); + } + } +} diff --git a/assets/snippets/FormLister/lib/FileValidator.php b/assets/snippets/FormLister/lib/FileValidator.php new file mode 100644 index 0000000000..808d6be8fa --- /dev/null +++ b/assets/snippets/FormLister/lib/FileValidator.php @@ -0,0 +1,197 @@ +isArray($value)) { + $value = array($value); + } + $flag = false; + foreach ($value as $file) { + $flag = !$file['error'] && is_uploaded_file($file['tmp_name']); + } + + return $flag; + } + + /** + * @param $value + * @return bool + */ + public function optional($value) + { + if (!$this->isArray($value)) { + $value = array($value); + } + $flag = false; + foreach ($value as $file) { + if ($file['error'] === 4) { + $flag = true; + } else { + $flag = !$file['error'] && is_uploaded_file($file['tmp_name']); + } + } + + return $flag; + } + + /** + * @param $value + * @param $allowed + * @return bool + */ + public function allowed($value, $allowed) + { + if (!$this->isArray($value)) { + $value = array($value); + } + $flag = false; + foreach ($value as $file) { + if ($file['error'] === 4) { + $flag = true; + } else { + $ext = strtolower(array_pop(explode('.', $file['name']))); + $flag = in_array($ext, $allowed); + } + } + + return $flag; + } + + /** + * @param $value + * @return bool + */ + public function images($value) + { + return $this->allowed($value, array("jpg", "jpeg", "png", "gif", "bmp")); + } + + /** + * @param $value + * @param $max + * @return bool + */ + public function maxSize($value, $max) + { + if (!$this->isArray($value)) { + $value = array($value); + } + $flag = false; + foreach ($value as $file) { + $size = round($file['size'] / 1024, 0); + $flag = $size < $max; + } + + return $flag; + } + + /** + * @param $value + * @param $min + * @return bool + */ + public function minSize($value, $min) + { + if (!$this->isArray($value)) { + $value = array($value); + } + $flag = false; + foreach ($value as $file) { + if ($file['error'] === 4) { + $flag = true; + } else { + $size = round($file['size'] / 1024, 0); + $flag = $size > $min; + } + } + + return $flag; + } + + /** + * @param $value + * @param $min + * @param $max + * @return bool + */ + public function sizeBetween($value, $min, $max) + { + if (!$this->isArray($value)) { + $value = array($value); + } + $flag = false; + foreach ($value as $file) { + if ($file['error'] === 4) { + $flag = true; + } else { + $size = round($file['size'] / 1024, 0); + $flag = $size > $min && $size < $max; + } + } + + return $flag; + } + + /** + * @param $value + * @param $max + * @return bool + */ + public function maxCount($value, $max) + { + if (!$this->isArray($value)) { + $value = array($value); + } + + return count($value) < $max; + } + + /** + * @param $value + * @param $min + * @return bool + */ + public function minCount($value, $min) + { + if (!$this->isArray($value)) { + $value = array($value); + } + + return count($value) > $min; + } + + /** + * @param $value + * @param $min + * @param $max + * @return bool + */ + public function countBetween($value, $min, $max) + { + if (!$this->isArray($value)) { + $value = array($value); + } + + return count($value) > $min && count($value) < $max; + } + + /** + * @param $value + * @return bool + */ + protected function isArray($value) + { + return !is_null($value[0]); + } +} diff --git a/assets/snippets/FormLister/lib/Lexicon.php b/assets/snippets/FormLister/lib/Lexicon.php new file mode 100644 index 0000000000..a855a01c82 --- /dev/null +++ b/assets/snippets/FormLister/lib/Lexicon.php @@ -0,0 +1,131 @@ +modx = $modx; + $this->cfg = $cfg; + } + + /** + * Загрузка языкового пакета + * + * @param string $name файл языкового пакета + * @param string $lang имя языкового пакета + * @param string $langDir папка с языковыми пакетами + * @return array массив с лексиконом + */ + public function loadLang($name = 'core', $lang = '', $langDir = '') + { + $langDir = empty($langDir) ? MODX_BASE_PATH . \APIhelpers::getkey($this->cfg, 'langDir', + 'lang/') : MODX_BASE_PATH . $langDir; + if (empty($lang)) { + $lang = \APIhelpers::getkey($this->cfg, 'lang', $this->modx->config['manager_language']); + } + + if (is_scalar($name) && !empty($name)) { + $name = array($name); + } else { + return $this->_lang; + } + foreach ($name as $n) { + if ($lang != 'english') { + $this->loadLangFile($n, 'english', $langDir); + } + $this->loadLangFile($n, $lang, $langDir); + } + + return $this->_lang; + } + + private function loadLangFile($name = 'core', $lang = '', $langDir = '') + { + $filepath = "{$langDir}{$lang}/{$name}.inc.php"; + if (file_exists($filepath)) { + $tmp = include($filepath); + if (is_array($tmp)) { + $this->_lang = array_merge($this->_lang, $tmp); + } + } + } + + /** + * Получение строк из массива + * + * @param $lang + * @return array + */ + public function fromArray($lang) + { + if (is_array($lang) && $lang) { + $this->_lang = array_merge($this->_lang, $lang); + } + + return $this->_lang; + } + + /** + * Получение строки из языкового пакета + * + * @param string $name имя записи в языковом пакете + * @param string $def Строка по умолчанию, если запись в языковом пакете не будет обнаружена + * @return string строка в соответствии с текущими языковыми настройками + */ + public function getMsg($name, $def = '') + { + $out = \APIhelpers::getkey($this->_lang, $name, $def); + if (class_exists('evoBabel', false) && isset($this->modx->snippetCache['lang'])) { + $msg = $this->modx->runSnippet('lang', array('a' => $name)); + if (!empty($msg)) { + $out = $msg; + } + } + + return $out; + } + + /** + * Замена в шаблоне фраз из лексикона + * + * @param string $tpl HTML шаблон + * @return string + */ + public function parseLang($tpl) + { + if (is_scalar($tpl) && !empty($tpl)) { + if (preg_match_all("/\[\%([a-zA-Z0-9\.\_\-]+)\%\]/", $tpl, $match)) { + $langVal = array(); + foreach ($match[1] as $item) { + $langVal[] = $this->getMsg($item); + } + $tpl = str_replace($match[0], $langVal, $tpl); + } + } else { + $tpl = ''; + } + + return $tpl; + } + + /** + * @return bool + */ + public function isReady() + { + return (bool)$this->_lang; + } +} diff --git a/assets/snippets/FormLister/lib/MailChimp/Batch.php b/assets/snippets/FormLister/lib/MailChimp/Batch.php new file mode 100644 index 0000000000..c200b42dce --- /dev/null +++ b/assets/snippets/FormLister/lib/MailChimp/Batch.php @@ -0,0 +1,136 @@ + + */ +class Batch +{ + private $MailChimp; + + private $operations = array(); + private $batch_id; + + public function __construct(MailChimp $MailChimp, $batch_id=null) + { + $this->MailChimp = $MailChimp; + $this->batch_id = $batch_id; + } + + /** + * Add an HTTP DELETE request operation to the batch - for deleting data + * @param string $id ID for the operation within the batch + * @param string $method URL of the API request method + * @return void + */ + public function delete($id, $method) + { + $this->queueOperation('DELETE', $id, $method); + } + + /** + * Add an HTTP GET request operation to the batch - for retrieving data + * @param string $id ID for the operation within the batch + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @return void + */ + public function get($id, $method, $args=array()) + { + $this->queueOperation('GET', $id, $method, $args); + } + + /** + * Add an HTTP PATCH request operation to the batch - for performing partial updates + * @param string $id ID for the operation within the batch + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @return void + */ + public function patch($id, $method, $args=array()) + { + $this->queueOperation('PATCH', $id, $method, $args); + } + + /** + * Add an HTTP POST request operation to the batch - for creating and updating items + * @param string $id ID for the operation within the batch + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @return void + */ + public function post($id, $method, $args=array()) + { + $this->queueOperation('POST', $id, $method, $args); + } + + /** + * Add an HTTP PUT request operation to the batch - for creating new items + * @param string $id ID for the operation within the batch + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @return void + */ + public function put($id, $method, $args=array()) + { + $this->queueOperation('PUT', $id, $method, $args); + } + + /** + * Execute the batch request + * @param int $timeout Request timeout in seconds (optional) + * @return array|false Assoc array of API response, decoded from JSON + */ + public function execute($timeout=10) + { + $req = array('operations' => $this->operations); + + $result = $this->MailChimp->post('batches', $req, $timeout); + + if ($result && isset($result['id'])) { + $this->batch_id = $result['id']; + } + + return $result; + } + + /** + * Check the status of a batch request. If the current instance of the Batch object + * was used to make the request, the batch_id is already known and is therefore optional. + * @param string $batch_id ID of the batch about which to enquire + * @return array|false Assoc array of API response, decoded from JSON + */ + public function checkStatus($batch_id=null) + { + if ($batch_id===null && $this->batch_id) $batch_id = $this->batch_id; + return $this->MailChimp->get('batches/'.$batch_id); + } + + /** + * Add an operation to the internal queue. + * @param string $http_verb GET, POST, PUT, PATCH or DELETE + * @param string $id ID for the operation within the batch + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @return void + */ + private function queueOperation($http_verb, $id, $method, $args=null) + { + $operation = array( + 'operation_id' => $id, + 'method' => $http_verb, + 'path' => $method, + ); + + if ($args) { + $key = ($http_verb == 'GET' ? 'params' : 'body'); + $operation[$key] = json_encode($args); + } + + $this->operations[] = $operation; + } +} diff --git a/assets/snippets/FormLister/lib/MailChimp/MailChimp.php b/assets/snippets/FormLister/lib/MailChimp/MailChimp.php new file mode 100644 index 0000000000..36bc24b745 --- /dev/null +++ b/assets/snippets/FormLister/lib/MailChimp/MailChimp.php @@ -0,0 +1,263 @@ + + * @version 2.1 + */ +class MailChimp +{ + private $api_key; + private $api_endpoint = 'https://.api.mailchimp.com/3.0'; + + /* SSL Verification + Read before disabling: + http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/ + */ + public $verify_ssl = true; + + private $last_error = ''; + private $last_response = array(); + private $last_request = array(); + + /** + * Create a new instance + * @param string $api_key Your MailChimp API key + */ + public function __construct($api_key) + { + $this->api_key = $api_key; + + list(, $datacentre) = explode('-', $this->api_key); + $this->api_endpoint = str_replace('', $datacentre, $this->api_endpoint); + + $this->last_response = array('headers'=>null, 'body'=>null); + } + + /** + * Create a new instance of a Batch request. Optionally with the ID of an existing batch. + * @param string $batch_id Optional ID of an existing batch, if you need to check its status for example. + * @return Batch New Batch object. + */ + public function newBatch($batch_id=null) + { + return new Batch($this, $batch_id); + } + + /** + * Convert an email address into a 'subscriber hash' for identifying the subscriber in a method URL + * @param string $email The subscriber's email address + * @return string Hashed version of the input + */ + public function getSubscriberHash($email) + { + return md5(strtolower($email)); + } + + /** + * Get the last error returned by either the network transport, or by the API. + * If something didn't work, this should contain the string describing the problem. + * @return array|false describing the error + */ + public function getLastError() + { + if ($this->last_error) return $this->last_error; + return false; + } + + /** + * Get an array containing the HTTP headers and the body of the API response. + * @return array Assoc array with keys 'headers' and 'body' + */ + public function getLastResponse() + { + return $this->last_response; + } + + /** + * Get an array containing the HTTP headers and the body of the API request. + * @return array Assoc array + */ + public function getLastRequest() + { + return $this->last_request; + } + + /** + * Make an HTTP DELETE request - for deleting data + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (if any) + * @param int $timeout Timeout limit for request in seconds + * @return array|false Assoc array of API response, decoded from JSON + */ + public function delete($method, $args=array(), $timeout=10) + { + return $this->makeRequest('delete', $method, $args, $timeout); + } + + /** + * Make an HTTP GET request - for retrieving data + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @param int $timeout Timeout limit for request in seconds + * @return array|false Assoc array of API response, decoded from JSON + */ + public function get($method, $args=array(), $timeout=10) + { + return $this->makeRequest('get', $method, $args, $timeout); + } + + /** + * Make an HTTP PATCH request - for performing partial updates + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @param int $timeout Timeout limit for request in seconds + * @return array|false Assoc array of API response, decoded from JSON + */ + public function patch($method, $args=array(), $timeout=10) + { + return $this->makeRequest('patch', $method, $args, $timeout); + } + + /** + * Make an HTTP POST request - for creating and updating items + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @param int $timeout Timeout limit for request in seconds + * @return array|false Assoc array of API response, decoded from JSON + */ + public function post($method, $args=array(), $timeout=10) + { + return $this->makeRequest('post', $method, $args, $timeout); + } + + /** + * Make an HTTP PUT request - for creating new items + * @param string $method URL of the API request method + * @param array $args Assoc array of arguments (usually your data) + * @param int $timeout Timeout limit for request in seconds + * @return array|false Assoc array of API response, decoded from JSON + */ + public function put($method, $args=array(), $timeout=10) + { + return $this->makeRequest('put', $method, $args, $timeout); + } + + /** + * Performs the underlying HTTP request. Not very exciting. + * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete + * @param string $method The API method to be called + * @param array $args Assoc array of parameters to be passed + * @return array|false Assoc array of decoded result + */ + private function makeRequest($http_verb, $method, $args=array(), $timeout=10) + { + if (!function_exists('curl_init') || !function_exists('curl_setopt')) { + throw new \Exception("cURL support is required, but can't be found."); + } + + $url = $this->api_endpoint.'/'.$method; + + $this->last_error = ''; + $response = array('headers'=>null, 'body'=>null); + $this->last_response = $response; + + $this->last_request = array( + 'method' => $http_verb, + 'path' => $method, + 'url' => $url, + 'body' => '', + 'timeout'=> $timeout, + ); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.api+json', + 'Content-Type: application/vnd.api+json', + 'Authorization: apikey '.$this->api_key)); + curl_setopt($ch, CURLOPT_USERAGENT, 'DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)'); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl); + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + curl_setopt($ch, CURLOPT_ENCODING, ''); + curl_setopt($ch, CURLINFO_HEADER_OUT, true); + + switch($http_verb) { + case 'post': + curl_setopt($ch, CURLOPT_POST, true); + $this->attachRequestPayload($ch, $args); + break; + + case 'get': + $query = http_build_query($args); + curl_setopt($ch, CURLOPT_URL, $url.'?'.$query); + break; + + case 'delete': + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); + break; + + case 'patch': + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); + $this->attachRequestPayload($ch, $args); + break; + + case 'put': + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + $this->attachRequestPayload($ch, $args); + break; + } + + $response['body'] = curl_exec($ch); + $response['headers'] = curl_getinfo($ch); + + $this->last_request['headers'] = $response['headers']['request_header']; + + if ($response['body'] === false) { + $this->last_error = curl_error($ch); + } + + curl_close($ch); + + return $this->formatResponse($response); + } + + /** + * Encode the data and attach it to the request + * @param resource $ch cURL session handle, used by reference + * @param array $data Assoc array of data to attach + */ + private function attachRequestPayload(&$ch, $data) + { + $encoded = json_encode($data); + $this->last_request['body'] = $encoded; + curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded); + } + + /** + * Decode the response and format any error messages for debugging + * @param array $response The response from the curl request + * @return array|false The JSON decoded into an array + */ + private function formatResponse($response) + { + $this->last_response = $response; + + if (!empty($response['body'])) { + + $d = json_decode($response['body'], true); + + if (isset($d['status']) && $d['status']!='200' && isset($d['detail'])) { + $this->last_error = sprintf('%d: %s', $d['status'], $d['detail']); + } + + return $d; + } + + return false; + } +} diff --git a/assets/snippets/FormLister/lib/Validator.php b/assets/snippets/FormLister/lib/Validator.php new file mode 100644 index 0000000000..7a54a62062 --- /dev/null +++ b/assets/snippets/FormLister/lib/Validator.php @@ -0,0 +1,276 @@ +format($format) == $value; + } + + /** + * @param $value + * @param $min + * @return bool + */ + public function min($value, $min) + { + return $value >= $min; + } + + /** + * @param $value + * @param $max + * @return bool + */ + public function max($value, $max) + { + return $value <= $max; + } + + /** + * @param $value + * @param $min + * @return bool + */ + public function greater($value, $min) + { + return $value > $min; + } + + /** + * @param $value + * @param $max + * @return bool + */ + public function less($value, $max) + { + return $value < $max; + } + + /** + * @param $value + * @param $min + * @param $max + * @return bool + */ + public function between($value, $min, $max) + { + return ($value >= $min && $value <= $max); + } + + /** + * @param $value + * @param $allowed + * @return bool + */ + public function equals($value, $allowed) + { + return $value === $allowed; + } + + /** + * @param $value + * @param array $allowed + * @return bool + */ + public function in($value, $allowed) + { + return in_array($value, $allowed, true); + } + + /** + * @param $value + * @return bool + */ + public function alpha($value) + { + return (bool) preg_match('/^\pL++$/uD', $value); + } + + /** + * @param $value + * @return bool + */ + public function numeric($value) + { + return (bool) preg_match('#^[0-9]*$#',$value); + } + + /** + * @param $value + * @return bool + */ + public function alphaNumeric($value) + { + return (bool) preg_match('/^[\pL\pN]++$/uD', $value); + } + + /** + * @param $value + * @return bool + */ + public function slug($value) + { + return (bool) preg_match('/^[\pL\pN\-\_]++$/uD', $value); + } + + /** + * @param $value + * @return bool + */ + public function decimal($value) + { + return (bool) preg_match('/^[0-9]+(?:\.[0-9]+)?$/D', $value); + } + + + /** + * @param $value + * @return bool + */ + public function phone($value) + { + return (bool) preg_match('#^[0-9\(\)\+ \-]*$#',$value); + } + + /** + * @param $value + * @param $regexp + * @return bool + */ + public function matches($value,$regexp) + { + return (bool) preg_match($regexp,$value); + } + + /** + * @param $value + * @return bool + */ + public function url($value) + { + return (bool) preg_match( + '~^ + [-a-z0-9+.]++:// + (?!-)[-a-z0-9]{1,63}+(?getLength($value) === $length; + } + + /** + * @param $value + * @param $minLength + * @return bool + */ + public function minLength($value, $minLength) + { + return $this->getLength($value) >= $minLength; + } + + /** + * @param $value + * @param $maxLength + * @return bool + */ + public function maxLength($value, $maxLength) + { + return $this->getLength($value) <= $maxLength; + } + + /** + * @param $value + * @param $minLength + * @param $maxLength + * @return bool + */ + public function lengthBetween($value, $minLength, $maxLength) + { + $length = $this->getLength($value); + return ($length >= $minLength && $length <= $maxLength); + } + + /** + * @param $value + * @param $minSize + * @return bool + */ + public function minCount($value, $minSize) { + return count($value) >= $minSize; + } + + /** + * @param $value + * @param $maxSize + * @return bool + */ + public function maxCount($value, $maxSize) { + return count($value) <= $maxSize; + } + + /** + * @param $value + * @param $minSize + * @param $maxSize + * @return bool + */ + public function countBetween($value, $minSize, $maxSize) { + return (count($value) >= $minSize && count($value) <= $maxSize); + } + + /** + * @param $string + * @return int + */ + protected function getLength($string) + { + return strlen(utf8_decode($string)); + } +} diff --git a/assets/snippets/FormLister/lib/captcha/Captcha.php b/assets/snippets/FormLister/lib/captcha/Captcha.php new file mode 100644 index 0000000000..c3c46b13c5 --- /dev/null +++ b/assets/snippets/FormLister/lib/captcha/Captcha.php @@ -0,0 +1,35 @@ +db->connect(); +if (empty ($modx->config)) { + $modx->getSettings(); +} +if(strstr($_SERVER['HTTP_REFERER'],$modx->config['site_url']) === false || !isset($_REQUEST['formid'])) throw new Exception('Wrong captcha request'); +$formid = (string) $_REQUEST['formid']; +include_once ('modxCaptcha.php'); +$width = isset($_REQUEST['w']) ? (int) $_REQUEST['w'] : 200; +$height = isset($_REQUEST['h']) ? (int) $_REQUEST['h'] : 160; +$captcha = new ModxCaptcha($modx, $width, $height); +$_SESSION[$formid.'.captcha'] = $captcha->word; +$captcha->outputImage(); diff --git a/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php b/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php new file mode 100644 index 0000000000..8b84a6f172 --- /dev/null +++ b/assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php @@ -0,0 +1,171 @@ +modx = $modx; + $this->dir_font = MODX_MANAGER_PATH . 'includes/' . $this->dir_font; + $this->dir_noise = MODX_MANAGER_PATH . 'includes/' . $this->dir_noise; + $this->im_width = $width; + $this->im_height = $height; + $this->word = $this->pickWord(); + } + + /** + * @param bool $inline + * @return string + */ + public function outputImage($inline = false) + { + /* output the image as jpeg */ + $this->drawImage(); + ob_clean(); + if ($inline) { + ob_start(); + imagejpeg($this->im); + $image = ob_get_contents(); + ob_end_clean(); + + return 'data:image/jpeg;base64,' . base64_encode($image); + } + header("Content-type: image/jpeg"); + imagejpeg($this->im); + imagedestroy($this->im); + } + + /** + * @return string + */ + public function pickWord() + { + // set default words + $words = "MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; + $words = $this->modx->config['captcha_words'] ? $this->modx->config['captcha_words'] : $words; + $words = str_replace(array(' ', ',,'), array('', ','), $words); + $arr_words = explode(',', $words); + + /* pick one randomly for text verification */ + + return (string)$arr_words[array_rand($arr_words)] . rand(10, 999); + } + + /** + * @return resource + */ + private function drawText() + { + $dir = dir($this->dir_font); + $fontstmp = array(); + while (false !== ($file = $dir->read())) { + if (substr($file, -4) == '.ttf') { + $fontstmp[] = $this->dir_font . $file; + } + } + $dir->close(); + $text_font = (string)$fontstmp[array_rand($fontstmp)]; + $chars = str_split($this->word); + /* angle for text inclination */ + /* initial text size */ + /* create canvas for text drawing */ + $im_text = imagecreate($this->im_width, $this->im_height); + $bg_color = imagecolorallocate($im_text, 255, 255, 255); + + $len = count($chars); + foreach ($chars as $index => $value) { + $text_angle = rand(-30, 30); + /* initial text size */ + $text_size = 30; + /* calculate text width and height */ + $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); + $text_width = $box[2] - $box[0]; //text width + /* adjust text size */ + $text_size = round((30 * $this->im_width) / $text_width); + /* recalculate text width and height */ + $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); + $text_width = ($box[2] - $box[0]) / $len; //text width + $text_height = $box[5] - $box[3]; //text height + + /* calculate center position of text */ + $text_x = ($this->im_width - $len * $text_width) / 2 + $index * $text_width; + $text_y = ($this->im_height - $text_height) / 2; + + + /* pick color for text */ + $text_color = imagecolorallocate($im_text, rand(10, 200), rand(10, 200), rand(10, 200)); + + /* draw text into canvas */ + imagettftext( + $im_text, + $text_size, + $text_angle, + $text_x, + $text_y, + $text_color, + $text_font, + $value); + } + /* remove background color */ + imagecolortransparent($im_text, $bg_color); + + return $im_text; + } + + + /** + * @return null|resource + */ + private function drawImage() + { + + /* pick one background image randomly from image directory */ + $img_file = $this->dir_noise . "noise" . rand(1, 4) . ".jpg"; + + /* create "noise" background image from your image stock*/ + + $noise_img = imagecreatefromjpeg($img_file); + $noise_width = imagesx($noise_img); + $noise_height = imagesy($noise_img); + + /* resize the background image to fit the size of image output */ + $this->im = imagecreatetruecolor($this->im_width, $this->im_height); + imagecopyresampled( + $this->im, + $noise_img, + 0, 0, 0, 0, + $this->im_width, + $this->im_height, + $noise_width, + $noise_height + ); + + /* put text image into background image */ + imagecopymerge( + $this->im, + $this->drawText(), + 0, 0, 0, 0, + $this->im_width, + $this->im_height, + 70 + ); + + return $this->im; + } +} diff --git a/assets/snippets/FormLister/lib/captcha/modxCaptcha/wrapper.php b/assets/snippets/FormLister/lib/captcha/modxCaptcha/wrapper.php new file mode 100644 index 0000000000..613e50cb3d --- /dev/null +++ b/assets/snippets/FormLister/lib/captcha/modxCaptcha/wrapper.php @@ -0,0 +1,92 @@ +cfg = $cfg; + $this->captcha = new \ModxCaptcha($modx, \APIhelpers::getkey($this->cfg, 'width', 100), + \APIhelpers::getkey($this->cfg, 'height', 60)); + } + + /** + * Устанавливает значение капчи + * @return mixed + */ + public function init() + { + $formid = \APIhelpers::getkey($this->cfg, 'id'); + if ($formid) { + $this->lastValue = isset($_SESSION[$formid . '.captcha']) + ? $_SESSION[$formid . '.captcha'] + : $this->captcha->word; + $_SESSION[$formid . '.captcha'] = $this->captcha->word; + } + } + + /** + * Плейсхолдер капчи для вывода в шаблон + * Может быть ссылкой на коннектор (чтобы можно было обновлять c помощью js), может быть сразу картинкой в base64 + * @return string + */ + public function getPlaceholder() + { + $inline = \APIhelpers::getkey($this->cfg, 'inline', 1); + if ($inline) { + $out = $this->captcha->outputImage(true); + } else { + $connectorDir = \APIhelpers::getkey($this->cfg, 'connectorDir', + 'assets/snippets/FormLister/lib/captcha/modxCaptcha/'); + $out = MODX_BASE_URL . $connectorDir . 'connector.php?formid=' . \APIhelpers::getkey($this->cfg, 'id', + 'modx'); + $out .= '&w=' . \APIhelpers::getkey($this->cfg, 'width', 100); + $out .= '&h=' . \APIhelpers::getkey($this->cfg, 'height', 60); + } + + return $out; + } + + /** + * @param \FormLister\Core $FormLister + * @param $value + * @param \FormLister\CaptchaInterface $captcha + * @return bool|string + */ + public static function validate(Core $FormLister, $value, CaptchaInterface $captcha) + { + if (empty($value)) { + $out = \APIhelpers::getkey($captcha->cfg, 'errorEmptyCode', 'Введите проверочный код'); + } else { + $out = $value == $captcha->lastValue ? true : \APIhelpers::getkey($captcha->cfg, + 'errorCodeFailed', 'Неверный проверочный код'); + } + $FormLister->log('Validate captcha value '.$value.' against '.$captcha->lastValue); + + return $out; + } +} diff --git a/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php b/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php new file mode 100644 index 0000000000..e1b05b4be7 --- /dev/null +++ b/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php @@ -0,0 +1,93 @@ +cfg = $cfg; + $this->modx = $modx; + } + + /** + * Устанавливает значение капчи + * @return mixed + */ + public function init() + { + return; + } + + /** + * Плейсхолдер капчи для вывода в шаблон + * Может быть ссылкой на коннектор (чтобы можно было обновлять c помощью js), может быть сразу картинкой в base64 + * @return string + */ + public function getPlaceholder() + { + $siteKey = \APIhelpers::getkey($this->cfg, 'siteKey'); + $type = \APIhelpers::getkey($this->cfg, 'type', 'image'); + $size = \APIhelpers::getkey($this->cfg, 'tabindex', 0); + $tabindex = \APIhelpers::getkey($this->cfg, 'tabindex', 0); + $theme = \APIhelpers::getkey($this->cfg, 'theme', 'light'); + $id = \APIhelpers::getkey($this->cfg, 'id'); + $id = 'id="' . $id . '-recaptcha"'; + $badge = \APIhelpers::getkey($this->cfg, 'badge', 'bottomright'); + $callback = \APIhelpers::getkey($this->cfg, 'callback', ''); + $expcallback = \APIhelpers::getkey($this->cfg, 'expired_callback', ''); + $out = ''; + if (!empty($siteKey)) { + $out = "
                              "; + } + + return $out; + } + + /** + * @param \FormLister\Core $FormLister + * @param $value + * @param \FormLister\CaptchaInterface $captcha + * @return bool|string + */ + public static function validate(Core $FormLister, $value, CaptchaInterface $captcha) + { + $secretKey = \APIhelpers::getkey($captcha->cfg, 'secretKey'); + $url = "https://www.google.com/recaptcha/api/siteverify?secret=" . $secretKey . "&response=" . $value . "&remoteip=" . \APIhelpers::getUserIP(); + $out = false; + if (!empty($value)) { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_TIMEOUT, 10); + curl_setopt($curl, CURLOPT_USERAGENT, + "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16"); + $response = curl_exec($curl); + curl_close($curl); + $response = json_decode($response, true); + $out = $response['success']; + } + if (!$out) { + $out = \APIhelpers::getkey($captcha->cfg, 'errorCodeFailed', 'Вы не прошли проверку'); + } + $FormLister->log('reCaptcha validation result: '.$out); + + return $out; + } +} diff --git a/assets/snippets/FormLister/lib/captcha/smsCaptcha/model.php b/assets/snippets/FormLister/lib/captcha/smsCaptcha/model.php new file mode 100644 index 0000000000..f616939756 --- /dev/null +++ b/assets/snippets/FormLister/lib/captcha/smsCaptcha/model.php @@ -0,0 +1,57 @@ + '', + 'phone' => '', + 'code' => '', + 'active' => 0, + 'expires' => 0, + 'ip' => '' + ); + + public function getData($phone,$formid) { + + $this->close(); + $this->markAllEncode(); + $this->newDoc = false; + $result = $this->query("SELECT * from {$this->makeTable($this->table)} where `phone`='{$this->escape($phone)}' AND `formid`='{$this->escape($formid)}'"); + $this->fromArray($this->modx->db->getRow($result)); + $this->store($this->toArray()); + $this->id = $this->eraseField($this->pkName); + if (is_bool($this->id) && $this->id === false) { + $this->id = null; + } else { + $this->decodeFields(); + } + + + return $this; + } + + public function createTable() + { + $table = $this->modx->getFullTableName($this->table); + $q = "CREATE TABLE IF NOT EXISTS {$table} ( + `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `formid` VARCHAR(255) NOT NULL DEFAULT '', + `phone` VARCHAR(20) NOT NULL DEFAULT '', + `code` VARCHAR (10) NOT NULL DEFAULT '', + `active` INT(1) NOT NULL DEFAULT 0, + `expires` INT(10) NOT NULL DEFAULT 0, + `ip` VARCHAR (16) NOT NULL DEFAULT '', + KEY `formid` (`formid`), + KEY `phone` (`phone`), + KEY `code` (`code`), + KEY `active` (`active`), + KEY `expires` (`expires`) + ) Engine=MyISAM + "; + $this->modx->db->query($q); + } +} diff --git a/assets/snippets/FormLister/lib/captcha/smsCaptcha/wrapper.php b/assets/snippets/FormLister/lib/captcha/smsCaptcha/wrapper.php new file mode 100644 index 0000000000..bff6b24a07 --- /dev/null +++ b/assets/snippets/FormLister/lib/captcha/smsCaptcha/wrapper.php @@ -0,0 +1,103 @@ +cfg = $cfg; + $this->modx = $modx; + } + + /** + * Устанавливает значение капчи + * @return mixed + */ + public function init() + { + return; + } + + /** + * Плейсхолдер капчи для вывода в шаблон + * @return string + */ + public function getPlaceholder() + { + return ''; + } + + /** + * @param \FormLister\Core $FormLister + * @param $value + * @param \FormLister\CaptchaInterface $captcha + * @return bool|string + */ + public static function validate(Core $FormLister, $value, CaptchaInterface $captcha) + { + $id = \APIhelpers::getkey($captcha->cfg, 'id'); + if (empty($value)) { + return \APIhelpers::getkey($captcha->cfg, 'errorEmptyCode', + 'Введите код авторизации'); + } + + if (empty($_SESSION[$id . '.smscaptcha'])) { + return \APIhelpers::getkey($captcha->cfg, 'errorCodeRequired', + 'Получите код авторизации'); + } + + $sms = $FormLister->loadModel('SmsModel'); + + if (is_null($sms->getData($_SESSION[$id . '.smscaptcha'], $id)->getID())) { + + return \APIhelpers::getkey($captcha->cfg, 'errorCodeRequired', 'Получите код авторизации'); + } + + if ($sms->get('code') != $value) { + + return \APIhelpers::getkey($captcha->cfg, 'errorCodeFailed', 'Неверный код авторизации'); + } + + if ($sms->get('expires') < time()) { + $sms->delete($sms->getID()); + + return \APIhelpers::getkey($captcha->cfg, 'errorCodeExpired', + 'Код авторизации истек, получите новый'); + } else { + if (!$sms->get('active')) { + $sms->set('active', 1)->set('expires', time() + \APIhelpers::getkey($captcha->cfg, 'codeLifeTime', + 86400))->set('ip', \APIhelpers::getUserIP())->save(); + } else { + + return \APIhelpers::getkey($captcha->cfg, 'errorCodeUsed', + 'Код авторизации уже использовался'); + } + $out = true; + + $FormLister->setField('captcha.phone', $sms->get('phone')); + } + $FormLister->log('Validate captcha value '.$value.' against '.$sms->get('code')); + + return $out; + } +} + diff --git a/assets/snippets/FormLister/plugin.userHelper.php b/assets/snippets/FormLister/plugin.userHelper.php new file mode 100644 index 0000000000..2d58642010 --- /dev/null +++ b/assets/snippets/FormLister/plugin.userHelper.php @@ -0,0 +1,49 @@ +event; +include_once(MODX_BASE_PATH . 'assets/lib/MODxAPI/modUsers.php'); +if ($e->name == 'OnWebAuthentication') { + if ($savedpassword != $userObj->getPassword($userpassword)) { + $fails = (int)$userObj->get('failedlogincount'); + $userObj->set('failedlogincount', ++$fails); + if ($fails > $maxFails) { + $userObj->set('blockeduntil', time() + $blockTime); + $userObj->set('failedlogincount', 0); + } + $userObj->save(); + } +} +if ($e->name == 'OnWebLogin') { + if (!$userObj->get('lastlogin')) { + $userObj->set('lastlogin',time()); + } else { + $userObj->set('lastlogin',$userObj->get('thislogin')); + } + $userObj->set('thislogin', time()); + $userObj->set('logincount', (int)$userObj->get('logincount') + 1); + $userObj->set('failedlogincount', 0); + $userObj->save(false,false); + if (isset($_COOKIE[$cookieName])) { + $userObj->setAutoLoginCookie($cookieName,$cookieLifetime); + } +} +if ($e->name == 'OnWebPageInit' || $e->name == 'OnPageNotFound') { + $user = new \modUsers($modx); + if ($modx->getLoginUserID('web')) { + if (isset($_REQUEST[$logoutKey])) { + $user->logOut($cookieName, true); + $page = $modx->config['site_url'] . (isset($_REQUEST['q']) ? $_REQUEST['q'] : ''); + $query = $_GET; + unset($query[$logoutKey], $query['q']); + if ($query) $page . '?' . http_build_query($query); + $modx->sendRedirect($page); + } + } else { + $user->AutoLogin($cookieLifetime, $cookieName, true); + } +} diff --git a/assets/snippets/FormLister/snippet.FormLister.php b/assets/snippets/FormLister/snippet.FormLister.php new file mode 100644 index 0000000000..8bddf6a5f0 --- /dev/null +++ b/assets/snippets/FormLister/snippet.FormLister.php @@ -0,0 +1,53 @@ +modx->logEvent(0, 1, "Parameter &formid is not set", 'FormLister'); + return; +} +include_once ('__autoload.php'); +$out = ''; +$FLDir = MODX_BASE_PATH . 'assets/snippets/FormLister/'; +if (isset($controller)) { + preg_match('/^(\w+)$/iu', $controller, $controller); + $controller = $controller[1]; +} else { + $params['controller'] = $controller = "Form"; +} +if ($controller == 'Core') return $out; + +$classname = '\FormLister\\'.$controller; + +if (!class_exists($classname)) { + $dir = isset($dir) ? MODX_BASE_PATH . $dir : $FLDir . "core/controller/"; + if (file_exists($dir . $controller . ".php") && !class_exists($classname)) { + require_once($dir . $controller . ".php"); + } +} +if (!isset($langDir)) $params['langDir'] = 'assets/snippets/FormLister/core/lang/'; + +if (class_exists($classname)) { + /** @var \FormLister\Core $FormLister */ + $FormLister = new $classname($modx, $params); + if (!$FormLister->getFormId()) return; + $FormLister->initForm(); + $out = $FormLister->render(); + if ($FormLister->getFormStatus() && isset($saveObject) && is_scalar($saveObject)) { + $modx->setPlaceholder($saveObject,$FormLister); + } + + if (!is_null($FormLister->debug)) { + $FormLister->debug->saveLog(); + } +} else { + $this->modx->logEvent(0, 1, "Controller {$classname} is missing", 'FormLister'); +} + +return $out; diff --git a/assets/snippets/ditto/classes/ditto.class.inc.php b/assets/snippets/ditto/classes/ditto.class.inc.php index bacd37f50b..bda152c4ea 100644 --- a/assets/snippets/ditto/classes/ditto.class.inc.php +++ b/assets/snippets/ditto/classes/ditto.class.inc.php @@ -337,7 +337,7 @@ function render($resource, $template, $removeChunk,$dateSource,$dateFormat,$ph=a // set QE Placeholders } - if ($phx == 1) { + if ($phx == 1 && !$modx->config['enable_filter']) { $PHs = $placeholders; foreach($PHs as $key=>$output) { $placeholders[$key] = str_replace( array_keys( $contentVars ), array_values( $contentVars ), $output ); @@ -346,6 +346,16 @@ function render($resource, $template, $removeChunk,$dateSource,$dateFormat,$ph=a $phx = new prePHx($template); $phx->setPlaceholders($placeholders); $output = $phx->output(); + } + elseif ($phx == 1 && $modx->config['enable_filter']) { + $output = $template; + $i = 0; + while($i<10) { + $_ = $output; + $output = $modx->parseText($output,$placeholders); + if($_===$output) break; + $i++; + } } else { $output = $this->template->replace($placeholders,$template); $output = $this->template->replace($contentVars,$output); @@ -374,6 +384,7 @@ function parseFields($placeholders,$seeThruUnpub,$dateSource,$randomize) { } $this->addField("id","display","db"); $this->addField("pagetitle","display","db"); + $this->addField("parent","display","db"); $checkOptions = array("pub_date","unpub_date","editedon","deletedon","publishedon"); if (in_array($dateSource,$checkOptions)) { $this->addField("createdon","display"); @@ -629,9 +640,27 @@ function determineIDs($IDs, $IDType, $TVs, $orderBy, $depth, $showPublishedOnly, $customReset = $this->customReset; if ($keywords) {$this->addField("haskeywords","*","db");$this->addField("hasmetatags","*","db");} if ($this->debug) {$this->addField("pagetitle","backend","db");} - if (count($customReset) > 0) {$this->addField("createdon","backend","db");} - $resource = $this->getDocuments($documentIDs,$this->fields["backend"]["db"],$TVs,$orderBy,$showPublishedOnly,0,$hidePrivate,$where,$limit,$keywords,$randomize,$dateSource); - if ($resource !== false) { +// intersel edit +// Bug when we use a date field ("pub_date","unpub_date","editedon","deletedon","publishedon") +// used to order the results' array in descending order: +// the result of getDocuments is not correct because the result is limited to $limit +// but the array of results was not sorted (see SQL Query in getDocuments) +// (see checkAdvSort function) +// my choice to fix this bug was to set limit to 0 in the getDocuments call when we order with a date field (see customReset), +// then to limit the size of the array after all sorting functions were done (see hereafter) +// I did not get side effects on my modx installs... + +/* + if (count($customReset) > 0) {$this->addField("createdon","backend","db");} + $resource = $this->getDocuments($documentIDs,$this->fields["backend"]["db"],$TVs,$orderBy,$showPublishedOnly,0,$hidePrivate,$where,$limit,$keywords,$randomize,$dateSource); +*/ + $limitSearch=$limit; + if (count($customReset) > 0) {$this->addField("createdon","backend","db"); $limitSearch=0;} + $resource = $this->getDocuments($documentIDs,$this->fields["backend"]["db"],$TVs,$orderBy,$showPublishedOnly,0,$hidePrivate,$where,$limitSearch,$keywords,$randomize,$dateSource); + +// EPO - End of change (then see line 692 - if ($limit) array_slice($resource, 0, $limit); ) + + if ($resource !== false) { $resource = array_values($resource); // remove #'s from keys $recordCount = count($resource); @@ -671,6 +700,9 @@ function determineIDs($IDs, $IDType, $TVs, $orderBy, $depth, $showPublishedOnly, $resource = $this->userSort($resource,$orderBy); } + //intersel - see above in order to limit the array to $limit. + if ($limit) $resource=array_slice($resource, 0, $limit); + $fields = (array_intersect($this->fields["backend"],$this->fields["display"])); $readyFields = array(); foreach ($fields as $field) { diff --git a/assets/snippets/docinfo/snippet.docinfo.php b/assets/snippets/docinfo/snippet.docinfo.php new file mode 100644 index 0000000000..e97b7914de --- /dev/null +++ b/assets/snippets/docinfo/snippet.docinfo.php @@ -0,0 +1,41 @@ + + * + * @TODO getTemplateVarOutput не применяет визуальный компонент к TV параметрам у которых значение совпадает со значением по умолчанию + * + * @example +* [[DocInfo? &docid=`15` &field=`pagetitle`]] +* [[DocInfo? &docid=`10` &field=`tvname`]] +* [[DocInfo? &docid=`3` &field=`tvname` &render=`1`]] +*/ +if(!defined('MODX_BASE_PATH')){die('What are you doing? Get out of here!');} +$default_field = array('type','contentType','pagetitle','longtitle','description','alias','link_attributes','published','pub_date','unpub_date','parent','isfolder','introtext','content','richtext','template','menuindex','searchable','cacheable','createdon','createdby','editedon','editedby','deleted','deletedon','deletedby','publishedon','publishedby','menutitle','donthit','haskeywords','hasmetatags','privateweb','privatemgr','content_dispo','hidemenu','alias_visible'); +$docid = (isset($docid) && (int)$docid>0) ? (int)$docid : $modx->documentIdentifier; +$field = (isset($field)) ? $field : 'pagetitle'; +$render = (isset($render)) ? $render : 0; +$output = ''; +if (in_array($field, $default_field)) { + $doc = $modx->getPageInfo($docid,'1',$field); + $output = $doc[$field]; +}else{ + if(isset($render) && 1==$render){ + $tv = $modx->getTemplateVarOutput($field, $docid); + $output = $tv[$field]; + }else{ + $tv = $modx->getTemplateVar($field,'*',$docid); + $output = ($tv['value']!='') ? $tv['value'] : $tv['defaultText']; + } +} +return $output; +?> \ No newline at end of file diff --git a/assets/snippets/if/custom/if.fileExists.php b/assets/snippets/if/custom/if.fileExists.php new file mode 100644 index 0000000000..cb6e4dceaa --- /dev/null +++ b/assets/snippets/if/custom/if.fileExists.php @@ -0,0 +1,21 @@ +
                              -

                              if 1.3

                              +

                              if 1.4

                              [[if? &is=`[*id*]:is:4:or:[*parent*]:in:5,6,5,7,8,9` &then=`[[if? &is=`0||is||0` &then=`true` &else=`false` &separator=`||`]]` &else=`@TPL:else`]]
                              [[if? &is=`[*id*]:is:1:or:[*id*]:is:2:and:[*parent*]:is:5:or:[*parent*]:in:2,3,4` &then=`true` &else=`false`]]

                              All expressions are logically (....:or:is:.... ) :and: (...:!empty:.....)
                              expression and divides the condition into 2 parts, which in the end compared to the true

                              -

                              Sample №1
                              Output action is necessary only in the parent ID = 5
                              [[if? &is=`[*parent*]:is:5` &then=`@TPL:chunk-name`]]

                              -

                              Sample №2
                              Output action is necessary only in the parent ID = 5 or template IDs in (7,8,9)
                              [[if? &is=`[*parent*]:is:5:or:[*template*]:in:7,8,9` &then=`@TPL:chunk-name`]]

                              -

                              Sample №3
                              Output action is necessary only in the parent ID = 5 and only the resource with the template ID = 7
                              [[if? &is=`[*parent*]:is:5:and:[*template*]:is:7` &then=`@TPL:chunk-name`]]

                              -

                              Sample №4
                              Output action is necessary only in the parent ID = 5 and (only in the template ID = 7 or in other templates but with TV `new` = 1
                              [[if? &is=`[*parent*]:is:5:and:[*template*]:is:7:or:[*new*]:is:1` &then=`@TPL:chunk-name`]]

                              -

                              Sample №5
                              Output share for the goods with a price in the range of > 300 <= 700
                              [[if? &is=`[*price*]:gt:300:and:[*price*]:lte:700` &then=`@TPL:chunk-name`]]

                              -

                              Sample №6
                              Output in the multiplicity of records Ditto 3
                              [[if? &is=`[+ditto_iteration+]:%:3` &then=`true` &else=`false`]]

                              -

                              Sample №7
                              Output in the multiplicity of records Ditto 3 but by multiplying the
                              [[if? &is=`[+ditto_iteration+]*2:%:3` &then=`true` &else=`false` &math=`on`]]

                              -

                              Sample №8
                              Print the value of the mathematical expression
                              [[if? &is=`[+ditto_iteration+]*2` &math=`on`]]

                              -

                              Sample №9
                              Output if pagetitle contains "string"
                              [[if? &is=`[*pagetitle*]:contains:string` &then=`@TPL:chunk-name`]]

                              +

                              Example 1
                              Output action is necessary only in the parent ID = 5
                              [[if? &is=`[*parent*]:is:5` &then=`@TPL:chunk-name`]]

                              +

                              Example 2
                              Output action is necessary only in the parent ID = 5 or template IDs in (7,8,9)
                              [[if? &is=`[*parent*]:is:5:or:[*template*]:in:7,8,9` &then=`@TPL:chunk-name`]]

                              +

                              Example 3
                              Output action is necessary only in the parent ID = 5 and only the resource with the template ID = 7
                              [[if? &is=`[*parent*]:is:5:and:[*template*]:is:7` &then=`@TPL:chunk-name`]]

                              +

                              Example 4
                              Output action is necessary only in the parent ID = 5 and (only in the template ID = 7 or in other templates but with TV `new` = 1
                              [[if? &is=`[*parent*]:is:5:and:[*template*]:is:7:or:[*new*]:is:1` &then=`@TPL:chunk-name`]]

                              +

                              Example 5
                              Output share for the goods with a price in the range of > 300 <= 700
                              [[if? &is=`[*price*]:gt:300:and:[*price*]:lte:700` &then=`@TPL:chunk-name`]]

                              +

                              Example 6
                              Output in the multiplicity of records Ditto 3
                              [[if? &is=`[+ditto_iteration+]:%:3` &then=`true` &else=`false`]]

                              +

                              Example 7
                              Output in the multiplicity of records Ditto 3 but by multiplying the
                              [[if? &is=`[+ditto_iteration+]*2:%:3` &then=`true` &else=`false` &math=`on`]]

                              +

                              Example 8
                              Print the value of the mathematical expression
                              [[if? &is=`[+ditto_iteration+]*2` &math=`on`]]

                              +

                              Example 9
                              Output if pagetitle contains "string"
                              [[if? &is=`[*pagetitle*]:contains:string` &then=`@TPL:chunk-name`]]

                              Operator:
                              (is,=) , (not,!=) , (gt,>) , (lt,<) , (gte,>=) , (<=,lte) , (isempty,empty) , (notempty,!empty)
                              (null, is_null) , (in_array, inarray, in) , (not_in,!in) , (contains)

                              -

                              More samples
                              [[if? &is=`eval('global $iteration;$iteration++;echo $iteration;')` &math=`on`]] // iteration in Ditto,Wayfinder and others
                              [[if? &is=`:is:` &then=`@eval: echo str_replace('<br/>','','[*pagetitle*]');`]] // 'our<br/>works' -> 'our works'
                              [[if? &is=`:is:` &then=`@eval: echo number_format('[*price*]', 2, ',', ' ');`]] // '1000000,89' -> '1 000 000,89'

                              +

                              More Examples
                              [[if? &is=`eval('global $iteration;$iteration++;echo $iteration;')` &math=`on`]] // iteration in Ditto,Wayfinder and others
                              [[if? &is=`:is:` &then=`@eval: echo str_replace('<br/>','','[*pagetitle*]');`]] // 'our<br/>works' -> 'our works'
                              [[if? &is=`:is:` &then=`@eval: echo number_format('[*price*]', 2, ',', ' ');`]] // '1000000,89' -> '1 000 000,89'

                              +

                              Custom Conditions
                              See assets/snippets/if/custom/if.fileExists.php for more information.

                              [[if? &is=`[*filename*]:fileExists` &custom=`fileExists` &then=`@TPL:chunk-name`]]

                              \ No newline at end of file diff --git a/assets/snippets/if/snippet.if.php b/assets/snippets/if/snippet.if.php index 65004f6c34..6ca29594b3 100644 --- a/assets/snippets/if/snippet.if.php +++ b/assets/snippets/if/snippet.if.php @@ -4,16 +4,16 @@ * * A simple conditional snippet. Allows for eq/neq/lt/gt/etc logic within templates, resources, chunks, etc. * - * @category snippet - * @version 1.3 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties - * @internal @modx_category Navigation + * @category snippet + * @version 1.4 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @properties + * @internal @modx_category Navigation * @internal @installset base * @documentation Readme [+site_url+]assets/snippets/if/readme.html * @reportissues https://github.com/modxcms/evolution - * @author Created By Bumkaka bumkaka@yandex.ru - * @lastupdate 07/02/2016 + * @author Created By Bumkaka bumkaka@yandex.ru + * @lastupdate 21/05/2017 */ if(!defined('MODX_BASE_PATH')){die('What are you doing? Get out of here!');} @@ -24,6 +24,22 @@ $subject=$opers[0]; $eq=true; $and=false; +$or = false; +$else = isset($else) ? $else : ''; +// Prepare custom conditions +$customConditions = array(); +if(!empty($custom)) { + $snippetPath = realpath(dirname(__FILE__)); + $cc = explode(',', $custom); + foreach($cc as $cCond) { + $ccFile = $snippetPath.'/custom/if.'.$cCond.'.php'; + if(!function_exists($cCond) && file_exists($ccFile)) { + include($ccFile); + $customConditions[$cCond] = true; + } + } +} + for ($i=1;$isafeEval('return ' . $subject.';'); @@ -49,11 +76,9 @@ $operator = strtolower($operator); switch ($operator) { - case '%': $output = ($subject %$operand==0) ? true: false;$i++; break; - case '!=': case 'not':$output = ($subject != $operand) ? true: false;$i++; break; @@ -98,6 +123,13 @@ $output = (strpos($subject,$operand) !== false) ? true : false; $i++; break; + case '!contains': + case 'not_contains': + $output = (strpos($subject,$operand) !== false) ? false : true; + $i++; + break; + case 'custom': + break; case '==': case '=': case 'eq': diff --git a/assets/snippets/jot/templates/chunk.form.inc.html b/assets/snippets/jot/templates/chunk.form.inc.html index ed03d95216..5bea45456d 100644 --- a/assets/snippets/jot/templates/chunk.form.inc.html +++ b/assets/snippets/jot/templates/chunk.form.inc.html @@ -68,7 +68,7 @@

                              [+form.edit:is=`1`:then=`Edit comment`:else=`Write a comment`+]


                              [+jot.captcha:is=`1`:then=` -
                              If you have trouble reading the code, click on the code itself to generate a new random code.
                              +
                              If you have trouble reading the code, click on the code itself to generate a new random code.
                                `:strip+] diff --git a/assets/snippets/jot/templates/jot.css b/assets/snippets/jot/templates/jot.css index f5fc52a7b0..97958f5b5b 100644 --- a/assets/snippets/jot/templates/jot.css +++ b/assets/snippets/jot/templates/jot.css @@ -1,9 +1,9 @@ .jot-err {border: 1px solid red;font-weight: bold;color: red;padding: 5px;margin-bottom: 10px;} .jot-cfm {border: 1px solid green;font-weight: bold;color: green;padding: 5px;margin-bottom: 10px;} -.jot-row {border: 1px solid #CCCCCC;margin-bottom: 10px;background-color: #e9e9e9;} -.jot-row-alt {background-color: #f9f9f9;} -.jot-row-author {background-color: #FFFFE1;} -.jot-row-me {background-color: #FFDDDD;} +.jot-row {margin-bottom: 10px;} +.jot-row-alt {} +.jot-row-author {} +.jot-row-me {} .jot-row-up {border: 1px dotted red;} .jot-row-new {border: 1px dotted green;} .jot-comment {padding: 3px;} @@ -13,7 +13,7 @@ .jot-mod {float: right;width: 100px;text-align: right;color: #666666;font-weight: bold;} .jot-mod img {border: 0px;} .jot-mod a {float: right;padding: 1px;padding-left: 2px;padding-right: 2px;} -.jot-mod a:hover {background-color: #666666;color: #666666;} +.jot-mod a:hover {color: #666666;} .jot-subject {font-weight: bold;font-size: 1.1em;} .jot-message {padding: 2px;overflow: auto;} .jot-poster {padding: 0px;text-align: left;font-size: 10px;} diff --git a/assets/snippets/phpthumb/phpthumb.unsharp.php b/assets/snippets/phpthumb/phpthumb.unsharp.php index 15531025ba..8e3505d5e0 100755 --- a/assets/snippets/phpthumb/phpthumb.unsharp.php +++ b/assets/snippets/phpthumb/phpthumb.unsharp.php @@ -43,7 +43,7 @@ class phpUnsharpMask { - static function __construct(&$img, $amount, $radius, $threshold) { + static function applyUnsharpMask(&$img, $amount, $radius, $threshold) { // $img is an image that is already created within php using // imgcreatetruecolor. No url! $img must be a truecolor image. @@ -147,4 +147,4 @@ static function __construct(&$img, $amount, $radius, $threshold) { return true; } } -?> \ No newline at end of file +?> diff --git a/assets/snippets/phpthumb/snippet.phpthumb.php b/assets/snippets/phpthumb/snippet.phpthumb.php index ffd6261ff9..9ed86ebc81 100644 --- a/assets/snippets/phpthumb/snippet.phpthumb.php +++ b/assets/snippets/phpthumb/snippet.phpthumb.php @@ -51,7 +51,7 @@ $tmpImagesFolder=str_replace("assets/images","",$tmpImagesFolder); $tmpImagesFolder=explode("/",$tmpImagesFolder); $ext=strtolower($path_parts['extension']); -$options = 'f='.(in_array($ext,explode(",","png,gif,jpeg"))?$ext:"jpg&q=96").'&'.strtr($options, Array("," => "&", "_" => "=", '{' => '[', '}' => ']')); +$options = 'f='.(in_array($ext,explode(",","png,gif,jpeg"))?$ext:"jpg&q=85").'&'.strtr($options, Array("," => "&", "_" => "=", '{' => '[', '}' => ']')); parse_str($options, $params); foreach ($tmpImagesFolder as $folder) { if (!empty($folder)) { @@ -62,10 +62,11 @@ } } } - -$fname_preffix=$cacheFolder."/".$params['w']."x".$params['h'].'-'; -$fname = $path_parts['filename'].".".substr(md5(serialize($params).filemtime(MODX_BASE_PATH . $input)),0,3).".".$params['f']; -$outputFilename =MODX_BASE_PATH.$fname_preffix.$fname; + +$fname_preffix = "$cacheFolder/"; +$fname = $path_parts['filename']; +$fname_suffix = "-{$params['w']}x{$params['h']}-".substr(md5(serialize($params).filemtime(MODX_BASE_PATH . $input)),0,3).".{$params['f']}"; +$outputFilename = MODX_BASE_PATH.$fname_preffix.$fname.$fname_suffix; if (!file_exists($outputFilename)) { require_once MODX_BASE_PATH.'assets/snippets/phpthumb/phpthumb.class.php'; $phpThumb = new phpthumb(); @@ -81,5 +82,5 @@ $modx->logEvent(0, 3, implode('
                              ', $phpThumb->debugmessages), 'phpthumb'); } } -return $fname_preffix.rawurlencode($fname); +return $fname_preffix.rawurlencode($fname).$fname_suffix; ?> diff --git a/assets/snippets/wayfinder/wayfinder.inc.php b/assets/snippets/wayfinder/wayfinder.inc.php index b68d0e4d6e..1d80b866a3 100644 --- a/assets/snippets/wayfinder/wayfinder.inc.php +++ b/assets/snippets/wayfinder/wayfinder.inc.php @@ -375,8 +375,9 @@ function getData() { //remove parents lower than level of startId + level depth $parents = array_slice(array_reverse($parents), 0, $depth-1); - foreach($parents as $p) - $ids = $modx->getChildIds($p, 1, $ids); + foreach($parents as $p) { + $ids += $modx->getChildIds($p, 1, $ids); + } } } //Get all of the ids for processing diff --git a/assets/snippets/weblogin/weblogin.common.inc.php b/assets/snippets/weblogin/weblogin.common.inc.php old mode 100755 new mode 100644 index 1a38d69887..525e1b7164 --- a/assets/snippets/weblogin/weblogin.common.inc.php +++ b/assets/snippets/weblogin/weblogin.common.inc.php @@ -25,7 +25,7 @@ function webLoginExtractDeclarations(&$html){ // show javascript alert function webLoginAlert($msg){ - global $modx; + global $modx; return ""; } @@ -50,7 +50,11 @@ function webLoginSendNewPassword($email,$uid,$pwd,$ufn){ $emailsender = $modx->config['emailsender']; $site_name = $modx->config['site_name']; $site_start = $modx->config['site_start']; - $message = sprintf($websignupemail_message, $uid, $pwd); // use old method + + //Escape quotes + $message = str_replace('"', '', $websignupemail_message); + + // replace placeholders $message = str_replace("[+uid+]",$uid,$message); $message = str_replace("[+pwd+]",$pwd,$message); @@ -58,37 +62,59 @@ function webLoginSendNewPassword($email,$uid,$pwd,$ufn){ $message = str_replace("[+sname+]",$site_name,$message); $message = str_replace("[+semail+]",$emailsender,$message); $message = str_replace("[+surl+]",$site_url,$message); - if (!ini_get('safe_mode')) $sent = mail($email, $emailsubject, $message, "From: ".$emailsender."\r\n"."X-Mailer: Content Manager - PHP/".phpversion(), "-f {$emailsender}"); - else $sent = mail($email, $emailsubject, $message, "From: ".$emailsender."\r\n"."X-Mailer: Content Manager - PHP/".phpversion()); + + + //Set HTML Headers + $headers = "From: ".$emailsender."\r\n"; + $headers .= "X-Mailer: PHP/".phpversion(); + $headers .= "MIME-Version: 1.0\r\n"; + $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; + + + if (!ini_get('safe_mode')) + $sent = mail($email, + $emailsubject, + $message, + $headers, + + "-f {$emailsender}"); + + else $sent = mail( + $email, + $emailsubject, + $message, + "From: ".$emailsender."\r\n"."X-Mailer: Content Manager - PHP/".phpversion()); + if (!$sent) webLoginAlert("Error while sending mail to $mailto",1); + return true; } function preserveUrl($docid = '', $alias = '', $array_values = array(), $suffix = false) { - global $modx; - $array_get = $_GET; - $urlstring = array(); - - unset($array_get["id"]); - unset($array_get["q"]); - unset($array_get["webloginmode"]); - - $array_url = array_merge($array_get, $array_values); - foreach ($array_url as $name => $value) { - if (!is_null($value)) { - $urlstring[] = urlencode($name) . '=' . urlencode($value); - } - } - - $url = implode('&',$urlstring); - if ($suffix) { - if (empty($url)) { - $url = "?"; - } else { - $url .= "&"; - } - } - return $modx->makeUrl($docid, $alias, $url); - } + global $modx; + $array_get = $_GET; + $urlstring = array(); + + unset($array_get["id"]); + unset($array_get["q"]); + unset($array_get["webloginmode"]); + + $array_url = array_merge($array_get, $array_values); + foreach ($array_url as $name => $value) { + if (!is_null($value)) { + $urlstring[] = urlencode($name) . '=' . urlencode($value); + } + } + + $url = implode('&',$urlstring); + if ($suffix) { + if (empty($url)) { + $url = "?"; + } else { + $url .= "&"; + } + } + return $modx->makeUrl($docid, $alias, $url); + } -?> \ No newline at end of file +?> diff --git a/assets/templates/help/version_notices/1.2.2.php b/assets/templates/help/version_notices/1.2.2.php new file mode 100644 index 0000000000..a3de907928 --- /dev/null +++ b/assets/templates/help/version_notices/1.2.2.php @@ -0,0 +1,17 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +?> +

                              +

                              TinyMCE4

                              +
                                +
                              • New checkbox "Use the global setting" +

                                There were issues setting "Custom Plugins", "Custom Buttons" and "Block Formats" via MODX-configuration globally for all users. Therefore a new checkbox has been added, which active by default.

                                +
                              • +
                              + +

                              Developer-Infos

                              +
                                +
                              • New $modx->configGlobal +

                                Params from MODX-configuration which get overwritten by user-specific settings will be stored inside $modx->configGlobal to be available as fallback.

                                +
                              • +
                              \ No newline at end of file diff --git a/autoload.php.blank b/autoload.php.blank deleted file mode 100644 index acf3e2d381..0000000000 --- a/autoload.php.blank +++ /dev/null @@ -1,8 +0,0 @@ - www.domain.com -- used with SEO Strict URLs plugin #RewriteCond %{HTTP_HOST} !^$ #RewriteCond %{HTTP_HOST} !^www\. [NC] @@ -32,7 +36,7 @@ RewriteRule .* - [F,L] #RewriteRule ^(.*)$ http://%1/$1 [R=301,L] # Exclude /assets and /manager directories and images from rewrite rules -RewriteRule ^(manager|assets)/.*$ - [L] +RewriteRule ^(manager|assets|js|css|images|img)/.*$ - [L] RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L] # For Friendly URLs diff --git a/index.php b/index.php index 95303a04ee..7f87015f0a 100644 --- a/index.php +++ b/index.php @@ -45,9 +45,12 @@ * ----------------------------- */ -if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); +$autoloader = 'vendor/autoload.php'; +if (file_exists($autoloader) && is_readable($autoloader)) { + include_once($autoloader); +} -if(is_file('autoload.php')) include_once('autoload.php'); +if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); $base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; if(is_file($base_path . 'assets/cache/siteManager.php')) diff --git a/install/assets/chunks/head.tpl b/install/assets/chunks/head.tpl new file mode 100644 index 0000000000..cf9172c830 --- /dev/null +++ b/install/assets/chunks/head.tpl @@ -0,0 +1,18 @@ +/** + * header + * + * sample header scripts + * + * @category chunk + * @version 1.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @modx_category Templates + * @internal @installset base + * @internal @overwrite false + */ + +[*titl*] +[*noIndex*] + + + diff --git a/install/assets/chunks/mm_rules.tpl b/install/assets/chunks/mm_rules.tpl index 72c354656b..a65e438fb7 100644 --- a/install/assets/chunks/mm_rules.tpl +++ b/install/assets/chunks/mm_rules.tpl @@ -1,20 +1,34 @@ -/** - * mm_rules - * - * Default ManagerManager rules. - * - * @category chunk - * @version 1.0.5 - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @modx_category Js - * @internal @overwrite false - * @internal @installset base, sample - */ - -// more example rules are in assets/plugins/managermanager/example_mm_rules.inc.php -// example of how PHP is allowed - check that a TV named documentTags exists before creating rule - -if ($modx->db->getValue($modx->db->select('count(id)', $modx->getFullTableName('site_tmplvars'), "name='documentTags'"))) { - mm_widget_tags('documentTags', ' '); // Give blog tag editing capabilities to the 'documentTags (3)' TV -} -mm_widget_showimagetvs(); // Always give a preview of Image TVs +/** + * mm_rules + * + * Default ManagerManager rules. + * + * @category chunk + * @version 1.0.5 + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) + * @internal @modx_category Js + * @internal @overwrite false + * @internal @installset base, sample + */ + +// more example rules are in assets/plugins/managermanager/example_mm_rules.inc.php +// example of how PHP is allowed - check that a TV named documentTags exists before creating rule + +if ($modx->db->getValue($modx->db->select('count(id)', $modx->getFullTableName('site_tmplvars'), "name='documentTags'"))) { + mm_widget_tags('documentTags', ' '); // Give blog tag editing capabilities to the 'documentTags (3)' TV +} +mm_widget_showimagetvs(); // Always give a preview of Image TVs + +mm_createTab('SEO', 'seo', '', '', '', ''); +mm_moveFieldsToTab('titl,keyw,desc,seoOverride,noIndex,sitemap_changefreq,sitemap_priority,sitemap_exclude', 'seo', '', ''); +mm_widget_tags('keyw',','); // Give blog tag editing capabilities to the 'documentTags (3)' TV + + +//mm_createTab('Изображения', 'photos', '', '', '', '850'); +//mm_moveFieldsToTab('images,photos', 'photos', '', ''); + +//mm_hideFields('longtitle,description,link_attributes,menutitle,content', '', '6,7'); + +//mm_hideTemplates('0,5,8,9,11,12', '2,3'); + +//mm_hideTabs('settings, access', '2'); diff --git a/install/assets/plugins/CodeMirror.tpl b/install/assets/plugins/CodeMirror.tpl index f426d5bbfd..d65b940a52 100644 --- a/install/assets/plugins/CodeMirror.tpl +++ b/install/assets/plugins/CodeMirror.tpl @@ -10,18 +10,19 @@ * @package modx * @internal @events OnDocFormRender,OnChunkFormRender,OnModFormRender,OnPluginFormRender,OnSnipFormRender,OnTempFormRender,OnRichTextEditorInit * @internal @modx_category Manager and Admin - * @internal @properties &theme=Theme;list;default,ambiance,blackboard,cobalt,eclipse,elegant,erlang-dark,lesser-dark,midnight,monokai,neat,night,rubyblue,solarized,twilight,vibrant-ink,xq-dark,xq-light;default &indentUnit=Indent unit;int;4 &tabSize=The width of a tab character;int;4 &lineWrapping=lineWrapping;list;true,false;true &matchBrackets=matchBrackets;list;true,false;true &activeLine=activeLine;list;true,false;false &emmet=emmet;list;true,false;true &search=search;list;true,false;false &indentWithTabs=indentWithTabs;list;true,false;true &undoDepth=undoDepth;int;200 &historyEventDelay=historyEventDelay;int;1250 + * @internal @properties &theme=Theme;list;default,ambiance,blackboard,cobalt,eclipse,elegant,erlang-dark,lesser-dark,midnight,monokai,neat,night,one-dark,rubyblue,solarized,twilight,vibrant-ink,xq-dark,xq-light;default &darktheme=Dark Theme;list;default,ambiance,blackboard,cobalt,eclipse,elegant,erlang-dark,lesser-dark,midnight,monokai,neat,night,one-dark,rubyblue,solarized,twilight,vibrant-ink,xq-dark,xq-light;one-dark &fontSize=Font-size;list;10,11,12,13,14,15,16,17,18;14 &lineHeight=Line-height;list;1,1.1,1.2,1.3,1.4,1.5;1.3 &indentUnit=Indent unit;int;4 &tabSize=The width of a tab character;int;4 &lineWrapping=lineWrapping;list;true,false;true &matchBrackets=matchBrackets;list;true,false;true &activeLine=activeLine;list;true,false;false &emmet=emmet;list;true,false;true &search=search;list;true,false;false &indentWithTabs=indentWithTabs;list;true,false;true &undoDepth=undoDepth;int;200 &historyEventDelay=historyEventDelay;int;1250 * @internal @installset base * @reportissues https://github.com/modxcms/evolution * @documentation Official docs https://codemirror.net/doc/manual.html * @author hansek from http://www.modxcms.cz * @author update Mihanik71 * @author update Deesen - * @lastupdate 11/04/2016 + * @author update 64j + * @lastupdate 3/07/2017 */ $_CM_BASE = 'assets/plugins/codemirror/'; $_CM_URL = $modx->config['site_url'] . $_CM_BASE; -require(MODX_BASE_PATH. $_CM_BASE .'codemirror.plugin.php'); \ No newline at end of file +require(MODX_BASE_PATH. $_CM_BASE .'codemirror.plugin.php'); diff --git a/install/assets/plugins/ElementsInTree.tpl b/install/assets/plugins/ElementsInTree.tpl index 81dfcd123f..7b3f59ed22 100644 --- a/install/assets/plugins/ElementsInTree.tpl +++ b/install/assets/plugins/ElementsInTree.tpl @@ -7,11 +7,12 @@ * @category plugin * @version 1.5.7 * @license http://creativecommons.org/licenses/GPL/2.0/ GNU Public License (GPL v2) - * @internal @properties &tabTreeTitle=Tree Tab Title;text;Site Tree;;Custom title of Site Tree tab. &useIcons=Use icons in tabs;list;yes,no;yes;;Icons available in MODX version 1.2 or newer. &treeButtonsInTab=Tree Buttons in tab;list;yes,no;yes;;Move Tree Buttons into Site Tree tab. &unifyFrames=Unify Frames;list;yes,no;yes;;Unify Tree and Main frame style. Right now supports MODxRE2 theme only. + * @internal @properties &tabTreeTitle=Tree Tab Title;text;Docs;;Custom title of Site Tree tab. &useIcons=Use icons in tabs;list;yes,no;yes;;Icons available in MODX version 1.2 or newer. &treeButtonsInTab=Tree Buttons in tab;list;yes,no;yes;;Move Tree Buttons into Site Tree tab. &unifyFrames=Unify Frames;list;yes,no;yes;;Unify Tree and Main frame style. Right now supports MODxRE2 theme only. * @internal @events OnManagerTreePrerender,OnManagerTreeRender,OnManagerMainFrameHeaderHTMLBlock,OnTempFormSave,OnTVFormSave,OnChunkFormSave,OnSnipFormSave,OnPluginFormSave,OnModFormSave,OnTempFormDelete,OnTVFormDelete,OnChunkFormDelete,OnSnipFormDelete,OnPluginFormDelete,OnModFormDelete * @internal @modx_category Manager and Admin * @internal @installset base * @documentation Requirements: This plugin requires MODX Evolution 1.2 or later + * @internal @disabled 1 * @reportissues https://github.com/modxcms/evolution/issues * @link Original Github thread https://github.com/modxcms/evolution/issues/783 * @author Dmi3yy https://github.com/dmi3yy diff --git a/install/assets/plugins/qm.tpl b/install/assets/plugins/qm.tpl index 7013c71e10..2ec520d45c 100644 --- a/install/assets/plugins/qm.tpl +++ b/install/assets/plugins/qm.tpl @@ -5,9 +5,9 @@ * Enables QuickManager+ front end content editing support * * @category plugin - * @version 1.5.6 + * @version 1.5.7 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL v3) - * @internal @properties &jqpath=Path to jQuery;text;assets/js/jquery.min.js &loadmanagerjq=Load jQuery in manager;list;true,false;false &loadfrontendjq=Load jQuery in front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in front-end;list;true,false;true &loadtb=Load modal box in front-end;list;true,false;true &tbwidth=Modal box window width;text;80% &tbheight=Modal box window height;text;90% &hidefields=Hide document fields from front-end editors;text;parent &hidetabs=Hide document tabs from front-end editors;text; &hidesections=Hide document sections from front-end editors;text; &addbutton=Show add document here button;list;true,false;true &tpltype=New document template type;list;parent,id,selected;parent &tplid=New document template id;int;3 &custombutton=Custom buttons;textarea; &managerbutton=Show go to manager button;list;true,false;true &logout=Logout to;list;manager,front-end;manager &disabled=Plugin disabled on documents;text; &autohide=Autohide toolbar;list;true,false;true &editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit button CSS class;text;qm-edit &newbuttons=Inline new resource buttons;list;true,false;false &newbclass=New resource button CSS class;text;qm-new &tvbuttons=Inline template variable buttons;list;true,false;false &tvbclass=Template variable button CSS class;text;qm-tv + * @internal @properties &jqpath=Path to jQuery;text;assets/js/jquery.min.js &loadmanagerjq=Load jQuery in manager;list;true,false;false &loadfrontendjq=Load jQuery in front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in front-end;list;true,false;true &loadtb=Load modal box in front-end;list;true,false;true &tbwidth=Modal box window width;text;80% &tbheight=Modal box window height;text;90% &hidefields=Hide document fields from front-end editors;text;parent &hidetabs=Hide document tabs from front-end editors;text; &hidesections=Hide document sections from front-end editors;text; &addbutton=Show add document here button;list;true,false;true &tpltype=New document template type;list;parent,id,selected;parent &tplid=New document template id;int;3 &custombutton=Custom buttons;textarea; &managerbutton=Show go to manager button;list;true,false;true &logout=Logout to;list;manager,front-end;manager &disabled=Plugin disabled on documents;text; &autohide=Autohide toolbar;list;true,false;true &position= Toolbar position;list;top,right,bottom,left,before;top &editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit button CSS class;text;qm-edit &newbuttons=Inline new resource buttons;list;true,false;false &newbclass=New resource button CSS class;text;qm-new &tvbuttons=Inline template variable buttons;list;true,false;false &tvbclass=Template variable button CSS class;text;qm-tv &removeBg=Remove toolbar background;list;yes,no;no &buttonStyle=QuickManager buttons CSS stylesheet;list;actionButtons,navButtons;actionButtons * @internal @events OnParseDocument,OnWebPagePrerender,OnDocFormPrerender,OnDocFormSave,OnManagerLogout * @internal @modx_category Manager and Admin * @internal @legacy_names QM+,QuickEdit @@ -17,8 +17,8 @@ * @documentation Official docs [+site_url+]assets/plugins/qm/readme.html * @link http://www.maagit.fi/modx/quickmanager-plus * @author Mikko Lammi - * @author Since 2011: yama, dmi3yy, segr - * @lastupdate 31/03/2014 + * @author Since 2011: yama, dmi3yy, segr, Nicola1971. + * @lastupdate 23/01/2017 */ // In manager @@ -43,5 +43,5 @@ if ($show) { } } include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php'); - $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq, $noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs, $hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton, $logout, $autohide, $editbuttons, $editbclass, $newbuttons, $newbclass, $tvbuttons, $tvbclass); + $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq, $noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs, $hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton, $logout, $autohide, $position, $editbuttons, $editbclass, $newbuttons, $newbclass, $tvbuttons, $tvbclass, $buttonStyle, $removeBg); } diff --git a/install/assets/plugins/tinymce4.tpl b/install/assets/plugins/tinymce4.tpl index 244fd24c5f..f1e3467eb8 100644 --- a/install/assets/plugins/tinymce4.tpl +++ b/install/assets/plugins/tinymce4.tpl @@ -5,9 +5,9 @@ * Javascript WYSIWYG editor * * @category plugin - * @version 4.3.7.2 + * @version 4.6.3 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties &styleFormats=Custom Style Formats;textarea;Title,cssClass|Title2,cssClass &customParams=Custom Parameters (Be careful or leave empty!);textarea; &entityEncoding=Entity Encoding;list;named,numeric,raw;named &entities=Entities;text; &pathOptions=Path Options;list;Site config,Absolute path,Root relative,URL,No convert;Site config &resizing=Advanced Resizing;list;true,false;false &disabledButtons=Disabled Buttons;text; &webTheme=Web Theme;test;webuser &webPlugins=Web Plugins;text; &webButtons1=Web Buttons 1;text;bold italic underline strikethrough removeformat alignleft aligncenter alignright &webButtons2=Web Buttons 2;text;link unlink image undo redo &webButtons3=Web Buttons 3;text; &webButtons4=Web Buttons 4;text; &webAlign=Web Toolbar Alignment;list;ltr,rtl;ltr &width=Width;text;100% &height=Height;text;400px &introtextRte=Introtext RTE
                              add richtext-features to "introtext";list;enabled,disabled;disabled &inlineMode=Inline-Mode;list;enabled,disabled;disabled &inlineTheme=Inline-Mode
                              Theme;text;inline &browser_spellcheck=Browser Spellcheck
                              At least one dictionary must be installed inside your browser;list;enabled,disabled;disabled + * @internal @properties &styleFormats=Custom Style Formats RAW

                              • leave empty to use below block/inline formats
                              • allows simple-format: Title,cssClass|Title2,cssClass2
                              • Also accepts full JSON-config as per TinyMCE4 docs / configure / content-formating / style_formats
                              ;textarea; &styleFormats_inline=Custom Style Formats INLINE

                              • will wrap selected text with span-tag + css-class
                              • simple-format only
                              ;textarea;InlineTitle,cssClass1|InlineTitle2,cssClass2 &styleFormats_block=Custom Style Formats BLOCK

                              • will add css-class to selected block-element
                              • simple-format only
                              ;textarea;BlockTitle,cssClass3|BlockTitle2,cssClass4 &customParams=Custom Parameters
                              (Be careful or leave empty!);textarea; &entityEncoding=Entity Encoding;list;named,numeric,raw;named &entities=Entities;text; &pathOptions=Path Options;list;Site config,Absolute path,Root relative,URL,No convert;Site config &resizing=Advanced Resizing;list;true,false;false &disabledButtons=Disabled Buttons;text; &webTheme=Web Theme;test;webuser &webPlugins=Web Plugins;text; &webButtons1=Web Buttons 1;text;bold italic underline strikethrough removeformat alignleft aligncenter alignright &webButtons2=Web Buttons 2;text;link unlink image undo redo &webButtons3=Web Buttons 3;text; &webButtons4=Web Buttons 4;text; &webAlign=Web Toolbar Alignment;list;ltr,rtl;ltr &width=Width;text;100% &height=Height;text;400px &introtextRte=Introtext RTE
                              add richtext-features to "introtext";list;enabled,disabled;disabled &inlineMode=Inline-Mode;list;enabled,disabled;disabled &inlineTheme=Inline-Mode
                              Theme;text;inline &browser_spellcheck=Browser Spellcheck
                              At least one dictionary must be installed inside your browser;list;enabled,disabled;disabled * @internal @events OnLoadWebDocument,OnParseDocument,OnWebPagePrerender,OnLoadWebPageCache,OnRichTextEditorRegister,OnRichTextEditorInit,OnInterfaceSettingsRender * @internal @modx_category Manager and Admin * @internal @installset base @@ -16,7 +16,7 @@ * @documentation Plugin docs https://github.com/extras-evolution/tinymce4-for-modx-evo * @documentation Official TinyMCE4-docs https://www.tinymce.com/docs/ * @author Deesen - * @lastupdate 2016-10-06 + * @lastupdate 2017-01-27 */ require MODX_BASE_PATH.'assets/plugins/tinymce4/plugin.tinymce.php'; \ No newline at end of file diff --git a/install/assets/plugins/transalias.tpl b/install/assets/plugins/transalias.tpl index 8ce950833e..60c7728659 100644 --- a/install/assets/plugins/transalias.tpl +++ b/install/assets/plugins/transalias.tpl @@ -10,7 +10,7 @@ * @package modx * @subpackage modx.plugins.transalias * @author Olivier B. Deland, additions by Mike Schell, rfoster - * @internal @properties &table_name=Trans table;list;common,russian,dutch,german,czech,utf8,utf8lowercase;utf8lowercase &char_restrict=Restrict alias to;list;lowercase alphanumeric,alphanumeric,legal characters;legal characters &remove_periods=Remove Periods;list;Yes,No;No &word_separator=Word Separator;list;dash,underscore,none;dash &override_tv=Override TV name;string; + * @internal @properties &table_name=Trans table;list;common,russian,dutch,german,czech,utf8,utf8lowercase;russian &char_restrict=Restrict alias to;list;lowercase alphanumeric,alphanumeric,legal characters;lowercase alphanumeric &remove_periods=Remove Periods;list;Yes,No;No &word_separator=Word Separator;list;dash,underscore,none;dash &override_tv=Override TV name;string; * @internal @events OnStripAlias * @internal @modx_category Manager and Admin * @internal @installset base, sample diff --git a/install/assets/plugins/userHelper.tpl b/install/assets/plugins/userHelper.tpl new file mode 100644 index 0000000000..2c08da34b2 --- /dev/null +++ b/install/assets/plugins/userHelper.tpl @@ -0,0 +1,14 @@ +// + * @internal @input_default + * @internal @output_widget + * @internal @output_widget_params + * @internal @lock_tv 0 + * @internal @template_assignments Home + * @internal @modx_category SEO + * @internal @installset sample + */ \ No newline at end of file diff --git a/install/assets/tvs/titl.tpl b/install/assets/tvs/titl.tpl new file mode 100644 index 0000000000..09f6a0e08f --- /dev/null +++ b/install/assets/tvs/titl.tpl @@ -0,0 +1,18 @@ +/** + * titl + * + * Meta title + * + * @category tv + * @name titl + * @internal @caption Meta title + * @internal @input_type text + * @internal @input_options + * @internal @input_default [*pagetitle*] - [(site_name)] + * @internal @output_widget + * @internal @output_widget_params + * @internal @lock_tv 0 + * @internal @template_assignments Home + * @internal @modx_category SEO + * @internal @installset sample + */ \ No newline at end of file diff --git a/install/config.inc.tpl b/install/config.inc.tpl index 6471955c27..a2549ec2de 100644 --- a/install/config.inc.tpl +++ b/install/config.inc.tpl @@ -64,7 +64,8 @@ if (!empty($site_hostnames[0]) && !in_array($site_hostname, $site_hostnames)) { } // assign site_url -$site_url= ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port) ? 'https://' : 'http://'; +$secured = (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'); +$site_url= ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port || $secured ) ? 'https://' : 'http://'; $site_url .= $site_hostname; if ($_SERVER['SERVER_PORT'] != 80) $site_url= str_replace(':' . $_SERVER['SERVER_PORT'], '', $site_url); // remove port from HTTP_HOST   @@ -87,7 +88,7 @@ if(!function_exists('startCMSSession')) { $site_sessionname = 'evo' . $_; function removeInvalidCmsSessionFromStorage(&$storage, $session_name) { - if (isset($storage[$session_name]) && $storage[$session_name] === '') + if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) { unset($storage[$session_name]); } diff --git a/install/index.php b/install/index.php old mode 100755 new mode 100644 index c207ca22a9..71ef4b2de7 --- a/install/index.php +++ b/install/index.php @@ -8,6 +8,11 @@ @ ini_set('magic_quotes_sybase', 0); } +$autoloader = '../vendor/autoload.php'; +if (file_exists($autoloader) && is_readable($autoloader)) { + include_once($autoloader); +} + $self = 'install/index.php'; $base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); require_once("{$base_path}install/functions.php"); diff --git a/install/instprocessor.php b/install/instprocessor.php old mode 100755 new mode 100644 index a54bd6474a..e8f643d1fc --- a/install/instprocessor.php +++ b/install/instprocessor.php @@ -490,7 +490,7 @@ function parseProperties($propertyString) { $name = mysqli_real_escape_string($conn, $moduleModule[0]); $desc = mysqli_real_escape_string($conn, $moduleModule[1]); $filecontent = $moduleModule[2]; - $properties = mysqli_real_escape_string($conn, $moduleModule[3]); + $properties = $moduleModule[3]; $guid = mysqli_real_escape_string($conn, $moduleModule[4]); $shared = mysqli_real_escape_string($conn, $moduleModule[5]); $category = mysqli_real_escape_string($conn, $moduleModule[6]); @@ -507,13 +507,14 @@ function parseProperties($propertyString) { $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'"); if (mysqli_num_rows($rs)) { $row = mysqli_fetch_assoc($rs); - $props = propUpdate($properties,mysqli_real_escape_string($conn, $row['properties'])); + $props = mysqli_real_escape_string($conn, propUpdate($properties,$row['properties'])); if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) { echo "

                              " . mysqli_error($sqlParser->conn) . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { + $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); if (!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { echo "

                              " . mysqli_error($sqlParser->conn) . "

                              "; return; @@ -535,7 +536,7 @@ function parseProperties($propertyString) { $name = mysqli_real_escape_string($conn, $modulePlugin[0]); $desc = mysqli_real_escape_string($conn, $modulePlugin[1]); $filecontent = $modulePlugin[2]; - $properties = mysqli_real_escape_string($conn, $modulePlugin[3]); + $properties = $modulePlugin[3]; $events = explode(",", $modulePlugin[4]); $guid = mysqli_real_escape_string($conn, $modulePlugin[5]); $category = mysqli_real_escape_string($conn, $modulePlugin[6]); @@ -565,7 +566,7 @@ function parseProperties($propertyString) { if (mysqli_num_rows($rs)) { $insert = true; while($row = mysqli_fetch_assoc($rs)) { - $props = propUpdate($properties,mysqli_real_escape_string($conn, $row['properties'])); + $props = mysqli_real_escape_string($conn, propUpdate($properties,$row['properties'])); if($row['description'] == $desc){ if (! mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) { echo "

                              " . mysqli_error($sqlParser->conn) . "

                              "; @@ -580,6 +581,7 @@ function parseProperties($propertyString) { } } if($insert === true) { + $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); if(!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);")) { echo "

                              ".mysqli_error($sqlParser->conn)."

                              "; return; @@ -587,6 +589,7 @@ function parseProperties($propertyString) { } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { + $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); if (!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);")) { echo "

                              " . mysqli_error($sqlParser->conn) . "

                              "; return; @@ -620,7 +623,7 @@ function parseProperties($propertyString) { $name = mysqli_real_escape_string($conn, $moduleSnippet[0]); $desc = mysqli_real_escape_string($conn, $moduleSnippet[1]); $filecontent = $moduleSnippet[2]; - $properties = mysqli_real_escape_string($conn, $moduleSnippet[3]); + $properties = $moduleSnippet[3]; $category = mysqli_real_escape_string($conn, $moduleSnippet[4]); if (!file_exists($filecontent)) echo "

                                $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

                              "; @@ -635,13 +638,14 @@ function parseProperties($propertyString) { $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'"); if (mysqli_num_rows($rs)) { $row = mysqli_fetch_assoc($rs); - $props = propUpdate($properties,mysqli_real_escape_string($conn, $row['properties'])); + $props = mysqli_real_escape_string($conn, propUpdate($properties,$row['properties'])); if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { echo "

                              " . mysqli_error($sqlParser->conn) . "

                              "; return; } echo "

                                $name: " . $_lang['upgraded'] . "

                              "; } else { + $properties = mysqli_real_escape_string($conn, parseProperties($properties, true)); if (!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { echo "

                              " . mysqli_error($sqlParser->conn) . "

                              "; return; @@ -777,34 +781,71 @@ function parseProperties($propertyString) { // Property Update function function propUpdate($new,$old){ - // Split properties up into arrays - $returnArr = array(); - $newArr = explode("&",$new); - $oldArr = explode("&",$old); - $return = ''; - - foreach ($newArr as $k => $v) { - if(!empty($v)){ - $tempArr = explode("=",trim($v)); - $returnArr[$tempArr[0]] = $tempArr[1]; - } - } - foreach ($oldArr as $k => $v) { - if(!empty($v)){ - $tempArr = explode("=",trim($v)); - $returnArr[$tempArr[0]] = $tempArr[1]; + $newArr = parseProperties($new); + $oldArr = parseProperties($old); + foreach ($oldArr as $k => $v){ + if (isset($v['0']['options'])){ + $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; } } + $return = $oldArr + $newArr; + $return = json_encode($return, JSON_UNESCAPED_UNICODE); + $return = ($return != '[]') ? $return : ''; + return $return; +} - // Make unique array - $returnArr = array_unique($returnArr); +function parseProperties($propertyString, $json=false) { + $propertyString = str_replace('{}', '', $propertyString ); + $propertyString = str_replace('} {', ',', $propertyString ); - // Build new string for new properties value - foreach ($returnArr as $k => $v) { - $return .= "&$k=$v "; + if(empty($propertyString)) return array(); + if($propertyString=='{}' || $propertyString=='[]') return array(); + + $jsonFormat = isJson($propertyString, true); + $property = array(); + // old format + if ( $jsonFormat === false) { + $props= explode('&', $propertyString); + $arr = array(); + $key = array(); + foreach ($props as $prop) { + if ($prop != ''){ + $arr = explode(';', $prop); + $key = explode('=', $arr['0']); + $property[$key['0']]['0']['label'] = trim($key['1']); + $property[$key['0']]['0']['type'] = trim($arr['1']); + switch ($arr['1']) { + case 'list': + case 'list-multi': + case 'checkbox': + case 'radio': + case 'menu': + $property[$key['0']]['0']['value'] = trim($arr['3']); + $property[$key['0']]['0']['options'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['3']); + break; + default: + $property[$key['0']]['0']['value'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['2']); + } + $property[$key['0']]['0']['desc'] = ''; + } + + } + // new json-format + } else if(!empty($jsonFormat)){ + $property = $jsonFormat; + } + if ($json) { + $property = json_encode($property, JSON_UNESCAPED_UNICODE); } + $property = ($property != '[]') ? $property : ''; + return $property; +} - return $return; +function isJson($string, $returnData=false) { + $data = json_decode($string, true); + return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; } function getCreateDbCategory($category, $sqlParser) { diff --git a/install/setup.sql b/install/setup.sql index 175c27dbaa..71c1639251 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -42,6 +42,7 @@ CREATE TABLE `{PREFIX}active_user_sessions` ( CREATE TABLE IF NOT EXISTS `{PREFIX}categories` ( `id` integer NOT NULL AUTO_INCREMENT, `category` varchar(45) NOT NULL DEFAULT '', + `rank` INT(5) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY(`id`) ) ENGINE=MyISAM COMMENT='Categories to be used snippets,tv,chunks, etc'; @@ -441,6 +442,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}user_roles` ( `change_password` int(1) NOT NULL default '0', `error_dialog` int(1) NOT NULL default '0', `about` int(1) NOT NULL default '0', + `category_manager` int(1) NOT NULL default '0', `file_manager` int(1) NOT NULL default '0', `assets_files` int(1) NOT NULL default '0', `assets_images` int(1) NOT NULL default '0', @@ -637,6 +639,12 @@ ALTER TABLE `{PREFIX}user_roles` ALTER TABLE `{PREFIX}user_roles` ADD COLUMN `assets_files` INT(1) NOT NULL DEFAULT '1' AFTER `assets_images`; +ALTER TABLE `{PREFIX}user_roles` + ADD COLUMN `category_manager` INT(1) NOT NULL DEFAULT '0' AFTER `about`; + +ALTER TABLE `{PREFIX}categories` + ADD COLUMN `rank` INT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `category`; + ALTER TABLE `{PREFIX}web_user_attributes` ADD COLUMN `street` varchar(255) NOT NULL DEFAULT '' AFTER `country`; @@ -847,13 +855,13 @@ REPLACE INTO `{PREFIX}manager_users` REPLACE INTO `{PREFIX}user_attributes` (id, internalKey, fullname, role, email, phone, mobilephone, blocked, blockeduntil, blockedafter, logincount, lastlogin, thislogin, failedlogincount, sessionid, dob, gender, country, street, city, state, zip, fax, photo, comment) VALUES -(1, 1, 'Default admin account', 1, '{ADMINEMAIL}', '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '','', '', '', '', ''); +(1, 1, 'Default admin account', 1, '{ADMINEMAIL}', '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '', '', '', ''); REPLACE INTO `{PREFIX}user_roles` -(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,manage_metatags,edit_doc_metatags,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks) VALUES -(2,'Editor','Limited to managing content',1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1), -(3,'Publisher','Editor with expanded permissions including manage users\, update Elements and site settings',1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1); +(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,manage_metatags,edit_doc_metatags,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks,category_manager) VALUES +(2,'Editor','Limited to managing content',1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0), +(3,'Publisher','Editor with expanded permissions including manage users\, update Elements and site settings',1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,0); # ]]non-upgrade-able @@ -877,9 +885,11 @@ INSERT IGNORE INTO `{PREFIX}system_settings` ('auto_template_logic','{AUTOTEMPLATELOGIC}'), ('default_template','3'), ('old_template',''), -('cache_type','1'), -('use_udperms','1'), -('udperms_allowroot','0'), +('publish_default','1'), +('friendly_urls','1'), +('friendly_alias_urls','1'), +('use_alias_path','1'), +('cache_type','2'), ('failed_login_attempts','3'), ('blocked_minutes','60'), ('use_captcha','0'), @@ -887,12 +897,28 @@ INSERT IGNORE INTO `{PREFIX}system_settings` ('use_editor','1'), ('use_browser','1'), ('fe_editor_lang','{MANAGERLANGUAGE}'), +('fck_editor_toolbar','standard'), +('fck_editor_autolang','0'), +('editor_css_path',''), +('editor_css_selectors',''), +('upload_maxsize','10485760'), +('manager_layout','4'), +('auto_menuindex','1'), ('session.cookie.lifetime','604800'), +('mail_check_timeperiod','600'), +('manager_direction','ltr'), +('xhtml_urls','0'), +('automatic_alias','1'), +('datetime_format','dd-mm-YYYY'), +('warning_visibility', '0'), +('remember_last_tab', '1'), +('enable_bindings', '1'), +('seostrict', '1'), ('theme_refresher',''); REPLACE INTO `{PREFIX}user_roles` -(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,manage_metatags,edit_doc_metatags,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks) VALUES -(1, 'Administrator', 'Site administrators have full access to all functions',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +(id,name,description,frames,home,view_document,new_document,save_document,publish_document,delete_document,empty_trash,action_ok,logout,help,messages,new_user,edit_user,logs,edit_parser,save_parser,edit_template,settings,credits,new_template,save_template,delete_template,edit_snippet,new_snippet,save_snippet,delete_snippet,edit_chunk,new_chunk,save_chunk,delete_chunk,empty_cache,edit_document,change_password,error_dialog,about,file_manager,save_user,delete_user,save_password,edit_role,save_role,delete_role,new_role,access_permissions,bk_manager,new_plugin,edit_plugin,save_plugin,delete_plugin,new_module,edit_module,save_module,exec_module,delete_module,view_eventlog,delete_eventlog,manage_metatags,edit_doc_metatags,new_web_user,edit_web_user,save_web_user,delete_web_user,web_access_permissions,view_unpublished,import_static,export_static,remove_locks,assets_images,assets_files,change_resourcetype,display_locks,category_manager) VALUES +(1, 'Administrator', 'Site administrators have full access to all functions',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); # 1 - "Parser Service Events", 2 - "Manager Access Events", 3 - "Web Access Service Events", 4 - "Cache Service Events", 5 - "Template Service Events", 6 - Custom Events diff --git a/manager/actions/access_permissions.dynamic.php b/manager/actions/access_permissions.dynamic.php index 4ff85d0e79..bb3d717022 100644 --- a/manager/actions/access_permissions.dynamic.php +++ b/manager/actions/access_permissions.dynamic.php @@ -1,278 +1,264 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('access_permissions')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table names (alphabetical) -$tbl_document_groups = $modx->getFullTableName('document_groups'); +$tbl_document_groups = $modx->getFullTableName('document_groups'); $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); -$tbl_manager_users = $modx->getFullTableName('manager_users'); -$tbl_member_groups = $modx->getFullTableName('member_groups'); -$tbl_membergroup_access = $modx->getFullTableName('membergroup_access'); -$tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); -$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_manager_users = $modx->getFullTableName('manager_users'); +$tbl_member_groups = $modx->getFullTableName('member_groups'); +$tbl_membergroup_access = $modx->getFullTableName('membergroup_access'); +$tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); +$tbl_site_content = $modx->getFullTableName('site_content'); // find all document groups, for the select :) -$rs = $modx->db->select('*',$tbl_documentgroup_names,'','name'); -if ($modx->db->getRecordCount($rs) < 1) { +$rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name'); +if($modx->db->getRecordCount($rs) < 1) { $docgroupselector = '[no groups to add]'; } else { - $docgroupselector = '' . "\n"; + while($row = $modx->db->getRow($rs)) { + $docgroupselector .= "\t" . '\n"; } $docgroupselector .= "\n"; } -$rs = $modx->db->select('*',$tbl_membergroup_names,'','name'); -if ($modx->db->getRecordCount($rs) < 1) { +$rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name'); +if($modx->db->getRecordCount($rs) < 1) { $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '' . "\n"; + while($row = $modx->db->getRow($rs)) { + $usrgroupselector .= "\t" . '\n"; } $usrgroupselector .= "\n"; } ?> - -

                              - - - - - - +

                              +

                              -

                              '.$_lang['access_permissions_off'].'

                              ' : ''?> - -
                              - +
                              + -
                              -

                              - - +

                              + + '.$_lang['access_permissions_users_tab'].'

                              '; + echo '

                              ' . $_lang['access_permissions_users_tab'] . '

                              '; -?> - - - - - -
                              -
                              - - -   - -
                              -
                              -
                              -db->select( - 'groupnames.*, users.id AS user_id, users.username user_name', - "{$tbl_membergroup_names} AS groupnames + ?> + + + + + + + + + +
                              +
                              + + +   + +
                              +
                              +
                              + db->select('groupnames.*, users.id AS user_id, users.username user_name', "{$tbl_membergroup_names} AS groupnames LEFT JOIN {$tbl_member_groups} AS groups ON groups.user_group = groupnames.id - LEFT JOIN {$tbl_manager_users} AS users ON users.id = groups.member", - '', - 'groupnames.name, user_name' - ); - if ($modx->db->getRecordCount($rs) < 1) { - echo ''.$_lang['no_groups_found'].''; - } else { - echo "
                                \n"; - $pid = ''; - while ($row = $modx->db->getRow($rs)) { - if ($row['id'] !== $pid) { - if ($pid != '') echo "
                              \n"; // close previous one + LEFT JOIN {$tbl_manager_users} AS users ON users.id = groups.member", '', 'groupnames.name, user_name'); + if($modx->db->getRecordCount($rs) < 1) { + echo '' . $_lang['no_groups_found'] . ''; + } else { + echo "
                                \n"; + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] !== $pid) { + if($pid != '') { + echo "
                              \n"; + } // close previous one - // display the current user group with a rename/delete form - echo '
                            • '."\n". - "\t".''."\n". - "\t".''."\n". - "\t".''."\n". - "\t".' '."\n". - "\t".' '."\n". - "\t".''."\n". - '
                              '; + // display the current user group with a rename/delete form + echo '
                            • ' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n" . "\t" . ' ' . "\n" . "\t" . ' ' . "\n" . "\t" . '' . "\n" . '
                              '; - echo "
                                \n"; - echo "\t
                              • ".$_lang['access_permissions_users_in_group'].' '; - } - if (!$row['user_id']) { - // no users in group - echo ''.$_lang['access_permissions_no_users_in_group'].''; - $pid = $row['id']; - continue; + echo "
                                  \n"; + echo "\t
                                • " . $_lang['access_permissions_users_in_group'] . ' '; + } + if(!$row['user_id']) { + // no users in group + echo '' . $_lang['access_permissions_no_users_in_group'] . ''; + $pid = $row['id']; + continue; + } + if($pid == $row['id']) { + echo ', '; + } // comma separation :) + echo '' . $row['user_name'] . ''; + $pid = $row['id']; + } + echo "
                              • \n"; + echo "
                              \n"; } - if ($pid == $row['id']) echo ', '; // comma separation :) - echo ''.$row['user_name'].''; - $pid = $row['id']; - } - echo "
                            • \n"; - echo "\n"; - } -?> -
                              - + ?> +
                              -
                              -

                              - - +

                              + + '.$_lang['access_permissions_resources_tab'].'

                              '; -?> - - - - - -
                              -
                              - - -   - -
                              -
                              -
                              -db->select( - 'dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', - "{$tbl_documentgroup_names} AS dgnames + echo '

                              ' . $_lang['access_permissions_resources_tab'] . '

                              '; + ?> + + + + + + + + + +
                              +
                              + + +   + +
                              +
                              +
                              + db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', "{$tbl_documentgroup_names} AS dgnames LEFT JOIN {$tbl_document_groups} AS dg ON dg.document_group = dgnames.id - LEFT JOIN {$tbl_site_content} AS sc ON sc.id = dg.document", - "", - "dgnames.name, sc.id" - ); - if ($modx->db->getRecordCount($rs) < 1) { - echo ''.$_lang['no_groups_found'].''; - } else { - echo ''."\n". - "\t".''."\n". - "\t".''."\n". - "\t".''."\n"; - $pid = ''; - while ($row = $modx->db->getRow($rs)) { - if ($row['id'] !== $pid) { - if ($pid != '') echo "\n"; // close previous one + LEFT JOIN {$tbl_site_content} AS sc ON sc.id = dg.document", "", "dgnames.name, sc.id"); + if($modx->db->getRecordCount($rs) < 1) { + echo '' . $_lang['no_groups_found'] . ''; + } else { + echo '
                              '.$_lang['access_permissions_resource_groups'].'
                              ' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n"; + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] !== $pid) { + if($pid != '') { + echo "\n"; + } // close previous one - echo '
                              ' . $_lang['access_permissions_resource_groups'] . '
                              '."\n". - "\t".''."\n". - "\t".''."\n". - "\t".''."\n". - "\t".' '."\n". - "\t".''."\n". - "\t".''."\n". - '
                              '; + echo '
                              ' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n" . "\t" . ' ' . "\n" . "\t" . '' . "\n" . "\t" . '' . "\n" . '
                              '; - echo '
                              '.$_lang['access_permissions_resources_in_group'].' '; - } - if (!$row['doc_id']) { - // no documents in group - echo $_lang['access_permissions_no_resources_in_group']; - $pid = $row['id']; - continue; + echo '
                              ' . $_lang['access_permissions_resources_in_group'] . ' '; + } + if(!$row['doc_id']) { + // no documents in group + echo $_lang['access_permissions_no_resources_in_group']; + $pid = $row['id']; + continue; + } + if($pid == $row['id']) { + echo ", \n"; + } + echo '' . $row['doc_id'] . ''; + $pid = $row['id']; + } + echo '
                              '; } - if ($pid == $row['id']) echo ", \n"; - echo ''.$row['doc_id'].''; - $pid = $row['id']; - } - echo ''; - } -?> -
                              + ?> +
                              -
                              -

                              - - +

                              + + '.$_lang['access_permissions_links_tab'].'

                              '; + echo '

                              ' . $_lang['access_permissions_links_tab'] . '

                              '; - $rs = $modx->db->select( - "groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name", - "{$tbl_membergroup_names} AS groupnames + $rs = $modx->db->select("groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name", "{$tbl_membergroup_names} AS groupnames LEFT JOIN {$tbl_membergroup_access} AS groupacc ON groupacc.membergroup = groupnames.id - LEFT JOIN {$tbl_documentgroup_names} AS dgnames ON dgnames.id = groupacc.documentgroup", - '', - 'name, dg_name' - ); - if ($modx->db->getRecordCount($rs) < 1) { - echo ''.$_lang['no_groups_found'].'
                              '; - } else { - ?> - - - - - -
                              -
                              - - - - - - - -
                              -
                              -
                              - \n"; - $pid = ''; - while ($row = $modx->db->getRow($rs)) { - if ($row['id'] != $pid) { - if ($pid != '') echo "\n"; // close previous one - echo '
                            • '.$row['name'].''; + LEFT JOIN {$tbl_documentgroup_names} AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); + if($modx->db->getRecordCount($rs) < 1) { + echo '' . $_lang['no_groups_found'] . '
                              '; + } else { + ?> + + + + + + + + + +
                              +
                              + + + + + + + +
                              +
                              +
                              + \n"; + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] != $pid) { + if($pid != '') { + echo "
                            • \n"; + } // close previous one + echo '
                            • ' . $row['name'] . ''; + + if(!$row['dg_id']) { + echo ' » ' . $_lang['no_groups_found'] . "
                            • \n"; + $pid = ''; + continue; + } else { + echo "
                                \n"; + } + } + if(!$row['dg_id']) { + continue; + } + echo "\t
                              • " . $row['dg_name']; + echo ' ('; + echo $_lang['remove'] . ')'; + echo "
                              • \n"; - if (!$row['dg_id']) { - echo ' » '.$_lang['no_groups_found']."\n"; - $pid = ''; - continue; - } else { - echo "
                                  \n"; + $pid = $row['id']; } + echo '
                                '; } - if (!$row['dg_id']) continue; - echo "\t
                              • ".$row['dg_name']; - echo ' ('; - echo $_lang['remove'].')'; - echo "
                              • \n"; + ?> +
                              - $pid = $row['id']; - } - echo ''; - } -?> -
                              - -
                              +
                              diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 5dfc74ab40..f426d762b0 100644 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -1,56 +1,50 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('bk_manager')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$dbase = trim($dbase,'`'); +$dbase = trim($dbase, '`'); -if(!isset($modx->config['snapshot_path'])) -{ - if(is_dir(MODX_BASE_PATH . 'temp/backup/')) $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/'; - else $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/'; +if(!isset($modx->config['snapshot_path'])) { + if(is_dir(MODX_BASE_PATH . 'temp/backup/')) { + $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/'; + } else { + $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/'; + } } // Backup Manager by Raymond: $mode = isset($_POST['mode']) ? $_POST['mode'] : ''; -if ($mode=='restore1') -{ - if(isset($_POST['textarea']) && !empty($_POST['textarea'])) - { +if($mode == 'restore1') { + if(isset($_POST['textarea']) && !empty($_POST['textarea'])) { $source = trim($_POST['textarea']); $_SESSION['textarea'] = $source . "\n"; - } - else - { + } else { $source = file_get_contents($_FILES['sqlfile']['tmp_name']); } import_sql($source); header('Location: index.php?r=9&a=93'); exit; -} -elseif ($mode=='restore2') -{ +} elseif($mode == 'restore2') { $path = $modx->config['snapshot_path'] . $_POST['filename']; - if(file_exists($path)) - { + if(file_exists($path)) { $source = file_get_contents($path); import_sql($source); - if (headers_sent()) { - echo "\n"; + if(headers_sent()) { + echo "\n"; } else { - header("Location: index.php?r=9&a=93"); + header("Location: index.php?r=9&a=93"); } } exit; -} -elseif ($mode=='backup') -{ +} elseif($mode == 'backup') { $tables = isset($_POST['chk']) ? $_POST['chk'] : ''; - if (!is_array($tables)) - { + if(!is_array($tables)) { $modx->webAlertAndQuit("Please select a valid table from the list below."); } @@ -64,80 +58,66 @@ $dumper->setDBtables($tables); $dumper->setDroptables((isset($_POST['droptables']) ? true : false)); $dumpfinished = $dumper->createDump('dumpSql'); - if($dumpfinished) - { + if($dumpfinished) { exit; - } - else - { + } else { $modx->webAlertAndQuit('Unable to Backup Database'); } // MySQLdumper class can be found below -} -elseif ($mode=='snapshot') -{ - if(!is_dir(rtrim($modx->config['snapshot_path'],'/'))) - { - mkdir(rtrim($modx->config['snapshot_path'],'/')); - @chmod(rtrim($modx->config['snapshot_path'],'/'), 0777); +} elseif($mode == 'snapshot') { + if(!is_dir(rtrim($modx->config['snapshot_path'], '/'))) { + mkdir(rtrim($modx->config['snapshot_path'], '/')); + @chmod(rtrim($modx->config['snapshot_path'], '/'), 0777); } - if(!is_file("{$modx->config['snapshot_path']}.htaccess")) - { + if(!is_file("{$modx->config['snapshot_path']}.htaccess")) { $htaccess = "order deny,allow\ndeny from all\n"; - file_put_contents("{$modx->config['snapshot_path']}.htaccess",$htaccess); + file_put_contents("{$modx->config['snapshot_path']}.htaccess", $htaccess); } - if(!is_writable(rtrim($modx->config['snapshot_path'],'/'))) - { - $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"],array('snapshot_path'=>$modx->config['snapshot_path']))); + if(!is_writable(rtrim($modx->config['snapshot_path'], '/'))) { + $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path']))); } - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; $rs = $modx->db->query($sql); - $tables = $modx->db->getColumn('Name', $rs); + $tables = $modx->db->getColumn('Name', $rs); //$today = $modx->toDateFormat(time()); //$today = str_replace(array('/',' '), '-', $today); //$today = str_replace(':', '', $today); //$today = strtolower($today); - $today = date('Y-m-d_H-i-s'); - global $path; + $today = date('Y-m-d_H-i-s'); + global $path; $path = "{$modx->config['snapshot_path']}{$today}.sql"; - + @set_time_limit(120); // set timeout limit to 2 minutes $dumper = new Mysqldumper($database_server, $database_user, $database_password, $dbase); $dumper->setDBtables($tables); $dumper->setDroptables(true); $dumpfinished = $dumper->createDump('snapshot'); - + $pattern = "{$modx->config['snapshot_path']}*.sql"; - $files = glob($pattern,GLOB_NOCHECK); + $files = glob($pattern, GLOB_NOCHECK); $total = ($files[0] !== $pattern) ? count($files) : 0; arsort($files); - while(10 < $total && $limit < 50) - { + while(10 < $total && $limit < 50) { $del_file = array_pop($files); unlink($del_file); $total = count($files); $limit++; } - - if($dumpfinished) - { + + if($dumpfinished) { $_SESSION['result_msg'] = 'snapshot_ok'; header("Location: index.php?a=93"); exit; } else { $modx->webAlertAndQuit('Unable to Backup Database'); } -} -else -{ +} else { include_once "header.inc.php"; // start normal header } -if(isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') -{ - switch($_SESSION['result_msg']) - { +if(isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') { + switch($_SESSION['result_msg']) { case 'import_ok': $ph['result_msg_import'] = '
                              ' . $_lang["bkmgr_import_ok"] . '
                              '; $ph['result_msg_snapshot'] = '
                              ' . $_lang["bkmgr_import_ok"] . '
                              '; @@ -148,336 +128,341 @@ break; } $_SESSION['result_msg'] = ''; -} -else -{ +} else { $ph['result_msg_import'] = ''; $ph['result_msg_snapshot'] = ''; } ?> - - -

                              - - - - - - -

                              - -
                              - -
                              - -
                              -
                              - -
                              -

                              - -
                              - -

                              - -

                              -

                              - - - - - - - - - - - - - db->escape($modx->db->config['table_prefix'])."%'"; -$rs = $modx->db->query($sql); -$i = 0; -while ($db_status = $modx->db->getRow($rs)) { - $bgcolor = ($i++ % 2) ? '#EEEEEE' : '#FFFFFF'; - - if (isset($tables)) - $table_string = implode(',', $table); - else $table_string = ''; - - echo ''."\n". - ''."\n". - ''."\n"; - echo ''."\n"; - - // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty - $truncateable = array( - $modx->db->config['table_prefix'].'event_log', - $modx->db->config['table_prefix'].'manager_log', - ); - if($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { - echo ''."\n"; - } else { - echo ''."\n"; - } - if($modx->hasPermission('settings')) { - echo ''."\n"; - } else { - echo ''."\n"; - } - - echo ''."\n". - ''."\n". - ''."\n". - ""; - - $total = $total+$db_status['Index_length']+$db_status['Data_length']; - $totaloverhead = $totaloverhead+$db_status['Data_free']; -} -?> - - - - - - - - -
                              '.$db_status['Rows'].''.$db_status['Collation'].''. - ''.$modx->nicesize($db_status['Data_length']+$db_status['Data_free']).''. - ''.$modx->nicesize($db_status['Data_length']+$db_status['Data_free']).''.($db_status['Data_free'] > 0 ? - ''.$modx->nicesize($db_status['Data_free']).'' : - '-'). - ''.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').''.$modx->nicesize($db_status['Data_length']-$db_status['Data_free']).''.$modx->nicesize($db_status['Index_length']).''.$modx->nicesize($db_status['Index_length']+$db_status['Data_length']+$db_status['Data_free']).'
                               0 ? ''.$modx->nicesize($totaloverhead).'
                              ('.number_format($totaloverhead).' B)' : '-'?>
                               ".$modx->nicesize($total)."
                              (".number_format($total)." B)"?>
                              - 0) { - echo '

                              '.$_lang['database_overhead'].'

                              '; -} -?> -
                              -
                              - - -
                              -

                              - - -
                              - -
                              -
                              - - - -$v) - { - $title[] = $k; - } - $result = '' . implode('',$title) . ''; - foreach($last_result as $row) - { - $result_value = array(); - if($row) - { - foreach($row as $k=>$v) - { - $result_value[] = $v; - } - $result .= '' . implode('',$result_value) . ''; + function confirmRevert(filename) { + var m = ''; + m = m.replace('[+filename+]', filename); + var c = confirm(m); + if(c) { + document.restore2.filename.value = filename; + document.restore2.save.click(); } } - $style = ''; - $result = $style . '' . $result . '
                              '; - } -} + -function checked($cond) -{ - if($cond) return ' checked'; -} -?> -

                              - - -

                              -
                              -
                              - -
                              -
                              - icons_save" /> + + +

                              + +

                              + +
                              +
                              - - -

                              ' . $result . '
                              '; -?> -
                              - -
                              -

                              - - -
                              - "snapshot_path={$modx->config['snapshot_path']}"));?> -
                              -
                              - - -
                              - - icons_save" /> - -
                              -
                              - -
                              -
                              -
                              - - - -config['snapshot_path']}*.sql"; -$files = glob($pattern,GLOB_NOCHECK); -$total = ($files[0] !== $pattern) ? count($files) : 0; -$detailFields = array('MODX Version', 'Host', 'Generation Time', 'Server version', 'PHP Version', 'Database', 'Description'); -if(is_array($files) && 0 < $total) -{ - echo ''; - echo "\n"; - arsort($files); - $tpl = '' . "\n"; - while ($file = array_shift($files)) - { - $filename = substr($file,strrpos($file,'/')+1); - $filesize = $modx->nicesize(filesize($file)); - - $file = fopen($file,"r"); - $count = 0; - $details = array(); - while($count < 11) { - $line = fgets($file); - foreach($detailFields as $label) { - $fileLabel = '# '.$label; - if (strpos($line, $fileLabel) !== false) { - $details[$label] = htmlentities(trim(str_replace(array($fileLabel,':','`'), '', $line)), ENT_QUOTES, $modx_manager_charset); - } - } - $count++; - }; - fclose($file); - - $tooltip = "Generation Time: ".$details["Generation Time"]."\n"; - $tooltip .= "Server version: ".$details["Server version"]."\n"; - $tooltip .= "PHP Version: ".$details["PHP Version"]."\n"; - $tooltip .= "Host: ".$details["Host"]."\n"; - - echo str_replace(array('[+filename+]','[+filesize+]','[+filedesc+]','[+modx_version+]','[+database_name+]','[+tooltip+]'),array($filename,$filesize,$details['Description'],$details['MODX Version'],$details['Database'],$tooltip),$tpl); - } - echo '
                              {$_lang["files_filename"]}{$_lang["files_filesize"]}{$_lang["description"]}{$_lang["modx_version"]}{$_lang["database_name"]}{$_lang["onlineusers_action"]}
                              [+filename+][+filesize+][+filedesc+][+modx_version+][+database_name+]' . $_lang["bkmgr_restore_submit"] . '
                              '; -} -else -{ - echo $_lang["bkmgr_snapshot_nothing"]; -} -?> - -
                              -
                              -
                              -
                              +
                              +
                              + + +
                              +

                              + +
                              + +

                              + +

                              +

                              + + + + + + + + + + + + + + + db->escape($modx->db->config['table_prefix']) . "%'"; + $rs = $modx->db->query($sql); + $i = 0; + while($db_status = $modx->db->getRow($rs)) { + $bgcolor = ($i++ % 2) ? '#EEEEEE' : '#FFFFFF'; + + if(isset($tables)) { + $table_string = implode(',', $table); + } else { + $table_string = ''; + } + + echo '' . "\n" . '' . "\n" . '' . "\n"; + echo '' . "\n"; + + // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty + $truncateable = array( + $modx->db->config['table_prefix'] . 'event_log', + $modx->db->config['table_prefix'] . 'manager_log', + ); + if($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { + echo '' . "\n"; + } else { + echo '' . "\n"; + } + + if($modx->hasPermission('settings')) { + echo '' . "\n"; + } else { + echo '' . "\n"; + } + + echo '' . "\n" . '' . "\n" . '' . "\n" . ""; + + $total = $total + $db_status['Index_length'] + $db_status['Data_length']; + $totaloverhead = $totaloverhead + $db_status['Data_free']; + } + ?> + + + + + + + + +
                              ' . $db_status['Rows'] . '' . $db_status['Collation'] . '' . '' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '' . '' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '' . ($db_status['Data_free'] > 0 ? '' . $modx->nicesize($db_status['Data_free']) . '' : '-') . '' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '' . $modx->nicesize($db_status['Index_length']) . '' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '
                                0 ? '' . $modx->nicesize($totaloverhead) . '
                              (' . number_format($totaloverhead) . ' B)' : '-' ?>
                               " . $modx->nicesize($total) . "
                              (" . number_format($total) . " B)" ?>
                              + 0) { + echo '

                              ' . $_lang['database_overhead'] . '

                              '; + } + ?> +
                              +
                              + + +
                              +

                              + + +
                              + +
                              +
                              + + + + + if(isset($_SESSION['last_result']) || !empty($_SESSION['last_result'])) { + $last_result = $_SESSION['last_result']; + unset($_SESSION['last_result']); + if(count($last_result) < 1) { + $result = ''; + } else { + $last_result = array_merge(array(), array_diff($last_result, array(''))); + foreach($last_result['0'] as $k => $v) { + $title[] = $k; + } + $result = '' . implode('', $title) . ''; + foreach($last_result as $row) { + $result_value = array(); + if($row) { + foreach($row as $k => $v) { + $result_value[] = $v; + } + $result .= '' . implode('', $result_value) . ''; + } + } + $style = ''; + $result = $style . '' . $result . '
                              '; + } + } + + function checked($cond) { + if($cond) { + return ' checked'; + } + } + + ?> +

                              + + +

                              +
                              +
                              + +
                              +
                              + +
                              + +
                              +

                              ' . $result . '
                              '; + } + ?> +
                              + +
                              +

                              + + +
                              + "snapshot_path={$modx->config['snapshot_path']}")); ?> +
                              +
                              + + +
                              + + + +
                              +
                              + +
                              +
                              +
                              + + + + config['snapshot_path']}*.sql"; + $files = glob($pattern, GLOB_NOCHECK); + $total = ($files[0] !== $pattern) ? count($files) : 0; + $detailFields = array( + 'MODX Version', + 'Host', + 'Generation Time', + 'Server version', + 'PHP Version', + 'Database', + 'Description' + ); + if(is_array($files) && 0 < $total) { + echo ''; + echo "\n"; + arsort($files); + $tpl = '' . "\n"; + while($file = array_shift($files)) { + $filename = substr($file, strrpos($file, '/') + 1); + $filesize = $modx->nicesize(filesize($file)); + + $file = fopen($file, "r"); + $count = 0; + $details = array(); + while($count < 11) { + $line = fgets($file); + foreach($detailFields as $label) { + $fileLabel = '# ' . $label; + if(strpos($line, $fileLabel) !== false) { + $details[$label] = htmlentities(trim(str_replace(array( + $fileLabel, + ':', + '`' + ), '', $line)), ENT_QUOTES, $modx_manager_charset); + } + } + $count++; + }; + fclose($file); + + $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; + $tooltip .= "Server version: " . $details["Server version"] . "\n"; + $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; + $tooltip .= "Host: " . $details["Host"] . "\n"; + + echo str_replace(array( + '[+filename+]', + '[+filesize+]', + '[+filedesc+]', + '[+modx_version+]', + '[+database_name+]', + '[+tooltip+]' + ), array( + $filename, + $filesize, + $details['Description'], + $details['MODX Version'], + $details['Database'], + $tooltip + ), $tpl); + } + echo '
                              {$_lang["files_filename"]}{$_lang["files_filesize"]}{$_lang["description"]}{$_lang["modx_version"]}{$_lang["database_name"]}{$_lang["onlineusers_action"]}
                              [+filename+][+filesize+][+filedesc+][+modx_version+][+database_name+]' . $_lang["bkmgr_restore_submit"] . '
                              '; + } else { + echo $_lang["bkmgr_snapshot_nothing"]; + } + ?> + +
                              +
                              +
                              + +
                              + +
                              tpDBM.setSelectedIndex( '.$_GET['tab'].' );'; +if(is_numeric($_GET['tab'])) { + echo ''; } - include_once "footer.inc.php"; // send footer +include_once "footer.inc.php"; // send footer ?> setDroptables(false); } - function setDBtables($dbtables) { $this->_dbtables = $dbtables; } + function setDroptables($state) { + $this->_isDroptables = $state; + } // If set to true, it will generate 'DROP TABLE IF EXISTS'-statements for each table. - function setDroptables($state) { $this->_isDroptables = $state; } - function isDroptables() { return $this->_isDroptables; } + + function setDBtables($dbtables) { + $this->_dbtables = $dbtables; + } function createDump($callBack) { global $modx; @@ -517,43 +507,42 @@ function createDump($callBack) { $result = $modx->db->query('SHOW TABLES'); $tables = $this->result2Array(0, $result); - foreach ($tables as $tblval) { + foreach($tables as $tblval) { $result = $modx->db->query("SHOW CREATE TABLE `{$tblval}`"); $createtable[$tblval] = $this->result2Array(1, $result); } - - $version = $modx->getVersionData(); - + + $version = $modx->getVersionData(); + // Set header - $output = "#{$lf}"; - $output .= "# ".addslashes($modx->config['site_name'])." Database Dump{$lf}"; + $output = "#{$lf}"; + $output .= "# " . addslashes($modx->config['site_name']) . " Database Dump{$lf}"; $output .= "# MODX Version:{$version['version']}{$lf}"; $output .= "# {$lf}"; $output .= "# Host: {$this->database_server}{$lf}"; $output .= "# Generation Time: " . $modx->toDateFormat(time()) . $lf; - $output .= "# Server version: ". $modx->db->getVersion() . $lf; + $output .= "# Server version: " . $modx->db->getVersion() . $lf; $output .= "# PHP Version: " . phpversion() . $lf; $output .= "# Database: `{$this->dbname}`{$lf}"; - $output .= "# Description: ".trim($_REQUEST['backup_title'])."{$lf}"; + $output .= "# Description: " . trim($_REQUEST['backup_title']) . "{$lf}"; $output .= "#"; file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); $output = ''; // Generate dumptext for the tables. - if (isset($this->_dbtables) && count($this->_dbtables)) { - $this->_dbtables = implode(',',$this->_dbtables); + if(isset($this->_dbtables) && count($this->_dbtables)) { + $this->_dbtables = implode(',', $this->_dbtables); } else { unset($this->_dbtables); } - foreach ($tables as $tblval) { + foreach($tables as $tblval) { // check for selected table if(isset($this->_dbtables)) { - if (strstr(",{$this->_dbtables},",",{$tblval},")===false) { + if(strstr(",{$this->_dbtables},", ",{$tblval},") === false) { continue; } } - if($callBack==='snapshot') - { + if($callBack === 'snapshot') { /* switch($tblval) { @@ -561,7 +550,9 @@ function createDump($callBack) { case $modx->db->config['table_prefix'].'manager_log': continue 2; }*/ - if(!preg_match('@^'.$modx->db->config['table_prefix'].'@', $tblval)) continue; + if(!preg_match('@^' . $modx->db->config['table_prefix'] . '@', $tblval)) { + continue; + } } $output .= "{$lf}{$lf}# --------------------------------------------------------{$lf}{$lf}"; $output .= "#{$lf}# Table structure for table `{$tblval}`{$lf}"; @@ -575,24 +566,28 @@ function createDump($callBack) { $output .= "{$createtable[$tblval][0]};{$lf}"; $output .= $lf; $output .= "#{$lf}# Dumping data for table `{$tblval}`{$lf}#{$lf}"; - $result = $modx->db->select('*',$tblval); + $result = $modx->db->select('*', $tblval); $rows = $this->loadObjectList('', $result); foreach($rows as $row) { $insertdump = $lf; $insertdump .= "INSERT INTO `{$tblval}` VALUES ("; $arr = $this->object2Array($row); foreach($arr as $key => $value) { - if(is_null($value)) $value = 'NULL'; - else { - $value = addslashes($value); - $value = str_replace(array("\r\n","\r","\n"), '\\n', $value); - $value = "'{$value}'"; + if(is_null($value)) { + $value = 'NULL'; + } else { + $value = addslashes($value); + $value = str_replace(array( + "\r\n", + "\r", + "\n" + ), '\\n', $value); + $value = "'{$value}'"; } - $insertdump .= $value .','; + $insertdump .= $value . ','; } - $output .= rtrim($insertdump,',') . ");\n"; - if(1048576 < strlen($output)) - { + $output .= rtrim($insertdump, ',') . ");\n"; + if(1048576 < strlen($output)) { file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); $output = ''; } @@ -601,10 +596,11 @@ function createDump($callBack) { $output = ''; } $output = file_get_contents($tempfile_path); - if(!empty($output)) unlink($tempfile_path); - - switch($callBack) - { + if(!empty($output)) { + unlink($tempfile_path); + } + + switch($callBack) { case 'dumpSql': dumpSql($output); break; @@ -615,83 +611,99 @@ function createDump($callBack) { return true; } - // Private function object2Array. - function object2Array($obj) { - $array = null; - if(is_object($obj)) { - $array = array(); - foreach (get_object_vars($obj) as $key => $value) { - if (is_object($value)) - $array[$key] = $this->object2Array($value); - else $array[$key] = $value; - } + function result2Array($numinarray = 0, $resource) { + global $modx; + $array = array(); + while($row = $modx->db->getRow($resource, 'num')) { + $array[] = $row[$numinarray]; } + $modx->db->freeResult($resource); return $array; } + // Private function object2Array. + + function isDroptables() { + return $this->_isDroptables; + } + // Private function loadObjectList. - function loadObjectList($key='', $resource) { + + function loadObjectList($key = '', $resource) { global $modx; $array = array(); - while ($row = $modx->db->getRow($resource,'object')) { - if ($key) - $array[$row->$key] = $row; - else $array[] = $row; + while($row = $modx->db->getRow($resource, 'object')) { + if($key) { + $array[$row->$key] = $row; + } else { + $array[] = $row; + } } $modx->db->freeResult($resource); return $array; } // Private function result2Array. - function result2Array($numinarray = 0, $resource) { - global $modx; - $array = array(); - while ($row = $modx->db->getRow($resource,'num')) { - $array[] = $row[$numinarray]; + + function object2Array($obj) { + $array = null; + if(is_object($obj)) { + $array = array(); + foreach(get_object_vars($obj) as $key => $value) { + if(is_object($value)) { + $array[$key] = $this->object2Array($value); + } else { + $array[$key] = $value; + } + } } - $modx->db->freeResult($resource); return $array; } } -function import_sql($source,$result_code='import_ok') -{ - global $modx,$e; - - if($modx->getLockedElements() !== array()) - { +function import_sql($source, $result_code = 'import_ok') { + global $modx, $e; + + if($modx->getLockedElements() !== array()) { $modx->webAlertAndQuit("At least one Resource is still locked or edited right now by any user. Remove locks or ask users to log out before proceeding."); } - + $settings = getSettings(); - - if(strpos($source, "\r")!==false) $source = str_replace(array("\r\n","\n","\r"),"\n",$source); + + if(strpos($source, "\r") !== false) { + $source = str_replace(array( + "\r\n", + "\n", + "\r" + ), "\n", $source); + } $sql_array = preg_split('@;[ \t]*\n@', $source); - foreach($sql_array as $sql_entry) - { + foreach($sql_array as $sql_entry) { $sql_entry = trim($sql_entry, "\r\n; "); - if(empty($sql_entry)) continue; + if(empty($sql_entry)) { + continue; + } $rs = $modx->db->query($sql_entry); } restoreSettings($settings); - + $modx->clearCache(); $_SESSION['last_result'] = $modx->db->makeArray($rs); - + $_SESSION['result_msg'] = $result_code; } function dumpSql(&$dumpstring) { global $modx; - $today = $modx->toDateFormat(time(),'dateOnly'); + $today = $modx->toDateFormat(time(), 'dateOnly'); $today = str_replace('/', '-', $today); $today = strtolower($today); $size = strlen($dumpstring); if(!headers_sent()) { - header('Expires: 0'); - header('Cache-Control: private'); - header('Pragma: cache'); + header('Expires: 0'); + header('Cache-Control: private'); + header('Pragma: cache'); header('Content-type: application/download'); header("Content-Length: {$size}"); header("Content-Disposition: attachment; filename={$today}_database_backup.sql"); @@ -702,22 +714,19 @@ function dumpSql(&$dumpstring) { function snapshot(&$dumpstring) { global $path; - file_put_contents($path,$dumpstring,FILE_APPEND); + file_put_contents($path, $dumpstring, FILE_APPEND); return true; } -function getSettings() -{ +function getSettings() { global $modx; $tbl_system_settings = $modx->getFullTableName('system_settings'); - - $rs = $modx->db->select('setting_name, setting_value',$tbl_system_settings); - + + $rs = $modx->db->select('setting_name, setting_value', $tbl_system_settings); + $settings = array(); - while ($row = $modx->db->getRow($rs)) - { - switch($row['setting_name']) - { + while($row = $modx->db->getRow($rs)) { + switch($row['setting_name']) { case 'rb_base_dir': case 'filemanager_path': case 'site_url': @@ -729,23 +738,21 @@ function getSettings() return $settings; } -function restoreSettings($settings) -{ +function restoreSettings($settings) { global $modx; $tbl_system_settings = $modx->getFullTableName('system_settings'); - - foreach($settings as $k=>$v) - { - $modx->db->update(array('setting_value'=>$v),$tbl_system_settings,"setting_name='{$k}'"); + + foreach($settings as $k => $v) { + $modx->db->update(array('setting_value' => $v), $tbl_system_settings, "setting_name='{$k}'"); } } -function parsePlaceholder($tpl='', $ph=array()) -{ - if(empty($ph) || empty($tpl)) return $tpl; - - foreach($ph as $k=>$v) - { +function parsePlaceholder($tpl = '', $ph = array()) { + if(empty($ph) || empty($tpl)) { + return $tpl; + } + + foreach($ph as $k => $v) { $k = "[+{$k}+]"; $tpl = str_replace($k, $v, $tpl); } diff --git a/manager/actions/category_mgr/inc/Categories.php b/manager/actions/category_mgr/inc/Categories.php new file mode 100644 index 0000000000..840ae10cd6 --- /dev/null +++ b/manager/actions/category_mgr/inc/Categories.php @@ -0,0 +1,211 @@ +db = & $modx->db; + $this->db_tbl['categories'] = $modx->getFullTableName('categories'); + + foreach( $this->elements as $element ) + { + $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); + } + } + + + /** + * Get all categories + * @return array $categories / array contains all categories + */ + function getCategories() + { + $categories = $this->db->makeArray( + $this->db->select( + '*', + $this->db_tbl['categories'], + '1', + '`rank`,`category`' + ) + ); + + if( !empty( $categories ) ) + { + return $categories; + } + return false; + } + + function getCategory( $search, $where = 'category' ) + { + $category = $this->db->getRow( + $this->db->select( + '*', + $this->db_tbl['categories'], + "`" . $where . "` = '" . $search . "'" + ) + ); + return $category; + } + + function getCategoryValue( $value, $search, $where = 'category' ) + { + $_value = $this->db->getValue( + $this->db->select( + '`' . $value . '`', + $this->db_tbl['categories'], + "`" . $where . "` = '" . $search . "'" + ) + ); + return $_value; + } + + function getAssignedElements( $category_id, $element ) + { + if( in_array( $element, $this->elements, true ) ) + { + + $fields = '`name`,`description`'; + if( $element === 'templates' ) + { + $fields = '`templatename`,`description`'; + } + + $fields = '*'; + + $elements = $this->db->makeArray( + $this->db->select( + $fields, + $this->db_tbl[$element], + "`category` = '" . $category_id . "'" + ) + ); + + // correct the name of templates + if( $element === 'templates' ) + { + $_elements_count = count($elements); + for( $i=0; $i < $_elements_count; $i++ ) + { + $elements[$i]['name'] = $elements[$i]['templatename']; + } + } + return $elements; + } + return false; + } + + function getAllAssignedElements( $category_id ) + { + $elements = array(); + foreach( $this->elements as $element ) + { + $elements[$element] = $this->getAssignedElements( $category_id, $element ); + } + return $elements; + } + + function deleteCategory( $category_id ) + { + $_update = array('category' => 0); + foreach( $this->elements as $element ) + { + $this->db->update( + $_update, + $this->db_tbl[$element], + "`category` = '" . $category_id . "'" + ); + } + + $this->db->delete( + $this->db_tbl['categories'], + "`id` = '" . $category_id . "'" + ); + + if( $this->db->getAffectedRows() === 1 ) + { + return true; + } + return false; + } + + function updateCategory( $category_id, $data = array() ) + { + if( empty( $data ) + || empty( $category_id ) ) + { + return false; + } + + $_update = array( + 'category' => $this->db->escape( $data['category'] ), + 'rank' => (int)$data['rank'] + ); + + $this->db->update( + $_update, + $this->db_tbl['categories'], + "`id` = '" . (int)$category_id . "'" + ); + + if( $this->db->getAffectedRows() === 1 ) + { + return true; + } + + return false; + } + + function addCategory( $category_name, $category_rank ) + { + if( $this->isCategoryExists( $category_name ) ) + { + return false; + } + + $_insert = array( + 'category' => $this->db->escape( $category_name ), + 'rank' => (int)$category_rank + ); + + $this->db->insert( + $_insert, + $this->db_tbl['categories'] + ); + + if( $this->db->getAffectedRows() === 1 ) + { + return $this->db->getInsertId(); + } + + //return $this->db->getLastError(); // this will never happen... + return false; + } + + function isCategoryExists( $category_name ) + { + $category = $this->db->escape( $category_name ); + + $category_id = $this->db->getValue( + $this->db->select( + '`id`', + $this->db_tbl['categories'], + "`category` = '" . $category . "'" + ) + ); + + if( $this->db->getAffectedRows() === 1 ) + { + return $category_id; + } + return false; + } +} \ No newline at end of file diff --git a/manager/actions/category_mgr/inc/Module_Categories_Manager.php b/manager/actions/category_mgr/inc/Module_Categories_Manager.php new file mode 100644 index 0000000000..b4f2fd568d --- /dev/null +++ b/manager/actions/category_mgr/inc/Module_Categories_Manager.php @@ -0,0 +1,127 @@ +isBackend() === false ) +{ + die('Please use the MODx Backend.'); +} + +require_once realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'Categories.php'; + +class Module_Categories_Manager extends Categories +{ + var $params = array(); + var $translations = array(); + var $new_translations = array(); + + + /** + * Set a paramter key and its value + * + * @return null + * @param string $key paramter key + * @param mixed $value parameter value - could be mixed value-types + */ + function set($key, $value) + { + $this->params[$key] = $value; + return null; + } + + + /** + * Get a parameter value + * + * @return mixed return the parameter value if exists, otherwise false + * @param string $key Paramter-key + */ + function get( $key ) + { + global $modx; + + if( isset( $this->params[$key] ) ) + { + return $this->params[$key]; + } + elseif( isset( $modx->config[$key] ) ) + { + return $modx->config[$key]; + } + elseif( isset( $modx->event->params[$key] ) ) + { + return $modx->event->params[$key]; + } + return false; + } + + + function addMessage( $message, $namespace = 'default' ) + { + $this->params['messages'][$namespace][] = $message; + } + + + function getMessages( $namespace = 'default' ) + { + if( isset( $this->params['messages'][$namespace] ) ) + { + return $this->params['messages'][$namespace]; + } + return false; + } + + + function renderView( $view_name, $data = array() ) + { + global $_lang, $_style; + + $filename = trim( $view_name ) . '.tpl.phtml'; + $file = self::get('views_dir') . $filename; + $view = & $this; + + if( is_file( $file ) + && is_readable( $file ) ) + { + include $file; + } + else + { + echo sprintf( + 'View "%s%s" not found.', + self::get('views_dir'), + $filename + ); + } + } + + function updateElement( $element, $element_id, $category_id ) + { + + $_update = array( + 'id' => (int)$element_id, + 'category' => (int)$category_id + ); + + $this->db->update( + $_update, + $this->db_tbl[$element], + "`id` = '" . (int)$element_id . "'" + ); + + if( $this->db->getAffectedRows() === 1 ) + { + return true; + } + return false; + } + + + function txt( $txt ) + { + global $_lang; + if(isset($_lang[$txt])) return $_lang[$txt]; + return $txt; + } +} \ No newline at end of file diff --git a/manager/actions/category_mgr/inc/request_trigger.inc.php b/manager/actions/category_mgr/inc/request_trigger.inc.php new file mode 100644 index 0000000000..3d65e15028 --- /dev/null +++ b/manager/actions/category_mgr/inc/request_trigger.inc.php @@ -0,0 +1,290 @@ +get('request_key')]['ajax'] ) ) +{ + $_data = $_REQUEST[$cm->get('request_key')]; + $output = ''; + $task = $_data['task']; + switch( $task ) + { + /** + * get categories + */ + case 'categorize_load_elements': + $elements = $_data['elements']; + + if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) + { + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); + } + + foreach( $cm->getCategories() as $category ) + { + $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); + $output .= $cm->renderView('chunks/categorize/category', $category); + } + break; + } + exit( $output ); +} +/** + * Categorize elements + * + * @notice array [data] removed + * @see /manager/includes/protect.inc.php ($limit) + * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 + * + */ +if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) +{ + $_data = $_POST[$cm->get('request_key')]['categorize']; + $_changes = 0; + + $cm->addMessage( + sprintf( + $cm->txt('cm_categorize_x'), + $cm->txt($_data['elementsgroup']) + ), + 'categorize' + ); + + if( !isset( $_data['elements'] ) ) + { + $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); + return; + } + + foreach( $_data['elements'] as $element_id => $data ) + { + if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) + { + $cm->addMessage( + sprintf( + $cm->txt('cm_x_assigned_to_category_y'), + $data['element_name'], + $element_id, + $data['category_name'], + $data['category_id'] + ), + 'categorize' + ); + $_changes++; + } + } + + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); + return; + } + else + { + $cm->addMessage( + sprintf( + $cm->txt('cm_x_changes_made'), + $_changes + ), + 'categorize' + ); + } +} + +/** + * Add a new category + */ +if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) +{ + $_data = $_POST[$cm->get('request_key')]['add']['data']; + $category = trim( html_entity_decode($_data['name']) ); + $rank = (int) $_data['rank']; + + if( empty( $category ) ) + { + $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); + return; + } + + if( $cm->isCategoryExists( $category ) ) + { + $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); + return; + } + + if( $cm->addCategory( $category, $rank ) !== 0 ) + { + $cm->addMessage( + sprintf( + $cm->txt( 'cm_category_x_saved_at_position_y' ), + $category, + $rank + ), + 'add' + ); + } + else + { + $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); + } +} + +/** + * Sort categories + */ +if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) +{ + $categories = $_POST[$cm->get('request_key')]['sort']['data']; + $_changes = 0; + + foreach( $categories as $category_id => $_data ) + { + $data = array( + 'category' => urldecode( $_data['category'] ), + 'rank' => $_data['rank'] + ); + + if( $cm->updateCategory( $category_id, $data ) ) + { + $cm->addMessage( + sprintf( + $cm->txt('cm_category_x_moved_to_position_y'), + $data['category'], + $data['rank'] + ), + 'sort' + ); + $_changes++; + } + } + + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); + } + else + { + $cm->addMessage( + sprintf( + $cm->txt('cm_x_changes_made'), + $_changes + ), + 'sort' + ); + } +} + +/** + * Edit categories + */ +if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) +{ + $categories = $_POST[$cm->get('request_key')]['edit']['data']; + $_changes = 0; + + foreach( $categories as $category_id => $_data ) + { + if( isset( $_data['delete'] ) ) + { + if( $cm->deleteCategory( $category_id ) ) + { + $cm->addMessage( + sprintf( + $cm->txt('cm_category_x_deleted'), + urldecode( $_data['origin'] ) + ), + 'edit' + ); + } + $_changes++; + continue; + } + + $data = array( + 'category' => trim( html_entity_decode( $_data['category'] ) ), + 'rank' => $_data['rank'] + ); + + if( $cm->updateCategory( $category_id, $data ) ) + { + $cm->addMessage( + sprintf( + $cm->txt('cm_category_x_renamed_to_y'), + urldecode( $_data['origin'] ), + $data['category'] + ), + 'edit' + ); + $_changes++; + } + } + + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); + } +} + +/** + * Delete singel category by $_GET + */ +if( isset( $_GET[$cm->get('request_key')]['delete'] ) + && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) +{ + $category_id = (int)$_GET[$cm->get('request_key')]['delete']; + + if( $cm->deleteCategory( $category_id ) ) + { + $cm->addMessage( + sprintf( + $cm->txt('cm_category_x_deleted'), + urldecode( $_GET[$cm->get('request_key')]['category'] ) + ), + 'edit' + ); + } +} +/** + * Translate phrases + */ +if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) +{ + $translations = $_POST[$cm->get('request_key')]['translate']['data']; + + foreach( $translations as $native_phrase => $translation ) + { + $native_phrase = urldecode( $native_phrase ); + + if( empty( $translation ) ) + { + $translation = $native_phrase; + + $cm->addMessage( + sprintf( + $cm->txt('cm_translation_for_x_empty'), + $native_phrase + ), + 'translate' + ); + } + + //$cm->c('Translator')->setType('phrase'); + $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); + + $cm->addMessage( + sprintf( + $cm->txt('cm_translation_for_x_to_y_success'), + $native_phrase, + $translation + ), + 'translate' + ); + } + + if( empty( $cm->new_translations ) ) + { + //$_REQUEST['webfxtab_manage-categories-pane'] = 0; + // unset( $_COOKIE['webfxtab_manage-categories-pane'] ); + // setcookie('webfxtab_manage-categories-pane', 0); + } +} \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/add.tpl.phtml b/manager/actions/category_mgr/skin/add.tpl.phtml new file mode 100644 index 0000000000..7a857666e3 --- /dev/null +++ b/manager/actions/category_mgr/skin/add.tpl.phtml @@ -0,0 +1,29 @@ +
                              + + + + + + + + + + + + + + + + + +
                              txt('cm_category_name'); ?>txt('cm_category_position'); ?>
                              +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/categorize.tpl.phtml b/manager/actions/category_mgr/skin/categorize.tpl.phtml new file mode 100644 index 0000000000..2ffc6585a2 --- /dev/null +++ b/manager/actions/category_mgr/skin/categorize.tpl.phtml @@ -0,0 +1,30 @@ +
                              + + + + +
                              + renderView('chunks/categorize/elements_select'); ?> +
                              + + + + + +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml b/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml new file mode 100644 index 0000000000..236f8882d5 --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/categorize/category.tpl.phtml @@ -0,0 +1,10 @@ +
                              +
                              +

                              + + + renderView('chunks/categorize/drag_element',$element); ?> + + +
                              +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/categorize/drag_element.tpl.phtml b/manager/actions/category_mgr/skin/chunks/categorize/drag_element.tpl.phtml new file mode 100644 index 0000000000..64d1fd0c7c --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/categorize/drag_element.tpl.phtml @@ -0,0 +1,6 @@ +
                              +

                              + +

                              + +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/categorize/elements_select.tpl.phtml b/manager/actions/category_mgr/skin/chunks/categorize/elements_select.tpl.phtml new file mode 100644 index 0000000000..4a4d63f67e --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/categorize/elements_select.tpl.phtml @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/categorize/uncategorized_elements.tpl.phtml b/manager/actions/category_mgr/skin/chunks/categorize/uncategorized_elements.tpl.phtml new file mode 100644 index 0000000000..d91c547bd6 --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/categorize/uncategorized_elements.tpl.phtml @@ -0,0 +1,7 @@ +
                              +

                              txt('no_category'); ?>

                              + + renderView('chunks/categorize/drag_element', $element); ?> + +
                              +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/db_setup.tpl.phtml b/manager/actions/category_mgr/skin/chunks/db_setup.tpl.phtml new file mode 100644 index 0000000000..02aec99186 --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/db_setup.tpl.phtml @@ -0,0 +1,14 @@ +
                              +

                              + Database not ready. +

                              + +

                              + The column "rank" don't exist. Please click the "Add rank column" button to add a new column to categories table.
                              + After that go to module configuration and set "Check DB-table" to "false" (optional). +

                              + +
                              + +
                              +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml new file mode 100644 index 0000000000..455090a34f --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements.tpl.phtml @@ -0,0 +1,14 @@ +
                              + $items ) : ?> +
                              txt( $element ); ?>
                              + +

                              txt('cm_no_x_assigned'), $element ); ?>

                              + +
                                + +
                              • + +
                              + + +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml new file mode 100644 index 0000000000..b1c9fc8deb --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/edit/assigned_elements_collapse.tpl.phtml @@ -0,0 +1,26 @@ + + + + $items ) : ?> + + + + + + + $items ) : ?> + + + + + + + + +
                              txt( $element ); ?>

                              txt( 'none' ); ?>

                              +
                                + +
                              • + +
                              +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/global_messages.tpl.phtml b/manager/actions/category_mgr/skin/chunks/global_messages.tpl.phtml new file mode 100644 index 0000000000..ee81fd6f16 --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/global_messages.tpl.phtml @@ -0,0 +1,12 @@ + +
                              txt('cm_global_messages'); ?>
                              +
                              +
                              +
                                + +
                              • + +
                              +
                              +
                              + \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/chunks/messages.tpl.phtml b/manager/actions/category_mgr/skin/chunks/messages.tpl.phtml new file mode 100644 index 0000000000..0398627081 --- /dev/null +++ b/manager/actions/category_mgr/skin/chunks/messages.tpl.phtml @@ -0,0 +1,9 @@ + +
                              +
                                + +
                              • + +
                              +
                              + \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/css/module.css b/manager/actions/category_mgr/skin/css/module.css new file mode 100644 index 0000000000..a041c4b340 --- /dev/null +++ b/manager/actions/category_mgr/skin/css/module.css @@ -0,0 +1,280 @@ +@charset "utf-8"; + +/** + $Id: module.css 3 2009-10-07 20:55:13Z stefan $ +----------------------------------------------------------------------------- */ + +h1 span.version { + font-size: .6em; + margin-left: 3px; +} + +div#section-body-categories .hidden { + display: none; +} + +/* FONT AWESOME */ + +div#section-body-categories div.messages ul li:before, +div#section-body-categories div.ok:before, +div#section-body-categories div.nok, +div#section-body-categories .ajax_loading { + font-family: 'FontAwesome'; + font-style: normal; + display: inline; + text-decoration: inherit; + color:#fff; + font-weight:normal; + float:left; + margin-right:5px; +} + +div#section-body-categories div.messages { + max-height: 100px; + overflow: auto; + padding: 6px; + padding-left: 0px; + margin-bottom: 10px; + border-bottom: 1px dotted #748394 +} + +div#section-body-categories div.messages ul { + margin: 0; + padding: 0 +} + +div#section-body-categories div.messages ul li { + list-style-type: none; + list-style-image: none; + margin: 0; + padding: 5px; +} + +div#section-body-categories div.messages ul li:before { + content: "\f00c"; + color:#3697CD; +} + +div#section-body-categories div.messages ul li span.highlight { + background-color: #f5f5f5; + color: #222; + padding: 1px 3px; +} + +div#section-body-categories fieldset { + margin: 0; + padding: 10px 0; +} + +div#section-body-categories table tr td.gridHeader { + padding: 3px 5px; +} + +div#section-body-categories table tr td.submit { + border-top: 1px solid #748394; + padding: 5px; + text-align: right; +} + +div#section-body-categories table tr td.assigned { + width: 150px; +} + +div#section-body-categories table tr td.assigned img { + cursor: help +} + +div#section-body-categories table tr td.assigned div.assigned_elements { + display: none; +} + + +/* Translations */ + +div#section-body-categories table tr td.native { + width: 30% +} + +div#section-body-categories table tr td.translation input { + width: 90%; +} + +div#section-body-categories table tr td.translation textarea { + background-color: #fff; + height: 3em; + width: 95%; +} + + +/* Edit */ + +.assigned-tip { + z-index: 13000; +} + +.assigned-tip, +div#section-body-categories div.assigned_elements { + background-color: #fff; + border: 1px solid #748394; + padding: 10px 10px; +} + +.assigned-tip h4, +div#section-body-categories div.assigned_elements h4 { + font-weight: bold; + margin-bottom: 0px; +} + +.assigned-tip ul, +div#section-body-categories div.assigned_elements ul { + margin-left:1.5em; +} + +.assigned-tip ul li, +div#section-body-categories div.assigned_elements ul li { } + +.assigned-tip p.no_assigned_elements, +div#section-body-categories div.assigned_elements p.no_assigned_elements { + color: #aaa; +} + +div#section-body-categories tr.move td { + background-color: #3697CD; + color: #fff; +} + +div#section-body-categories table#category-edit td.input input { + width: 90%; +} + +div#section-body-categories table#category-edit td.delete a img { + vertical-align: middle; +} + +div#section-body-categories table#category-edit td.delete a { + display: inline-block; + color: #fff; + font-weight: bold; + font-size: 12px; + background: #32AB9A; + padding: 4px 6px; + white-space: nowrap; + text-decoration: none; + border: none; + border-radius: 3px !important; + outline: none; +} + +div#section-body-categories table#category-edit td.delete a:hover { + color: #fff; + background: #35baa8; +} + + +/* Categorization */ + +div#section-body-categories div#categorize-workbench { + min-height: 50px; +} + +div#section-body-categories div.drag { + padding: 2px 5px; + background-color:#3697CD; + cursor: move; + position: relative; + float: left; + margin: 4px 0 4px 8px; +} + +div#section-body-categories div.drag h4 { + margin: 3px; + font-size: 1em; + color:#fff; +} + +div#section-body-categories div.drag p { + display: none; + position: absolute; + z-index: 10000; + width: 250px; + background-color: #fff; + top: 30px; + left: 30px; + padding: 5px; + border: 1px solid #88939E; +} + +div#section-body-categories div.drag:hover p { + display: block; +} + +div#section-body-categories div.uncategorized_elements, +div#section-body-categories div.drop { + width: 32%; + float: left; + min-height: 50px; + margin: .5%; + border: 1px solid #C3C3C3; + background-color:#fff; + position: relative; + padding-bottom:4px; +} + +div#section-body-categories div.uncategorized_elements { + width: auto; +} + +div#section-body-categories div.uncategorized_elements h2, +div#section-body-categories div.drop h2 { + padding: 5px 7px 6px 7px; + color: #3697CD; + border-bottom:2px solid #3697CD; + margin:0 4px 4px 4px; + font-size: 12px; + font-weight: bold; +} +div#section-body-categories div { + +} +div#section-body-categories div.over { + background-color: rgba(54,151,204,.2); +} + +div#section-body-categories .ajax_loading:before { + content: "\f110"; + color:#3697CD; +} + +div#section-body-categories div.ok { + background-color: #37bdf4; + +} +div#section-body-categories div.ok:before { + content: "\f00c"; +} + +div#section-body-categories div.nok { + content: "\f06a"; + color:#C9302C; +} + +/* Avoid jumping when Tooltip is longer than viewport-bottom */ +html { overflow-y:scroll; } +.grid { background-color: #f2f2f2; } +.gridItem { background-color: transparent; } +.drag h4 { float:left; } +.inputBox { width:100%; } +#categories-sort tr:hover td { color:#fff; background-color: #37bdf4; } +td.assigned > button.btn { display:inline-block; width:auto; border-radius:3px !important; color:#fff; padding: 4px 6px; font-size:12px; } +td.assigned > button.btn.collapsed { background-color:#3697CD; } +td.assigned > button.btn, +td.assigned > button.btn:hover { background-color:#37bdf4; } + +/* FIX BOOTSTRAP H1 BACK TO MODxRE2 */ +/*h1 { + font-size: 1.8em; + line-height: 35px; + margin: 15px 15px 10px 15px; +}*/ + +#category-edit table.grid .gridAltItem { background-color:#fff; } \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/edit.tpl.phtml b/manager/actions/category_mgr/skin/edit.tpl.phtml new file mode 100644 index 0000000000..110c22afab --- /dev/null +++ b/manager/actions/category_mgr/skin/edit.tpl.phtml @@ -0,0 +1,54 @@ +
                              + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              txt('cm_assigned_elements'); ?>txt('cm_edit_name'); ?>txt('cm_mark_for_deletion'); ?>txt('cm_delete_now'); ?>
                              + +
                              renderView('chunks/edit/assigned_elements', $view->getAllAssignedElements($category['id'])); ?>
                              +
                              + + + + + + + txt('delete'); ?> +
                              + renderView('chunks/edit/assigned_elements_collapse', $view->getAllAssignedElements($category['id'])); ?> +
                              +
                              \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/js/categories.js b/manager/actions/category_mgr/skin/js/categories.js new file mode 100644 index 0000000000..6c4010ce84 --- /dev/null +++ b/manager/actions/category_mgr/skin/js/categories.js @@ -0,0 +1,157 @@ + +//window.addEvent('domready',function(){ + +/** + * Tips + */ +new Tips($$('.mootooltip'),{className:'custom'} ); +new MooTips($$('.mootooltip_dom'), { + className :'assigned', + showOnClick: true, + showOnMouseEnter: true, + showDelay: 200, + hideDelay: 200, + offsets: {'x': 20, 'y': 20}, + fixed: true +}); + +/** + * Sort Categories + */ +new Sortables($('categories-sort'), { + //handles:'span.handle', + onStart: function(element){ + element.toggleClass('move'); + }, + onComplete: function(element){ + element.toggleClass('move'); + // reorder the indexes + this.list.getChildren().each(function(element, i){ + element.getElement('input.sort').setProperty( 'value', (i+1) ); + element.getElement('span.sort').setHTML( (i+1) ); + element.getElements('td').each(function(td){ + td.removeClass('gridItem').removeClass('gridAltItem'); + td.addClass( ( i%2===0 ) ? 'gridItem' : 'gridAltItem' ); + }); + }); + } +}); + +/** + * Categorization + */ +var reset_position = function( drag ) { + drag.setStyles({ left:0+"px", top:0+"px" }); +} + +var optDrop = { + over: function(drag) { + this.addClass('over'); + drag.addClass('ok'); + }, + leave: function(drag) { + this.removeClass('over'); + drag.removeClass('ok'); + }, + drop: function(drag) { + this.removeClass('over'); + drag.injectInside(this); + reset_position(drag); + } +} + +var optDrag = { + onStart: function(drag) { + drag.setOpacity(.5).setStyle('z-index', 10000); + }, + onComplete: function(drag) { + drag.setOpacity(1).setStyle('z-index', 1000); + reset_position(drag); + } +} + +var init_drag = function() { + + optDrag.droppables = $$('div.drop').addEvents( optDrop ); + $$('div#categorize-workbench div.drag').makeDraggable( optDrag ); + $$('div#categorize-workbench div.drag').each(function(element){ reset_position(element) }); + + /** + * Make container uncategorized elements movable.... but for what + + if( $('categorize-category-0') !== null ){ + var first_click = true; + var container_uncategorized = $('categorize-category-0'); + container_uncategorized.getElement('h2').addEvent('click',function(){ + if( first_click === true ) { + this.getParent().setStyles({ + 'top' : '-50px', + 'left': '0' + }); + new Drag.Move(container_uncategorized, { + handle: container_uncategorized.getElement('h2') + }); + first_click = false; + } + }); + } + + */ +} + +/** + * collect the categorization in formfields + * + * @TODO collect them within a object and send by jason-request. + */ +$('categorize-submit').addEvent('mouseenter',function() { + + this.setProperty('disabled','disabled'); + this.setProperty('value','wait...'); + + $('categorize-formfields').empty(); + + $$('div.categorize_category').each(function(drop) { + + category_id = drop.getProperty('id').split('-')[2]; + category_name = drop.getElement('h2').getText().trim(); + elements = drop.getElements('div.drag'); + + if( elements.length > 0 ) { + elements.each(function(element,index) { + var element_id = element.getProperty('id').split('-')[2]; + var element_name = element.getElement('h4').getText(); + var id_input_element = 'input-element-'+element_id; + var id_input_element_name = 'input-element-name-'+element_id; + var id_input_category_name = 'input-category-name-'+element_id; + + new Element( 'input', { + 'type' : 'text', + 'id' : id_input_element_name, + 'name' : request_key + '[categorize][elements]['+element_id+'][element_name]', + 'value': element_name.trim() + }).injectInside( $('categorize-formfields') ); + + new Element( 'input', { + 'type' : 'text', + 'id' : id_input_element, + 'name' : request_key + '[categorize][elements]['+element_id+'][category_id]', + 'value': category_id + }).injectInside( $('categorize-formfields') ); + + new Element( 'input', { + 'type' : 'text', + 'id' : id_input_category_name, + 'name' : request_key + '[categorize][elements]['+element_id+'][category_name]', + 'value': category_name.trim() + }).injectInside( $('categorize-formfields') ); + + }); + } + }); + + this.removeProperty('disabled'); + this.setProperty('value','Save categorization'); +}); + +//}); diff --git a/manager/actions/category_mgr/skin/js/mootips.js b/manager/actions/category_mgr/skin/js/mootips.js new file mode 100644 index 0000000000..2e77c449c9 --- /dev/null +++ b/manager/actions/category_mgr/skin/js/mootips.js @@ -0,0 +1,215 @@ +var MooTips = new Class({ + + options: { // modded for X3 + onShow: function(tip){ + tip.setStyle('visibility', 'visible'); + }, + onHide: function(tip){ + tip.setStyle('visibility', 'hidden'); + }, + showOnClick: false, + showOnMouseEnter: true, + maxTitleChars: 30, + showDelay: 100, + hideDelay: 100, + className: 'tool', + offsets: {'x': 16, 'y': 16}, + fixed: false, + loadingText: 'Loading...', + errTitle: 'Error...', + errText: 'There was a problem retrieving the contents of this tooltip.', + evalAlways: false + }, + + initialize: function(elements, options){ + this.setOptions(options); + this.toolTip = new Element('div', { + 'class': this.options.className + '-tip', + 'styles': { + 'position': 'absolute', + 'top': '0', + 'left': '0', + 'visibility': 'hidden' + }, + 'events': { + 'mouseenter': function(event){ + //setting state property, needed on end function + this.setProperty('state','mouseenter'); + }, + 'mouseleave': function(event){ + //setting state property, needed on end function + this.setProperty('state','mouseleave'); + this.pather.end(event); + } + } + }).inject(document.body); + + //didn't find other way to get owner of toolTip inside toolTip + this.toolTip.pather = this; + + this.wrapper = new Element('div').inject(this.toolTip); + $$(elements).each(this.buildEvents, this); + $$(elements).each(this.build, this); + if (this.options.initialize) this.options.initialize.call(this); + }, + + buildEvents: function(el) { + //code with errors but works + //that's why showOnClick option is false by default + if (this.options.showOnClick) { + el.addEvent('click', function(event){ + this.start(el); + if (!this.options.fixed) this.locate(event); + else this.position(el); + }.bindWithEvent(this)); + } + + if (this.options.showOnMouseEnter) { + el.addEvent('mouseenter', function(event){ + this.start(el); + if (!this.options.fixed) this.locate(event); + else this.position(el); + }.bind(this)); + } + + if (!this.options.fixed) el.addEvent('mousemove', this.locate.bindWithEvent(this)); + var end = this.end.bind(this); + el.addEvent('mouseleave', end); + el.addEvent('trash', end); + }, + + build: function(el){ // modded for X3 + el.$tmp.myTitle = (el.href && el.getTag() == 'a') ? el.href.replace('http://', '') : (el.rel || false); + if (el.title){ + + if (el.title.test('^DOM:', 'i')) { // check if we need to extract contents from a DOM element + el.title = $(el.title.split(':')[1].trim()).innerHTML; + } else if (el.title.test('^AJAX:', 'i')) { // check for an URL to retrieve content from + el.title = this.options.loadingText + '::' + el.title; + } else if (el.title.test('^EVAL:', 'i')) { // check for a statement to eval + el.title = this.options.loadingText + '::' + el.title; + } + + var dual = el.title.split('::'); + if (dual.length > 1) { + el.$tmp.myTitle = dual[0].trim(); + el.$tmp.myText = dual[1].trim(); + } else { + el.$tmp.myTitle = false; + el.$tmp.myText = el.title; + } + el.removeAttribute('title'); + } else { + el.$tmp.myText = false; + } + if (el.$tmp.myTitle && el.$tmp.myTitle.length > this.options.maxTitleChars) el.$tmp.myTitle = el.$tmp.myTitle.substr(0, this.options.maxTitleChars - 1) + "…"; + }, + + start: function(el){ // modded for X3 + this.wrapper.empty(); + + // check if we have an AJAX request - if so, show a loading animation and launch the request + if (el.$tmp.myText && el.$tmp.myText.test('^AJAX:', 'i')) { + //if (this.ajax) this.ajax.cancel(); + if(this.options.evalAlways) { + // save original text + el.$tmp.myEvalAlwaysText = el.$tmp.myText; + } + this.ajax = new Ajax (el.$tmp.myText.replace(/AJAX:/i,''), { + onComplete: function (responseText, responseXML) { + el.title = responseText; + this.build(el); + this.start(el); + }.bind(this), + onFailure: function () { + el.title = this.options.errTitle + '::' + this.options.errText; + this.build(el); + this.start(el); + }.bind(this), + method: 'get' + }).request(); + el.$tmp.myText = '
                               
                              '; + } else if (el.$tmp.myText && el.$tmp.myText.test('^EVAL:', 'i')) { + var tmp; + + if(this.options.evalAlways) { + // save original text to reevaluate on the fly (AJAX or EVAL only) + el.$tmp.myEvalAlwaysText = el.$tmp.myText; + } + try { + eval('tmp = ' + el.$tmp.myText.replace(/EVAL:/i, '') + ';'); + var dual = tmp.split('::'); + if (dual.length > 1) { + el.$tmp.myTitle = dual[0].trim(); + el.$tmp.myText = dual[1].trim(); + } else { + el.$tmp.myTitle = false; + el.$tmp.myText = tmp; + } + } catch(err) { + el.$tmp.myTitle = this.options.errTitle; + el.$tmp.myText = this.options.errText + '
                              --------
                              ' + err.description; + } + } + + if (el.$tmp.myTitle){ + this.title = new Element('span').inject( + new Element('div', {'class': this.options.className + '-title'}).inject(this.wrapper) + ).setHTML(el.$tmp.myTitle); + } + if (el.$tmp.myText){ + this.text = new Element('span').inject( + new Element('div', {'class': this.options.className + '-text'}).inject(this.wrapper) + ).setHTML(el.$tmp.myText); + + if((this.options.evalAlways) && (el.$tmp.myEvalAlwaysText)) { + // reset text so that it will evaluate again + el.$tmp.myText = el.$tmp.myEvalAlwaysText; + } + } + $clear(this.timer); + + // setting initial state of tip + this.toolTip.setProperty('state','mouseleave'); + + this.timer = this.show.delay(this.options.showDelay, this); + }, + + end: function(event){ + $clear(this.timer); + this.timer = this.hide.delay(this.options.hideDelay, this); + }, + + position: function(element){ + var pos = element.getPosition(); + this.toolTip.setStyles({ + 'left': pos.x + this.options.offsets.x, + 'top': pos.y + this.options.offsets.y + }); + }, + + locate: function(event){ + var win = {'x': window.getWidth(), 'y': window.getHeight()}; + var scroll = {'x': window.getScrollLeft(), 'y': window.getScrollTop()}; + var tip = {'x': this.toolTip.offsetWidth, 'y': this.toolTip.offsetHeight}; + var prop = {'x': 'left', 'y': 'top'}; + for (var z in prop){ + var pos = event.page[z] + this.options.offsets[z]; + if ((pos + tip[z] - scroll[z]) > win[z]) pos = event.page[z] - this.options.offsets[z] - tip[z]; + this.toolTip.setStyle(prop[z], pos); + }; + }, + + show: function(){ + if (this.options.timeout) this.timer = this.hide.delay(this.options.timeout, this); + this.fireEvent('onShow', [this.toolTip]); + }, + + hide: function(){ + // if "fixed", tooltip is only hidden when mouse leaves the tooltip (itself) + if ((this.toolTip.getProperty('state') == 'mouseleave') || (!this.options.fixed)) + this.fireEvent('onHide', [this.toolTip]); + } +}); + +MooTips.implement(new Events, new Options); \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/main.tpl.phtml b/manager/actions/category_mgr/skin/main.tpl.phtml new file mode 100644 index 0000000000..f89f2e7e14 --- /dev/null +++ b/manager/actions/category_mgr/skin/main.tpl.phtml @@ -0,0 +1,102 @@ + + + +js_output)) : ?> + + + +

                              + get('name') ?> +

                              + +
                              + + + renderView('chunks/db_setup'); ?> + + + renderView('chunks/messages', $view->getMessages('global')); ?> + +
                              + + +
                              +

                              txt('cm_add_new_category'); ?>

                              + + renderView('chunks/messages', $view->getMessages('add')); ?> + renderView('add'); ?> +
                              + + + +
                              +

                              txt('cm_edit_categories'); ?>

                              + + renderView('chunks/messages', $view->getMessages('edit')); ?> + renderView('edit', $data); ?> +
                              + +
                              +

                              txt('cm_sort_categories'); ?>

                              + + renderView('chunks/messages', $view->getMessages('sort')); ?> + renderView('sort', $data); ?> +
                              + +
                              +

                              txt('cm_categorize_elements'); ?>

                              + + renderView('chunks/messages', $view->getMessages('categorize')); ?> + renderView('categorize', $data); ?> +
                              + + + + new_translations[$view->get('manager_language')] && !empty($view->new_translations[$view->get('manager_language')])) : ?> + +
                              +

                              txt('Translations'); ?>

                              + + renderView('chunks/messages', $view->getMessages('translate')); ?> + renderView('translate', $view->new_translations[$view->get('manager_language')]); ?> +
                              + + + +
                              + + + +
                              + + + + \ No newline at end of file diff --git a/manager/actions/category_mgr/skin/sort.tpl.phtml b/manager/actions/category_mgr/skin/sort.tpl.phtml new file mode 100644 index 0000000000..be4fd6bffa --- /dev/null +++ b/manager/actions/category_mgr/skin/sort.tpl.phtml @@ -0,0 +1,41 @@ +
                              + + + + + + + + + + + + + + + + + + + +
                              txt('category_heading') ?>txt('position') ?>
                              + + + + + + + + +
                              +
                              diff --git a/manager/actions/category_mgr/skin/translate.tpl.phtml b/manager/actions/category_mgr/skin/translate.tpl.phtml new file mode 100644 index 0000000000..a65ba79709 --- /dev/null +++ b/manager/actions/category_mgr/skin/translate.tpl.phtml @@ -0,0 +1,32 @@ +
                              +
                              + txt('cm_translate_module_phrases'); ?> + + + + + + + + + $translation ) : ?> + + + + + + + + + + + +
                              txt('cm_native_phrase'); ?>txt('cm_translation'); ?>
                              + + + +
                              + +
                              +
                              +
                              \ No newline at end of file diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index e0141093f0..c8eef22d17 100644 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -1,34 +1,37 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} -if (isset($_REQUEST['id'])) - $id = (int)$_REQUEST['id']; -else $id = 0; +if(isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id']; +} else { + $id = 0; +} -if (isset($_GET['opened'])) $_SESSION['openedArray'] = $_GET['opened']; +if(isset($_GET['opened'])) { + $_SESSION['openedArray'] = $_GET['opened']; +} $url = $modx->config['site_url']; // Get table names (alphabetical) -$tbl_document_groups = $modx->getFullTableName('document_groups'); -$tbl_manager_users = $modx->getFullTableName('manager_users'); -$tbl_site_content = $modx->getFullTableName('site_content'); -$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_document_groups = $modx->getFullTableName('document_groups'); +$tbl_manager_users = $modx->getFullTableName('manager_users'); +$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); // Get access permissions -if($_SESSION['mgrDocgroups']) - $docgrp = implode(",",$_SESSION['mgrDocgroups']); -$access = "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0".(!$docgrp ? "":" OR dg.document_group IN ($docgrp)"); +if($_SESSION['mgrDocgroups']) { + $docgrp = implode(",", $_SESSION['mgrDocgroups']); +} +$access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); // Get the document content -$rs = $modx->db->select( - 'DISTINCT sc.*', - "{$tbl_site_content} AS sc - LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", - "sc.id ='{$id}' AND ({$access})" - ); +$rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc + LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); $content = $modx->db->getRow($rs); -if (!$content) { +if(!$content) { $modx->webAlertAndQuit($_lang["access_permission_denied"]); } @@ -44,7 +47,7 @@ $editedbyname = $modx->db->getValue($rs); // Get Template name -$rs = $modx->db->select('templatename',$tbl_site_templates, "id='{$content['template']}'"); +$rs = $modx->db->select('templatename', $tbl_site_templates, "id='{$content['template']}'"); $templatename = $modx->db->getValue($rs); // Set the item name for logger @@ -54,325 +57,428 @@ * "View Children" tab setup */ $maxpageSize = $modx->config['number_of_results']; -define('MAX_DISPLAY_RECORDS_NUM',$maxpageSize); +define('MAX_DISPLAY_RECORDS_NUM', $maxpageSize); $modx->loadExtension('makeTable'); // Get child document count -$rs = $modx->db->select( - 'count(DISTINCT sc.id)', - "{$tbl_site_content} AS sc - LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", - "sc.parent='{$content['id']}' AND ({$access})" - ); +$rs = $modx->db->select('count(DISTINCT sc.id)', "{$tbl_site_content} AS sc + LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.parent='{$content['id']}' AND ({$access})"); $numRecords = $modx->db->getValue($rs); -$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon' ; -$dir = isset($_REQUEST['dir'])? $_REQUEST['dir']: 'DESC'; +$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; +$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'DESC'; // Get child documents (with paging) -$rs = $modx->db->select( - 'DISTINCT sc.*', - "{$tbl_site_content} AS sc - LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", - "sc.parent='{$content['id']}' AND ({$access})", - "{$sort} {$dir}", - $modx->table->handlePaging() // add limit clause +$rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc + LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.parent='{$content['id']}' AND ({$access})", "{$sort} {$dir}", $modx->table->handlePaging() // add limit clause +); +$filter_sort = ''; +$filter_dir = ''; +if($numRecords > 0) { + $filter_sort = '

                              '; + $filter_dir = '

                              '; + $resource = $modx->db->makeArray($rs); + + // CSS style for table + $tableClass = 'grid'; + $rowHeaderClass = 'gridHeader'; + $rowRegularClass = 'gridItem'; + $rowAlternateClass = 'gridAltItem'; + + $modx->table->setTableClass($tableClass); + $modx->table->setRowHeaderClass($rowHeaderClass); + $modx->table->setRowRegularClass($rowRegularClass); + $modx->table->setRowAlternateClass($rowAlternateClass); + + // Table header + $listTableHeader = array( + 'docid' => $_lang['id'], + 'title' => $_lang['resource_title'], + 'createdon' => $_lang['createdon'], + 'pub_date' => $_lang['page_data_publishdate'], + 'status' => $_lang['page_data_status'], + 'edit' => $_lang['mgrlog_action'], ); -$filter_sort=''; -$filter_dir=''; -if ($numRecords > 0) { - $filter_sort='

                              '; - $filter_dir='

                              '; - $resource = $modx->db->makeArray($rs); - - // CSS style for table - $tableClass = 'grid'; - $rowHeaderClass = 'gridHeader'; - $rowRegularClass = 'gridItem'; - $rowAlternateClass = 'gridAltItem'; - - $modx->table->setTableClass($tableClass); - $modx->table->setRowHeaderClass($rowHeaderClass); - $modx->table->setRowRegularClass($rowRegularClass); - $modx->table->setRowAlternateClass($rowAlternateClass); - - // Table header - $listTableHeader = array( - 'docid' => $_lang['id'], - 'title' => $_lang['resource_title'], - 'createdon' => $_lang['createdon'], - 'pub_date' => $_lang['page_data_publishdate'], - 'status' => $_lang['page_data_status'], - 'edit' => $_lang['mgrlog_action'], - ); - $tbWidth = array('2%', '', '10%', '10%', '90', '150'); - $modx->table->setColumnWidths($tbWidth); - -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; - - - $listDocs = array(); - foreach($resource as $k => $children){ - /* - $listDocs[] = array( - 'docid' => $children['id'], - 'title' => (($children['deleted'] ? (''.$children['pagetitle'].'') : ( ($modx->hasPermission('edit_document')) ? ('' . $children['pagetitle'] . '') : $children['pagetitle'] ))), - 'createdon' => ($modx->toDateFormat($children['createdon']+$server_offset_time,'dateOnly')), - 'pub_date' => ($children['pub_date']? ($modx->toDateFormat($children['pub_date']+$server_offset_time,'dateOnly')) : ''), - 'status' => ($children['published'] == 0) ? ''.$_lang['page_data_unpublished'].'' : ''.$_lang['page_data_published'].'', - 'edit' => (($modx->hasPermission('edit_document')) ? '    ' : '') . - (($modx->hasPermission('delete_document')) ? '  ' : ''), - ); - */ - - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь - // для сохранения сортировки - $icon_pub_unpub = (!$children['published']) ? '' : ''; - $icon_del_undel = (!$children['deleted']) ? '' : ''; - $listDocs[] = array( - 'docid' => $children['id'], - 'title' => (($children['deleted'] ? (''.$children['pagetitle'].'') : ( ($modx->hasPermission('edit_document')) ? ('' . ($children['published']?$children['pagetitle']:''.$children['pagetitle'].'') . '') : $children['pagetitle'] ))), - 'createdon' => ($modx->toDateFormat($children['createdon']+$server_offset_time,'dateOnly')), - 'pub_date' => ($children['pub_date']? ($modx->toDateFormat($children['pub_date']+$server_offset_time,'dateOnly')) : ''), - 'status' => ($children['published'] == 0) ? ''.$_lang['page_data_unpublished'].'' : ''.$_lang['page_data_published'].'', - 'edit' => (($modx->hasPermission('edit_document')) ? '   '.$icon_pub_unpub .' ': '') . - (($modx->hasPermission('delete_document')) ? ' ' . $icon_del_undel : ''), - ); - - /****************/ + $tbWidth = array( + '2%', + '', + '10%', + '10%', + '90', + '150' + ); + $modx->table->setColumnWidths($tbWidth); + + $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; + $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; + $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; + $add_path = $sd . $sb . $pg; + + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + 'application/rss+xml' => $_style['tree_page_rss'], + 'application/pdf' => $_style['tree_page_pdf'], + 'application/vnd.ms-word' => $_style['tree_page_word'], + 'application/vnd.ms-excel' => $_style['tree_page_excel'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + + $listDocs = array(); + foreach($resource as $k => $children) { + + switch($children['id']) { + case $modx->config['site_start'] : + $icon = $_style['tree_page_home']; + break; + case $modx->config['error_page'] : + $icon = $_style['tree_page_404']; + break; + case $modx->config['site_unavailable_page'] : + $icon = $_style['tree_page_hourglass']; + break; + case $modx->config['unauthorized_page'] : + $icon = $_style['tree_page_info']; + break; + default: + if($children[isfolder]) { + $isPrivate = ($children['privateweb'] || $children['privatemgr']) ? '1' : '0'; + $icon = $isPrivate ? $_style['tree_folder_secure'] : $_style['tree_folder_new']; + } else { + if($children['privateweb'] || $children['privatemgr']) { + if(isset($icons[$children['contentType']])) { + $icon = $icons[$children['contentType']]; + } else { + $icon = $_style['tree_page_secure']; + } + } elseif(isset($icons[$children['contentType']])) { + $icon = $icons[$children['contentType']]; + } else { + $icon = $_style['tree_page']; + } + } } - $modx->table->createPagingNavigation($numRecords,'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort); - $children_output = $modx->table->create($listDocs,$listTableHeader,'index.php?a=3&id='.$content['id']); + /* + $listDocs[] = array( + 'docid' => $children['id'], + 'title' => (($children['deleted'] ? (''.$children['pagetitle'].'') : ( ($modx->hasPermission('edit_document')) ? ('' . $children['pagetitle'] . '') : $children['pagetitle'] ))), + 'createdon' => ($modx->toDateFormat($children['createdon']+$server_offset_time,'dateOnly')), + 'pub_date' => ($children['pub_date']? ($modx->toDateFormat($children['pub_date']+$server_offset_time,'dateOnly')) : ''), + 'status' => ($children['published'] == 0) ? ''.$_lang['page_data_unpublished'].'' : ''.$_lang['page_data_published'].'', + 'edit' => (($modx->hasPermission('edit_document')) ? '    ' : '') . + (($modx->hasPermission('delete_document')) ? '  ' : ''), + ); + */ + + // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь + // для сохранения сортировки + $icon_pub_unpub = (!$children['published']) ? '' : ''; + + $icon_del_undel = (!$children['deleted']) ? '' : ''; + + $listDocs[] = array( + 'docid' => $children['id'], + 'title' => (($children['deleted'] ? ('' . $icon . ' ' . $children['pagetitle'] . '') : (($modx->hasPermission('edit_document')) ? ('' . ($children['published'] ? $icon . ' ' . $children['pagetitle'] : '' . $icon . ' ' . $children['pagetitle'] . '') . '') : $icon . ' ' . $children['pagetitle']))), + 'createdon' => ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')), + 'pub_date' => ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : ''), + 'status' => ($children['published'] == 0) ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '', + 'edit' => (($modx->hasPermission('edit_document')) ? '   ' . $icon_pub_unpub . ' ' : '') . (($modx->hasPermission('delete_document')) ? $icon_del_undel : ''), + ); + } + + $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); } else { // No Child documents - $children_output = "

                              ".$_lang['resources_in_container_no']."

                              "; + $children_output = "

                              " . $_lang['resources_in_container_no'] . "

                              "; } - ?> - - - - -

                              - - - - - ('. $_REQUEST['id'].')'; ?> - -

                              - - -
                              - -
                              + + +

                              + config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . ' (' . $_REQUEST['id'] . ')' ?> +

                              + + - -
                              -

                              - -
                              - - - - - - - - - - - - - - - +
                              + +
                              + + + +
                              +

                              + + +
                              :
                              : ".$_lang['not_set'].")"?>
                              : ".$_lang['not_set'].")"?>
                              : ".$_lang['not_set'].")"?>
                              :
                              : ".$_lang['not_set'].")"?>
                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + config['show_meta'] === '1'): + $tbl_keyword_xref = $modx->getFullTableName('keyword_xref'); + $tbl_site_keywords = $modx->getFullTableName('site_keywords'); + $tbl_site_content_metatags = $modx->getFullTableName('site_content_metatags'); + $tbl_site_metatags = $modx->getFullTableName('site_metatags'); + // Get list of current keywords for this document + $keywords = array(); + $rs = $modx->db->select('k.keyword', "{$tbl_site_keywords} AS k, {$tbl_keyword_xref} AS x ", "k.id = x.keyword_id AND x.content_id='{$id}'", 'k.keyword ASC'); + $keywords = $modx->db->getColumn('keyword', $rs); + + // Get list of selected site META tags for this document + $metatags_selected = array(); + $rs = $modx->db->select('meta.id, meta.name, meta.tagvalue', "{$tbl_site_metatags} AS meta LEFT JOIN {$tbl_site_content_metatags} AS sc ON sc.metatag_id = meta.id", "sc.content_id='{$content['id']}'"); + while($row = $modx->db->getRow($rs)) { + $metatags_selected[] = $row['name'] . ': ' . $row['tagvalue'] . ''; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              :
                              : + " . $_lang['not_set'] . ")" ?> +
                              :" . $_lang['not_set'] . ")" ?>
                              :" . $_lang['not_set'] . ")" ?>
                              :
                              :" . $_lang['not_set'] . ")" ?>
                              :" . $_lang['not_set'] . ")"; + } + ?>
                              :', $metatags_selected); + } else { + echo "(" . $_lang['not_set'] . ")"; + } + ?>
                               
                              :toDateFormat($content['createdon'] + $server_offset_time) ?> () +
                              :toDateFormat($content['editedon'] + $server_offset_time) ?> () +
                               
                              :' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '' ?>
                              :" . $_lang['not_set'] . ")" : $modx->toDateFormat($content['pub_date']) ?>
                              :" . $_lang['not_set'] . ")" : $modx->toDateFormat($content['unpub_date']) ?>
                              :
                              :
                              :
                              :
                              :' . $_lang['private'] . ' ' . $_style["icons_secured"] ?>
                              :' . $_lang['private'] . ' ' . $_style["icons_secured"] ?>
                               
                              :
                              :
                              :
                              +
                              + + +
                              +

                              + + 0) { + echo '

                              ' . $numRecords . ' ' . $_lang['resources_in_container'] . ' (' . $content['pagetitle'] . ')

                              ' . "\n"; + } + echo $filter_sort . $filter_dir; + echo $children_output . "\n"; + ?> +
                              + + config['cache_type'] != 2) { ?> + +
                              +

                              + + + config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; + $handle = @fopen($filename, "r"); + if(!$handle) { + $buffer = $_lang['page_data_notcached']; + } else { + while(!feof($handle)) { + $buffer .= fgets($handle, 4096); + } + fclose($handle); + $buffer = $_lang['page_data_cached'] . '

                              \n"; + } + echo $buffer; + ?> +

                              + + +
                              + +
                              config['show_meta']==='1'): - $tbl_keyword_xref = $modx->getFullTableName('keyword_xref'); - $tbl_site_keywords = $modx->getFullTableName('site_keywords'); - $tbl_site_content_metatags = $modx->getFullTableName('site_content_metatags'); - $tbl_site_metatags = $modx->getFullTableName('site_metatags'); - // Get list of current keywords for this document - $keywords = array(); - $rs = $modx->db->select( - 'k.keyword', - "{$tbl_site_keywords} AS k, {$tbl_keyword_xref} AS x ", - "k.id = x.keyword_id AND x.content_id='{$id}'", - 'k.keyword ASC'); - $keywords = $modx->db->getColumn('keyword', $rs); - -// Get list of selected site META tags for this document - $metatags_selected = array(); - $rs = $modx->db->select( - 'meta.id, meta.name, meta.tagvalue', - "{$tbl_site_metatags} AS meta LEFT JOIN {$tbl_site_content_metatags} AS sc ON sc.metatag_id = meta.id", - "sc.content_id='{$content['id']}'" - ); - while ($row = $modx->db->getRow($rs)) { - $metatags_selected[] = $row['name'].': '.$row['tagvalue'].''; - } -?> - : - ".$_lang['not_set'].")"; - ?> - : - ', $metatags_selected); - else echo "(".$_lang['not_set'].")"; - ?> - docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; +} ?> -   - - : - toDateFormat($content['createdon']+$server_offset_time)?> () - - : - toDateFormat($content['editedon']+$server_offset_time)?> () - -   - - : - '.$_lang['page_data_unpublished'].'' : ''.$_lang['page_data_published'].''?> - : - ".$_lang['not_set'].")" : $modx->toDateFormat($content['pub_date'])?> - : - ".$_lang['not_set'].")" : $modx->toDateFormat($content['unpub_date'])?> - : - - : - - : - - : - - : - '.$_lang['private'].' '?> - : - '.$_lang['private'].' '?> -   - - : - - : - - : - - -
                              - - - -
                              -

                              - -hasPermission('new_document')) { ?> - - + + +
                              +
                              + +
                              0) - echo '

                              '.$numRecords.' '.$_lang['resources_in_container'].' ('.$content['pagetitle'].')

                              '."\n"; - echo $filter_sort.$filter_dir; - echo $children_output."\n"; -?> -
                              -config['cache_type'] !=2) { ?> - -
                              -

                              - - config['base_path']."assets/cache/docid_".$id.".pageCache.php"; - $handle = @fopen($filename, "r"); - if(!$handle) { - $buffer = $_lang['page_data_notcached']; - } else { - while (!feof($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose($handle); - $buffer = $_lang['page_data_cached'].'

                              \n"; - } - echo $buffer; -?> -

                              - - - - - - -
                              -
                              - -
                              -INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('view_eventlog')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table Names (alphabetical) -$tbl_event_log = $modx->getFullTableName('event_log'); +$tbl_event_log = $modx->getFullTableName('event_log'); $tbl_manager_users = $modx->getFullTableName('manager_users'); -$tbl_web_users = $modx->getFullTableName('web_users'); +$tbl_web_users = $modx->getFullTableName('web_users'); // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op']=='reset') { +if($_REQUEST['op'] == 'reset') { $sqlQuery = $query = ''; - $_PAGE['vs']['search']=''; -} -else { - $sqlQuery = $query = isset($_REQUEST['search'])? $_REQUEST['search']:$_PAGE['vs']['search']; - if(!is_numeric($sqlQuery)) $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = ''; +} else { + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + if(!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } $_PAGE['vs']['search'] = $query; } // get & save listmode -$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode']:$_PAGE['vs']['lm']; +$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : $_PAGE['vs']['lm']; $_PAGE['vs']['lm'] = $listmode; // context menu -include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang['view_log'],"js:menuAction(1)",$_style['icons_save']); +$cm->addItem($_lang['view_log'], "js:menuAction(1)", ''); $cm->addSeparator(); -$cm->addItem($_lang['delete'], "js:menuAction(2)",$_style['icons_delete'],(!$modx->hasPermission('delete_eventlog') ? 1:0)); +$cm->addItem($_lang['delete'], "js:menuAction(2)", '', (!$modx->hasPermission('delete_eventlog') ? 1 : 0)); echo $cm->render(); ?>
                              - - - + + + -

                              - - - - - - -

                              +

                              + +

                              -
                              -
                              - -

                              - -
                              - db->select( - "el.id, ELT(el.type , '{$_style['icons_event1']}' , '{$_style['icons_event2']}' , '{$_style['icons_event3']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", - "{$tbl_event_log} AS el +
                              +
                              + db->select("el.id, ELT(el.type , '{$_style['actions_info']}' , '{$_style['actions_triangle']}' , '{$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", - ($sqlQuery ? "".(is_numeric($sqlQuery)?"(eventid='{$sqlQuery}') OR ":'')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - "createdon DESC" - ); - include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; - $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass="grid"; - $grd->columnHeaderClass="gridHeader"; - $grd->itemClass="gridItem"; - $grd->altItemClass="gridAltItem"; - $grd->fields="type,source,createdon,eventid,username"; - $grd->columns=$_lang['type']." ,".$_lang['source']." ,".$_lang['date']." ,".$_lang['event_id']." ,".$_lang['sysinfo_userid']; - $grd->colWidths="34,,150,60"; - $grd->colAligns="center,,,center,center"; - $grd->colTypes="template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if($listmode=='1') $grd->pageSize=0; - if($_REQUEST['op']=='reset') $grd->pageNumber = 1; - // render grid - echo $grd->render(); - ?> + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "34,,150,60"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
                              +
                              - -
                              diff --git a/manager/actions/eventlog_details.dynamic.php b/manager/actions/eventlog_details.dynamic.php index 8917780afa..4de946887a 100644 --- a/manager/actions/eventlog_details.dynamic.php +++ b/manager/actions/eventlog_details.dynamic.php @@ -1,80 +1,101 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if(!$modx->hasPermission('view_eventlog')) { +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('view_eventlog')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // get id $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; -$ds = $modx->db->select( - 'el.*, IFNULL(wu.username,mu.username) as username', - $modx->getFullTableName("event_log")." el - LEFT JOIN ".$modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0 - LEFT JOIN ".$modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", - "el.id='{$id}'" - ); - $content = $modx->db->getRow($ds); +$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el + LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0 + LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); +$content = $modx->db->getRow($ds); ?> -

                              +

                                -hasPermission('delete_eventlog')) { ?> -
                              • " />
                              • - -
                              • " />
                              • + hasPermission('delete_eventlog')) { ?> +
                              • + "> +
                              • + +
                              • + "> +
                              +
                              - - - - -
                              -
                              -toDateFormat($content["createdon"]); -if($content["type"]==1) $msgtype = $_lang["information"]; -else if($content["type"]==2) $msgtype = $_lang["warning"]; -else if($content["type"]==3) $msgtype = $_lang["error"]; -echo << - -
                              {$msgtype}

                              - - - {$_lang["event_id"]}: - {$content["eventid"]} - {$_lang["source"]}: - {$content["source"]} - -
                               
                              - - {$_lang["date"]}: - $date - {$_lang["user"]}: - {$content["username"]} - -
                               
                              - -
                              - {$content["description"]} - - - -HTML; -?> -
                              + + + + +
                              +
                              +
                              + toDateFormat($content["createdon"]); + if($content["type"] == 1) { + $icon = $_style['actions_info']; + $msgtype = $_lang["information"]; + } else if($content["type"] == 2) { + $icon = $_style['actions_triangle']; + $msgtype = $_lang["warning"]; + } else if($content["type"] == 3) { + $icon = $_style['actions_error']; + $msgtype = $_lang["error"]; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              +
                              +
                              +
                              ::
                              +
                               
                              +
                              ::
                              +
                               
                              +

                              + +
                              +
                              +
                              diff --git a/manager/actions/export_site.static.php b/manager/actions/export_site.static.php index 23b5d192cc..42696cc0d5 100644 --- a/manager/actions/export_site.static.php +++ b/manager/actions/export_site.static.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('export_static')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -7,99 +9,89 @@ // figure out the base of the server, so we know where to get the documents in order to export them ?> -

                              - - - - - - +

                              +

                              - +
                              - - -
                              -
                              -
                              -

                              - +
                              + - +

                              + -if(isset($_POST['export'])) -{ - $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); - echo $rs; -} -else -{ -?> + - - - - - - - - - - - - - - - - - - - - - - - - -
                              -
                              -
                              - -
                              + if(isset($_POST['export'])) { + $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); + echo $rs; + } else { + ?> - - - +
                              + + + + + + + + + + + + + + + + + + + + + + + + +
                              +
                              +
                              + +
                              - + + +
                              + -
                              -
                              -

                              - -'.$_lang['export_site_message'].'

                              '; -?> -
                              -
                              +
                              +
                              +

                              + + ' . $_lang['export_site_message'] . '

                              '; + ?> +
                              +
                              diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index 3ba2efe16a..ecb2625ba3 100644 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('file_manager')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -8,38 +10,52 @@ // settings $theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/'; -$excludes = array('.', '..', '.svn'); -$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix,'.') : ''; -$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess'.$alias_suffix); -$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess'.$alias_suffix); -$viewablefiles = explode(',', 'jpg,gif,png,ico'); - -$editablefiles = add_dot($editablefiles); +$excludes = array( + '.', + '..', + '.svn' +); +$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : ''; +$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess' . $alias_suffix); +$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess' . $alias_suffix); +$viewablefiles = explode(',', 'jpg,gif,png,ico'); + +$editablefiles = add_dot($editablefiles); $inlineviewablefiles = add_dot($inlineviewablefiles); -$viewablefiles = add_dot($viewablefiles); +$viewablefiles = add_dot($viewablefiles); $protected_path = array(); /* jp only if($_SESSION['mgrRole']!=1) { */ - $protected_path[] = $modx->config['site_manager_path']; - $protected_path[] = $modx->config['base_path'] . 'temp/backup'; - $protected_path[] = $modx->config['base_path'] . 'assets/backup'; - - if(!$modx->hasPermission('save_plugin')) $protected_path[] = $modx->config['base_path'] . 'assets/plugins'; - if(!$modx->hasPermission('save_snippet')) $protected_path[] = $modx->config['base_path'] . 'assets/snippets'; - if(!$modx->hasPermission('save_template')) $protected_path[] = $modx->config['base_path'] . 'assets/templates'; - if(!$modx->hasPermission('save_module')) $protected_path[] = $modx->config['base_path'] . 'assets/modules'; - if(!$modx->hasPermission('empty_cache')) $protected_path[] = $modx->config['base_path'] . 'assets/cache'; - if(!$modx->hasPermission('import_static')) { - $protected_path[] = $modx->config['base_path'] . 'temp/import'; - $protected_path[] = $modx->config['base_path'] . 'assets/import'; - } - if(!$modx->hasPermission('export_static')) { - $protected_path[] = $modx->config['base_path'] . 'temp/export'; - $protected_path[] = $modx->config['base_path'] . 'assets/export'; - } +$protected_path[] = $modx->config['site_manager_path']; +$protected_path[] = $modx->config['base_path'] . 'temp/backup'; +$protected_path[] = $modx->config['base_path'] . 'assets/backup'; + +if(!$modx->hasPermission('save_plugin')) { + $protected_path[] = $modx->config['base_path'] . 'assets/plugins'; +} +if(!$modx->hasPermission('save_snippet')) { + $protected_path[] = $modx->config['base_path'] . 'assets/snippets'; +} +if(!$modx->hasPermission('save_template')) { + $protected_path[] = $modx->config['base_path'] . 'assets/templates'; +} +if(!$modx->hasPermission('save_module')) { + $protected_path[] = $modx->config['base_path'] . 'assets/modules'; +} +if(!$modx->hasPermission('empty_cache')) { + $protected_path[] = $modx->config['base_path'] . 'assets/cache'; +} +if(!$modx->hasPermission('import_static')) { + $protected_path[] = $modx->config['base_path'] . 'temp/import'; + $protected_path[] = $modx->config['base_path'] . 'assets/import'; +} +if(!$modx->hasPermission('export_static')) { + $protected_path[] = $modx->config['base_path'] . 'temp/export'; + $protected_path[] = $modx->config['base_path'] . 'assets/export'; +} /* } */ @@ -51,582 +67,569 @@ $new_file_permissions = $new_file_permissions ? octdec($new_file_permissions) : 0666; // End Mod - by Raymond // make arrays from the file upload settings -$upload_files = explode(',',$upload_files); -$upload_images = explode(',',$upload_images); -$upload_media = explode(',',$upload_media); -$upload_flash = explode(',',$upload_flash); +$upload_files = explode(',', $upload_files); +$upload_images = explode(',', $upload_images); +$upload_media = explode(',', $upload_media); +$upload_flash = explode(',', $upload_flash); // now merge them $uploadablefiles = array(); -$uploadablefiles = array_merge($upload_files,$upload_images,$upload_media,$upload_flash); +$uploadablefiles = array_merge($upload_files, $upload_images, $upload_media, $upload_flash); $uploadablefiles = add_dot($uploadablefiles); -function add_dot($array) -{ +function add_dot($array) { $count = count($array); - for($i=0; $i<$count; $i++) { - $array[$i] = '.'.strtolower(trim($array[$i])); // add a dot :) + for($i = 0; $i < $count; $i++) { + $array[$i] = '.' . strtolower(trim($array[$i])); // add a dot :) } return $array; } + // end settings // get the current work directory -if(isset($_REQUEST['path']) && !empty($_REQUEST['path'])) -{ - $_REQUEST['path'] = str_replace('..','',$_REQUEST['path']); - $startpath = is_dir($_REQUEST['path']) ? $_REQUEST['path'] : removeLastPath($_REQUEST['path']) ; -} -else -{ +if(isset($_REQUEST['path']) && !empty($_REQUEST['path'])) { + $_REQUEST['path'] = str_replace('..', '', $_REQUEST['path']); + $startpath = is_dir($_REQUEST['path']) ? $_REQUEST['path'] : removeLastPath($_REQUEST['path']); +} else { $startpath = $filemanager_path; } -$startpath = rtrim($startpath,'/'); +$startpath = rtrim($startpath, '/'); -if(!is_readable($startpath)) -{ +if(!is_readable($startpath)) { $modx->webAlertAndQuit($_lang["not_readable_dir"]); } // Raymond: get web start path for showing pictures $rf = realpath($filemanager_path); $rw = realpath('../'); -$webstart_path = str_replace('\\','/',str_replace($rw,'',$rf)); -if(substr($webstart_path,0,1)=='/') $webstart_path = '..'.$webstart_path; -else $webstart_path = '../'.$webstart_path; - -?> - -

                              - - - - - - -

                              -
                              -
                                - -
                              • ">
                              • - - [+subject+]'; - $ph['image'] = $_style['files_folder-open']; - $ph['subject'] = $_lang['add_folder']; - $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name='; - $_ = parsePlaceholder($tpl,$ph); - - $tpl = '
                              • ' . $_lang['files.dynamic.php1'] . '
                              • '; - $ph['image'] = $_style['files_page_html']; - $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name='; - $_ .= parsePlaceholder($tpl,$ph); - echo $_; -} -?> -
                              • -
                              -
                              - -
                              -
                              - -", ''); + if(f) a.href += encodeURI(f); + return !!(f); + } -if(in_array($startpath,$protected_path)) -{ - $modx->webAlertAndQuit($_lang["files.dynamic.php2"]); -} + function getFileName(a) { + var f = window.prompt("", ''); + if(f) a.href += encodeURI(f); + return !!(f); + } -$tpl = ' [+subject+] '; -$ph = array(); -$ph['style_path'] = $theme_image_path; -// To Top Level with folder icon to the left -if($startpath==$filemanager_path || $startpath.'/' == $filemanager_path) -{ - $ph['image'] = ''.$_style['files_top'] .''; - $ph['subject'] = 'Top'; -} -else -{ - $ph['image'] = ''.$_style['files_top'] .''; - $ph['subject'] = 'Top / '; -} -echo parsePlaceholder($tpl,$ph); + function deleteFolder(folder, status) { + if(confirmDeleteFolder(status)) { + window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token="; + return false; + } + } -$len = strlen($filemanager_path); -if(substr($startpath, $len, strlen($startpath))=='') - $topic_path = '/'; -else -{ - $topic_path = substr($startpath, $len, strlen($startpath)); - $pieces = explode('/',rtrim($topic_path,'/')); - $path = ''; - $count = count($pieces); - foreach($pieces as $i=>$v) - { - if(empty($v)) continue; - $path .= rtrim($v,'/') . '/'; - if(1<$count) - { - $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path.$path); - $pieces[$i] = '' . trim($v,'/') . ''; - } - else $pieces[$i] = trim($v,'/'); - $count--; - } - $topic_path = implode(' / ', $pieces); -} + function deleteFile(file) { + if(confirmDelete()) { + window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token="; + return false; + } + } -?> -webAlertAndQuit($_lang["files_access_denied"]); -} + function duplicateFile(file) { + var newFilename = prompt("", file); + if(newFilename !== null && newFilename !== file) { + window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token="; + } + } -// Unzip .zip files - by Raymond -if ($enablefileunzip && $_REQUEST['mode']=='unzip' && is_writable($startpath)) -{ - if(!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']),realpath($startpath))) - { - echo ''.$_lang['file_unzip_fail'].($err===0? 'Missing zip library (php_zip.dll / zip.so)':'').'

                              '; - } - else - { - echo ''.$_lang['file_unzip'].'

                              '; - } -} -// End Unzip - Raymond + function renameFolder(dir) { + var newDirname = prompt("", dir); + if(newDirname !== null && newDirname !== dir) { + window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token="; + } + } + function renameFile(file) { + var newFilename = prompt("", file); + if(newFilename !== null && newFilename !== file) { + window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token="; + } + } + + '.$_lang['file_folder_not_deleted'].'

                              '; - } - else - { - echo ''.$_lang['file_folder_deleted'].'

                              '; - } - } + if(in_array($startpath, $protected_path)) { + $modx->webAlertAndQuit($_lang["files.dynamic.php2"]); + } - // Create folder here - if($_REQUEST['mode']=='newfolder') - { - $old_umask = umask(0); - $foldername = str_replace('..\\','',str_replace('../','',$_REQUEST['name'])); - if(!mkdirs("{$startpath}/{$foldername}",0777)) - { - echo '',$_lang['file_folder_not_created'],'

                              '; - } - else - { - if (!@chmod($startpath.'/'.$foldername,$newfolderaccessmode)) - { - echo ''.$_lang['file_folder_chmod_error'].'

                              '; + $tpl = ' [+subject+] '; + $ph = array(); + $ph['style_path'] = $theme_image_path; + // To Top Level with folder icon to the left + if($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) { + $ph['image'] = '' . $_style['files_top'] . ''; + $ph['subject'] = 'Top'; + } else { + $ph['image'] = '' . $_style['files_top'] . ''; + $ph['subject'] = 'Top / '; } - else - { - echo ''.$_lang['file_folder_created'].'

                              '; + echo parsePlaceholder($tpl, $ph); + + $len = strlen($filemanager_path); + if(substr($startpath, $len, strlen($startpath)) == '') { + $topic_path = '/'; + } else { + $topic_path = substr($startpath, $len, strlen($startpath)); + $pieces = explode('/', rtrim($topic_path, '/')); + $path = ''; + $count = count($pieces); + foreach($pieces as $i => $v) { + if(empty($v)) { + continue; + } + $path .= rtrim($v, '/') . '/'; + if(1 < $count) { + $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path); + $pieces[$i] = '' . trim($v, '/') . ''; + } else { + $pieces[$i] = trim($v, '/'); + } + $count--; + } + $topic_path = implode(' / ', $pieces); } - } - umask($old_umask); - } - // Create file here - if($_REQUEST['mode']=='newfile') - { - $old_umask = umask(0); - $filename = str_replace('..\\','',str_replace('../','',$_REQUEST['name'])); - $filename = $modx->db->escape($filename); - - if(!checkExtension($filename)) - { - echo ''.$_lang['files_filetype_notok'].'

                              '; - } - elseif(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@',$filename)!==0) - { - echo $_lang['files.dynamic.php3']; - } - else - { - $rs = file_put_contents("{$startpath}/{$filename}",''); - if($rs===false) - { - echo '',$_lang['file_folder_not_created'],'

                              '; + + ?> + webAlertAndQuit($_lang["files_access_denied"]); } - else - { - echo $_lang['files.dynamic.php4']; + + // Unzip .zip files - by Raymond + if($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) { + if(!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) { + echo '' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '

                              '; + } else { + echo '' . $_lang['file_unzip'] . '

                              '; + } } - umask($old_umask); - } - } - // Duplicate file here - if($_REQUEST['mode']=='duplicate') - { - $old_umask = umask(0); - $filename = $_REQUEST['path']; - $filename = $modx->db->escape($filename); - $newFilename = str_replace('..\\','',str_replace('../','',$_REQUEST['newFilename'])); - $newFilename = $modx->db->escape($newFilename); - - if(!checkExtension($newFilename)) - { - echo ''.$_lang['files_filetype_notok'].'

                              '; - } - elseif(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@',$newFilename)!==0) - { - echo $_lang['files.dynamic.php3']; - } - else - { - if (!copy($filename, MODX_BASE_PATH.$newFilename)) { - echo $_lang['files.dynamic.php5']; + // End Unzip - Raymond + + + // New Folder & Delete Folder option - Raymond + if(is_writable($startpath)) { + // Delete Folder + if($_REQUEST['mode'] == 'deletefolder') { + $folder = $_REQUEST['folderpath']; + if(!$token_check || !@rrmdir($folder)) { + echo '' . $_lang['file_folder_not_deleted'] . '

                              '; + } else { + echo '' . $_lang['file_folder_deleted'] . '

                              '; + } + } + + // Create folder here + if($_REQUEST['mode'] == 'newfolder') { + $old_umask = umask(0); + $foldername = str_replace('..\\', '', str_replace('../', '', $_REQUEST['name'])); + if(!mkdirs("{$startpath}/{$foldername}", 0777)) { + echo '', $_lang['file_folder_not_created'], '

                              '; + } else { + if(!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) { + echo '' . $_lang['file_folder_chmod_error'] . '

                              '; + } else { + echo '' . $_lang['file_folder_created'] . '

                              '; + } + } + umask($old_umask); + } + // Create file here + if($_REQUEST['mode'] == 'newfile') { + $old_umask = umask(0); + $filename = str_replace('..\\', '', str_replace('../', '', $_REQUEST['name'])); + $filename = $modx->db->escape($filename); + + if(!checkExtension($filename)) { + echo '' . $_lang['files_filetype_notok'] . '

                              '; + } elseif(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) { + echo $_lang['files.dynamic.php3']; + } else { + $rs = file_put_contents("{$startpath}/{$filename}", ''); + if($rs === false) { + echo '', $_lang['file_folder_not_created'], '

                              '; + } else { + echo $_lang['files.dynamic.php4']; + } + umask($old_umask); + } + } + // Duplicate file here + if($_REQUEST['mode'] == 'duplicate') { + $old_umask = umask(0); + $filename = $_REQUEST['path']; + $filename = $modx->db->escape($filename); + $newFilename = str_replace('..\\', '', str_replace('../', '', $_REQUEST['newFilename'])); + $newFilename = $modx->db->escape($newFilename); + + if(!checkExtension($newFilename)) { + echo '' . $_lang['files_filetype_notok'] . '

                              '; + } elseif(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { + echo $_lang['files.dynamic.php3']; + } else { + if(!copy($filename, MODX_BASE_PATH . $newFilename)) { + echo $_lang['files.dynamic.php5']; + } + umask($old_umask); + } + } + // Rename folder here + if($_REQUEST['mode'] == 'renameFolder') { + $old_umask = umask(0); + $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname']; + $dirname = $modx->db->escape($dirname); + $newDirname = str_replace(array( + '..\\', + '../', + '\\', + '/' + ), '', $_REQUEST['newDirname']); + $newDirname = $modx->db->escape($newDirname); + + if(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { + echo $_lang['files.dynamic.php3']; + } else if(!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { + echo '', $_lang['file_folder_not_created'], '

                              '; + } + umask($old_umask); + } + // Rename file here + if($_REQUEST['mode'] == 'renameFile') { + $old_umask = umask(0); + $path = dirname($_REQUEST['path']); + $filename = $_REQUEST['path']; + $filename = $modx->db->escape($filename); + $newFilename = str_replace(array( + '..\\', + '../', + '\\', + '/' + ), '', $_REQUEST['newFilename']); + $newFilename = $modx->db->escape($newFilename); + + if(!checkExtension($newFilename)) { + echo '' . $_lang['files_filetype_notok'] . '

                              '; + } elseif(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { + echo $_lang['files.dynamic.php3']; + } else { + if(!rename($filename, $path . '/' . $newFilename)) { + echo $_lang['files.dynamic.php5']; + } + umask($old_umask); + } + } } - umask($old_umask); - } - } - // Rename folder here - if($_REQUEST['mode']=='renameFolder') { - $old_umask = umask(0); - $dirname = $_REQUEST['path'] .'/'. $_REQUEST['dirname']; - $dirname = $modx->db->escape($dirname); - $newDirname = str_replace(array('..\\', '../', '\\', '/'),'',$_REQUEST['newDirname']); - $newDirname = $modx->db->escape($newDirname); - - if(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@',$newDirname)!==0) - { - echo $_lang['files.dynamic.php3']; - } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) { - echo '', $_lang['file_folder_not_created'], '

                              '; - } - umask($old_umask); - } - // Rename file here - if($_REQUEST['mode']=='renameFile') - { - $old_umask = umask(0); - $path = dirname($_REQUEST['path']); - $filename = $_REQUEST['path']; - $filename = $modx->db->escape($filename); - $newFilename = str_replace(array('..\\', '../', '\\', '/'),'',$_REQUEST['newFilename']); - $newFilename = $modx->db->escape($newFilename); - - if(!checkExtension($newFilename)) - { - echo ''.$_lang['files_filetype_notok'].'

                              '; - } - elseif(preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@',$newFilename)!==0) - { - echo $_lang['files.dynamic.php3']; - } - else - { - if (!rename($filename, $path.'/'.$newFilename)) { - echo $_lang['files.dynamic.php5']; + // End New Folder - Raymond + + $filesize = 0; + $files = 0; + $folders = 0; + $dirs_array = array(); + $files_array = array(); + if(strlen(MODX_BASE_PATH) < strlen($filemanager_path)) { + $len--; } - umask($old_umask); - } - } -} -// End New Folder - Raymond - -$filesize = 0; -$files = 0; -$folders = 0; -$dirs_array = array(); -$files_array = array(); -if(strlen(MODX_BASE_PATH) < strlen($filemanager_path)) $len--; - -echo '
                              '; -?> - - - - - - - - - -'; -} -?>
                              '.$_lang['files_directory_is_empty'].'
                              -
                              -',$folders,' '; -echo $_lang['files_files'],': ',$files,' '; -echo $_lang['files_data'],': ',$modx->nicesize($filesizes),' '; -echo $_lang['files_dirwritable'],' ',is_writable($startpath)==1 ? $_lang['yes'].'.' : $_lang['no'].'.' -?> -
                              - -
                              + echo '
                              '; + ?> + + + + + + + + + + '; + } + ?>
                              ' . $_lang['files_directory_is_empty'] . '
                              +
                              + ' . $folders . ' '; + echo $_lang['files_files'] . ': ' . $files . ' '; + echo $_lang['files_data'] . ': ' . $modx->nicesize($filesizes) . ' '; + echo $_lang['files_dirwritable'] . ' ' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.' + ?> + +
                              + + + +
                              + + + + + + +
                              + + +
                              +
                              + " . $_lang['files_upload_inhibited_msg'] . "

                              "; + } + ?> +
                              +
                              - -
                              - - - - +if($_REQUEST['mode'] == "edit" || $_REQUEST['mode'] == "view") { + ?> + +
                              +
                              +
                              + webAlertAndQuit("Error opening file for reading."); + } + ?> + + + + + + + + +
                              + +
                              +
                              + invokeEvent('OnRichTextEditorInit', array( + 'editor' => 'Codemirror', + 'elements' => array( + 'content', + ), + 'contentType' => $contentType, + 'readOnly' => $_REQUEST['mode'] == 'edit' ? false : true + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } -
                              - - - -
                              - -".$_lang['files_upload_inhibited_msg']."

                              "; } -?> - - - - - - -
                              -
                              -
                              -webAlertAndQuit("Error opening file for reading."); +function determineIcon($file, $selFile, $mode) { + $icons = array( + 'default'=>'fa fa-file-o', + 'edit'=>'fa fa-pencil-square-o', + 'view'=>'fa fa-eye' + ); + $icon = $icons['default']; + if($file == $selFile) $icon = isset($icons[$mode]) ? $icons[$mode] : $icons['default']; + return ''; } -?> -
                              - - - - - - - -
                              -
                              -
                              -
                              -invokeEvent('OnRichTextEditorInit', array( - 'editor' => 'Codemirror', - 'elements' => array( - 'content', - ), - 'contentType'=>$contentType, - 'readOnly'=>$_REQUEST['mode']=='edit' ? false : true -)); -if (is_array($evtOut)) - echo implode('', $evtOut); - + +function markRow($file, $selFile, $mode) { + $classNames = array( + 'default'=>'', + 'edit'=>'editRow', + 'view'=>'viewRow' + ); + if($file == $selFile) { + $class = isset($classNames[$mode]) ? $classNames[$mode] : $classNames['default']; + return ' class="' . $class . '"'; + } + return ''; } -function ls($curpath) -{ - global $_lang,$theme_image_path,$_style; +function ls($curpath) { + global $_lang, $theme_image_path, $_style; global $excludes, $protected_path, $editablefiles, $inlineviewablefiles, $viewablefiles, $enablefileunzip, $enablefiledownload, $uploadablefiles, $folders, $files, $filesizes, $len, $dirs_array, $files_array, $webstart_path, $modx; $dircounter = 0; $filecounter = 0; - $curpath = str_replace('//','/',$curpath.'/'); + $curpath = str_replace('//', '/', $curpath . '/'); - if (!is_dir($curpath)) - { - echo 'Invalid path "',$curpath,'"
                              '; + if(!is_dir($curpath)) { + echo 'Invalid path "', $curpath, '"
                              '; return; } $dir = scandir($curpath); // first, get info - foreach ($dir as $file) - { - $newpath = $curpath.$file; - if($file==='..'||$file==='.') continue; - if(is_dir($newpath)) - { + foreach($dir as $file) { + $newpath = $curpath . $file; + if($file === '..' || $file === '.') { + continue; + } + if(is_dir($newpath)) { $dirs_array[$dircounter]['dir'] = $newpath; $dirs_array[$dircounter]['stats'] = lstat($newpath); - if($file==='..'||$file==='.') continue; - elseif(!in_array($file, $excludes) && !in_array($newpath,$protected_path)) - { - $dirs_array[$dircounter]['text'] = ' '.$file.''; - + if($file === '..' || $file === '.') { + continue; + } elseif(!in_array($file, $excludes) && !in_array($newpath, $protected_path)) { + $dirs_array[$dircounter]['text'] = ' ' . $file . ''; + $dfiles = scandir($newpath); - foreach($dfiles as $i=>$infile) - { - switch($infile) - { + foreach($dfiles as $i => $infile) { + switch($infile) { case '..': case '.': unset($dfiles[$i]); break; } } - $file_exists = (0' : ''; - } - else - { - $dirs_array[$dircounter]['text'] = ' '.$file . ''; - $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '' : ''; + $file_exists = (0 < count($dfiles)) ? 'file_exists' : ''; + + $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '' : ''; + } else { + $dirs_array[$dircounter]['text'] = ' ' . $file . ''; + $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '' : ''; } - - $dirs_array[$dircounter]['rename'] = is_writable($curpath) - ? ' ' - : ''; - + + $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? ' ' : ''; + // increment the counter $dircounter++; - } - else - { - $type=getExtension($newpath); + } else { + $type = getExtension($newpath); $files_array[$filecounter]['file'] = $newpath; $files_array[$filecounter]['stats'] = lstat($newpath); - $files_array[$filecounter]['text'] = ' '.$file; - $files_array[$filecounter]['view'] = (in_array($type, $viewablefiles)) - ? ' ' : (($enablefiledownload && in_array($type, $uploadablefiles))? ' ':' '); - $files_array[$filecounter]['view'] = (in_array($type, $inlineviewablefiles)) ? ' ' : $files_array[$filecounter]['view'] ; - $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type=='.zip') ? ' ' : '' ; - $files_array[$filecounter]['edit'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? ' ' : ' '; - $files_array[$filecounter]['duplicate'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? ' ' : ' '; - $files_array[$filecounter]['rename'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? ' ' : ' '; - $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? ' ' : ' '; + $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']) . $file; + $files_array[$filecounter]['view'] = (in_array($type, $viewablefiles)) ? ' ' : (($enablefiledownload && in_array($type, $uploadablefiles)) ? ' ' : ' '); + $files_array[$filecounter]['view'] = (in_array($type, $inlineviewablefiles)) ? ' ' : $files_array[$filecounter]['view']; + $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? ' ' : ''; + $files_array[$filecounter]['edit'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? ' ' : ' '; + $files_array[$filecounter]['duplicate'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? ' ' : ' '; + $files_array[$filecounter]['rename'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? ' ' : ' '; + $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? ' ' : ' '; // increment the counter $filecounter++; @@ -636,13 +639,12 @@ function ls($curpath) // dump array entries for directories $folders = count($dirs_array); sort($dirs_array); // sorting the array alphabetically (Thanks pxl8r!) - for($i=0; $i<$folders; $i++) - { + for($i = 0; $i < $folders; $i++) { $filesizes += $dirs_array[$i]['stats']['7']; echo ''; - echo '',$dirs_array[$i]['text'],''; - echo '',$modx->toDateFormat($dirs_array[$i]['stats']['9']),''; - echo '',$modx->nicesize($dirs_array[$i]['stats']['7']),''; + echo '' . $dirs_array[$i]['text'] . ''; + echo '' . $modx->toDateFormat($dirs_array[$i]['stats']['9']) . ''; + echo '' . $modx->nicesize($dirs_array[$i]['stats']['7']) . ''; echo ''; echo $dirs_array[$i]['rename']; echo $dirs_array[$i]['delete']; @@ -653,13 +655,12 @@ function ls($curpath) // dump array entries for files $files = count($files_array); sort($files_array); // sorting the array alphabetically (Thanks pxl8r!) - for($i=0; $i<$files; $i++) - { + for($i = 0; $i < $files; $i++) { $filesizes += $files_array[$i]['stats']['7']; - echo ''; - echo '',$files_array[$i]['text'],''; - echo '',$modx->toDateFormat($files_array[$i]['stats']['9']),''; - echo '',$modx->nicesize($files_array[$i]['stats']['7']),''; + echo ''; + echo '' . $files_array[$i]['text'] . ''; + echo '' . $modx->toDateFormat($files_array[$i]['stats']['9']) . ''; + echo '' . $modx->nicesize($files_array[$i]['stats']['7']) . ''; echo ''; echo $files_array[$i]['unzip']; echo $files_array[$i]['view']; @@ -675,53 +676,65 @@ function ls($curpath) function removeLastPath($string) { $pos = strrpos($string, '/'); - if($pos!==false) - { - $path = substr($string,0,$pos); + if($pos !== false) { + $path = substr($string, 0, $pos); + } else { + $path = false; } - else $path = false; return $path; } function getExtension($string) { $pos = strrpos($string, '.'); - if($pos!==false) - { - $ext = substr($string,$pos); - $ext = strtolower($ext); + if($pos !== false) { + $ext = substr($string, $pos); + $ext = strtolower($ext); + } else { + $ext = false; } - else $ext = false; return $ext; } -function checkExtension($path='') -{ +function checkExtension($path = '') { global $uploadablefiles; - - if(in_array(getExtension($path), $uploadablefiles)) return true; - else return false; + + if(in_array(getExtension($path), $uploadablefiles)) { + return true; + } else { + return false; + } } -function mkdirs($strPath, $mode){ // recursive mkdir function - if (is_dir($strPath)) return true; +function mkdirs($strPath, $mode) { // recursive mkdir function + if(is_dir($strPath)) { + return true; + } $pStrPath = dirname($strPath); - if (!mkdirs($pStrPath, $mode)) return false; + if(!mkdirs($pStrPath, $mode)) { + return false; + } return @mkdir($strPath); } -function logFileChange($type, $filename) -{ +function logFileChange($type, $filename) { //global $_lang; include_once('log.class.inc.php'); $log = new logHandler(); - switch ($type) - { - case 'upload': $string = 'Uploaded File'; break; - case 'delete': $string = 'Deleted File'; break; - case 'modify': $string = 'Modified File'; break; - default: $string = 'Viewing File'; break; + switch($type) { + case 'upload': + $string = 'Uploaded File'; + break; + case 'delete': + $string = 'Deleted File'; + break; + case 'modify': + $string = 'Modified File'; + break; + default: + $string = 'Viewing File'; + break; } $string = sprintf($string, $filename); @@ -729,43 +742,43 @@ function logFileChange($type, $filename) // HACK: change the global action to prevent double logging // @see index.php @ 915 - global $action; $action = 1; + global $action; + $action = 1; } // by patrick_allaert - php user notes -function unzip($file, $path) -{ +function unzip($file, $path) { global $newfolderaccessmode, $token_check; - - if(!$token_check) return false; - + + if(!$token_check) { + return false; + } + // added by Raymond - if (!extension_loaded('zip')) return 0; + if(!extension_loaded('zip')) { + return 0; + } // end mod $zip = zip_open($file); - if ($zip) - { + if($zip) { $old_umask = umask(0); - $path = rtrim($path,'/') . '/'; - while ($zip_entry = zip_read($zip)) - { - if (zip_entry_filesize($zip_entry) > 0) - { + $path = rtrim($path, '/') . '/'; + while($zip_entry = zip_read($zip)) { + if(zip_entry_filesize($zip_entry) > 0) { // str_replace must be used under windows to convert "/" into "\" $zip_entry_name = zip_entry_name($zip_entry); - $complete_path = $path.str_replace('\\', '/', dirname($zip_entry_name)); - $complete_name = $path.str_replace('\\', '/', $zip_entry_name); - if(!file_exists($complete_path)) - { + $complete_path = $path . str_replace('\\', '/', dirname($zip_entry_name)); + $complete_name = $path . str_replace('\\', '/', $zip_entry_name); + if(!file_exists($complete_path)) { $tmp = ''; - foreach(explode('/', $complete_path) AS $k) - { - $tmp .= $k.'/'; - if(!is_dir($tmp)) mkdir($tmp, 0777); + foreach(explode('/', $complete_path) AS $k) { + $tmp .= $k . '/'; + if(!is_dir($tmp)) { + mkdir($tmp, 0777); + } } } - if (zip_entry_open($zip, $zip_entry, 'r')) - { + if(zip_entry_open($zip, $zip_entry, 'r')) { file_put_contents($complete_name, zip_entry_read($zip_entry, zip_entry_filesize($zip_entry))); zip_entry_close($zip_entry); } @@ -778,12 +791,13 @@ function unzip($file, $path) zip_close($zip); } -function rrmdir($dir) -{ - foreach(glob($dir . '/*') as $file) - { - if(is_dir($file)) rrmdir($file); - else unlink($file); +function rrmdir($dir) { + foreach(glob($dir . '/*') as $file) { + if(is_dir($file)) { + rrmdir($file); + } else { + unlink($file); + } } return rmdir($dir); } @@ -792,61 +806,60 @@ function fileupload() { global $modx, $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; $msg = ''; - foreach ($_FILES['userfile']['name'] as $i => $name) { - if (!empty($_FILES['userfile']['tmp_name'][$i])) { + foreach($_FILES['userfile']['name'] as $i => $name) { + if(!empty($_FILES['userfile']['tmp_name'][$i])) { $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i]; - $userfile['error'] = $_FILES['userfile']['error'][$i]; - $name = $_FILES['userfile']['name'][$i]; - if ($modx->config['clean_uploaded_filename'] == 1) { + $userfile['error'] = $_FILES['userfile']['error'][$i]; + $name = $_FILES['userfile']['name'][$i]; + if($modx->config['clean_uploaded_filename'] == 1) { $nameparts = explode('.', $name); - $nameparts = array_map(array($modx, 'stripAlias'), $nameparts, array('file_manager')); - $name = implode('.', $nameparts); + $nameparts = array_map(array( + $modx, + 'stripAlias' + ), $nameparts, array('file_manager')); + $name = implode('.', $nameparts); } $userfile['name'] = $name; $userfile['type'] = $_FILES['userfile']['type'][$i]; - // this seems to be an upload action. $path = $modx->config['site_url'] . substr($startpath, strlen($filemanager_path), strlen($startpath)); $path = rtrim($path, '/') . '/' . $userfile['name']; $msg .= $path; - if ($userfile['error'] == 0) { + if($userfile['error'] == 0) { $img = (strpos($userfile['type'], 'image') !== false) ? '
                              ' : ''; $msg .= "

                              " . $_lang['files_file_type'] . $userfile['type'] . ", " . $modx->nicesize(filesize($userfile['tmp_name'])) . $img . '

                              '; } $userfilename = $userfile['tmp_name']; - if (is_uploaded_file($userfilename)) { + if(is_uploaded_file($userfilename)) { // file is uploaded file, process it! - if (!checkExtension($userfile['name'])) { + if(!checkExtension($userfile['name'])) { $msg .= '

                              ' . $_lang['files_filetype_notok'] . '

                              '; - } - else { - if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) { + } else { + if(@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) { // Ryan: Repair broken permissions issue with file manager - if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') + if(strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { @chmod($_POST['path'] . "/" . $userfile['name'], $new_file_permissions); + } // Ryan: End $msg .= '

                              ' . $_lang['files_upload_ok'] . '


                              '; // invoke OnFileManagerUpload event - $modx->invokeEvent('OnFileManagerUpload', - array( - 'filepath' => $_POST['path'], - 'filename' => $userfile['name'] - )); + $modx->invokeEvent('OnFileManagerUpload', array( + 'filepath' => $_POST['path'], + 'filename' => $userfile['name'] + )); // Log the change logFileChange('upload', $_POST['path'] . '/' . $userfile['name']); - } - else { + } else { $msg .= '

                              ' . $_lang['files_upload_copyfailed'] . ' ' . $_lang["files_upload_permissions_error"] . '

                              '; } } - } - else { + } else { $msg .= '
                              ' . $_lang['files_upload_error'] . ':'; - switch ($userfile['error']) { + switch($userfile['error']) { case 0: //no error; possible file attack! $msg .= $_lang['files_upload_error0']; break; @@ -873,22 +886,18 @@ function fileupload() { return $msg . '
                              '; } -function textsave() -{ +function textsave() { global $_lang; - + $msg = $_lang['editing_file']; $filename = $_POST['path']; - $content = $_POST['content']; + $content = $_POST['content']; // Write $content to our opened file. - if (file_put_contents($filename, $content) === FALSE) - { - $msg .= ''.$_lang['file_not_saved'].'

                              '; - } - else - { - $msg .= ''.$_lang['file_saved'].'

                              '; + if(file_put_contents($filename, $content) === FALSE) { + $msg .= '' . $_lang['file_not_saved'] . '

                              '; + } else { + $msg .= '' . $_lang['file_saved'] . '

                              '; $_REQUEST['mode'] = 'edit'; } // Log the change @@ -896,53 +905,51 @@ function textsave() return $msg; } -function delete_file() -{ +function delete_file() { global $_lang, $token_check; - + $msg = sprintf($_lang['deleting_file'], str_replace('\\', '/', $_REQUEST['path'])); - + $file = $_REQUEST['path']; - if(!$token_check || !@unlink($file)) - { - $msg .= ''.$_lang['file_not_deleted'].'

                              '; - } - else - { - $msg .= ''.$_lang['file_deleted'].'

                              '; + if(!$token_check || !@unlink($file)) { + $msg .= '' . $_lang['file_not_deleted'] . '

                              '; + } else { + $msg .= '' . $_lang['file_deleted'] . '

                              '; } // Log the change logFileChange('delete', $file); - + return $msg; } -function parsePlaceholder($tpl,$ph) { - foreach($ph as $k=>$v) { +function parsePlaceholder($tpl, $ph) { + foreach($ph as $k => $v) { $k = "[+{$k}+]"; - $tpl = str_replace($k,$v,$tpl); + $tpl = str_replace($k, $v, $tpl); } return $tpl; } -function checkToken() -{ - if(isset($_POST['token']) && !empty($_POST['token'])) $token = $_POST['token']; - elseif(isset($_GET['token']) && !empty($_GET['token'])) $token = $_GET['token']; - else $token = false; - - if(isset($_SESSION['token']) && !empty($_SESSION['token']) && $_SESSION['token']===$token) - { - $rs =true; +function checkToken() { + if(isset($_POST['token']) && !empty($_POST['token'])) { + $token = $_POST['token']; + } elseif(isset($_GET['token']) && !empty($_GET['token'])) { + $token = $_GET['token']; + } else { + $token = false; + } + + if(isset($_SESSION['token']) && !empty($_SESSION['token']) && $_SESSION['token'] === $token) { + $rs = true; + } else { + $rs = false; } - else $rs = false; $_SESSION['token'] = ''; return $rs; } -function makeToken() -{ +function makeToken() { $newToken = uniqid(''); $_SESSION['token'] = $newToken; return $newToken; diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index 7f77c2779e..48b1df1ca4 100644 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -1,55 +1,52 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} $helpBasePath = MODX_BASE_PATH . "assets/templates/help/"; ?> - - -

                              - - - - - - + +

                              +

                              -
                              - - + -natcasesort($help); - -foreach($help as $k=>$v) { - - $helpname = substr($v, 0, strrpos($v, '.')); - - $prefix = substr($helpname, 0, 2); - if(is_numeric($prefix)) { - $helpname = substr($helpname, 2, strlen($helpname)-1 ); - } - - $hnLower = strtolower($helpname); - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); - - echo '
                              '; - echo '

                              '.$helpname.'

                              '; - echo ''; - include_once($helpBasePath."{$v}"); - echo '
                              '; -} -?> -
                              + $v) { + + $helpname = substr($v, 0, strrpos($v, '.')); + + $prefix = substr($helpname, 0, 2); + if(is_numeric($prefix)) { + $helpname = substr($helpname, 2, strlen($helpname) - 1); + } + + $hnLower = strtolower($helpname); + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); + + echo '
                              '; + echo '

                              ' . $helpname . '

                              '; + echo ''; + include_once($helpBasePath . "{$v}"); + echo '
                              '; + } + ?> +
                              - -

                              - - - - - - -

                              - -
                              - -
                              - -
                              -
                              - + parent.tree.ca = "parent"; + function setParent(pId, pName) { + document.importFrm.parent.value = pId; + document.getElementById('parentName').innerHTML = pId + " (" + pName + ")"; + if(pId !== 0) + document.getElementById('reset').disabled = true; + else + document.getElementById('reset').disabled = false; + } + -if(!isset($_POST['import'])) { - echo "
                              ".$_lang['import_site_message']."
                              "; -?> +

                              + +

                              -
                              -
                              - - - - - - - - - - - - - - - - - - - - - - - - -
                               0 ()
                                -
                              - -
                                -
                              - -
                                - - -
                              -
                              - -
                              -
                              +
                              + +
                              -clearCache('full'); -?> - - - -
                              -
                              +
                              +
                              + " . $_lang['import_site_message'] . "
                              "; + ?> + +
                              + +
                              + + + + + + + + + + + + + + + + + + + + + + + + +
                               0 ()
                                +
                              + +
                                +
                              + +
                                + + +
                              +
                              + +
                              +
                              + + clearCache('full'); + ?> + + + +
                              + getFullTableName('site_content'); - + $output = ''; - + $maxtime = $_POST['maxtime']; - if(!is_numeric($maxtime)) $maxtime = 30; + if(!is_numeric($maxtime)) { + $maxtime = 30; + } @set_time_limit($maxtime); - - $mtime = microtime(); $mtime = explode(' ', $mtime); $mtime = $mtime[1] + $mtime[0]; + + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; $importstart = $mtime; - - if ($_POST['reset']=='on') - { + + if($_POST['reset'] == 'on') { $modx->db->truncate($tbl_site_content); $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); } - + $parent = intval($_POST['parent']); - - if(is_dir(MODX_BASE_PATH . 'temp/import')) $filedir = MODX_BASE_PATH . 'temp/import/'; - elseif(is_dir(MODX_BASE_PATH . 'assets/import')) $filedir = MODX_BASE_PATH . 'assets/import/'; - + + if(is_dir(MODX_BASE_PATH . 'temp/import')) { + $filedir = MODX_BASE_PATH . 'temp/import/'; + } elseif(is_dir(MODX_BASE_PATH . 'assets/import')) { + $filedir = MODX_BASE_PATH . 'assets/import/'; + } + $filesfound = 0; - + $files = getFiles($filedir); $files = pop_index($files); - + // no. of files to import $output .= sprintf('

                              ' . $_lang['import_files_found'] . '

                              ', $filesfound); - + // import files - if(0 < count($files)) - { - $rs = $modx->db->update(array('isfolder'=>1),$tbl_site_content,"id='{$parent}'"); - importFiles($parent,$filedir,$files,'root'); + if(0 < count($files)) { + $rs = $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); + importFiles($parent, $filedir, $files, 'root'); } - - $mtime = microtime(); $mtime = explode(' ', $mtime); $mtime = $mtime[1] + $mtime[0]; + + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; $importend = $mtime; $totaltime = ($importend - $importstart); - $output .= sprintf ('

                              '.$_lang['import_site_time'].'

                              ', round($totaltime, 3)); - - if($_POST['convert_link']=='on') convertLink(); - + $output .= sprintf('

                              ' . $_lang['import_site_time'] . '

                              ', round($totaltime, 3)); + + if($_POST['convert_link'] == 'on') { + convertLink(); + } + return $output; } -function importFiles($parent,$filedir,$files,$mode) { - global $modx; - global $_lang, $allowedfiles; - global $search_default, $cache_default, $publish_default; - - $tbl_site_content = $modx->getFullTableName('site_content'); +function importFiles($parent, $filedir, $files, $mode) { + global $modx; + global $_lang, $allowedfiles; + global $search_default, $cache_default, $publish_default; + + $tbl_site_content = $modx->getFullTableName('site_content'); $tbl_system_settings = $modx->getFullTableName('system_settings'); - - $createdon = time(); - $createdby = $modx->getLoginUserID(); - if (!is_array($files)) return; - if ($_POST['object']=='all') - { - $modx->config['default_template'] = '0'; - $richtext = '0'; + + $createdon = time(); + $createdby = $modx->getLoginUserID(); + if(!is_array($files)) { + return; } - else - { - $richtext = '1'; + if($_POST['object'] == 'all') { + $modx->config['default_template'] = '0'; + $richtext = '0'; + } else { + $richtext = '1'; } - - foreach($files as $id => $value) - { - if(is_array($value)) - { + + foreach($files as $id => $value) { + if(is_array($value)) { // create folder $alias = $id; - printf(''.$_lang['import_site_importing_document'].'', $alias); + printf('' . $_lang['import_site_importing_document'] . '', $alias); $field = array(); $field['type'] = 'document'; $field['contentType'] = 'text/html'; @@ -199,14 +209,15 @@ function importFiles($parent,$filedir,$files,$mode) { $field['isfolder'] = 1; $field['menuindex'] = 1; $find = false; - foreach(array('index.html','index.htm') as $filename) - { + foreach(array( + 'index.html', + 'index.htm' + ) as $filename) { $filepath = $filedir . $alias . '/' . $filename; - if($find===false && file_exists($filepath)) - { + if($find === false && file_exists($filepath)) { $file = getFileContent($filepath); - list($pagetitle,$content,$description) = treatContent($file,$filename,$alias); - + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + $date = filemtime($filepath); $field['pagetitle'] = $pagetitle; $field['longtitle'] = $pagetitle; @@ -215,22 +226,17 @@ function importFiles($parent,$filedir,$files,$mode) { $field['createdon'] = $date; $field['editedon'] = $date; $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) - { + if($newid) { $find = true; - echo ' - '.$_lang['import_site_success'] . '
                              ' . "\n"; - importFiles($newid, $filedir . $alias . '/',$value,'sub'); - } - else - { - echo ''.$_lang["import_site_failed"]." " - .$_lang["import_site_failed_db_error"].$modx->db->getLastError(); + echo ' - ' . $_lang['import_site_success'] . '
                              ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); exit; } } } - if($find===false) - { + if($find === false) { $date = time(); $field['pagetitle'] = '---'; $field['content'] = ''; @@ -238,37 +244,33 @@ function importFiles($parent,$filedir,$files,$mode) { $field['editedon'] = $date; $field['hidemenu'] = '1'; $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) - { + if($newid) { $find = true; - echo ' - '.$_lang['import_site_success'] . '
                              ' . "\n"; - importFiles($newid, $filedir . $alias . '/',$value,'sub'); - } - else - { - echo ''.$_lang["import_site_failed"]." " - .$_lang["import_site_failed_db_error"].$modx->db->getLastError(); + echo ' - ' . $_lang['import_site_success'] . '
                              ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); exit; } } - } - else - { + } else { // create document - if($mode=='sub' && $value == 'index.html') continue; + if($mode == 'sub' && $value == 'index.html') { + continue; + } $filename = $value; - $fparts = explode('.',$value); + $fparts = explode('.', $value); $alias = $fparts[0]; - $ext = (count($fparts)>1)? $fparts[count($fparts)-1]:""; - printf("".$_lang['import_site_importing_document']."", $filename); - - if(!in_array($ext,$allowedfiles)) echo ' - '.$_lang["import_site_skip"].'
                              ' . "\n"; - else - { + $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; + printf("" . $_lang['import_site_importing_document'] . "", $filename); + + if(!in_array($ext, $allowedfiles)) { + echo ' - ' . $_lang["import_site_skip"] . '
                              ' . "\n"; + } else { $filepath = $filedir . $filename; $file = getFileContent($filepath); - list($pagetitle,$content,$description) = treatContent($file,$filename,$alias); - + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + $date = filemtime($filepath); $field = array(); $field['type'] = 'document'; @@ -288,188 +290,176 @@ function importFiles($parent,$filedir,$files,$mode) { $field['createdon'] = $date; $field['editedon'] = $date; $field['isfolder'] = 0; - $field['menuindex'] = ($alias=='index') ? 0 : 2; + $field['menuindex'] = ($alias == 'index') ? 0 : 2; $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) - { - echo ' - '.$_lang['import_site_success'] . '
                              ' . "\n"; - } - else - { - echo ''.$_lang["import_site_failed"]." " - .$_lang["import_site_failed_db_error"].$modx->db->getLastError(); + if($newid) { + echo ' - ' . $_lang['import_site_success'] . '
                              ' . "\n"; + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); exit; } - + $is_site_start = false; - if($filename == 'index.html') $is_site_start = true; - if($is_site_start==true && $_POST['reset']=='on') - { - $modx->db->update(array('setting_value'=>$newid),$tbl_system_settings,"setting_name='site_start'"); - $modx->db->update(array('menuindex'=>0),$tbl_site_content,"id='{$newid}'"); + if($filename == 'index.html') { + $is_site_start = true; + } + if($is_site_start == true && $_POST['reset'] == 'on') { + $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); + $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); } } } } } -function getFiles($directory,$listing = array(), $count = 0) -{ +function getFiles($directory, $listing = array(), $count = 0) { global $_lang; global $filesfound; $dummy = $count; - if ($files = scandir($directory)) - { - foreach($files as $file) - { - if ($file=='.' || $file=='..') continue; - elseif ($h = @opendir($directory.$file."/")) - { + if($files = scandir($directory)) { + foreach($files as $file) { + if($file == '.' || $file == '..') { + continue; + } elseif($h = @opendir($directory . $file . "/")) { closedir($h); $count = -1; - $listing[$file] = getFiles($directory.$file."/",array(), $count + 1); - } - elseif(strpos($file,'.htm')!==false) - { + $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); + } elseif(strpos($file, '.htm') !== false) { $listing[$dummy] = $file; $dummy = $dummy + 1; $filesfound++; } } - } - else - { - echo '

                              '.$_lang["import_site_failed"]." " - .$_lang["import_site_failed_no_open_dir"].$directory.".

                              "; + } else { + echo '

                              ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

                              "; } return ($listing); } -function getFileContent($filepath) -{ +function getFileContent($filepath) { global $_lang; // get the file - if(!$buffer=file_get_contents($filepath)) - { - echo '

                              ' . $_lang['import_site_failed']." " - .$_lang["import_site_failed_no_retrieve_file"].$filepath.".

                              "; + if(!$buffer = file_get_contents($filepath)) { + echo '

                              ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

                              "; + } else { + return $buffer; } - else return $buffer; } -function pop_index($array) -{ +function pop_index($array) { $new_array = array(); - foreach($array as $k=>$v) - { - if($v!=='index.html' && $v!=='index.htm') - { + foreach($array as $k => $v) { + if($v !== 'index.html' && $v !== 'index.htm') { $new_array[$k] = $v; - } - else - { + } else { array_unshift($new_array, $v); } } - foreach($array as $k=>$v) - { - if(is_array($v)) - { + foreach($array as $k => $v) { + if(is_array($v)) { $new_array[$k] = $v; } } return $new_array; } -function treatContent($src,$filename,$alias) -{ +function treatContent($src, $filename, $alias) { global $modx; - + $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); - - if (preg_match("@(.*)@i",$src,$matches)) - { - $pagetitle = ($matches[1]!=='') ? $matches[1] : $filename; - $pagetitle = str_replace('[*pagetitle*]','',$pagetitle); + + if(preg_match("@(.*)@i", $src, $matches)) { + $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; + $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); + } else { + $pagetitle = $alias; } - else $pagetitle = $alias; - if(!$pagetitle) $pagetitle = $alias; - - if (preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i',$src,$matches)) - { - $description = ($matches[1]!=='') ? $matches[1] : $filename; - $description = str_replace('[*description*]','',$description); + if(!$pagetitle) { + $pagetitle = $alias; } - else $description = ''; - if ((preg_match("@]*>(.*)[^<]+@is",$src,$matches)) && $_POST['object']=='body') - { - $content = $matches[1]; + if(preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { + $description = ($matches[1] !== '') ? $matches[1] : $filename; + $description = str_replace('[*description*]', '', $description); + } else { + $description = ''; } - else - { + + if((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { + $content = $matches[1]; + } else { $content = $src; $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; $r = '$1' . $modx->config['modx_charset'] . '$2'; $content = preg_replace($s, $r, $content); $content = preg_replace('@.*@i', "[*pagetitle*]", $content); } - $content = str_replace('[*content*]','[ *content* ]',$content); + $content = str_replace('[*content*]', '[ *content* ]', $content); $content = trim($content); $pagetitle = $modx->db->escape($pagetitle); - return array($pagetitle,$content,$description); + return array( + $pagetitle, + $content, + $description + ); } -function convertLink() -{ +function convertLink() { global $modx; $tbl_site_content = $modx->getFullTableName('site_content'); - + $rs = $modx->db->select('id,content', $tbl_site_content); - while($row=$modx->db->getRow($rs)) - { + while($row = $modx->db->getRow($rs)) { $id = $row['id']; - $array = explode('config['site_url'])!==false) - { - $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'],'',$_); + if(strpos($_, $modx->config['site_url']) !== false) { + $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); + } + if($_[0] === '/') { + $_ = substr($_, 1); } - if($_[0]==='/') $_ = substr($_,1); - $_ = str_replace('/index.html','.html',$_); - $level = substr_count($_,'../'); - if(1<$level) - { - if(!isset($p[$id])) $p[$id] = $modx->getParentIds($id); + $_ = str_replace('/index.html', '.html', $_); + $level = substr_count($_, '../'); + if(1 < $level) { + if(!isset($p[$id])) { + $p[$id] = $modx->getParentIds($id); + } $k = array_keys($p[$id]); - while(0<$level) - { + while(0 < $level) { $dir = array_shift($k); $level--; } - if($dir!='') $dir .= '/'; + if($dir != '') { + $dir .= '/'; + } + } else { + $dir = ''; + } + + $_ = trim($_, './'); + if(strpos($_, '/') !== false) { + $_ = substr($_, strrpos($_, '/')); + } + $_ = $dir . str_replace('.html', '', $_); + if(!isset($target[$_])) { + $target[$_] = $modx->getIdFromAlias($_); } - else $dir = ''; - - $_ = trim($_,'./'); - if(strpos($_,'/')!==false) $_ = substr($_,strrpos($_,'/')); - $_ = $dir . str_replace('.html','',$_); - if(!isset($target[$_])) $target[$_] = $modx->getIdFromAlias($_); $target[$_] = trim($target[$_]); - if(!empty($target[$_])) $href = '[~' . $target[$_] . '~]'; + if(!empty($target[$_])) { + $href = '[~' . $target[$_] . '~]'; + } $array[$c] = 'db->escape($content); - $modx->db->update($f,$tbl_site_content,"id='{$id}'"); + $modx->db->update($f, $tbl_site_content, "id='{$id}'"); } } diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index 3cfca533a5..3cdd927afa 100644 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,17 +1,23 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('logs')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } function array_unique_multi($array, $checkKey) { // Use the builtin if we're not a multi-dimensional array - if (!is_array(current($array)) || empty($checkKey)) return array_unique($array); + if(!is_array(current($array)) || empty($checkKey)) { + return array_unique($array); + } $ret = array(); $checkValues = array(); // contains the unique key Values - foreach ($array as $key => $current) { - if (in_array($current[$checkKey], $checkValues)) continue; // duplicate + foreach($array as $key => $current) { + if(in_array($current[$checkKey], $checkValues)) { + continue; + } // duplicate $checkValues[] = $current[$checkKey]; $ret[$key] = $current; @@ -21,13 +27,12 @@ function array_unique_multi($array, $checkKey) { function record_sort($array, $key) { $hash = array(); - foreach ($array as $k => $v) $hash[$k] = $v[$key]; + foreach($array as $k => $v) $hash[$k] = $v[$key]; natsort($hash); $records = array(); - foreach ($hash as $k => $row) - $records[$k] = $array[$k]; + foreach($hash as $k => $row) $records[$k] = $array[$k]; return $records; } @@ -36,148 +41,168 @@ function record_sort($array, $key) { $logs = $modx->db->makeArray($rs); ?> -

                              - - - - - - -

                              +

                              + +

                              -
                              -
                              -

                              -
                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              - -
                              - -
                              - -
                              - -
                              - -
                              - " /> - " border="0" alt="No date" /> -
                              - " /> - " border="0" alt="No date" /> -
                              - -
                              - - " style="display:none;" /> -
                              -
                              -
                              +
                              +
                              +
                              +

                              +
                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              + +
                              + +
                              + +
                              + +
                              + +
                              + " /> + "> +
                              + " /> + "> +
                              + +
                              + + " style="display:none;" /> +
                              +
                              +
                              -
                              +
                              +
                              db->escape($_REQUEST['itemname'])."'"; - if($_REQUEST['message']!="") $sqladd[] = "message LIKE '%".$modx->db->escape($_REQUEST['message'])."%'"; + if($_REQUEST['searchuser'] != 0) { + $sqladd[] = "internalKey='" . intval($_REQUEST['searchuser']) . "'"; + } + if($_REQUEST['action'] != 0) { + $sqladd[] = "action=" . intval($_REQUEST['action']); + } + if($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { + $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; + } + if($_REQUEST['itemname'] != '0') { + $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; + } + if($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } // date stuff - if($_REQUEST['datefrom']!="") $sqladd[] = "timestamp>".$modx->toTimeStamp($_REQUEST['datefrom']); - if($_REQUEST['dateto']!="") $sqladd[] = "timestamp<".$modx->toTimeStamp($_REQUEST['dateto']); + if($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } // If current position is not set, set it to zero - if( !isset( $_REQUEST['int_cur_position'] ) || $_REQUEST['int_cur_position'] == 0 ){ - $int_cur_position = 0; + if(!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; } else { $int_cur_position = $_REQUEST['int_cur_position']; } @@ -185,102 +210,100 @@ function record_sort($array, $key) { // Number of result to display on the page, will be in the LIMIT of the sql query also $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - $extargv = "&a=13&searchuser=".$_REQUEST['searchuser']."&action=".$_REQUEST['action']. - "&itemid=".$_REQUEST['itemid']."&itemname=".$_REQUEST['itemname']."&message=". - $_REQUEST['message']."&dateto=".$_REQUEST['dateto']."&datefrom=". - $_REQUEST['datefrom']."&nrresults=".$int_num_result."&log_submit=".$_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) // build the sql - $limit = $num_rows = $modx->db->getValue( - $modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : '')) - ); - + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); - if($limit<1) { - echo '

                              '.$_lang["mgrlog_emptysrch"].'

                              '; - } else { - echo '

                              '.$_lang["mgrlog_sortinst"].'

                              '; +if($limit < 1) { + echo '

                              ' . $_lang["mgrlog_emptysrch"] . '

                              '; +} else { + echo '

                              ' . $_lang["mgrlog_sortinst"] . '

                              '; - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging( $num_rows, $int_cur_position, $int_num_result, $extargv ); + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position/$int_num_result; + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; - // Display the result as you like... - print "

                              ". $_lang["paging_showing"]." ". $array_paging['lower']; - print " ". $_lang["paging_to"] . " ". $array_paging['upper']; - print " (". $array_paging['total'] . " " . $_lang["paging_total"] . ")
                              "; - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "
                              " : " "); - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if($pagesfound>6) { - $paging .= $array_row_paging[$current_row-2]; // ." "; - $paging .= $array_row_paging[$current_row-1]; // ." "; - $paging .= $array_row_paging[$current_row]; // ." "; - $paging .= $array_row_paging[$current_row+1]; // ." "; - $paging .= $array_row_paging[$current_row+2]; // ." "; - } else { - for( $i=0; $i<$pagesfound; $i++ ){ - $paging .= $array_row_paging[$i] ." "; - } + // Display the result as you like... + print "

                              " . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
                              "; + $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; + $paging .= $array_row_paging[$current_row - 1]; // ." "; + $paging .= $array_row_paging[$current_row]; // ." "; + $paging .= $array_row_paging[$current_row + 1]; // ." "; + $paging .= $array_row_paging[$current_row + 2]; // ." "; + } else { + for($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; } - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . "

                              "; - echo $paging; - // The above exemple print somethings like: - // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> - // Of course you can now play with array_row_paging in order to print - // only the results you would like... - ?> - - - + } + $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . "

                              "; + echo $paging; + // The above exemple print somethings like: + // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> + // Of course you can now play with array_row_paging in order to print + // only the results you would like... + ?> + +
                              + + - + + db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + while($logentry = $modx->db->getRow($rs)) { + if(!preg_match("/^[0-9]+$/", $logentry['itemid'])) { $item = '
                              -
                              '; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' - . '[' . $logentry['itemid'] . '] ' . $logentry['itemname'] . ''; + } elseif($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . '[' . $logentry['itemid'] . '] ' . $logentry['itemname'] . ''; } else { $item = '[' . $logentry['itemid'] . '] ' . $logentry['itemname']; } //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; - ?> - - - - - - + + + + + + + - +
                              '.$logentry['username'].''; ?>toDateFormat($logentry['timestamp']+$server_offset_time); ?>
                              ' . $logentry['username'] . ''; ?>toDateFormat($logentry['timestamp'] + $server_offset_time); ?>
                              - +
                              INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('messages')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> -

                              - - - - - - + +

                              +

                              - -
                              -
                              -db->select('*', $modx->getFullTableName('user_messages'), "id='".(int)$_REQUEST['id']."'"); -$message=$modx->db->getRow($rs); -if(!$message) { - echo "Wrong number of messages returned!"; -} else { - if($message['recipient']!=$modx->getLoginUserID()) { - echo $_lang['messages_not_allowed_to_read']; - } else { - // output message! - // get the name of the sender - $sender = $message['sender']; - if($sender==0) { - $sendername = $_lang['messages_system_user']; - } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } -?> - - - - - - - - - - - - - - - - - - - - - - - - + +
                              -
                                -
                              • " />
                              • -
                              • " />
                              • -
                              • " />
                              • - - - -
                              -
                               
                              :
                              :toDateFormat($message['postdate']+$server_offset_time); ?>
                              :
                               
                              - ", $message['message']); - $dashcount = substr_count($message, "-----"); - $message = str_replace ("-----", "", $message); - for( $i=0; $i<$dashcount; $i++ ){ - $message .= ""; - } + +
                              +
                              +
                              + db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int) $_REQUEST['id'] . "'"); + $message = $modx->db->getRow($rs); + if(!$message) { + echo "Wrong number of messages returned!"; + } else { + if($message['recipient'] != $modx->getLoginUserID()) { + echo $_lang['messages_not_allowed_to_read']; + } else { + // output message! + // get the name of the sender + $sender = $message['sender']; + if($sender == 0) { + $sendername = $_lang['messages_system_user']; + } else { + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + - -
                              +
                                +
                              • + " /> +
                              • +
                              • + + " />
                              • +
                              • ">
                              • + + + +
                              +
                               
                              :
                              :toDateFormat($message['postdate'] + $server_offset_time); ?>
                              :
                               
                              + ", $message['message']); + $dashcount = substr_count($message, "-----"); + $message = str_replace("-----", "", $message); + for($i = 0; $i < $dashcount; $i++) { + $message .= ""; + } - echo $message; - ?> + echo $message; + ?> -
                              -db->update(array('messageread'=>1), $modx->getFullTableName('user_messages'), "id='{$_REQUEST['id']}'"); - } -} -?> -
                              -
                              +
                              + db->update(array('messageread' => 1), $modx->getFullTableName('user_messages'), "id='{$_REQUEST['id']}'"); + } + } + ?> +
                              +
                              -
                              -db->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); -$num_rows = $modx->db->getValue($rs); +
                              +
                              + db->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); + $num_rows = $modx->db->getValue($rs); -// ============================================================== -// Exemple Usage -// Note: I make 2 query to the database for this exemple, it -// could (and should) be made with only one query... -// ============================================================== + // ============================================================== + // Exemple Usage + // Note: I make 2 query to the database for this exemple, it + // could (and should) be made with only one query... + // ============================================================== -// If current position is not set, set it to zero -if( !isset( $_REQUEST['int_cur_position'] ) || $_REQUEST['int_cur_position'] == 0 ){ - $int_cur_position = 0; -} else { - $int_cur_position = (int)$_REQUEST['int_cur_position']; -} + // If current position is not set, set it to zero + if(!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = (int) $_REQUEST['int_cur_position']; + } -// Number of result to display on the page, will be in the LIMIT of the sql query also -$int_num_result = $number_of_messages; + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = $number_of_messages; -$extargv = "&a=10"; // extra argv here (could be anything depending on your page) + $extargv = "&a=10"; // extra argv here (could be anything depending on your page) -include_once "paginate.inc.php"; -// New instance of the Paging class, you can modify the color and the width of the html table -$p = new Paging( $num_rows, $int_cur_position, $int_num_result, $extargv ); + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); -// Load up the 2 array in order to display result -$array_paging = $p->getPagingArray(); -$array_row_paging = $p->getPagingRowArray(); + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); -// Display the result as you like... -$pager .= $_lang['showing']." ". $array_paging['lower']; -$pager .= " ".$_lang['to']." ". $array_paging['upper']; -$pager .= " (". $array_paging['total']." ".$_lang['total'].")"; -$pager .= "
                              ". $array_paging['previous_link'] ."<<" . (isset($array_paging['previous_link']) ? " " : " "); -for( $i=0; $i" : ""); + // Display the result as you like... + $pager .= $_lang['showing'] . " " . $array_paging['lower']; + $pager .= " " . $_lang['to'] . " " . $array_paging['upper']; + $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")"; + $pager .= "
                              " . $array_paging['previous_link'] . "<<" . (isset($array_paging['previous_link']) ? " " : " "); + for($i = 0; $i < sizeof($array_row_paging); $i++) { + $pager .= $array_row_paging[$i] . " "; + } + $pager .= $array_paging['next_link'] . ">>" . (isset($array_paging['next_link']) ? "" : ""); -// The above exemple print somethings like: -// Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> -// Of course you can now play with array_row_paging in order to print -// only the results you would like... + // The above exemple print somethings like: + // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> + // Of course you can now play with array_row_paging in order to print + // only the results you would like... -$rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); -$limit = $modx->db->getRecordCount($rs); -if($limit<1) { - echo $_lang['messages_no_messages']; -} else { -echo $pager; -$dotablestuff = 1; -?> - - - - - - - - - - - - -db->getRow($rs)) { - $sender = $message['sender']; - if($sender==0) { - $sendername = "[System]"; - } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } - $messagestyle = $message['messageread']==0 ? "messageUnread" : "messageRead"; -?> - - - - - - - - db->select('*', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + echo $_lang['messages_no_messages']; + } else { + echo $pager; + $dotablestuff = 1; + ?> + +
                              " : ""; ?>toDateFormat($message['postdate']+$server_offset_time); ?>
                              + + + + + + + + + + + db->getRow($rs)) { + $sender = $message['sender']; + if($sender == 0) { + $sendername = "[System]"; + } else { + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } + $messagestyle = $message['messageread'] == 0 ? "messageUnread" : "messageRead"; + ?> + + + + + + + + - -
                              " : ""; ?>toDateFormat($message['postdate'] + $server_offset_time); ?>
                              - -
                              + if($dotablestuff == 1) { ?> + + + +
                              +
                              -
                              -db->select('*', $modx->getFullTableName('user_messages'), "id='".$_REQUEST['id']."'"); - $message=$modx->db->getRow($rs); - if(!$message) { - echo "Wrong number of messages returned!"; - } else { - if($message['recipient']!=$modx->getLoginUserID()) { - echo $_lang['messages_not_allowed_to_read']; - } else { - // output message! - // get the name of the sender - $sender = $message['sender']; - if($sender==0) { - $sendername = "[System]"; - } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } - $subjecttext = $_REQUEST['m']=='rp' ? "Re: " : "Fwd: "; - $subjecttext .= $message['subject']; - $messagetext = "\n\n\n-----\n".$_lang['messages_from'].": $sendername\n".$_lang['messages_sent'].": ".$modx->toDateFormat($message['postdate']+$server_offset_time)."\n".$_lang['messages_subject'].": ".$message['subject']."\n\n".$message['message']; - if($_REQUEST['m']=='rp') { - $recipientindex = $message['sender']; - } - } - } -} +
                              +
                              + db->select('*', $modx->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'"); + $message = $modx->db->getRow($rs); + if(!$message) { + echo "Wrong number of messages returned!"; + } else { + if($message['recipient'] != $modx->getLoginUserID()) { + echo $_lang['messages_not_allowed_to_read']; + } else { + // output message! + // get the name of the sender + $sender = $message['sender']; + if($sender == 0) { + $sendername = "[System]"; + } else { + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } + $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: "; + $subjecttext .= $message['subject']; + $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message']; + if($_REQUEST['m'] == 'rp') { + $recipientindex = $message['sender']; + } + } + } + } + ?> + +
                              +
                              + : + + + + +
                              +     +     + +
                              :  + db->select('username, id', $modx->getFullTableName('manager_users')); + ?> + +
                              + + +
                              +
                              +

                              -?> +
                              + : - - -
                              -: - - - - -
                              -     -     -   
                              - :  - db->select('username, id', $modx->getFullTableName('manager_users')); - ?> - - - - -
                              -
                              - -

                              - -

                              -: + + + + + + + + + + + + +
                              :
                              :
                              - - - - - - - - - - - - -
                              :
                              :
                              + - - -
                              - -
                              + + +
                              +
                              db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." and messageread=0"); +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . " and messageread=0"); $_SESSION['nrnewmessages'] = $modx->db->getValue($rs); -$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); $_SESSION['nrtotalmessages'] = $modx->db->getValue($rs); $messagesallowed = $modx->hasPermission('messages'); ?> diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index 730a30c4b1..3b120136fb 100644 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,6 +1,8 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if(!($modx->hasPermission('new_module')||$modx->hasPermission('edit_module')||$modx->hasPermission('exec_module'))) { +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -8,41 +10,40 @@ $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op']=='reset') { +if($_REQUEST['op'] == 'reset') { $query = ''; - $_PAGE['vs']['search']=''; -} -else { - $query = isset($_REQUEST['search'])? $_REQUEST['search']:$_PAGE['vs']['search']; + $_PAGE['vs']['search'] = ''; +} else { + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; $sqlQuery = $modx->db->escape($query); $_PAGE['vs']['search'] = $query; } // get & save listmode -$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode']:$_PAGE['vs']['lm']; +$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : $_PAGE['vs']['lm']; $_PAGE['vs']['lm'] = $listmode; // context menu -include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang["run_module"],"js:menuAction(1)",$_style['icons_run'],(!$modx->hasPermission('exec_module') ? 1:0)); +$cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0)); $cm->addSeparator(); -$cm->addItem($_lang["edit"],"js:menuAction(2)",$_style['icons_edit_document'],(!$modx->hasPermission('edit_module') ? 1:0)); -$cm->addItem($_lang["duplicate"],"js:menuAction(3)",$_style['icons_resource_duplicate'],(!$modx->hasPermission('new_module') ? 1:0)); -$cm->addItem($_lang["delete"], "js:menuAction(4)",$_style['icons_delete'],(!$modx->hasPermission('delete_module') ? 1:0)); +$cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0)); +$cm->addItem($_lang["duplicate"], "js:menuAction(3)", $_style['actions_duplicate'], (!$modx->hasPermission('new_module') ? 1 : 0)); +$cm->addItem($_lang["delete"], "js:menuAction(4)", $_style['actions_delete'], (!$modx->hasPermission('delete_module') ? 1 : 0)); echo $cm->render(); ?> -

                              - - - - - - +

                              +

                              +
                              -
                              - -

                              +
                              + +

                              -
                              - -
                              +
                              + +
                              -
                              - + db->select( - "id,name,description,IF(locked,'{$_lang['yes']}','-') as locked,IF(disabled,'{$_lang['yes']}','-') as disabled,IF(icon<>'',icon,'{$_style['icons_modules']}') as icon", - $modx->getFullTableName("site_modules"), - (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - "name" - ); - include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; - $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass="grid"; - $grd->columnHeaderClass="gridHeader"; - $grd->itemClass="gridItem"; - $grd->altItemClass="gridAltItem"; - $grd->fields="icon,name,description,locked,disabled"; - $grd->columns=$_lang["icon"]." ,".$_lang["name"]." ,".$_lang["description"]." ,".$_lang["locked"]." ,".$_lang["disabled"]; - $grd->colWidths="34,,,60,60"; - $grd->colAligns="center,,,center,center"; - $grd->colTypes="template:||template:[+value+]"; - if($listmode=='1') $grd->pageSize=0; - if($_REQUEST['op']=='reset') $grd->pageNumber = 1; - // render grid - echo $grd->render(); - ?> + $ds = $modx->db->select("id,name,description,IF(locked,'{$_lang['yes']}','-') as locked,IF(disabled,'{$_lang['yes']}','-') as disabled,IF(icon<>'',icon,'{$_style['icons_modules']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name"); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->fields = "icon,name,description,locked,disabled"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; + $grd->colWidths = "34,,,60,60"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+value+]"; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
                              -
                              diff --git a/manager/actions/move_document.dynamic.php b/manager/actions/move_document.dynamic.php index 19cc0f6d0f..bd4e66aaff 100644 --- a/manager/actions/move_document.dynamic.php +++ b/manager/actions/move_document.dynamic.php @@ -1,13 +1,15 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('save_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } if(isset($_REQUEST['id'])) { - $id = intval($_REQUEST['id']); + $id = intval($_REQUEST['id']); } else { - $modx->webAlertAndQuit($_lang["error_no_id"]); + $modx->webAlertAndQuit($_lang["error_no_id"]); } // check permissions on the document @@ -18,7 +20,7 @@ $udperms->role = $_SESSION['mgrRole']; if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // Set the item name for logger @@ -28,67 +30,63 @@ ?> -

                              - - - - - - +

                              +

                              -
                              -

                              -

                              - - -:
                              -
                              - -
                              - -
                              -
                              +
                              +
                              +

                              +

                              + + + :
                              +
                              + +
                              + +
                              +
                              diff --git a/manager/actions/mutate_categories.dynamic.php b/manager/actions/mutate_categories.dynamic.php new file mode 100644 index 0000000000..db36b37542 --- /dev/null +++ b/manager/actions/mutate_categories.dynamic.php @@ -0,0 +1,44 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); + +if(!$modx->hasPermission('category_manager')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$_module_params = array( + 'module_version' => '1.0.0', + 'module_params' => '', + 'module_id' => $_GET['id'], + 'package_name' => 'Module_Categories_Manager', + 'native_language' => 'de', + 'name' => 'Categories Manager', + 'dirname' => $site_manager_url, + 'url' => 'index.php?a=120&id=' . $_GET['id'], + 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, + 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, + 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, + 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, + 'request_key' => 'module_categories_manager', + 'messages' => array() +); + +require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php'; +$cm = new Module_Categories_Manager(); + +// assign module_params to internal params +foreach( $_module_params as $param => $value ) +{ + $cm->set( $param, $value ); +} + +// catch the request actions +include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; + +if( !$categories = $cm->getCategories() ) +{ + setcookie('webfxtab_manage-categories-pane', 0 ); + $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); +} + +$cm->renderView('main', $categories ); +return; \ No newline at end of file diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 58b85e7a6e..57ab54a097 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1,78 +1,79 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} /********************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; +$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; +$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; +$add_path = $sd . $sb . $pg; /*******************/ // check permissions -switch ($modx->manager->action) { - case 27: - if (!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 85: - case 72: - case 4: - if (!$modx->hasPermission('new_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { - // check user has permissions for parent - include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; - $udperms->role = $_SESSION['mgrRole']; - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 27: + if(!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 85: + case 72: + case 4: + if(!$modx->hasPermission('new_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { + // check user has permissions for parent + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; + $udperms->role = $_SESSION['mgrRole']; + if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } - $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; // Get table names (alphabetical) -$tbl_categories = $modx->getFullTableName('categories'); -$tbl_document_group_names = $modx->getFullTableName('documentgroup_names'); -$tbl_member_groups = $modx->getFullTableName('member_groups'); -$tbl_membergroup_access = $modx->getFullTableName('membergroup_access'); -$tbl_document_groups = $modx->getFullTableName('document_groups'); -$tbl_keyword_xref = $modx->getFullTableName('keyword_xref'); -$tbl_site_content = $modx->getFullTableName('site_content'); -$tbl_site_content_metatags = $modx->getFullTableName('site_content_metatags'); -$tbl_site_keywords = $modx->getFullTableName('site_keywords'); -$tbl_site_metatags = $modx->getFullTableName('site_metatags'); -$tbl_site_templates = $modx->getFullTableName('site_templates'); -$tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access'); +$tbl_categories = $modx->getFullTableName('categories'); +$tbl_document_group_names = $modx->getFullTableName('documentgroup_names'); +$tbl_member_groups = $modx->getFullTableName('member_groups'); +$tbl_membergroup_access = $modx->getFullTableName('membergroup_access'); +$tbl_document_groups = $modx->getFullTableName('document_groups'); +$tbl_keyword_xref = $modx->getFullTableName('keyword_xref'); +$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_site_content_metatags = $modx->getFullTableName('site_content_metatags'); +$tbl_site_keywords = $modx->getFullTableName('site_keywords'); +$tbl_site_metatags = $modx->getFullTableName('site_metatags'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access'); $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); -$tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); - -if ($modx->manager->action == 27) { - //editing an existing document - // check permissions on the document - include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $id; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } +$tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); + +if($modx->manager->action == 27) { + //editing an existing document + // check permissions on the document + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $id; + $udperms->role = $_SESSION['mgrRole']; + + if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } } // check to see if resource isn't locked -if ($lockedEl = $modx->elementIsLocked(7, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['resource'])); +if($lockedEl = $modx->elementIsLocked(7, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); } // end check for lock @@ -80,1283 +81,1477 @@ $modx->lockElement(7, $id); // get document groups for current user -if ($_SESSION['mgrDocgroups']) { - $docgrp = implode(',', $_SESSION['mgrDocgroups']); +if($_SESSION['mgrDocgroups']) { + $docgrp = implode(',', $_SESSION['mgrDocgroups']); } -if (!empty ($id)) { - $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); - if($docgrp) $access .= " OR dg.document_group IN ({$docgrp})"; - $rs = $modx->db->select( - 'sc.*', - "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", - "sc.id='{$id}' AND ({$access})" - ); +if(!empty ($id)) { + $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); + if($docgrp) { + $access .= " OR dg.document_group IN ({$docgrp})"; + } + $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); $content = array(); - $content = $modx->db->getRow($rs); - $modx->documentObject = &$content; - if (!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - $_SESSION['itemname'] = $content['pagetitle']; + $content = $modx->db->getRow($rs); + $modx->documentObject = &$content; + if(!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + $_SESSION['itemname'] = $content['pagetitle']; } else { - $content = array(); - - if (isset($_REQUEST['newtemplate'])){ - $content['template'] = $_REQUEST['newtemplate']; - }else{ - $content['template'] = getDefaultTemplate(); - } - - $_SESSION['itemname'] = $_lang["new_resource"]; + $content = array(); + + if(isset($_REQUEST['newtemplate'])) { + $content['template'] = $_REQUEST['newtemplate']; + } else { + $content['template'] = getDefaultTemplate(); + } + + $_SESSION['itemname'] = $_lang["new_resource"]; } // restore saved form $formRestored = $modx->manager->loadFormValues(); -if(isset($_REQUEST['newtemplate'])) $formRestored = true; +if(isset($_REQUEST['newtemplate'])) { + $formRestored = true; +} // retain form values if template was changed // edited to convert pub_date and unpub_date // sottwell 02-09-2006 -if ($formRestored == true) { - $content = array_merge($content, $_POST); - $content['content'] = $_POST['ta']; - if (empty ($content['pub_date'])) { - unset ($content['pub_date']); - } else { - $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); - } - if (empty ($content['unpub_date'])) { - unset ($content['unpub_date']); - } else { - $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); - } +if($formRestored == true) { + $content = array_merge($content, $_POST); + $content['content'] = $_POST['ta']; + if(empty ($content['pub_date'])) { + unset ($content['pub_date']); + } else { + $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); + } + if(empty ($content['unpub_date'])) { + unset ($content['unpub_date']); + } else { + $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); + } } // increase menu index if this is a new document -if (!isset ($_REQUEST['id'])) { - if (!isset ($modx->config['auto_menuindex'])) $modx->config['auto_menuindex'] = 1; - if ($modx->config['auto_menuindex']) { - $pid = intval($_REQUEST['pid']); - $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); - $content['menuindex'] = $modx->db->getValue($rs); - } else { - $content['menuindex'] = 0; - } +if(!isset ($_REQUEST['id'])) { + if(!isset ($modx->config['auto_menuindex'])) { + $modx->config['auto_menuindex'] = 1; + } + if($modx->config['auto_menuindex']) { + $pid = intval($_REQUEST['pid']); + $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); + $content['menuindex'] = $modx->db->getValue($rs); + } else { + $content['menuindex'] = 0; + } } -if (isset ($_POST['which_editor'])) { - $modx->config['which_editor'] = $_POST['which_editor']; +if(isset ($_POST['which_editor'])) { + $modx->config['which_editor'] = $_POST['which_editor']; } // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 7; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); ?> - + // setup parameters + var t, dp = (snippetParams[df]) ? snippetParams[df].split("&") : [""]; + if(dp) { + t = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              <\/td><\/td><\/tr><\/thead>'; + for(p = 0; p < dp.length; p++) { + dp[p] = (dp[p] + '').replace(/^\s|\s$/, ""); // trim + ar = dp[p].split("="); + key = ar[0]; // param + ar = (ar[1] + '').split(";"); + desc = ar[0]; // description + dt = ar[1]; // data type + value = decode((currentParams[key]) ? currentParams[key] : (dt == 'list') ? ar[3] : (ar[2]) ? ar[2] : ''); + if(value !== currentParams[key]) currentParams[key] = value; + value = (value + '').replace(/^\s|\s$/, ""); // trim + if(dt) { + switch(dt) { + case 'int': + c = ''; + break; + case 'list': + c = ''; + break; + + } + t += '
                              ' + desc + '<\/td>' + c + '<\/td><\/tr>'; + } + } + t += '<\/table>'; + var td = (document.getElementById) ? document.getElementById('snippetparams') : document.all['snippetparams']; + td.innerHTML = t; + } + implodeParameters(); + } + + function setParameter(key, dt, ctrl) { + var v; + if(!ctrl) return null; + switch(dt) { + case 'int': + ctrl.value = parseInt(ctrl.value); + if(isNaN(ctrl.value)) ctrl.value = 0; + v = ctrl.value; + break; + case 'list': + v = ctrl.options[ctrl.selectedIndex].value; + break; + default: + v = ctrl.value + ''; + break; + } + currentParams[key] = v; + implodeParameters(); + } + + function resetParameters() { + document.mutate.params.value = ""; + lastmod[lastsp] = ""; + showParameters(); + } + + // implode parameters + function implodeParameters() { + var v, p, s = ''; + for(p in currentParams) { + v = currentParams[p]; + if(v) s += '&' + p + '=' + encode(v); + } + //document.forms['mutate'].params.value = s; + if(lastsp) lastmod[lastsp] = s; + } + + function encode(s) { + s = s + ''; + s = s.replace(/\=/g, '%3D'); // = + s = s.replace(/\&/g, '%26'); // & + return s; + } + + function decode(s) { + s = s + ''; + s = s.replace(/\%3D/g, '='); // = + s = s.replace(/\%26/g, '&'); // & + return s; + } + + function setLastClickedElement(type, id) { + localStorage.setItem('MODX_lastClickedElement', '[' + type + ',' + id + ']'); + } + + manager->action == '72') { // Web Link specific ?> + var lastImageCtrl; + var lastFileCtrl; + + function OpenServerBrowser(url, width, height) { + var iLeft = (screen.width - width) / 2; + var iTop = (screen.height - height) / 2; + + var sOptions = 'toolbar=no,status=no,resizable=yes,dependent=yes'; + sOptions += ',width=' + width; + sOptions += ',height=' + height; + sOptions += ',left=' + iLeft; + sOptions += ',top=' + iTop; + + var oWindow = window.open(url, 'FCKBrowseWindow', sOptions); + } + + function BrowseServer(ctrl) { + lastImageCtrl = ctrl; + var w = screen.width * 0.5; + var h = screen.height * 0.5; + OpenServerBrowser('media/browser//browser.php?Type=images', w, h); + } + + function BrowseFileServer(ctrl) { + lastFileCtrl = ctrl; + var w = screen.width * 0.5; + var h = screen.height * 0.5; + OpenServerBrowser('media/browser//browser.php?Type=files', w, h); + } + + function SetUrlChange(el) { + if('createEvent' in document) { + var evt = document.createEvent('HTMLEvents'); + evt.initEvent('change', false, true); + el.dispatchEvent(evt); + } else { + el.fireEvent('onchange'); + } + } + + function SetUrl(url, width, height, alt) { + if(lastFileCtrl) { + var c = document.getElementById(lastFileCtrl); + if(c && c.value !== url) { + c.value = url; + SetUrlChange(c); + } + lastFileCtrl = ''; + } else if(lastImageCtrl) { + var c = document.getElementById(lastImageCtrl); + if(c && c.value !== url) { + c.value = url; + SetUrlChange(c); + } + lastImageCtrl = ''; + } else { -
                              -invokeEvent('OnDocFormPrerender', array( - 'id' => $id, - 'template' => $content['template'] -)); - -if (is_array($evtOut)) - echo implode('', $evtOut); - -/*************************/ -$dir=isset($_REQUEST['dir'])?$_REQUEST['dir']:''; -$sort=isset($_REQUEST['sort'])?$_REQUEST['sort']:'createdon'; -$page=isset($_REQUEST['page'])?(int)$_REQUEST['page']:''; -/*************************/ + } + } + + + /* ]]> */ + + + + invokeEvent('OnDocFormPrerender', array( + 'id' => $id, + 'template' => $content['template'] + )); + + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + /*************************/ + $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; + $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; + $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; + /*************************/ + + ?> + + + + + + + + + + +
                              + +

                              + config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; + } else { + echo $_lang['create_resource_title']; + } ?> +

                              + + config['use_breadcrumbs']) { + $temp = array(); + $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; + + if(isset($_REQUEST['id']) && $content['parent'] != 0) { + $bID = (int) $_REQUEST['id']; + $temp = $modx->getParentIds($bID); + } else if(isset($_REQUEST['pid'])) { + $bID = (int) $_REQUEST['pid']; + $temp = $modx->getParentIds($bID); + array_unshift($temp, $bID); + } -?> - - - - - - - - - - -
                              -

                              - - - - - ('. $_REQUEST['id'].')'; } else { echo $_lang['create_resource_title'];}?> - -

                              - config['use_breadcrumbs']) { - $temp = array(); - $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; - - if (isset($_REQUEST['id']) && $content['parent'] != 0) { - $bID = (int)$_REQUEST['id']; - $temp = $modx->getParentIds($bID); - } else if (isset($_REQUEST['pid'])) { - $bID = (int)$_REQUEST['pid']; - $temp = $modx->getParentIds($bID); - array_unshift($temp, $bID); - } - - if ($temp) { - $parents = implode(',', $temp); - - if (!empty($parents)) { - $where = "FIND_IN_SET(id,'{$parents}') DESC"; - $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); - while ($row = $modx->db->getRow($rs)) { - $out .= ''; - } - } - } - - $out .= ''; - echo ''; - } - ?> - -
                              - -
                              - - -
                              - - -
                              - - - - invokeEvent('OnDocFormTemplateRender', array( - 'id' => $id - )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } else { - ?> -
                              -

                              - - - - - - - - - - - - - - -manager->action == '72') { // Web Link specific ?> - - - - - - - - - - - - - - - - - - - - - - - - -manager->action == '72') { -?> - - - - - - -
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" /> -
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              " alt="tree_folder" onclick="enableLinkSelection(!allowLinkSelection);" style="cursor:pointer; margin-top:-4px;" />  - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" spellcheck="true"/>
                              " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" /> -
                              onclick="changestate(document.mutate.hidemenu);" /> - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" /> -
                              - db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); - $parentname = $modx->db->getValue($rs); - if (!$parentname) { - $modx->webAlertAndQuit($_lang["error_no_parent"]); - } - } - ?> tree_folder" onclick="enableParentSelection(!allowParentSelection);" style="cursor:pointer;margin-top:-4px;" /> () -  " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" /> - -
                              - -
                              - -manager->action == '4') { ?> - -
                              -
                              -manager->action == '4') && $use_editor == 1) { - $htmlContent = $content['content']; -?> -
                              - - - - -
                              -config['which_editor']][] = 'ta'; - $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; - } else { - echo "\t".'
                              '."\n"; - } -?> -
                              - + } + } + } -manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { ?> - -
                              -
                              -' . $title . ''; + echo ''; + } + ?> + +
                              +
                                +
                              • + + "> + + + +
                              • + manager->action == '4' || $modx->manager->action == '72') { ?> +
                              • + + "> +
                              • +
                              • + + "> +
                              • + +
                              • + + "> +
                              • +
                              • + + "> +
                              • + +
                              • + "> + "> +
                              • +
                              • + + "> +
                              • +
                              +
                              + + +
                              + +
                              + + + + invokeEvent('OnDocFormTemplateRender', array( + 'id' => $id + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } else { + ?> +
                              +

                              + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '72') { // Web Link specific ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '72') { + ?> + + + + + + + + + + manager->action == '4') { ?> + + + + + +
                              + + " data-tooltip=""> + + + +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + +
                              + " data-tooltip=""> + + " onclick="enableLinkSelection(!allowLinkSelection);"> + +
                              + + " data-tooltip="" spellcheck="true"> + + +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + + + +
                              + + " data-tooltip=""> + + onclick="changestate(document.mutate.hidemenu);" /> +
                              + + " data-tooltip=""> + + db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); + $parentname = $modx->db->getValue($rs); + if(!$parentname) { + $modx->webAlertAndQuit($_lang["error_no_parent"]); + } + } + ?> + " onclick="enableParentSelection(!allowParentSelection);"> + () + +
                              +
                              +
                              + + +
                              +
                              + + +
                              + manager->action == '4') && $use_editor == 1) { + $htmlContent = $content['content']; + ?> +
                              + + + + +
                              + config['which_editor']][] = 'ta'; + $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; + } else { + echo "\t" . '
                              ' . "\n"; + } + ?> +
                              +
                              + + manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { ?> + db->select($field,$from,$where,'tvtpl.rank,tv.rank, tv.id'); - $limit = $modx->db->getRecordCount($rs); - if ($limit > 0) { - $tvsArray = $modx->db->makeArray($rs,'name'); - echo "\t".''."\n"; - require_once(MODX_MANAGER_PATH.'includes/tmplvars.inc.php'); - require_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php'); - $i = 0; - foreach ($tvsArray as $row) { - // Go through and display all Template Variables - if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { - // determine TV-options - $tvOptions = $modx->parseProperties($row['elements']); - if(!empty($tvOptions)) { - // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 - $editor = isset($tvOptions['editor']) ? $tvOptions['editor']: $modx->config['which_editor']; - }; - // Add richtext editor to the list - $richtexteditorIds[$editor][] = "tv".$row['id']; - $richtexteditorOptions[$editor]["tv".$row['id']] = $tvOptions; - } - // splitter - if ($i++ > 0) - echo "\t\t",'',"\n"; - - // post back value - if(array_key_exists('tv'.$row['id'], $_POST)) { - if(is_array($_POST['tv'.$row['id']])) { - $tvPBV = implode('||', $_POST['tv'.$row['id']]); - } else { - $tvPBV = $_POST['tv'.$row['id']]; - } - } else { - $tvPBV = $row['value']; - } - - $tvDescription = (!empty($row['description'])) ? '
                              ' . $row['description'] . '' : ''; - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
                              (' . $_lang['tmplvars_inherited'] . ')' : ''; - $tvName = $modx->hasPermission('edit_template') ? '
                              [*'.$row['name'].'*]' : ''; - - echo "\t\t",'\n", - "\t\t\t",'\n"; - } - echo "\t
                              ',$row['caption'].$tvName,"\n", - "\t\t\t",$tvDescription,$tvInherited,"',"\n", - "\t\t\t",renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray),"\n", - "\t\t
                              \n"; - } else { - // There aren't any Template Variables - echo "\t

                              ".$_lang['tmplvars_novars']."

                              \n"; - } - ?> -
                              - - - -
                              - - -
                              -

                              - - - - - hasPermission('publish_document') ? '' : 'disabled="disabled" '; ?> - - - - - - - - - - - - - - - - - - - - - - - - -manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { -?> - - - - - - - - - - - -manager->action != '72') { - // non-admin managers creating or editing a document resource -?> - " /> - - - - - + $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; + $vs = array( + $template, + $_SESSION['mgrRole'], + $dgs + ); + $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); + $rs = $modx->db->select($field, $from, $where, 'tvtpl.rank,tv.rank, tv.id'); + $limit = $modx->db->getRecordCount($rs); + if($limit > 0) { + ?> + +
                              +
                              + db->makeArray($rs, 'name'); + echo "\t" . '
                              name="publishedcheck" type="checkbox" class="checkbox" onclick="changestate(document.mutate.published);" /> - - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              name="pub_date" class="DatePicker" value="toDateFormat($content['pub_date'])?>" onblur="documentDirty=true;" /> - - " width="16" height="16" border="0" alt="" /> - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left: 5px;" /> -
                              config['datetime_format']; ?> HH:MM:SS
                              name="unpub_date" class="DatePicker" value="toDateFormat($content['unpub_date'])?>" onblur="documentDirty=true;" /> - - " width="16" height="16" border="0" alt="" /> - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left: 5px;" /> -
                              config['datetime_format']; ?> HH:MM:SS
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;" />
                              ' . "\n"; + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); + $i = 0; + foreach($tvsArray as $row) { + // Go through and display all Template Variables + if($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { + // determine TV-options + $tvOptions = $modx->parseProperties($row['elements']); + if(!empty($tvOptions)) { + // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 + $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; + }; + // Add richtext editor to the list + $richtexteditorIds[$editor][] = "tv" . $row['id']; + $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; + } + // splitter + if($i++ > 0) { + echo "\t\t", '', "\n"; + } + + // post back value + if(array_key_exists('tv' . $row['id'], $_POST)) { + if(is_array($_POST['tv' . $row['id']])) { + $tvPBV = implode('||', $_POST['tv' . $row['id']]); + } else { + $tvPBV = $_POST['tv' . $row['id']]; + } + } else { + $tvPBV = $row['value']; + } + + $tvDescription = (!empty($row['description'])) ? '
                              ' . $row['description'] . '' : ''; + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
                              (' . $_lang['tmplvars_inherited'] . ')' : ''; + $tvName = $modx->hasPermission('edit_template') ? '
                              [*' . $row['name'] . '*]' : ''; + + echo "\t\t", '\n", "\t\t\t", '\n"; + } + echo "\t
                              ', $row['caption'] . $tvName, "\n", "\t\t\t", $tvDescription, $tvInherited, "
                              ' . "\n", "\t\t\t" . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . "\n" . "\t\t
                              \n"; + ?> +
                              + + + " . $_lang['tmplvars_novars'] . "

                              \n"; + } + ?> + + +
                              + + + +
                              +

                              + + + + hasPermission('publish_document') ? '' : 'disabled="disabled" '; ?> + + + + + + + + + + + + + + + + + + + + + + + + + manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { + ?> + + + + + + + + + + + + + + + + + + manager->action != '72') { + // non-admin managers creating or editing a document resource + ?> + " /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              + + " data-tooltip=""> + + name="publishedcheck" type="checkbox" class="checkbox" onclick="changestate(document.mutate.published);" /> + +
                              + + " data-tooltip=""> + + name="pub_date" class="DatePicker" value="toDateFormat($content['pub_date']) ?>" onblur="documentDirty=true;" /> + + " title=""> +
                              + config['datetime_format']; ?> HH:MM:SS
                              + + " data-tooltip=""> + + name="unpub_date" class="DatePicker" value="toDateFormat($content['unpub_date']) ?>" onblur="documentDirty=true;" /> + + " title=""> +
                              + config['datetime_format']; ?> HH:MM:SS +
                              +
                              +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + +
                              + + " data-tooltip=""> + + +
                              +
                              +
                              + + " data-tooltip=""> + + manager->action == '85') ? "checked" : '' ?> onclick="changestate(document.mutate.isfolder);" /> + +
                              + + " data-tooltip=""> + + onclick="changestate(document.mutate.alias_visible);" /> +
                              + + " data-tooltip=""> + + manager->action == '27' ? '' : "checked" ?> onclick="changestate(document.mutate.richtext);" /> + +
                              + + " data-tooltip=""> + + onclick="changestate(document.mutate.donthit);" /> +
                              + + " data-tooltip=""> + + onclick="changestate(document.mutate.searchable);" /> +
                              + + " data-tooltip=""> + + onclick="changestate(document.mutate.cacheable);" /> + +
                              + + + " data-tooltip=""> + + +
                              +
                              + + + + + hasPermission('edit_doc_metatags') && $modx->config['show_meta']) { + // get list of site keywords + $keywords = array(); + $ds = $modx->db->select('id, keyword', $tbl_site_keywords, '', 'keyword ASC'); + while($row = $modx->db->getRow($ds)) { + $keywords[$row['id']] = $row['keyword']; + } + // get selected keywords using document's id + if(isset ($content['id']) && count($keywords) > 0) { + $keywords_selected = array(); + $ds = $modx->db->select('keyword_id', $tbl_keyword_xref, "content_id='{$content['id']}'"); + while($row = $modx->db->getRow($ds)) { + $keywords_selected[$row['keyword_id']] = ' selected="selected"'; + } + } + + // get list of site META tags + $metatags = array(); + $ds = $modx->db->select('id, name', $tbl_site_metatags); + while($row = $modx->db->getRow($ds)) { + $metatags[$row['id']] = $row['name']; + } + // get selected META tags using document's id + if(isset ($content['id']) && count($metatags) > 0) { + $metatags_selected = array(); + $ds = $modx->db->select('metatag_id', $tbl_site_content_metatags, "content_id='{$content['id']}'"); + while($row = $modx->db->getRow($ds)) { + $metatags_selected[$row['metatag_id']] = ' selected="selected"'; + } + } + ?> + +
                              +

                              + + + + + + +


                              + + + + +

                              + +
                              + +

                              + +
                              + +
                              +
                              +
                              + + manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); + if($documentId > 0) { + // Load up, the permissions from the parent (if new document) or existing document + $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); + while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; + + // Load up the current permissions and names + $vs = array( + $tbl_document_group_names, + $tbl_document_groups, + $documentId + ); + $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); + $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); + } else { + // Just load up the names, we're starting clean + $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); + } + + // retain selected doc groups between post + if(isset($_POST['docgroups'])) { + $groupsarray = array_merge($groupsarray, $_POST['docgroups']); + } + + $isManager = $modx->hasPermission('access_permissions'); + $isWeb = $modx->hasPermission('web_access_permissions'); + + // Setup Basic attributes for each Input box + $inputAttributes = array( + 'type' => 'checkbox', + 'class' => 'checkbox', + 'name' => 'docgroups[]', + 'onclick' => 'makePublic(false);', + ); + $permissions = array(); // New Permissions array list (this contains the HTML) + $permissions_yes = 0; // count permissions the current mgr user has + $permissions_no = 0; // count permissions the current mgr user doesn't have + + // Loop through the permissions list + while($row = $modx->db->getRow($rs)) { + + // Create an inputValue pair (group ID and group link (if it exists)) + $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); + $inputId = 'group-' . $row['id']; + + $checked = in_array($inputValue, $groupsarray); + if($checked) { + $notPublic = true; + } // Mark as private access (either web or manager) + + // Skip the access permission if the user doesn't have access... + if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { + continue; + } + + // Setup attributes for this Input box + $inputAttributes['id'] = $inputId; + $inputAttributes['value'] = $inputValue; + if($checked) { + $inputAttributes['checked'] = 'checked'; + } else { + unset($inputAttributes['checked']); + } + + // Create attribute string list + $inputString = array(); + foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; + + // Make the HTML + $inputHTML = ''; + + // does user have this permission? + $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; + $vs = array( + $row['id'], + $_SESSION['mgrInternalKey'] + ); + $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); + $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); + $count = $modx->db->getValue($rsp); + if($count > 0) { + ++$permissions_yes; + } else { + ++$permissions_no; + } + $permissions[] = "\t\t" . '
                            • ' . $inputHTML . '
                            • '; + } + // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public + if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { + $permissions = array(); + } + + // See if the Access Permissions section is worth displaying... + if(!empty($permissions)) { + // Add the "All Document Groups" item if we have rights in both contexts + if($isManager && $isWeb) { + array_unshift($permissions, "\t\t" . '
                            • '); + } + // Output the permissions list... + ?> + +
                              +

                              + + +

                              +
                                + +
                              +
                              + 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { + ?> +

                              + + + + invokeEvent('OnDocFormRender', array( + 'id' => $id, + 'template' => $content['template'] + )); + + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> +
                              +
                              +
                              + + + - -
                              manager->action=='85') ? "checked" : ''?> onclick="changestate(document.mutate.isfolder);" /> - - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              onclick="changestate(document.mutate.alias_visible);" /> - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              manager->action=='27' ? '' : "checked"?> onclick="changestate(document.mutate.richtext);" /> - - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              onclick="changestate(document.mutate.donthit);" /> - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              onclick="changestate(document.mutate.searchable);" /> - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              onclick="changestate(document.mutate.cacheable);" /> - - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              - - " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help;margin-left:5px;" />
                              - - - -hasPermission('edit_doc_metatags') && $modx->config['show_meta']) { - // get list of site keywords - $keywords = array(); - $ds = $modx->db->select('id, keyword', $tbl_site_keywords, '', 'keyword ASC'); - while ($row = $modx->db->getRow($ds)) { - $keywords[$row['id']] = $row['keyword']; - } - // get selected keywords using document's id - if (isset ($content['id']) && count($keywords) > 0) { - $keywords_selected = array(); - $ds = $modx->db->select('keyword_id', $tbl_keyword_xref, "content_id='{$content['id']}'"); - while ($row = $modx->db->getRow($ds)) { - $keywords_selected[$row['keyword_id']] = ' selected="selected"'; - } - } - - // get list of site META tags - $metatags = array(); - $ds = $modx->db->select('id, name', $tbl_site_metatags); - while ($row = $modx->db->getRow($ds)) { - $metatags[$row['id']] = $row['name']; - } - // get selected META tags using document's id - if (isset ($content['id']) && count($metatags) > 0) { - $metatags_selected = array(); - $ds = $modx->db->select('metatag_id', $tbl_site_content_metatags, "content_id='{$content['id']}'"); - while ($row = $modx->db->getRow($ds)) { - $metatags_selected[$row['metatag_id']] = ' selected="selected"'; - } - } - ?> - -
                              -

                              - - - - - -


                              - - - -

                              - -
                              - -

                              - -
                              - -
                              -
                              -
                              -manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); - if ($documentId > 0) { - // Load up, the permissions from the parent (if new document) or existing document - $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); - while ($currentgroup = $modx->db->getRow($rs)) - $groupsarray[] = $currentgroup['document_group'].','.$currentgroup['id']; - - // Load up the current permissions and names - $vs = array($tbl_document_group_names, $tbl_document_groups, $documentId); - $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'",$vs); - $rs = $modx->db->select('dgn.*, groups.id AS link_id',$from,'','name'); - } else { - // Just load up the names, we're starting clean - $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); - } - - // retain selected doc groups between post - if (isset($_POST['docgroups'])) - $groupsarray = array_merge($groupsarray, $_POST['docgroups']); - - $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); - - // Setup Basic attributes for each Input box - $inputAttributes = array( - 'type' => 'checkbox', - 'class' => 'checkbox', - 'name' => 'docgroups[]', - 'onclick' => 'makePublic(false);', - ); - $permissions = array(); // New Permissions array list (this contains the HTML) - $permissions_yes = 0; // count permissions the current mgr user has - $permissions_no = 0; // count permissions the current mgr user doesn't have - - // Loop through the permissions list - while ($row = $modx->db->getRow($rs)) { - - // Create an inputValue pair (group ID and group link (if it exists)) - $inputValue = $row['id'].','.($row['link_id'] ? $row['link_id'] : 'new'); - $inputId = 'group-'.$row['id']; - - $checked = in_array($inputValue, $groupsarray); - if ($checked) $notPublic = true; // Mark as private access (either web or manager) - - // Skip the access permission if the user doesn't have access... - if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) - continue; - - // Setup attributes for this Input box - $inputAttributes['id'] = $inputId; - $inputAttributes['value'] = $inputValue; - if ($checked) - $inputAttributes['checked'] = 'checked'; - else unset($inputAttributes['checked']); - - // Create attribute string list - $inputString = array(); - foreach ($inputAttributes as $k => $v) $inputString[] = $k.'="'.$v.'"'; - - // Make the HTML - $inputHTML = ''; - - // does user have this permission? - $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; - $vs = array($row['id'], $_SESSION['mgrInternalKey']); - $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); - $rsp = $modx->db->select('COUNT(mg.id)',$from,$where); - $count = $modx->db->getValue($rsp); - if($count > 0) { - ++$permissions_yes; - } else { - ++$permissions_no; - } - $permissions[] = "\t\t".'
                            • '.$inputHTML.'
                            • '; - } - // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public - if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { - $permissions = array(); - } - - // See if the Access Permissions section is worth displaying... - if (!empty($permissions)) { - // Add the "All Document Groups" item if we have rights in both contexts - if ($isManager && $isWeb) - array_unshift($permissions,"\t\t".'
                            • '); - // Output the permissions list... -?> - -
                              -

                              - - -

                              -
                                - -
                              -
                              - 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { -?> -

                              -manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { + if(is_array($richtexteditorIds)) { + foreach($richtexteditorIds as $editor => $elements) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( + 'editor' => $editor, + 'elements' => $elements, + 'options' => $richtexteditorOptions[$editor] + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + } + } } -/* End Document Access Permissions * - ***********************************/ -?> - - -invokeEvent('OnDocFormRender', array( - 'id' => $id, - 'template' => $content['template'] -)); -if (is_array($evtOut)) echo implode('', $evtOut); -?> - - - - - - -manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { - if (is_array($richtexteditorIds)) { - foreach($richtexteditorIds as $editor=>$elements) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( - 'editor' => $editor, - 'elements' => $elements, - 'options' => $richtexteditorOptions[$editor] - )); - if (is_array($evtOut)) - echo implode('', $evtOut); - } - } - } - -function getDefaultTemplate() -{ +function getDefaultTemplate() { global $modx; - - switch($modx->config['auto_template_logic']) - { + + switch($modx->config['auto_template_logic']) { case 'sibling': - if(!isset($_GET['pid']) || empty($_GET['pid'])) - { - $site_start = $modx->config['site_start']; - $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template']!=='') $default_template = $sibl[0]['template']; - } - else - { + if(!isset($_GET['pid']) || empty($_GET['pid'])) { + $site_start = $modx->config['site_start']; + $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } else { $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template']!=='') $default_template = $sibl[0]['template']; - else - { + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } else { $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template']!=='') $default_template = $sibl[0]['template']; + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } } } - break; + if(isset($default_template)) { + break; + } // If $default_template could not be determined, fall back / through to "parent"-mode case 'parent': - if (isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) - { + if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); - if(isset($parent['template'])) $default_template = $parent['template']; + if(isset($parent['template'])) { + $default_template = $parent['template']; + } } break; case 'system': default: // default_template is already set $default_template = $modx->config['default_template']; } - if(!isset($default_template)) $default_template = $modx->config['default_template']; // default_template is already set - + if(!isset($default_template)) { + $default_template = $modx->config['default_template']; + } // default_template is already set + return $default_template; } diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 5c41e981d2..9a3d2a945c 100644 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,19 +1,21 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); - -switch ($modx->manager->action) { - case 78: - if (!$modx->hasPermission('edit_chunk')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 77: - if (!$modx->hasPermission('new_chunk')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 78: + if(!$modx->hasPermission('edit_chunk')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 77: + if(!$modx->hasPermission('new_chunk')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; @@ -22,8 +24,8 @@ $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(3, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['chunk'])); +if($lockedEl = $modx->elementIsLocked(3, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['chunk'])); } // end check for lock @@ -31,28 +33,31 @@ $modx->lockElement(3, $id); $content = array(); -if (isset($_REQUEST['id']) && $_REQUEST['id']!='' && is_numeric($_REQUEST['id'])) { - $rs = $modx->db->select('*', $tbl_site_htmlsnippets, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - $modx->webAlertAndQuit("Chunk not found for id '{$id}'."); - } - $_SESSION['itemname'] = $content['name']; - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(isset($_REQUEST['id']) && $_REQUEST['id'] != '' && is_numeric($_REQUEST['id'])) { + $rs = $modx->db->select('*', $tbl_site_htmlsnippets, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("Chunk not found for id '{$id}'."); + } + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } +} else if(isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; } else { - $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; + $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; + $content['category'] = intval($_REQUEST['catid']); } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } -if (isset($_POST['which_editor'])) { - $which_editor = $_POST['which_editor']; +if(isset($_POST['which_editor'])) { + $which_editor = $_POST['which_editor']; } else { - $which_editor = $content['editor_name'] != 'none' ? $content['editor_name'] : 'none'; + $which_editor = $content['editor_name'] != 'none' ? $content['editor_name'] : 'none'; } $content = array_merge($content, $_POST); @@ -60,184 +65,187 @@ // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 3; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); // Print RTE Javascript function ?>
                              -invokeEvent('OnChunkFormPrerender', array( - 'id' => $id, -)); -if (is_array($evtOut)) - echo implode('', $evtOut); - -?> - - - - -

                              - - - - - - -

                              - -
                              - -
                              - - -
                              -
                              - -
                              -

                              - - -

                              - -

                              - - - - - - - - - - - - - - - -hasPermission('save_role')):?> - - - -
                              {{ }}  -
                              -
                              -
                              - -
                              -
                              - -
                              -
                              - -
                              -
                              - - - -
                              - -invokeEvent('OnChunkFormRender', array( - 'id' => $id, -)); -if (is_array($evtOut)) - echo implode('', $evtOut); -?> -
                              -
                              - + invokeEvent('OnChunkFormPrerender', array( + 'id' => $id, + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + ?> + + + + +

                              + +

                              + +
                              +
                                +
                              • + + "> + + + + +
                              • + manager->action == '77') { ?> +
                              • ">
                              • +
                              • ">
                              • + +
                              • ">
                              • +
                              • ">
                              • + +
                              • ">
                              • +
                              +
                              + +
                              +
                              + + +
                              +

                              + + +

                              + +

                              + + + + + + + + + + + + + + + + + + + hasPermission('save_role')): ?> + + + + +
                              {{ }}  + +
                              +
                              +
                              + +
                              +
                              + +
                              +
                              + +
                              +
                              + + + +
                              + + invokeEvent('OnChunkFormRender', array( + 'id' => $id, + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> +
                              +
                              +
                              invokeEvent('OnRichTextEditorInit', array( - 'editor' => $which_editor, - 'elements' => array( - 'post', - ), - )); - if (is_array($evtOut)) - echo implode('', $evtOut); +if($use_editor == 1) { + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( + 'editor' => $which_editor, + 'elements' => array( + 'post', + ), + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } } ?> diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index 36a6d5ec79..b71f0f5a94 100644 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('edit_document')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -18,52 +20,51 @@ $udperms->role = $_SESSION['mgrRole']; if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } if(isset($_POST['listSubmitted'])) { - $updateMsg .= 'Updated!'; - if (strlen($items) > 0) { - $items = explode(';', $items); - foreach ($items as $key => $value) { - $docid = ltrim($value, 'item_'); - $key = $reset ? 0 : $key; - if (is_numeric($docid)) { - $modx->db->update(array('menuindex'=>$key), $modx->getFullTableName('site_content'), "id='{$docid}'"); - } - } - } + $updateMsg .= 'Updated!'; + if(strlen($items) > 0) { + $items = explode(';', $items); + foreach($items as $key => $value) { + $docid = ltrim($value, 'item_'); + $key = $reset ? 0 : $key; + if(is_numeric($docid)) { + $modx->db->update(array('menuindex' => $key), $modx->getFullTableName('site_content'), "id='{$docid}'"); + } + } + } } $limit = 0; $disabled = 'true'; $pagetitle = ''; -if ($id !== NULL) { - $rs = $modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"); - $pagetitle = $modx->db->getValue($rs); - - $rs = $modx->db->select('id, pagetitle, parent, menuindex, published, hidemenu, deleted', $modx->getFullTableName('site_content'), "parent='{$id}'", 'menuindex ASC'); - $resource = $modx->db->makeArray($rs); - $limit = count($resource); - if ($limit < 1) { - $updateMsg = $_lang['sort_nochildren']; - } else { - $disabled = 0; - foreach ($resource as $item) { - // Add classes to determine whether it's published, deleted, not in the menu - // or has children. - // Use class names which match the classes in the document tree - $classes = ''; - $classes .= ($item['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode' ; - $classes .= ($item['published']) ? ' publishedNode ' : ' unpublishedNode ' ; - $classes = ($item['deleted']) ? ' deletedNode ' : $classes ; - $classes .= (count($modx->getChildIds($item['id'], 1)) > 0) ? ' hasChildren ' : ' noChildren '; - $ressourcelist .= '
                            • '. $item['pagetitle'] . ' ('.$item['id'].')
                            • '; - } - } +if($id !== NULL) { + $rs = $modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"); + $pagetitle = $modx->db->getValue($rs); + + $rs = $modx->db->select('id, pagetitle, parent, menuindex, published, hidemenu, deleted', $modx->getFullTableName('site_content'), "parent='{$id}'", 'menuindex ASC'); + $resource = $modx->db->makeArray($rs); + $limit = count($resource); + if($limit < 1) { + $updateMsg = $_lang['sort_nochildren']; + } else { + $disabled = 0; + foreach($resource as $item) { + // Add classes to determine whether it's published, deleted, not in the menu + // or has children. + // Use class names which match the classes in the document tree + $classes = ''; + $classes .= ($item['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; + $classes .= ($item['published']) ? ' publishedNode ' : ' unpublishedNode '; + $classes = ($item['deleted']) ? ' deletedNode ' : $classes; + $hasChildren = (count($modx->getChildIds($item['id'], 1)) > 0) ? ' ' : ' '; + $ressourcelist .= '
                            • ' . $hasChildren . $item['pagetitle'] . ' (' . $item['id'] . ')
                            • '; + } + } } - $header = ' '; - $pagetitle = $id == 0 ? $site_name : $pagetitle; - + $header .= ' -

                              - - - - - '.$_lang["sort_menuindex"].' - +

                              + ' . $_lang["sort_menuindex"] . '

                              -
                              '.$pagetitle.' ('.$id.')
                              +
                              ' . $pagetitle . ' (' . $id . ')
                              '; if(!$disabled) { - $header .= '

                              ' . $_lang["sort_elements_msg"] . '

                              + $header .= '

                              ' . $_lang["sort_elements_msg"] . '

                              '; }; @@ -197,17 +186,15 @@ function resetSortOrder() { echo $updateMsg . "Updating..."; if(!$disabled) { - echo ' + echo '
                                - '.$ressourcelist.' + ' . $ressourcelist . '
                              '; } - echo '
                              '; -?> diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index 177209c842..2df4d3cbcb 100644 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,660 +1,711 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -switch ($modx->manager->action) { - case 107: - if(!$modx->hasPermission('new_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 108: - if(!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +switch($modx->manager->action) { + case 107: + if(!$modx->hasPermission('new_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 108: + if(!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; // Get table names (alphabetical) -$tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); -$tbl_site_content = $modx->getFullTableName('site_content'); -$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); +$tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); +$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); $tbl_site_module_access = $modx->getFullTableName('site_module_access'); $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj'); -$tbl_site_modules = $modx->getFullTableName('site_modules'); -$tbl_site_plugins = $modx->getFullTableName('site_plugins'); -$tbl_site_snippets = $modx->getFullTableName('site_snippets'); -$tbl_site_templates = $modx->getFullTableName('site_templates'); -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +$tbl_site_modules = $modx->getFullTableName('site_modules'); +$tbl_site_plugins = $modx->getFullTableName('site_plugins'); +$tbl_site_snippets = $modx->getFullTableName('site_snippets'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); // create globally unique identifiers (guid) -function createGUID(){ - srand((double)microtime()*1000000); - $r = rand() ; - $u = uniqid(getmypid() . $r . (double)microtime()*1000000,1); - $m = md5 ($u); - return $m; +function createGUID() { + srand((double) microtime() * 1000000); + $r = rand(); + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); + $m = md5($u); + return $m; } // check to see the module editor isn't locked -if ($lockedEl = $modx->elementIsLocked(6, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['module'])); +if($lockedEl = $modx->elementIsLocked(6, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(6, $id); -if (isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); - } - $content['properties'] = str_replace("&", "&", $content['properties']); - $_SESSION['itemname'] = $content['name']; - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); + } + $content['properties'] = str_replace("&", "&", $content['properties']); + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_module"]; - $content['wrap'] = '1'; + $_SESSION['itemname'] = $_lang["new_module"]; + $content['wrap'] = '1'; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 6; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); ?> - - + +
                              -invokeEvent('OnModFormPrerender', array('id' => $id)); - if(is_array($evtOut)) echo implode('',$evtOut); - - // Prepare internal params & info-tab via parseDocBlock - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; - $docBlock = $modx->parseDocBlockFromString($modulecode); - $docBlockList = $modx->convertDocBlockIntoList($docBlock); - $internal = array(); -?> - - - -

                              - - - - - - -

                              -
                              - -
                              - - -
                              + diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index f1020adc03..50f6d613e6 100644 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('edit_web_user')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -8,135 +10,133 @@ $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op']=='reset') { +if($_REQUEST['op'] == 'reset') { $query = ''; - $_PAGE['vs']['search']=''; -} -else { - $query = isset($_REQUEST['search'])? $_REQUEST['search']:$_PAGE['vs']['search']; + $_PAGE['vs']['search'] = ''; +} else { + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; $sqlQuery = $modx->db->escape($query); $_PAGE['vs']['search'] = $query; } // get & save listmode -$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode']:$_PAGE['vs']['lm']; +$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : $_PAGE['vs']['lm']; $_PAGE['vs']['lm'] = $listmode; // context menu -include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang["edit"],"js:menuAction(1)",$_style["icons_edit_document"],(!$modx->hasPermission('edit_user') ? 1:0)); -$cm->addItem($_lang["delete"], "js:menuAction(2)",$_style["icons_delete"],(!$modx->hasPermission('delete_user') ? 1:0)); +$cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0)); +$cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0)); echo $cm->render(); ?>
                              - - - + + + + +

                              + +

                              -

                              - - - - - - -

                              -
                              -
                              -

                              - -
                              - +
                              + db->select( - "wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", - $modx->getFullTableName("web_users")." wu - INNER JOIN ".$modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id", - ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')":""), - 'username' - ); - include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; - $grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass="grid"; - $grd->columnHeaderClass="gridHeader"; - $grd->itemClass="gridItem"; - $grd->altItemClass="gridAltItem"; - $grd->fields="id,username,fullname,email,gender,blocked"; - $grd->columns=$_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,".$_lang["user_gender"]." ,".$_lang["user_block"]; - $grd->colWidths="34,,,,40,34"; - $grd->colAligns="center,,,,center,center"; - $grd->colTypes="template:||template:[+value+]"; - if($listmode=='1') $grd->pageSize=0; - if($_REQUEST['op']=='reset') $grd->pageNumber = 1; - // render grid - echo $grd->render(); - ?> + $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu + INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->fields = "id,username,fullname,email,gender,blocked"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; + $grd->colWidths = "34,,,,40,34"; + $grd->colAligns = "center,,,,center,center"; + $grd->colTypes = "template:||template:[+value+]"; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
                              +
                              -
                              diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index 088cc8085a..6f34c61bbe 100644 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -1,106 +1,78 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != 'true') { + die('INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly.'); +} unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes -if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { - // seems to be a new install - send the user to the configuration page - echo ''; - exit; +if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { + // seems to be a new install - send the user to the configuration page + exit(''); } -$script = << - function hideConfigCheckWarning(key){ - var myAjax = new Ajax('index.php?a=118', { - method: 'post', - data: 'action=setsetting&key=_hide_configcheck_' + key + '&value=1' - }); - myAjax.addEvent('onComplete', function(resp){ - fieldset = $(key + '_warning_wrapper').getParent().getParent(); - var sl = new Fx.Slide(fieldset); - sl.slideOut(); - }); - myAjax.request(); - } - - -JS; -$modx->regClientScript($script); - // set placeholders -$ph = array(); -$ph['theme'] = $modx->config['manager_theme']; -$ph['home'] = $_lang["home"]; -$ph['logo_slogan'] = $_lang["logo_slogan"]; -$ph['site_name'] = $site_name; -$ph['welcome_title'] = $_lang['welcome_title']; -$ph['resetgrid'] = $_lang['reset']; -$ph['search'] = $_lang['search']; +$ph = $_lang; // setup message info -if ($modx->hasPermission('messages')) { - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); - $_SESSION['nrtotalmessages'] = $nrtotalmessages; - $_SESSION['nrnewmessages'] = $nrnewmessages; - - $msg = ' -  ' . $_lang["inbox"] . '' . ($_SESSION['nrnewmessages'] > 0 ? " (" . $_SESSION['nrnewmessages'] . ")" : "") . '
                              - ' . sprintf($_lang["welcome_messages"], $_SESSION['nrtotalmessages'], "" . $_SESSION['nrnewmessages'] . "") . ''; - $ph['MessageInfo'] = $msg; -} +if($modx->hasPermission('messages')) { + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); + $_SESSION['nrtotalmessages'] = $nrtotalmessages; + $_SESSION['nrnewmessages'] = $nrnewmessages; -// setup icons -function wrapIcon($i) -{ - return '' . $i . ''; + $msg = array(); + $msg[] = sprintf('', $_style['icons_mail_large']); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; + $msg[] = sprintf(' [%%inbox%%]%s
                              ', $nrnewmessages); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); + $msg[] = sprintf('%s', $welcome_messages); + $ph['MessageInfo'] = join("\n", $msg); } + // setup icons -if($modx->hasPermission('new_user')||$modx->hasPermission('edit_user')) { - $icon = '
                              '.$_lang['security'].'
                              '; - $ph['SecurityIcon'] = wrapIcon($icon); +if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { + $icon = '
                              [%security%]'; + $ph['SecurityIcon'] = wrapIcon($icon, 75); } -if($modx->hasPermission('new_web_user')||$modx->hasPermission('edit_web_user')) { - $icon = '
                              '.$_lang['web_users'].'
                              '; - $ph['WebUserIcon'] = wrapIcon($icon); +if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { + $icon = '
                              [%web_users%]'; + $ph['WebUserIcon'] = wrapIcon($icon, 99); } if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { - $icon = '
                              '.$_lang['modules'].'
                              '; - $ph['ModulesIcon'] = wrapIcon($icon); + $icon = '
                              [%modules%]'; + $ph['ModulesIcon'] = wrapIcon($icon, 106); } if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { - $icon = '
                              '.$_lang['elements'].'
                              '; - $ph['ResourcesIcon'] = wrapIcon($icon); + $icon = '
                              [%elements%]'; + $ph['ResourcesIcon'] = wrapIcon($icon, 76); } if($modx->hasPermission('bk_manager')) { - $icon = '
                              '.$_lang['backup'].'
                              '; - $ph['BackupIcon'] = wrapIcon($icon); + $icon = '
                              [%backup%]'; + $ph['BackupIcon'] = wrapIcon($icon, 93); } -if ($modx->hasPermission('help')) { - $icon = '
                              ' . $_lang['help'] . '
                              '; - $ph['HelpIcon'] = wrapIcon($icon); +if($modx->hasPermission('help')) { + $icon = '
                              [%help%]'; + $ph['HelpIcon'] = wrapIcon($icon, 9); } // do some config checks -if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { - include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); - $ph['settings_config'] = $_lang['settings_config']; - $ph['configcheck_title'] = $_lang['configcheck_title']; - if ($config_check_results != $_lang['configcheck_ok']) { - $ph['config_check_results'] = $config_check_results; - $ph['config_display'] = 'block'; - } else { - $ph['config_display'] = 'none'; - } +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); + if($config_check_results != $_lang['configcheck_ok']) { + $ph['config_check_results'] = $config_check_results; + $ph['config_display'] = 'block'; + } else { + $ph['config_display'] = 'none'; + } } else { - $ph['config_display'] = 'none'; + $ph['config_display'] = 'none'; } // Check logout-reminder if(isset($_SESSION['show_logout_reminder'])) { switch($_SESSION['show_logout_reminder']['type']) { case 'logout_reminder': - $ph['logout_reminder_msg'] = $modx->parseText($_lang["logout_reminder_msg"], array('date' => $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'))); + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); break; } $ph['show_logout_reminder'] = 'block'; @@ -110,284 +82,365 @@ function wrapIcon($i) } // Check multiple sessions -$rs = $modx->db->select('count(*) AS count', $modx->getFullTableName('active_user_sessions'), "internalKey='{$_SESSION['mgrInternalKey']}'"); +$where = sprintf("internalKey='%s'", $modx->db->escape($_SESSION['mgrInternalKey'])); +$rs = $modx->db->select('count(*) AS count', '[+prefix+]active_user_sessions', $where); $count = $modx->db->getValue($rs); if($count > 1) { - $ph['multiple_sessions_msg'] = $modx->parseText($_lang["multiple_sessions_msg"], array('username' => $_SESSION['mgrShortname'], 'total'=>$count)); + $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( + 'username' => $_SESSION['mgrShortname'], + 'total' => $count + )); $ph['show_multiple_sessions'] = 'block'; } else { $ph['show_multiple_sessions'] = 'none'; } -// include rss feeds for important forum topics -include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); - -// modx news -$ph['modx_news'] = $_lang["modx_news_tab"]; -$ph['modx_news_title'] = $_lang["modx_news_title"]; -$ph['modx_news_content'] = $feedData['modx_news_content']; - -// security notices -$ph['modx_security_notices'] = $_lang["security_notices_tab"]; -$ph['modx_security_notices_title'] = $_lang["security_notices_title"]; -$ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; - -$ph['RecentInfo'] = getRecentInfo(); -$ph['recent_docs'] = $_lang['recent_docs']; -$ph['activity_title'] = $_lang['activity_title']; - -// user info -$ph['info'] = $_lang['info']; -$ph['yourinfo_title'] = $_lang['yourinfo_title']; -$html = ' +$ph['RecentInfo'] = getRecentInfo(); + +$tpl = ' - - - - - - - - - - - - - - - - - - - - + + + + +
                              ' . $_lang["yourinfo_username"] . '' . $modx->getLoginUserName() . '
                              ' . $_lang["yourinfo_role"] . '' . $_SESSION['mgrPermissions']['name'] . '
                              ' . $_lang["yourinfo_previous_login"] . '' . $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time) . '
                              ' . $_lang["yourinfo_total_logins"] . '' . ($_SESSION['mgrLogincount'] + 1) . '
                              ' . $_lang["inbox"] . '' . sprintf($_lang["welcome_messages"], $_SESSION['nrtotalmessages'], "" . $_SESSION['nrnewmessages'] . "") . '
                              [%yourinfo_username%] [+username+]
                              [%yourinfo_role%] [+role+]
                              [%yourinfo_previous_login%] [+lastlogin+]
                              [%yourinfo_total_logins%] [+logincount+]
                              [%inbox%] [+msginfo+]
                              '; -$ph['UserInfo'] = $html; - -// online users -$ph['online'] = $_lang['online']; -$ph['onlineusers_title'] = $_lang['onlineusers_title']; -$timetocheck = (time() - (60 * 20)); //+$server_offset_time; - -include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); +$nrnewmessages = '' . $_SESSION['nrnewmessages'] . ''; +$ph['UserInfo'] = $modx->parseText($tpl, array( + 'username' => $modx->getLoginUserName(), + 'role' => $_SESSION['mgrPermissions']['name'], + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), + 'logincount' => $_SESSION['mgrLogincount'] + 1, + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) +)); -$rs = $modx->db->select('*, count(au.sid) AS count', $modx->getFullTableName('active_user_sessions')." us LEFT JOIN {$modx->getFullTableName('active_users')} au ON au.internalKey=us.internalKey GROUP BY au.sid HAVING au.action <> '8'", "", 'username ASC, au.sid ASC'); -$limit = $modx->db->getRecordCount($rs); -if ($limit < 1) { - $html = "

                              " . $_lang['no_active_users_found'] . "

                              "; +$from = array(); +$from[] = '[+prefix+]active_user_sessions'; +$from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; +$rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); +if($modx->db->getRecordCount($rs) < 1) { + $html = '

                              [%no_active_users_found%]

                              '; } else { - $html = $_lang["onlineusers_message"] . '' . strftime('%H:%M:%S', time() + $server_offset_time) . '):

                              + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; + $ph['now'] = strftime('%H:%M:%S', $now); + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; + $html = '[%onlineusers_message%] [+now+]):

                              - - - - - + + + + + - - '; - while ($activeusers = $modx->db->getRow($rs)) { - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; - $multipleSessions = $activeusers['count'] > 1 ? ' class="userMultipleSessions"' : ''; - $webicon = ($activeusers['internalKey'] < 0) ? sprintf('Web user',$_style["tree_globe"]) : ''; - $currentaction = getAction($activeusers['action'], $activeusers['id']); - $params = array($idle, $multipleSessions, $activeusers['username'], $webicon, abs($activeusers['internalKey']), $activeusers['ip'], strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),$currentaction); - $html .= vsprintf('', $params); - } - $html .= ' + '; + + $userList = array(); + $userCount = array(); + // Create userlist with session-count first before output + while($activeusers = $modx->db->getRow($rs)) { + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; + + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; + $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; + $currentaction = getAction($activeusers['action'], $activeusers['id']); + $userList[] = array( + $idle, + '', + $activeusers['username'], + $webicon, + abs($activeusers['internalKey']), + $ip, + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), + $currentaction + ); + } + foreach($userList as $params) { + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; + $html .= "\n" . vsprintf('', $params); + } + + $html .= '
                              ' . $_lang["onlineusers_user"] . '' . $_lang["onlineusers_userid"] . '' . $_lang["onlineusers_ipaddress"] . '' . $_lang["onlineusers_lasthit"] . '' . $_lang["onlineusers_action"] . '[%onlineusers_user%]ID[%onlineusers_ipaddress%][%onlineusers_lasthit%][%onlineusers_action%]
                              %s%s %s%s%s%s
                              %s%s%s%s%s%s
                              '; } -$ph['OnlineInfo'] = $html; +$ph['OnlineInfo'] = $html; + +// include rss feeds for important forum topics +include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); +$ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; +$ph['modx_news_content'] = $feedData['modx_news_content']; + +$ph['theme'] = $modx->config['manager_theme']; +$ph['site_name'] = $modx->config['site_name']; +$ph['home'] = $_lang['home']; +$ph['logo_slogan'] = $_lang['logo_slogan']; +$ph['welcome_title'] = $_lang['welcome_title']; +$ph['search'] = $_lang['search']; +$ph['settings_config'] = $_lang['settings_config']; +$ph['configcheck_title'] = $_lang['configcheck_title']; +$ph['online'] = $_lang['online']; +$ph['onlineusers_title'] = $_lang['onlineusers_title']; +$ph['recent_docs'] = $_lang['recent_docs']; +$ph['activity_title'] = $_lang['activity_title']; +$ph['info'] = $_lang['info']; +$ph['yourinfo_title'] = $_lang['yourinfo_title']; + +$ph['modx_security_notices'] = $_lang['security_notices_tab']; +$ph['modx_security_notices_title'] = $_lang['security_notices_title']; +$ph['modx_news'] = $_lang['modx_news_tab']; +$ph['modx_news_title'] = $_lang['modx_news_title']; $modx->toPlaceholders($ph); +$script = getStartUpScript(); +$modx->regClientScript($script); + // invoke event OnManagerWelcomePrerender $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); -if (is_array($evtOut)) { - $output = implode("", $evtOut); - $ph['OnManagerWelcomePrerender'] = $output; +if(is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomePrerender'] = $output; } // invoke event OnManagerWelcomeHome $evtOut = $modx->invokeEvent('OnManagerWelcomeHome'); -if (is_array($evtOut)) { - $output = implode("", $evtOut); - $ph['OnManagerWelcomeHome'] = $output; +if(is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomeHome'] = $output; } // invoke event OnManagerWelcomeRender $evtOut = $modx->invokeEvent('OnManagerWelcomeRender'); -if (is_array($evtOut)) { - $output = implode("", $evtOut); - $ph['OnManagerWelcomeRender'] = $output; +if(is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomeRender'] = $output; } // load template -if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; } $target = $modx->config['manager_welcome_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); -if (substr($target, 0, 1) === '@') { - if (substr($target, 0, 6) === '@CHUNK') { - $target = trim(substr($target, 7)); - $welcome_tpl = $modx->getChunk($target); - } elseif (substr($target, 0, 5) === '@FILE') { - $target = trim(substr($target, 6)); - $welcome_tpl = file_get_contents($target); - } +if(substr($target, 0, 1) === '@') { + if(substr($target, 0, 6) === '@CHUNK') { + $content = $modx->getChunk(trim(substr($target, 7))); + } elseif(substr($target, 0, 5) === '@FILE') { + $content = file_get_contents(trim(substr($target, 6))); + } else { + $content = ''; + } } else { - $chunk = $modx->getChunk($target); - if ($chunk !== false && !empty($chunk)) { - $welcome_tpl = $chunk; - } elseif (is_file(MODX_BASE_PATH . $target)) { - $target = MODX_BASE_PATH . $target; - $welcome_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'; - $welcome_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'; - $welcome_tpl = file_get_contents($target); - } else { - $target = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; - $welcome_tpl = file_get_contents($target); - } + $chunk = $modx->getChunk($target); + if($chunk !== false && !empty($chunk)) { + $content = $chunk; + } elseif(is_file(MODX_BASE_PATH . $target)) { + $content = file_get_contents(MODX_BASE_PATH . $target); + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible + { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); + } else { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); + } } // merge placeholders -$welcome_tpl = $modx->mergeConditionalTagsContent($welcome_tpl); -$welcome_tpl = $modx->mergeSettingsContent($welcome_tpl); -$welcome_tpl = $modx->parseText($welcome_tpl,$ph); -if(strpos($welcome_tpl,'[+')!==false) { - $modx->toPlaceholders($ph); - $welcome_tpl = $modx->mergePlaceholderContent($welcome_tpl); +$content = $modx->mergeConditionalTagsContent($content); +$content = $modx->mergeSettingsContent($content); +$content = $modx->parseText($content, $ph); +if(strpos($content, '[+') !== false) { + $modx->toPlaceholders($ph); + $content = $modx->mergePlaceholderContent($content); } -$welcome_tpl = $modx->parseText($welcome_tpl,$_lang, '[%','%]'); -$welcome_tpl = $modx->parseText($welcome_tpl,$_style,'[&','&]'); -$welcome_tpl = $modx->cleanUpMODXTags($welcome_tpl); //cleanup +$content = $modx->parseDocumentSource($content); +$content = $modx->parseText($content, $_lang, '[%', '%]'); +$content = $modx->parseText($content, $_style, '[&', '&]'); +$content = $modx->cleanUpMODXTags($content); //cleanup -if ($js = $modx->getRegisteredClientScripts()) { - $welcome_tpl .= $js; +if($js = $modx->getRegisteredClientScripts()) { + $content .= $js; } -echo $welcome_tpl; - +echo $content; function getRecentInfo() { // recent document info - global $modx, $_lang; - - $html = '
                              + global $modx; + + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); + + $html = ' +
                              - - - - - - - - '; - - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); - - if ($modx->db->getRecordCount($rs) < 1) { - $html .= ''; - } - else { - while ($content = $modx->db->getRow($rs)) { - - $editedbyu = $modx->getUserInfo($content['editedby']); - $content['username'] = $editedbyu['username']; - - $html .= ''; - $html = $modx->parseText($html,$content); + + + + + + + + + + [[#recentInfoList]] + +
                              [%id%][%resource_title%][%page_data_edited%][%user%][%mgrlog_action%]
                              [%no_activity_message%]
                              [+id+]'; - - $html .= 'hasPermission('edit_document')) { - $html .= ' '; - } - - if ($content['deleted'] == 1) { - $html .= ' '; - } else { - $html .= ' '; - } - - if ($modx->hasPermission('delete_document')) { - if ($content['deleted'] == 0) { - $html .= ' '; - } else { - $html .= ' '; - } - } - - if ($content['deleted'] == 1 && $content['published'] == 0) { - $html .= ' '; - } elseif ($content['deleted'] == 1 && $content['published'] == 1) { - $html .= ' '; - } elseif ($content['deleted'] == 0 && $content['published'] == 0) { - $html .= ' '; - } else { - $html .= ' '; - } - - $html .= ''; - - $html .='
                                '; - - $html .= '
                              • [%long_title%]: '; - $html .= ($content['longtitle'] != '') ? '[+longtitle+]' : '([%not_set%])'; - $html .= '
                              • '; - - $html .= '
                              • [%description%]: '; - $html .= ($content['description'] != '') ? '[+description+] ' : '([%not_set%])'; - $html .= '
                              • '; - - $html .= '
                              • [%resource_summary%]: '; - $html .= ($content['introtext'] != '') ? '[+introtext+] ' : '([%not_set%])'; - $html .= '
                              • '; - - $html .= '
                              • [%type%]: '; - $html .= ($content['type'] != 'reference') ? '[%resource%]' : '[%weblink%]'; - $html .= '
                              • '; - - $html .= '
                              • [%resource_alias%]: '; - $html .= ($content['alias'] != '') ? '[+alias+]' : '([%not_set%])'; - $html .= '
                              • '; - - $html .= '
                              • [%page_data_cacheable%]: '; - $html .= ($content['cacheable'] == 0) ? '[%yes%]' : '[%no%]'; - $html .= '
                              • '; - - $html .= '
                              • [%resource_opt_show_menu%]: '; - $html .= ($content['hidemenu'] == 0) ? '[%yes%]' : '[%no%]'; - $html .= '
                              • '; - - $html .= '
                              • [%page_data_template%]: [+template:templatename+]
                              • '; - $html .= '
                              [%id%][%resource_title%][%page_data_edited%][%user%][%mgrlog_action%]
                              +
                              +'; + return $html; +} + +function getRecentInfoList() { + global $modx; + + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); + + if($modx->db->getRecordCount($rs) < 1) { + return '[%no_activity_message%]'; + } + + $tpl = getRecentInfoRowTpl(); + + $btntpl['edit'] = ' '; + $btntpl['preview_btn'] = ' '; + + $output = array(); + while($ph = $modx->db->getRow($rs)) { + $docid = $ph['id']; + $_ = $modx->getUserInfo($ph['editedby']); + $ph['username'] = $_['username']; + + if($ph['deleted'] == 1) { + $ph['status'] = 'deleted'; + } elseif($ph['published'] == 0) { + $ph['status'] = 'unpublished'; + } else { + $ph['status'] = 'published'; + } + + if($modx->hasPermission('edit_document')) { + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); + } else { + $ph['edit_btn'] = ''; + } + + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; + $ph['preview_btn'] = str_replace(array( + '[+id+]', + '[+preview_disabled+]' + ), array( + $docid, + $preview_disabled + ), $btntpl['preview_btn']); + + if($modx->hasPermission('delete_document')) { + if($ph['deleted'] == 0) { + $delete_btn = ' '; + } else { + $delete_btn = ' '; + } + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); + } else { + $ph['delete_btn'] = ''; + } + + if($ph['deleted'] == 1 && $ph['published'] == 0) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { + $publish_btn = ' '; + } else { + $publish_btn = ' '; + } + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); + + $ph['info_btn'] = str_replace('[+id+]', $docid, ''); + + if($ph['longtitle'] == '') { + $ph['longtitle'] = '([%not_set%])'; + } + if($ph['description'] == '') { + $ph['description'] = '([%not_set%])'; + } + if($ph['introtext'] == '') { + $ph['introtext'] = '([%not_set%])'; + } + if($ph['alias'] == '') { + $ph['alias'] = '([%not_set%])'; + } + + $output[] = $modx->parseText($tpl, $ph); + } + return join("\n", $output); +} + +function getRecentInfoRowTpl() { + $tpl = ' + + [+id+] + [+pagetitle+] + [+editedon:math("%s+[(server_offset_time)]"):dateFormat+] + [+username+] + [+edit_btn+][+preview_btn+][+delete_btn+][+publish_btn+][+info_btn+] + + + +
                              +
                              +
                                +
                              • [%long_title%]: [+longtitle+]
                              • +
                              • [%description%]: [+description+]
                              • +
                              • [%resource_summary%]: [+longtitle+]
                              • +
                              • [%type%]: [+type:is(reference):then([%weblink%]):else([%resource%])+]
                              • +
                              • [%resource_alias%]: [+alias+]
                              • +
                              • [%page_data_cacheable%]: [+cacheable:is(1):then([%yes%]):else([%no%])+]
                              • +
                              • [%resource_opt_show_menu%]: [+hidemenu:is(0):then([%yes%]):else([%no%])+]
                              • +
                              • [%page_data_template%]: [+template:templatename+]
                              • +
                              +
                              +
                              + +'; + return $tpl; +} + +// setup icons +function wrapIcon($i, $action) { + return sprintf('%s', $action, $i); +} + +function getStartUpScript() { + $script = << + function hideConfigCheckWarning(key){ + var myAjax = new Ajax('index.php?a=118', { + method: 'post', + data: 'action=setsetting&key=_hide_configcheck_' + key + '&value=1' + }); + myAjax.addEvent('onComplete', function(resp){ + fieldset = $(key + '_warning_wrapper').getParent().getParent(); + var sl = new Fx.Slide(fieldset); + sl.slideOut(); + }); + myAjax.request(); } - } - - $html .= '
                              '; - return $html; + + +JS; + return $script; } diff --git a/manager/frames/mainmenu.php b/manager/frames/mainmenu.php index 4f73f22027..755da4afa2 100644 --- a/manager/frames/mainmenu.php +++ b/manager/frames/mainmenu.php @@ -51,6 +51,9 @@ if ($modx->hasPermission('file_manager')) { $sitemenu['manage_files'] = array('manage_files', 'elements', $_lang['manage_files'], 'index.php?a=31', $_lang['manage_files'], 'this.blur();', 'file_manager', 'main', 0, 70, ''); } +if ($modx->hasPermission('category_manager')) { + $sitemenu['manage_categories'] = array('manage_categories', 'elements', $_lang['manage_categories'], 'index.php?a=120', $_lang['manage_categories'], 'this.blur();', 'category_manager', 'main', 0, 80, ''); +} // Modules Menu Items if ($modx->hasPermission('new_module')) { $sitemenu['new_module'] = array('new_module', 'modules', $_lang['module_management'], 'index.php?a=106', $_lang['module_management'], 'this.blur();', 'new_module,edit_module', 'main', 1, 0, ''); diff --git a/manager/frames/menu.php b/manager/frames/menu.php index 2428ee7659..b0d6ba8cc3 100644 --- a/manager/frames/menu.php +++ b/manager/frames/menu.php @@ -1,272 +1,270 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if (!array_key_exists('mail_check_timeperiod', $modx->config) || !is_numeric($modx->config['mail_check_timeperiod'])) { +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!array_key_exists('mail_check_timeperiod', $modx->config) || !is_numeric($modx->config['mail_check_timeperiod'])) { $modx->config['mail_check_timeperiod'] = 5; } $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; ?> -> +> - + nav - + - + invokeEvent('OnManagerTopPrerender',$_REQUEST); - if (is_array($evtOut)) - echo implode("\n", $evtOut); +// invoke OnManagerTopPrerender event +$evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST); +if(is_array($evtOut)) { + echo implode("\n", $evtOut); +} ?>
                              >
                              -
                              - -
                              - - -
                              - -
                              - ' . $modx->getLoginUserName() . '' . ($modx->hasPermission('change_password') ? ' '.$_lang['change_password'].''."\n" : "\n") - ?> - - config['settings_version']!=$modx->getVersionData('version') ? 'style="color:#ffff8a;"' : ''; ?> - hasPermission('help')) { - echo sprintf('%s ',$site_name,$modx->getVersionData('full_appname'),$style,$modx->config['settings_version']); - } else - { - echo sprintf('%s ',$site_name,$modx->getVersionData('full_appname'),$style,$modx->config['settings_version']); - } - ?> -
                              - -
                              -
                              -
                              -
                              - - -
                              +
                              + +
                              + +
                              -
                              - - +
                              + + + +
                              +
                              + +
                              diff --git a/manager/frames/nodes.functions.inc.php b/manager/frames/nodes.functions.inc.php index 80b54466a6..187d587700 100644 --- a/manager/frames/nodes.functions.inc.php +++ b/manager/frames/nodes.functions.inc.php @@ -1,396 +1,397 @@ -INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly.'); - -function makeHTML($indent,$parent,$expandAll,$theme) { - global $modx; - global $icons, $iconsPrivate, $_style; - global $output, $_lang, $opened, $opened2, $closed2; //added global vars - global $modx_textdir; - - $pad = '     '; - - // setup spacer - $spacer = ''; - for ($i = 1; $i <= $indent; $i++){ - $spacer .= '     '; - } - - // manage order-by - if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) { - // This is the first startup, set default sort order - $_SESSION['tree_sortby'] = 'menuindex'; - $_SESSION['tree_sortdir'] = 'ASC'; - } - - switch($_SESSION['tree_sortby']) { - case 'createdon': - case 'editedon': - case 'publishedon': - case 'pub_date': - case 'unpub_date': - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', $_SESSION['tree_sortby'], $_SESSION['tree_sortby']); - break; - default: - $sortby = $_SESSION['tree_sortby']; - }; - - $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); - - // Folder sorting gets special setup ;) Add menuindex and pagetitle - if($_SESSION['tree_sortby'] == 'isfolder') $orderby .= ', menuindex ASC, pagetitle'; - - $tblsc = $modx->getFullTableName('site_content'); - $tbldg = $modx->getFullTableName('document_groups'); - $tblst = $modx->getFullTableName('site_templates'); - // get document groups for current user - $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',',$_SESSION['mgrDocgroups']) : ''; - $showProtected= false; - if (isset ($modx->config['tree_show_protected'])) { - $showProtected= (boolean) $modx->config['tree_show_protected']; - } - $mgrRole= (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole']==='1') ? '1' : '0'; - if ($showProtected == false) { - $access = "AND (1={$mgrRole} OR sc.privatemgr=0". - (!$docgrp ? ')':" OR dg.document_group IN ({$docgrp}))"); - } else { - $access = ''; - } - $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; - $field = "DISTINCT sc.id, pagetitle, longtitle, menutitle, parent, isfolder, published, pub_date, unpub_date, richtext, searchable, cacheable, deleted, type, template, templatename, menuindex, donthit, hidemenu, alias, contentType, privateweb, privatemgr, - MAX(IF(1={$mgrRole} OR sc.privatemgr=0 {$docgrp_cond}, 1, 0)) AS hasAccess"; - $from = "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id LEFT JOIN {$tblst} st on st.id = sc.template"; - $where = "(parent={$parent}) {$access} GROUP BY sc.id"; - $result = $modx->db->select($field,$from,$where,$orderby); - if($modx->db->getRecordCount($result)==0) { - $output .= sprintf('
                              %s%s %s
                              ',$spacer,$pad,$_style['tree_deletedpage'],$_lang['empty_folder']); - } - - $nodeNameSource = $_SESSION['tree_nodename'] == 'default' ? $modx->config['resource_tree_node_name'] : $_SESSION['tree_nodename']; - while($row = $modx->db->getRow($result)) - { - extract($row); - - $nodetitle = getNodeTitle($nodeNameSource,$row); - $nodetitle_esc = addslashes($nodetitle); - $protectedClass = $hasAccess==0 ? ' protectedNode' : ''; - - if($deleted==1) $nodetitleDisplay = sprintf('%s' ,$nodetitle); - elseif($published==0) $nodetitleDisplay = sprintf('%s',$nodetitle); - elseif($hidemenu==1) $nodetitleDisplay = sprintf('%s',$protectedClass,$nodetitle); - else $nodetitleDisplay = sprintf('%s',$protectedClass,$nodetitle); - - $weblinkDisplay = $type=='reference' ? sprintf(' ',$_style['tree_linkgo']) : '' ; - $pageIdDisplay = '('.($modx_textdir ? '‏':'').$id.')'; - - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked(7, $id, true); - if($rowLock && $modx->hasPermission('display_locks')) { - if($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array('element_type'=>$_lang["lock_element_type_7"], 'lasthit_df'=>$rowLock['lasthit_df'])); - $lockedByUser = ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array('element_type'=>$_lang["lock_element_type_7"], 'username'=>$rowLock['username'], 'lasthit_df'=>$rowLock['lasthit_df'])); - if($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - - $url = $modx->makeUrl($id); - - $alt = ''; - if(isDateNode($nodeNameSource)) $alt = $_lang['pagetitle'] .': '.$pagetitle.'[+lf+]'; - $alt.= $_lang['resource_opt_menu_title'] .': '.$menutitle; - $alt.= '[+lf+]'.$_lang['resource_opt_menu_index'] .': '.$menuindex; - $alt.= '[+lf+]'.$_lang['alias'] .': '.(!empty($alias) ? $alias : '-'); - $alt.= '[+lf+]'.$_lang['template'] .': '.$templatename; - $alt.= '[+lf+]'.$_lang['publish_date'] .': '.$modx->toDateFormat($pub_date); - $alt.= '[+lf+]'.$_lang['unpublish_date'] .': '.$modx->toDateFormat($unpub_date); - $alt.= '[+lf+]'.$_lang['page_data_web_access'] .': '.($privateweb ? $_lang['private']:$_lang['public']); - $alt.= '[+lf+]'.$_lang['page_data_mgr_access'] .': '.($privatemgr ? $_lang['private']:$_lang['public']); - $alt.= '[+lf+]'.$_lang['resource_opt_richtext'] .': '.($richtext==0 ? $_lang['no'] : $_lang['yes']); - $alt.= '[+lf+]'.$_lang['page_data_searchable'] .': '.($searchable==0 ? $_lang['no'] : $_lang['yes']); - $alt.= '[+lf+]'.$_lang['page_data_cacheable'] .': '.($cacheable==0 ? $_lang['no'] : $_lang['yes']); - $alt = $modx->htmlspecialchars($alt); - $alt = str_replace('[+lf+]', ' ', $alt); // replace line-breaks with empty space as fall-back - - $data = array('id' => $id, 'pagetitle' => $pagetitle, 'longtitle' => $longtitle, 'menutitle' => $menutitle,'parent' =>$parent, - 'isfolder' =>$isfolder,'published' =>$published,'deleted' =>$deleted,'type' =>$type,'menuindex' =>$menuindex, - 'donthit' =>$donthit,'hidemenu' =>$hidemenu,'alias' =>$alias,'contenttype' =>$contentType,'privateweb' =>$privateweb, - 'privatemgr' =>$privatemgr,'hasAccess' => $hasAccess, 'template' => $template, - 'nodetitle' => $nodetitle, 'spacer' => $spacer, 'pad' => $pad, 'url' => $url, 'alt' => $alt, - 'nodetitleDisplay' => $nodetitleDisplay,'weblinkDisplay' => $weblinkDisplay,'pageIdDisplay' => $pageIdDisplay, - 'lockedByUser'=>$lockedByUser - ); - // invoke OnManagerNodePrerender event - - $evtOut = $modx->invokeEvent('OnManagerNodePrerender',$data); - if (is_array($evtOut)) $evtOut = implode("\n", $evtOut); - - $node = ''; - $ph = $data; - $ph['nodetitle_esc'] = $nodetitle_esc; - $ph['indent'] = $indent+1; - $ph['expandAll'] = $expandAll; - - if (!$isfolder) - { - switch($id) { - case $modx->config['site_start'] : $icon = $_style['tree_page_home']; break; - case $modx->config['error_page'] : $icon = $_style['tree_page_404']; break; - case $modx->config['site_unavailable_page'] : $icon = $_style['tree_page_hourglass']; break; - case $modx->config['unauthorized_page'] : $icon = $_style['tree_page_info']; break; - default: - if ($privateweb||$privatemgr) { - if (isset($iconsPrivate[$contentType])) $icon = $iconsPrivate[$contentType]; - else $icon = $_style['tree_page_secure']; - } elseif (isset($icons[$contentType])) $icon = $icons[$contentType]; - else $icon = $_style['tree_page']; - } - $ph['icon'] = $icon; - $tpl = getTplSingleNode(); - $node = $modx->parseText($tpl,$ph); - $node = $modx->parseText($node,$_lang,'[%','%]'); - } - else - { - $isPrivate = ($privateweb==1||$privatemgr==1) ? '1' : '0'; - $ph['isPrivate'] = $isPrivate; - // expandAll: two type for partial expansion - if ($expandAll ==1 || ($expandAll == 2 && in_array($id, $opened))) - { - if ($expandAll == 1) $opened2[] = $id; - $tpl = getTplOpenFolderNode(); - $ph['src'] = $isPrivate ? $_style['tree_folderopen_secure'] : $_style['tree_folderopen']; - $node = $modx->parseText($tpl,$ph); - $node = $modx->parseText($node,$_lang, '[%','%]'); - $node = $modx->parseText($node,$_style,'[&','&]'); - $output .= $node; - makeHTML($indent+1,$id,$expandAll,$theme); - $node = '
                              '; - } - else - { - $tpl = getTplClosedFolderNode(); - $ph['src'] = $isPrivate ? $_style['tree_folder_secure'] : $_style['tree_folder']; - $node = $modx->parseText($tpl,$ph); - $node = $modx->parseText($node,$_lang, '[%','%]'); - $node = $modx->parseText($node,$_style,'[&','&]'); - $closed2[] = $id; - } - } - $node = $evtOut.$node; - - // invoke OnManagerNodeRender event - $data['node'] = $node; - $evtOut = $modx->invokeEvent('OnManagerNodeRender',$data); - if (is_array($evtOut)) $evtOut = implode("\n", $evtOut); - if ($evtOut != '') $node = $evtOut; - - $output .= $node; - // store vars in Javascript - $scr = ''; - if ($expandAll == 1) { - $scr .= ' '; - } elseif ($expandAll == 0) { - $scr .= ' '; - } - $output = $scr . $output; - } -} - -function getIconInfo($_style) { - if(!isset($_style['tree_page_gif'])) $_style['tree_page_gif'] = $_style['tree_page']; - if(!isset($_style['tree_page_jpg'])) $_style['tree_page_jpg'] = $_style['tree_page']; - if(!isset($_style['tree_page_png'])) $_style['tree_page_png'] = $_style['tree_page']; - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - 'application/rss+xml' => $_style['tree_page_rss'], - 'application/pdf' => $_style['tree_page_pdf'], - 'application/vnd.ms-word' => $_style['tree_page_word'], - 'application/vnd.ms-excel' => $_style['tree_page_excel'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - return $icons; -} - -function getPrivateIconInfo($_style) { - if(!isset($_style['tree_page_gif_secure'])) $_style['tree_page_gif_secure'] = $_style['tree_page_secure']; - if(!isset($_style['tree_page_jpg_secure'])) $_style['tree_page_jpg_secure'] = $_style['tree_page_secure']; - if(!isset($_style['tree_page_png_secure'])) $_style['tree_page_png_secure'] = $_style['tree_page_secure']; - $iconsPrivate = array( - 'text/html' => $_style['tree_page_html_secure'], - 'text/plain' => $_style['tree_page_secure'], - 'text/xml' => $_style['tree_page_xml_secure'], - 'text/css' => $_style['tree_page_css_secure'], - 'text/javascript' => $_style['tree_page_js_secure'], - 'application/rss+xml' => $_style['tree_page_rss_secure'], - 'application/pdf' => $_style['tree_page_pdf_secure'], - 'application/vnd.ms-word' => $_style['tree_page_word_secure'], - 'application/vnd.ms-excel' => $_style['tree_page_excel_secure'], - 'image/gif' => $_style['tree_page_gif_secure'], - 'image/jpg' => $_style['tree_page_jpg_secure'], - 'image/png' => $_style['tree_page_png_secure'] - ); - return $iconsPrivate; -} - -function getNodeTitle($nodeNameSource,$row) { - global $modx; - - extract($row); - switch($nodeNameSource) - { - case 'menutitle': - $nodetitle = $menutitle ? $menutitle : $pagetitle; - break; - case 'alias': - $nodetitle = $alias ? $alias : $id; - if(strpos($alias, '.') === false) - { - if($isfolder!=1 || $modx->config['make_folders']!=1) - $nodetitle .= $modx->config['friendly_url_suffix']; - } - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; - break; - case 'pagetitle': - $nodetitle = $pagetitle; - break; - case 'longtitle': - $nodetitle = $longtitle ? $longtitle : $pagetitle; - break; - case 'createdon': - case 'editedon': - case 'publishedon': - case 'pub_date': - case 'unpub_date': - $doc = $modx->getDocumentObject('id',$id); - $date = $doc[$nodeNameSource]; - if(!empty($date)) $nodetitle = $modx->toDateFormat($date); - else $nodetitle = '- - -'; - break; - default: - $nodetitle = $pagetitle; - } - $nodetitle = $modx->htmlspecialchars(str_replace(array("\r\n", "\n", "\r"), ' ', $nodetitle), ENT_COMPAT); - return $nodetitle; -} - -function isDateNode($nodeNameSource) { - switch($nodeNameSource) { - case 'createdon': - case 'editedon': - case 'publishedon': - case 'pub_date': - case 'unpub_date': - return true; - default: - return false; - } -} - -function getTplSingleNode() { - return '
                              [+spacer+][+pad+] [+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
                              '; -} - -function getTplOpenFolderNode() { - return '
                              [+spacer+] [+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
                              '; -} - -function getTplClosedFolderNode() { - return '
                              [+spacer+] [+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+] [+pageIdDisplay+]
                              '; -} \ No newline at end of file +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly.'); + +function makeHTML($indent,$parent,$expandAll,$theme) { + global $modx; + global $icons, $iconsPrivate, $_style; + global $output, $_lang, $opened, $opened2, $closed2; //added global vars + global $modx_textdir; + + $pad = '     '; + + // setup spacer + $spacer = ''; + for ($i = 1; $i <= $indent; $i++){ + $spacer .= '     '; + } + + // manage order-by + if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) { + // This is the first startup, set default sort order + $_SESSION['tree_sortby'] = 'menuindex'; + $_SESSION['tree_sortdir'] = 'ASC'; + } + + switch($_SESSION['tree_sortby']) { + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', $_SESSION['tree_sortby'], $_SESSION['tree_sortby']); + break; + default: + $sortby = $_SESSION['tree_sortby']; + }; + + $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); + + // Folder sorting gets special setup ;) Add menuindex and pagetitle + if($_SESSION['tree_sortby'] == 'isfolder') $orderby .= ', menuindex ASC, pagetitle'; + + $tblsc = $modx->getFullTableName('site_content'); + $tbldg = $modx->getFullTableName('document_groups'); + $tblst = $modx->getFullTableName('site_templates'); + // get document groups for current user + $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',',$_SESSION['mgrDocgroups']) : ''; + $showProtected= false; + if (isset ($modx->config['tree_show_protected'])) { + $showProtected= (boolean) $modx->config['tree_show_protected']; + } + $mgrRole= (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole']==='1') ? '1' : '0'; + if ($showProtected == false) { + $access = "AND (1={$mgrRole} OR sc.privatemgr=0". + (!$docgrp ? ')':" OR dg.document_group IN ({$docgrp}))"); + } else { + $access = ''; + } + $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; + $field = "DISTINCT sc.id, pagetitle, longtitle, menutitle, parent, isfolder, published, pub_date, unpub_date, richtext, searchable, cacheable, deleted, type, template, templatename, menuindex, donthit, hidemenu, alias, contentType, privateweb, privatemgr, + MAX(IF(1={$mgrRole} OR sc.privatemgr=0 {$docgrp_cond}, 1, 0)) AS hasAccess"; + $from = "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id LEFT JOIN {$tblst} st on st.id = sc.template"; + $where = "(parent={$parent}) {$access} GROUP BY sc.id"; + $result = $modx->db->select($field,$from,$where,$orderby); + if($modx->db->getRecordCount($result)==0) { + $output .= sprintf('
                              %s%s %s
                              ',$spacer,$pad,$_style['tree_deletedpage'],$_lang['empty_folder']); + } + + $nodeNameSource = $_SESSION['tree_nodename'] == 'default' ? $modx->config['resource_tree_node_name'] : $_SESSION['tree_nodename']; + while($row = $modx->db->getRow($result)) + { + extract($row); + + $nodetitle = getNodeTitle($nodeNameSource,$row); + $nodetitle_esc = addslashes($nodetitle); + $protectedClass = $hasAccess==0 ? ' protectedNode' : ''; + + if($deleted==1) $nodetitleDisplay = sprintf('%s' ,$nodetitle); + elseif($published==0) $nodetitleDisplay = sprintf('%s',$nodetitle); + elseif($hidemenu==1) $nodetitleDisplay = sprintf('%s',$protectedClass,$nodetitle); + else $nodetitleDisplay = sprintf('%s',$protectedClass,$nodetitle); + + $weblinkDisplay = $type=='reference' ? sprintf(' ',$_style['tree_linkgo']) : '' ; + $pageIdDisplay = '('.($modx_textdir ? '‏':'').$id.')'; + + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked(7, $id, true); + if($rowLock && $modx->hasPermission('display_locks')) { + if($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array('element_type'=>$_lang["lock_element_type_7"], 'lasthit_df'=>$rowLock['lasthit_df'])); + $lockedByUser = ''.$_style['tree_preview_resource'].' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array('element_type'=>$_lang["lock_element_type_7"], 'username'=>$rowLock['username'], 'lasthit_df'=>$rowLock['lasthit_df'])); + if($modx->hasPermission('remove_locks')) { + $lockedByUser = ''.$_style['icons_secured'].''; + } else { + $lockedByUser = ''.$_style['icons_secured'].''; + } + } + } + + $url = $modx->makeUrl($id); + + $alt = ''; + if(isDateNode($nodeNameSource)) $alt = $_lang['pagetitle'] .': '.$pagetitle.'[+lf+]'; + $alt.= $_lang['id'] .': '.$id; + $alt.= '[+lf+]'.$_lang['resource_opt_menu_title'] .': '.$menutitle; + $alt.= '[+lf+]'.$_lang['resource_opt_menu_index'] .': '.$menuindex; + $alt.= '[+lf+]'.$_lang['alias'] .': '.(!empty($alias) ? $alias : '-'); + $alt.= '[+lf+]'.$_lang['template'] .': '.$templatename; + $alt.= '[+lf+]'.$_lang['publish_date'] .': '.$modx->toDateFormat($pub_date); + $alt.= '[+lf+]'.$_lang['unpublish_date'] .': '.$modx->toDateFormat($unpub_date); + $alt.= '[+lf+]'.$_lang['page_data_web_access'] .': '.($privateweb ? $_lang['private']:$_lang['public']); + $alt.= '[+lf+]'.$_lang['page_data_mgr_access'] .': '.($privatemgr ? $_lang['private']:$_lang['public']); + $alt.= '[+lf+]'.$_lang['resource_opt_richtext'] .': '.($richtext==0 ? $_lang['no'] : $_lang['yes']); + $alt.= '[+lf+]'.$_lang['page_data_searchable'] .': '.($searchable==0 ? $_lang['no'] : $_lang['yes']); + $alt.= '[+lf+]'.$_lang['page_data_cacheable'] .': '.($cacheable==0 ? $_lang['no'] : $_lang['yes']); + $alt = $modx->htmlspecialchars($alt); + $alt = str_replace('[+lf+]', ' ', $alt); // replace line-breaks with empty space as fall-back + + $data = array('id' => $id, 'pagetitle' => $pagetitle, 'longtitle' => $longtitle, 'menutitle' => $menutitle,'parent' =>$parent, + 'isfolder' =>$isfolder,'published' =>$published,'deleted' =>$deleted,'type' =>$type,'menuindex' =>$menuindex, + 'donthit' =>$donthit,'hidemenu' =>$hidemenu,'alias' =>$alias,'contenttype' =>$contentType,'privateweb' =>$privateweb, + 'privatemgr' =>$privatemgr,'hasAccess' => $hasAccess, 'template' => $template, + 'nodetitle' => $nodetitle, 'spacer' => $spacer, 'pad' => $pad, 'url' => $url, 'alt' => $alt, + 'nodetitleDisplay' => $nodetitleDisplay,'weblinkDisplay' => $weblinkDisplay,'pageIdDisplay' => $pageIdDisplay, + 'lockedByUser'=>$lockedByUser + ); + // invoke OnManagerNodePrerender event + + $evtOut = $modx->invokeEvent('OnManagerNodePrerender',$data); + if (is_array($evtOut)) $evtOut = implode("\n", $evtOut); + + $node = ''; + $ph = $data; + $ph['nodetitle_esc'] = $nodetitle_esc; + $ph['indent'] = $indent+1; + $ph['expandAll'] = $expandAll; + + if (!$isfolder) + { + switch($id) { + case $modx->config['site_start'] : $icon = $_style['tree_page_home']; break; + case $modx->config['error_page'] : $icon = $_style['tree_page_404']; break; + case $modx->config['site_unavailable_page'] : $icon = $_style['tree_page_hourglass']; break; + case $modx->config['unauthorized_page'] : $icon = $_style['tree_page_info']; break; + default: + if ($privateweb||$privatemgr) { + if (isset($iconsPrivate[$contentType])) $icon = $iconsPrivate[$contentType]; + else $icon = $_style['tree_page_secure']; + } elseif (isset($icons[$contentType])) $icon = $icons[$contentType]; + else $icon = $_style['tree_page']; + } + $ph['icon'] = $icon; + $tpl = getTplSingleNode(); + $node = $modx->parseText($tpl,$ph); + $node = $modx->parseText($node,$_lang,'[%','%]'); + } + else + { + $isPrivate = ($privateweb==1||$privatemgr==1) ? '1' : '0'; + $ph['isPrivate'] = $isPrivate; + // expandAll: two type for partial expansion + if ($expandAll ==1 || ($expandAll == 2 && in_array($id, $opened))) + { + if ($expandAll == 1) $opened2[] = $id; + $tpl = getTplOpenFolderNode(); + $ph['src'] = $isPrivate ? $_style['tree_folderopen_secure'] : $_style['tree_folderopen']; + $node = $modx->parseText($tpl,$ph); + $node = $modx->parseText($node,$_lang, '[%','%]'); + $node = $modx->parseText($node,$_style,'[&','&]'); + $output .= $node; + makeHTML($indent+1,$id,$expandAll,$theme); + $node = '
                              '; + } + else + { + $tpl = getTplClosedFolderNode(); + $ph['src'] = $isPrivate ? $_style['tree_folder_secure'] : $_style['tree_folder']; + $node = $modx->parseText($tpl,$ph); + $node = $modx->parseText($node,$_lang, '[%','%]'); + $node = $modx->parseText($node,$_style,'[&','&]'); + $closed2[] = $id; + } + } + $node = $evtOut.$node; + + // invoke OnManagerNodeRender event + $data['node'] = $node; + $evtOut = $modx->invokeEvent('OnManagerNodeRender',$data); + if (is_array($evtOut)) $evtOut = implode("\n", $evtOut); + if ($evtOut != '') $node = $evtOut; + + $output .= $node; + // store vars in Javascript + $scr = ''; + if ($expandAll == 1) { + $scr .= ' '; + } elseif ($expandAll == 0) { + $scr .= ' '; + } + $output = $scr . $output; + } +} + +function getIconInfo($_style) { + if(!isset($_style['tree_page_gif'])) $_style['tree_page_gif'] = $_style['tree_page']; + if(!isset($_style['tree_page_jpg'])) $_style['tree_page_jpg'] = $_style['tree_page']; + if(!isset($_style['tree_page_png'])) $_style['tree_page_png'] = $_style['tree_page']; + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + 'application/rss+xml' => $_style['tree_page_rss'], + 'application/pdf' => $_style['tree_page_pdf'], + 'application/vnd.ms-word' => $_style['tree_page_word'], + 'application/vnd.ms-excel' => $_style['tree_page_excel'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + return $icons; +} + +function getPrivateIconInfo($_style) { + if(!isset($_style['tree_page_gif_secure'])) $_style['tree_page_gif_secure'] = $_style['tree_page_secure']; + if(!isset($_style['tree_page_jpg_secure'])) $_style['tree_page_jpg_secure'] = $_style['tree_page_secure']; + if(!isset($_style['tree_page_png_secure'])) $_style['tree_page_png_secure'] = $_style['tree_page_secure']; + $iconsPrivate = array( + 'text/html' => $_style['tree_page_html_secure'], + 'text/plain' => $_style['tree_page_secure'], + 'text/xml' => $_style['tree_page_xml_secure'], + 'text/css' => $_style['tree_page_css_secure'], + 'text/javascript' => $_style['tree_page_js_secure'], + 'application/rss+xml' => $_style['tree_page_rss_secure'], + 'application/pdf' => $_style['tree_page_pdf_secure'], + 'application/vnd.ms-word' => $_style['tree_page_word_secure'], + 'application/vnd.ms-excel' => $_style['tree_page_excel_secure'], + 'image/gif' => $_style['tree_page_gif_secure'], + 'image/jpg' => $_style['tree_page_jpg_secure'], + 'image/png' => $_style['tree_page_png_secure'] + ); + return $iconsPrivate; +} + +function getNodeTitle($nodeNameSource,$row) { + global $modx; + + extract($row); + switch($nodeNameSource) + { + case 'menutitle': + $nodetitle = $menutitle ? $menutitle : $pagetitle; + break; + case 'alias': + $nodetitle = $alias ? $alias : $id; + if(strpos($alias, '.') === false) + { + if($isfolder!=1 || $modx->config['make_folders']!=1) + $nodetitle .= $modx->config['friendly_url_suffix']; + } + $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; + break; + case 'pagetitle': + $nodetitle = $pagetitle; + break; + case 'longtitle': + $nodetitle = $longtitle ? $longtitle : $pagetitle; + break; + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + $doc = $modx->getDocumentObject('id',$id); + $date = $doc[$nodeNameSource]; + if(!empty($date)) $nodetitle = $modx->toDateFormat($date); + else $nodetitle = '- - -'; + break; + default: + $nodetitle = $pagetitle; + } + $nodetitle = $modx->htmlspecialchars(str_replace(array("\r\n", "\n", "\r"), ' ', $nodetitle), ENT_COMPAT); + return $nodetitle; +} + +function isDateNode($nodeNameSource) { + switch($nodeNameSource) { + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + return true; + default: + return false; + } +} + +function getTplSingleNode() { + return '
                              [+spacer+][+pad+] [+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
                              '; +} + +function getTplOpenFolderNode() { + return '
                              [+spacer+] [+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
                              '; +} + +function getTplClosedFolderNode() { + return '
                              [+spacer+] [+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+] [+pageIdDisplay+]
                              '; +} diff --git a/manager/frames/tree.php b/manager/frames/tree.php old mode 100755 new mode 100644 index dceaa5028a..9aebc1ad43 --- a/manager/frames/tree.php +++ b/manager/frames/tree.php @@ -1,725 +1,755 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js'; $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; ?> -> +> - Document Tree - - - - - '."\n", $modx->config['mgr_jquery_path']); ?> - - + Document Tree + + + + + ' . "\n", $modx->config['mgr_jquery_path']); ?> + + - + invokeEvent('OnManagerTreeInit',$_REQUEST); - if (is_array($evtOut)) - echo implode("\n", $evtOut); +// invoke OnTreePrerender event +$evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); +if(is_array($evtOut)) { + echo implode("\n", $evtOut); +} ?>
                              -
                              - - - - - -
                              - - - - - hasPermission('new_document')) { ?> - - - - - - hasPermission('edit_document')) { ?> - - - hasPermission('assets_images')) { ?> - - - hasPermission('assets_files')) { ?> - - - hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> - - - hasPermission('empty_trash')) { ?> - - - -
                              ">">">
                              -
                              - -hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> - - - -hasPermission('assets_images')) { ?> - - - -hasPermission('assets_files')) { ?> - - - -
                              -manager->saveLastUserSetting($param, $_REQUEST[$param]); - $_SESSION[$param] = $_REQUEST[$param]; - } else if(!isset($_SESSION[$param])) { - $_SESSION[$param] = $modx->manager->getLastUserSetting($param); - } -} -?> -
                              - - - - - - - - - - - - - - -
                              - - -
                              - -
                              -

                              - -
                              -
                                -
                              • -
                              -
                              -
                              -
                              - -
                              -invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); - if (is_array($evtOut)) - echo implode("\n", $evtOut); -?> -
                               
                              -invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); - if (is_array($evtOut)) - echo implode("\n", $evtOut); -?> -
                              - - - - -
                              -
                               
                              - hasPermission('new_document')); // new Resource - constructLink(2, $_style["ctx_edit_document"], $_lang["edit_resource"], $modx->hasPermission('edit_document')); // edit - constructLink(5, $_style["ctx_move_document"] , $_lang["move_resource"], $modx->hasPermission('save_document')); // move - constructLink(7, $_style["ctx_resource_duplicate"], $_lang["resource_duplicate"], $modx->hasPermission('new_document')); // duplicate - constructLink(11,$_style["ctx_sort_menuindex"], $_lang["sort_menuindex"], $modx->hasPermission('edit_document')); // sort menu index - ?> -
                              - hasPermission('publish_document')); // publish - constructLink(10, $_style["ctx_unpublish_resource"], $_lang["unpublish_resource"], $modx->hasPermission('publish_document')); // unpublish - constructLink(4, $_style["ctx_delete"], $_lang["delete_resource"], $modx->hasPermission('delete_document')); // delete - constructLink(8, $_style["ctx_undelete_resource"], $_lang["undelete_resource"], $modx->hasPermission('delete_document')); // undelete - ?> -
                              - hasPermission('new_document')); // new Weblink - ?> -
                              - hasPermission('view_document')); // view - constructLink(12, $_style["ctx_preview_resource"], $_lang["preview_resource"], 1); // preview - ?> -
                              +
                              + + + + + +
                              + + + + + hasPermission('new_document')) { ?> + + + + + + hasPermission('edit_document')) { ?> + + + hasPermission('assets_images')) { ?> + + + hasPermission('assets_files')) { ?> + + + hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> + + + hasPermission('empty_trash')) { ?> + + + +
                              ">">">
                              +
                              + + hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> + + + + hasPermission('assets_images')) { ?> + + + + hasPermission('assets_files')) { ?> + + + +
                              + manager->saveLastUserSetting($param, $_REQUEST[$param]); + $_SESSION[$param] = $_REQUEST[$param]; + } else if(!isset($_SESSION[$param])) { + $_SESSION[$param] = $modx->manager->getLastUserSetting($param); + } + } + ?> +
                              + + + + + + + + + + + + + + +
                              + + +
                              + +
                              +

                              + +
                              +
                                +
                              • +
                              +
                              +
                              +
                              + +
                              + invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); + if(is_array($evtOut)) { + echo implode("\n", $evtOut); + } + ?> +
                                +
                              +
                              + invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); + if(is_array($evtOut)) { + echo implode("\n", $evtOut); + } + ?> +
                              + + + + +
                              +
                               
                              + hasPermission('new_document')); // new Resource + constructLink(2, $_style["ctx_edit_document"], $_lang["edit_resource"], $modx->hasPermission('edit_document')); // edit + constructLink(5, $_style["ctx_move_document"], $_lang["move_resource"], $modx->hasPermission('save_document')); // move + constructLink(7, $_style["ctx_resource_duplicate"], $_lang["resource_duplicate"], $modx->hasPermission('new_document')); // duplicate + constructLink(11, $_style["ctx_sort_menuindex"], $_lang["sort_menuindex"], $modx->hasPermission('edit_document')); // sort menu index + ?> +
                              + hasPermission('publish_document')); // publish + constructLink(10, $_style["ctx_unpublish_resource"], $_lang["unpublish_resource"], $modx->hasPermission('publish_document')); // unpublish + constructLink(4, $_style["ctx_delete"], $_lang["delete_resource"], $modx->hasPermission('delete_document')); // delete + constructLink(8, $_style["ctx_undelete_resource"], $_lang["undelete_resource"], $modx->hasPermission('delete_document')); // undelete + ?> +
                              + hasPermission('new_document')); // new Weblink + ?> +
                              + hasPermission('view_document')); // view + constructLink(12, $_style["ctx_preview_resource"], $_lang["preview_resource"], 1); // preview + ?> +
                              ', $action, $action); - } else { - echo '', $img, $text); + if($allowed == 1) { + echo sprintf(''; + } else { + $closed2[] = $row['id']; + $ph['icon'] = $ph['icon_folder_close']; + $ph['icon_node_toggle'] = $ph['tree_plusnode']; + $ph['node_toggle'] = 0; + + if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { + $ph['showChildren'] = 1; + $ph['icon_node_toggle'] = ''; + } elseif(!$checkDocs && $checkFolders) { + $ph['showChildren'] = 0; + $ph['openFolder'] = 2; + } else { + $ph['openFolder'] = 2; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '0' + )); + if(is_array($prenode)) { + $phnew = array(); + foreach($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + } + + if($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + $node .= '
                              '; + } + } else { + $tpl = getTplFolderNode(); + // expandAll: two type for partial expansion + if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { + if($expandAll == 1) { + $opened2[] = $row['id']; + } + $ph['icon'] = $ph['icon_folder_open']; + $ph['icon_node_toggle'] = $ph['tree_minusnode']; + $ph['node_toggle'] = 1; + $ph['subMenuState'] = ' open'; + + if($ph['donthit'] == 1) { + $ph['tree_page_click'] = 3; + $ph['icon_node_toggle'] = ''; + $ph['icon'] = $ph['icon_folder_close']; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '1' + )); + if(is_array($prenode)) { + $phnew = array(); + foreach($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + if($ph['showChildren'] == 0) { + unset($opened2[$row['id']]); + $ph['node_toggle'] = 0; + $ph['subMenuState'] = ''; + $tpl = getTplFolderNodeNotChildren(); + } + } + + if($ph['showChildren'] == 0) { + $ph['icon_node_toggle'] = ''; + $ph['donthit'] = 1; + $ph['icon'] = $ph['icon_folder_close']; + } + + if($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + if($ph['donthit'] == 0) { + $node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid); + } + $node .= ''; + } else { + $closed2[] = $row['id']; + $ph['icon'] = $ph['icon_folder_close']; + $ph['icon_node_toggle'] = $ph['tree_plusnode']; + $ph['node_toggle'] = 0; + + if($ph['donthit'] == 1) { + $ph['tree_page_click'] = 3; + $ph['icon_node_toggle'] = ''; + $ph['icon'] = $ph['icon_folder_close']; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '0' + )); + if(is_array($prenode)) { + $phnew = array(); + foreach($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + if($ph['showChildren'] == 0) { + $tpl = getTplFolderNodeNotChildren(); + } + } + + if($ph['showChildren'] == 0) { + $ph['icon_node_toggle'] = ''; + $ph['donthit'] = 1; + $ph['icon'] = $ph['icon_folder_close']; + } + + if($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + $node .= ''; + } + } + } + + // invoke OnManagerNodeRender event + $data['node'] = $node; + $evtOut = $modx->invokeEvent('OnManagerNodeRender', $data); + if(is_array($evtOut)) { + $evtOut = implode("\n", $evtOut); + } + if($evtOut != '') { + $node = $evtOut; + } + + $output .= $node; + } + + return $output; +} + +function getIconInfo($_style) { + if(!isset($_style['tree_page_gif'])) { + $_style['tree_page_gif'] = $_style['tree_page']; + } + if(!isset($_style['tree_page_jpg'])) { + $_style['tree_page_jpg'] = $_style['tree_page']; + } + if(!isset($_style['tree_page_png'])) { + $_style['tree_page_png'] = $_style['tree_page']; + } + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + 'application/rss+xml' => $_style['tree_page_rss'], + 'application/pdf' => $_style['tree_page_pdf'], + 'application/vnd.ms-word' => $_style['tree_page_word'], + 'application/vnd.ms-excel' => $_style['tree_page_excel'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + return $icons; +} + +function getPrivateIconInfo($_style) { + if(!isset($_style['tree_page_gif_secure'])) { + $_style['tree_page_gif_secure'] = $_style['tree_page_secure']; + } + if(!isset($_style['tree_page_jpg_secure'])) { + $_style['tree_page_jpg_secure'] = $_style['tree_page_secure']; + } + if(!isset($_style['tree_page_png_secure'])) { + $_style['tree_page_png_secure'] = $_style['tree_page_secure']; + } + $iconsPrivate = array( + 'text/html' => $_style['tree_page_html_secure'], + 'text/plain' => $_style['tree_page_secure'], + 'text/xml' => $_style['tree_page_xml_secure'], + 'text/css' => $_style['tree_page_css_secure'], + 'text/javascript' => $_style['tree_page_js_secure'], + 'application/rss+xml' => $_style['tree_page_rss_secure'], + 'application/pdf' => $_style['tree_page_pdf_secure'], + 'application/vnd.ms-word' => $_style['tree_page_word_secure'], + 'application/vnd.ms-excel' => $_style['tree_page_excel_secure'], + 'image/gif' => $_style['tree_page_gif_secure'], + 'image/jpg' => $_style['tree_page_jpg_secure'], + 'image/png' => $_style['tree_page_png_secure'] + ); + return $iconsPrivate; +} + +function getNodeTitle($nodeNameSource, $row) { + global $modx; + + switch($nodeNameSource) { + case 'menutitle': + $nodetitle = $row['menutitle'] ? $row['menutitle'] : $row['pagetitle']; + break; + case 'alias': + $nodetitle = $row['alias'] ? $row['alias'] : $row['id']; + if(strpos($row['alias'], '.') === false) { + if($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) { + $nodetitle .= $modx->config['friendly_url_suffix']; + } + } + $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; + break; + case 'pagetitle': + $nodetitle = $row['pagetitle']; + break; + case 'longtitle': + $nodetitle = $row['longtitle'] ? $row['longtitle'] : $row['pagetitle']; + break; + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + $doc = $modx->getDocumentObject('id', $row['id']); + $date = $doc[$nodeNameSource]; + if(!empty($date)) { + $nodetitle = $modx->toDateFormat($date); + } else { + $nodetitle = '- - -'; + } + break; + default: + $nodetitle = $row['pagetitle']; + } + $nodetitle = $modx->htmlspecialchars(str_replace(array( + "\r\n", + "\n", + "\r" + ), ' ', $nodetitle), ENT_COMPAT); + return $nodetitle; +} + +function isDateNode($nodeNameSource) { + switch($nodeNameSource) { + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + return true; + default: + return false; + } +} + +function checkIsFolder($parent = 0, $isfolder = 1) { + global $modx; + + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); +} + +function _htmlentities($array) { + global $modx; + + $array = json_encode($array, JSON_UNESCAPED_UNICODE); + $array = htmlentities($array, ENT_COMPAT, $modx->config['modx_charset']); + + return $array; +} + +function getTplSingleNode() { + return ''; +} + +function getTplFolderNode() { + return '
                              [+spacer+][+icon_node_toggle+][+icon+][+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
                              '; +} + +function getTplFolderNodeNotChildren() { + return '
                              [+spacer+][+icon+][+lockedByUser+][+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
                              '; +} + +function dbug($str, $flag = false) { + print('
                              ');
                              +	print_r($str);
                              +	print('
                              '); + if($flag) { + exit; + } +} diff --git a/manager/media/style/MODxRE2_DropdownMenu/frames/nodes.php b/manager/media/style/MODxRE2_DropdownMenu/frames/nodes.php new file mode 100644 index 0000000000..45ad492527 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/frames/nodes.php @@ -0,0 +1,79 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly.'); +} + +include_once('nodes.functions.inc.php'); + +// save folderstate +if(isset($_GET['opened'])) { + $_SESSION['openedArray'] = $_GET['opened']; +} +if(isset($_GET['savestateonly'])) { + exit('send some data'); +} //?? + +$indent = intval($_GET['indent']); +$parent = intval($_GET['parent']); +$expandAll = intval($_GET['expandAll']); +$output = ''; +$theme = $manager_theme . "/"; +$hereid = isset($_GET['id']) ? $_GET['id'] : ''; + +if(isset($_GET['showonlyfolders'])) { + $_SESSION['tree_show_only_folders'] = $_GET['showonlyfolders']; +} + +// setup sorting +$sortParams = array( + 'tree_sortby', + 'tree_sortdir', + 'tree_nodename' +); +foreach($sortParams as $param) { + if(isset($_REQUEST[$param])) { + $_SESSION[$param] = $_REQUEST[$param]; + $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]); + } +} + +// icons by content type +$icons = getIconInfo($_style); +$iconsPrivate = getPrivateIconInfo($_style); + +if(isset($_SESSION['openedArray'])) { + $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); +} else { + $opened = array(); +} + +$opened2 = array(); +$closed2 = array(); + +//makeHTML($indent, $parent, $expandAll, $theme, $hereid); +echo makeHTML($indent, $parent, $expandAll, $theme, $hereid); + +// store vars in Javascript +//$scr = ''; +//if($expandAll == 1) { +// $scr .= ' '; +//} +//echo $scr; + +// check for deleted documents on reload +if($expandAll == 2) { + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), 'deleted=1'); + $count = $modx->db->getValue($rs); + if($count > 0) { + echo ''; + } // add a special element to let system now that the bin is full +} diff --git a/manager/media/style/MODxRE2_DropdownMenu/frames/tree.php b/manager/media/style/MODxRE2_DropdownMenu/frames/tree.php new file mode 100644 index 0000000000..60f35140a0 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/frames/tree.php @@ -0,0 +1,74 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +// invoke OnManagerTreeInit event +$evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); +if(is_array($evtOut)) { + echo implode("\n", $evtOut); +} +?> + +
                              +
                              + + + + + + hasPermission('new_document')) { ?> + + + + + + + + + hasPermission('edit_document')) { ?> + + + + hasPermission('assets_images')) { ?> + "> + + + hasPermission('assets_files')) { ?> + "> + + + hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> + "> + + + hasPermission('empty_trash')) { ?> + + + + + +
                              + +
                              + invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); + if(is_array($evtOut)) { + echo implode("\n", $evtOut); + } + ?> +
                              +
                              +
                              +
                              + invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); + if(is_array($evtOut)) { + echo implode("\n", $evtOut); + } + ?> +
                              +
                              diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/_session.gif b/manager/media/style/MODxRE2_DropdownMenu/images/_session.gif new file mode 100644 index 0000000000..fc2560981e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/_session.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/body.jpg b/manager/media/style/MODxRE2_DropdownMenu/images/body.jpg new file mode 100644 index 0000000000..e8828183ab Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/body.jpg differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/credits/dtree.gif b/manager/media/style/MODxRE2_DropdownMenu/images/credits/dtree.gif new file mode 100644 index 0000000000..c921b195d9 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/credits/dtree.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/credits/mysql.gif b/manager/media/style/MODxRE2_DropdownMenu/images/credits/mysql.gif new file mode 100644 index 0000000000..167226919c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/credits/mysql.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/credits/penguin.gif b/manager/media/style/MODxRE2_DropdownMenu/images/credits/penguin.gif new file mode 100644 index 0000000000..83e2d605f7 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/credits/penguin.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/credits/php.gif b/manager/media/style/MODxRE2_DropdownMenu/images/credits/php.gif new file mode 100644 index 0000000000..2a4b030cbe Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/credits/php.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/add.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/add.png new file mode 100644 index 0000000000..bcab54020b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/add.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_get.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_get.png new file mode 100644 index 0000000000..da3cd6433d Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_get.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_side_contract.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_side_contract.png new file mode 100644 index 0000000000..c96087690d Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_side_contract.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_side_expand.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_side_expand.png new file mode 100644 index 0000000000..030cf7c378 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/application_side_expand.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-down.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-down.png new file mode 100644 index 0000000000..8cb82b44fd Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-down.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-right.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-right.png new file mode 100644 index 0000000000..d811b98fea Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-right.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-up.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-up.png new file mode 100644 index 0000000000..7603fdcd4b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow-up.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow_down.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow_down.png new file mode 100644 index 0000000000..05f17f7009 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow_down.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow_up.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow_up.png new file mode 100644 index 0000000000..1ebb193243 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/arrow_up.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/b02.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b02.gif new file mode 100644 index 0000000000..993bdece2c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b02.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/b02_trans.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b02_trans.gif new file mode 100644 index 0000000000..6f68a447c3 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b02_trans.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/b06.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b06.gif new file mode 100644 index 0000000000..3ee7084dbf Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b06.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/b092.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b092.gif new file mode 100644 index 0000000000..60b73593ac Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/b092.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/backup.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/backup.gif new file mode 100644 index 0000000000..ffcad1b964 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/backup.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/bkmanager.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/bkmanager.gif new file mode 100644 index 0000000000..b1cc21f62b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/bkmanager.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/brick.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/brick.png new file mode 100644 index 0000000000..7851cf34c9 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/brick.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/cal.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/cal.gif new file mode 100644 index 0000000000..08a10639f3 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/cal.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/cal_nodate.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/cal_nodate.gif new file mode 100644 index 0000000000..8c4fddce23 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/cal_nodate.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/calendar-empty.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/calendar-empty.png new file mode 100644 index 0000000000..2255ffae89 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/calendar-empty.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/calendar.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/calendar.png new file mode 100644 index 0000000000..c760be3063 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/calendar.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/camera.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/camera.png new file mode 100644 index 0000000000..4d44a4760c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/camera.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/cancel.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/cancel.png new file mode 100644 index 0000000000..44197a49d1 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/cancel.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/circlerightarrow.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/circlerightarrow.gif new file mode 100644 index 0000000000..585b4cc676 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/circlerightarrow.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/clock_play.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/clock_play.png new file mode 100644 index 0000000000..fb4ebc850a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/clock_play.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/clock_stop.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/clock_stop.png new file mode 100644 index 0000000000..6fe8a6f951 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/clock_stop.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/clone.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/clone.png new file mode 100644 index 0000000000..349f024605 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/clone.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/comment.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/comment.gif new file mode 100644 index 0000000000..4d3a770a6a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/comment.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/context_view.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/context_view.gif new file mode 100644 index 0000000000..d5217bda86 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/context_view.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/copy.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/copy.gif new file mode 100644 index 0000000000..abb13f67ac Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/copy.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/date.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/date.gif new file mode 100644 index 0000000000..0fa5303868 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/date.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/datefocus.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/datefocus.gif new file mode 100644 index 0000000000..13f734ca71 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/datefocus.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/datenofocus.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/datenofocus.gif new file mode 100644 index 0000000000..52e27d116f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/datenofocus.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/delete.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/delete.gif new file mode 100644 index 0000000000..8b2236111b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/delete.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/delete.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/delete.png new file mode 100644 index 0000000000..5cc0d4a2dc Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/delete.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/down.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/down.gif new file mode 100644 index 0000000000..559229e175 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/down.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/download-alt.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/download-alt.png new file mode 100644 index 0000000000..6e5f9882fc Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/download-alt.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/ed_save.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/ed_save.gif new file mode 100644 index 0000000000..df3aaabdb6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/ed_save.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/email.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/email.png new file mode 100644 index 0000000000..3c645a86e1 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/email.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/error.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/error.png new file mode 100644 index 0000000000..628cf2dae3 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/error.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/event1.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/event1.png new file mode 100644 index 0000000000..f55680b0e6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/event1.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/event2.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/event2.png new file mode 100644 index 0000000000..8d434cc753 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/event2.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/event3.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/event3.png new file mode 100644 index 0000000000..042ca49002 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/event3.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/exclamation.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/exclamation.png new file mode 100644 index 0000000000..c37bd062e6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/exclamation.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/eye.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/eye.png new file mode 100644 index 0000000000..b3b1ab6b76 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/eye.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/files.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/files.png new file mode 100644 index 0000000000..d819d8f405 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/files.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder-open.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder-open.png new file mode 100644 index 0000000000..079e37ee4e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder-open.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder.gif new file mode 100644 index 0000000000..aecebb5f59 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder.png new file mode 100644 index 0000000000..d096d08f68 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder_add.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder_add.png new file mode 100644 index 0000000000..529fe8fe04 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder_add.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder_page_add.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder_page_add.png new file mode 100644 index 0000000000..09b2839fad Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/folder_page_add.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/forward.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/forward.gif new file mode 100644 index 0000000000..d2e0654e96 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/forward.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/forward.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/forward.png new file mode 100644 index 0000000000..0dc7b94b68 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/forward.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/globe.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/globe.gif new file mode 100644 index 0000000000..f22d361373 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/globe.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/help.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/help.png new file mode 100644 index 0000000000..0bf44fc16c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/help.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/home.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/home.gif new file mode 100644 index 0000000000..50b176a777 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/home.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/home.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/home.png new file mode 100644 index 0000000000..c97fbda9ce Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/home.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/info-sign.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/info-sign.png new file mode 100644 index 0000000000..63c4230399 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/info-sign.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/information.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/information.png new file mode 100644 index 0000000000..63c4230399 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/information.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/layout_go.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/layout_go.png new file mode 100644 index 0000000000..b84b9394f8 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/layout_go.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/link.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/link.png new file mode 100644 index 0000000000..34b8bac39f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/link.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/link_add.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/link_add.png new file mode 100644 index 0000000000..00be352c57 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/link_add.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/lock.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/lock.png new file mode 100644 index 0000000000..9ae0020f54 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/lock.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/logging.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/logging.gif new file mode 100644 index 0000000000..12df115357 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/logging.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/mail_generic.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/mail_generic.gif new file mode 100644 index 0000000000..8a5a531126 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/mail_generic.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/module.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/module.gif new file mode 100644 index 0000000000..1862875176 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/module.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/modules.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/modules.gif new file mode 100644 index 0000000000..1862875176 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/modules.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/modules.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/modules.png new file mode 100644 index 0000000000..6a11d3bfc3 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/modules.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/move.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/move.png new file mode 100644 index 0000000000..c5b05ad278 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/move.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/new1-09.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/new1-09.gif new file mode 100644 index 0000000000..2a5d10c640 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/new1-09.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/newdoc.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/newdoc.gif new file mode 100644 index 0000000000..0c4c55c8e2 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/newdoc.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/next.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/next.gif new file mode 100644 index 0000000000..cbf1e6a749 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/next.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_add.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_add.png new file mode 100644 index 0000000000..aa23dde374 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_add.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_copy.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_copy.png new file mode 100644 index 0000000000..a9f31a278e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_copy.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_go.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_go.png new file mode 100644 index 0000000000..7e62a924bc Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_go.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_magnify.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_magnify.png new file mode 100644 index 0000000000..f6b74cc40f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/page_white_magnify.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/play.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/play.png new file mode 100644 index 0000000000..8bc9a8f359 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/play.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/prev.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/prev.gif new file mode 100644 index 0000000000..84bae5a294 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/prev.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/preview.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/preview.png new file mode 100644 index 0000000000..cf3d97f75e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/preview.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/question-sign-trans.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/question-sign-trans.png new file mode 100644 index 0000000000..6e6b7c3d42 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/question-sign-trans.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/question-sign.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/question-sign.png new file mode 100644 index 0000000000..05bf84f241 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/question-sign.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/refresh.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/refresh.gif new file mode 100644 index 0000000000..9199cfa9f1 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/refresh.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/refresh.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/refresh.png new file mode 100644 index 0000000000..79cb1c052d Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/refresh.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/reply.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/reply.gif new file mode 100644 index 0000000000..3c9ce14b42 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/reply.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/reply.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/reply.png new file mode 100644 index 0000000000..eea4c7ce6a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/reply.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/resources.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/resources.gif new file mode 100644 index 0000000000..ca3ec26296 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/resources.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/run.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/run.png new file mode 100644 index 0000000000..5119f14313 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/run.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/save.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/save.png new file mode 100644 index 0000000000..fca9970173 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/save.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/secured.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/secured.gif new file mode 100644 index 0000000000..95f0e0670e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/secured.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/security.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/security.gif new file mode 100644 index 0000000000..1f59ecf076 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/security.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/sort.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/sort.png new file mode 100644 index 0000000000..258c16c63a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/sort.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/sort_index.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/sort_index.png new file mode 100644 index 0000000000..d09c246478 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/sort_index.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/stop.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/stop.png new file mode 100644 index 0000000000..7dc446519c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/stop.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/table.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/table.gif new file mode 100644 index 0000000000..5b2980c7ea Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/table.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/table.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/table.png new file mode 100644 index 0000000000..7099f0ea23 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/table.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/table_refresh.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/table_refresh.png new file mode 100644 index 0000000000..ab92010c2c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/table_refresh.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/trash.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/trash.png new file mode 100644 index 0000000000..e4dd2dccb9 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/trash.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/trash_full.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/trash_full.png new file mode 100644 index 0000000000..ebad933c8b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/trash_full.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/undelete.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/undelete.png new file mode 100644 index 0000000000..eb12e8c76e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/undelete.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/unzip.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/unzip.gif new file mode 100644 index 0000000000..14439628ca Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/unzip.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/user.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/user.gif new file mode 100644 index 0000000000..6c578ab953 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/user.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/user.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/user.png new file mode 100644 index 0000000000..928de545a6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/user.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/web_users.gif b/manager/media/style/MODxRE2_DropdownMenu/images/icons/web_users.gif new file mode 100644 index 0000000000..d7bc391679 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/web_users.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/icons/world_link.png b/manager/media/style/MODxRE2_DropdownMenu/images/icons/world_link.png new file mode 100644 index 0000000000..b8edc1265d Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/icons/world_link.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/input-bg.gif b/manager/media/style/MODxRE2_DropdownMenu/images/input-bg.gif new file mode 100644 index 0000000000..cbbbd18ba6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/input-bg.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/_tx_.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/_tx_.gif new file mode 100644 index 0000000000..4b2a9a8a38 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/_tx_.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/ajax-loader.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/ajax-loader.gif new file mode 100644 index 0000000000..cf9e7ccfdd Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/ajax-loader.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/button-gradient.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/button-gradient.png new file mode 100644 index 0000000000..1d681bf6fe Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/button-gradient.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/ed_save.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/ed_save.gif new file mode 100644 index 0000000000..b9c67e22e0 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/ed_save.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/enter.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/enter.png new file mode 100644 index 0000000000..b61f65c46e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/enter.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/fade.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/fade.gif new file mode 100644 index 0000000000..dbdc7ccf58 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/fade.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/headers.jpg b/manager/media/style/MODxRE2_DropdownMenu/images/misc/headers.jpg new file mode 100644 index 0000000000..54d6403d39 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/headers.jpg differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/input-bg.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/input-bg.gif new file mode 100644 index 0000000000..cbbbd18ba6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/input-bg.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/li.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/li.gif new file mode 100644 index 0000000000..f76f19d39f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/li.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/li.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/li.png new file mode 100644 index 0000000000..dd5f9253df Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/li.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/line.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/line.gif new file mode 100644 index 0000000000..5b0f5be790 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/line.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/lock.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/lock.gif new file mode 100644 index 0000000000..e6f19e000d Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/lock.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/locked.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/locked.gif new file mode 100644 index 0000000000..3a2fe3211a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/locked.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/login-logo.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/login-logo.png new file mode 100644 index 0000000000..4a8d39ab79 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/login-logo.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/logo-dashboard.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/logo-dashboard.png new file mode 100644 index 0000000000..e2a78b04c6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/logo-dashboard.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/logo.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/logo.png new file mode 100644 index 0000000000..0c5057ec84 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/logo.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/longbarbg.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/longbarbg.png new file mode 100644 index 0000000000..44197d8aee Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/longbarbg.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/mainbg.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/mainbg.gif new file mode 100644 index 0000000000..3251a4e72c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/mainbg.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/menubg.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/menubg.png new file mode 100644 index 0000000000..323797511f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/menubg.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/minus.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/minus.gif new file mode 100644 index 0000000000..bbdcbfc58a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/minus.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/modx-logo-4.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/modx-logo-4.png new file mode 100644 index 0000000000..5ca5317f16 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/modx-logo-4.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/plus.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/plus.gif new file mode 100644 index 0000000000..957b4a7710 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/plus.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/submit.png b/manager/media/style/MODxRE2_DropdownMenu/images/misc/submit.png new file mode 100644 index 0000000000..b8779de446 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/submit.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/tab.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/tab.gif new file mode 100644 index 0000000000..787666d1e5 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/tab.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/misc/tabareabg.gif b/manager/media/style/MODxRE2_DropdownMenu/images/misc/tabareabg.gif new file mode 100644 index 0000000000..4a8bf79cbc Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/misc/tabareabg.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/subnav.jpg b/manager/media/style/MODxRE2_DropdownMenu/images/subnav.jpg new file mode 100644 index 0000000000..7780c2d685 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/subnav.jpg differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-down.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-down.png new file mode 100644 index 0000000000..9197ab12b1 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-down.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-left.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-left.png new file mode 100644 index 0000000000..04bfdc34d6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-left.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-right.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-right.png new file mode 100644 index 0000000000..d6362d5ee6 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-right.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-up.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-up.png new file mode 100644 index 0000000000..a3c0be7dba Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/angle-up.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/deletedfolder.gif b/manager/media/style/MODxRE2_DropdownMenu/images/tree/deletedfolder.gif new file mode 100644 index 0000000000..a8e7e5add1 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/deletedfolder.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/deletedfolder.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/deletedfolder.png new file mode 100644 index 0000000000..99d891f9e2 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/deletedfolder.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/expand.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/expand.png new file mode 100644 index 0000000000..1267a4a036 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/expand.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt-deleted.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt-deleted.png new file mode 100644 index 0000000000..f8b40ec9df Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt-deleted.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt-secure.png new file mode 100644 index 0000000000..4084e04fbb Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt.png new file mode 100644 index 0000000000..e0c0a5cdeb Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-alt.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-code-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-code-secure.png new file mode 100644 index 0000000000..5971b08a01 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-code-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-code.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-code.png new file mode 100644 index 0000000000..19c603f8fd Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-code.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-deleted.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-deleted.png new file mode 100644 index 0000000000..596bcce831 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-deleted.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-excel-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-excel-secure.png new file mode 100644 index 0000000000..2ad89f3a55 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-excel-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-excel.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-excel.png new file mode 100644 index 0000000000..14c33d9f9b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-excel.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-pdf-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-pdf-secure.png new file mode 100644 index 0000000000..ce852f411e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-pdf-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-pdf.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-pdf.png new file mode 100644 index 0000000000..39faad4cc9 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-pdf.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-rss-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-rss-secure.png new file mode 100644 index 0000000000..23ae05a436 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-rss-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-rss.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-rss.png new file mode 100644 index 0000000000..352f39195e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-rss.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-secure.png new file mode 100644 index 0000000000..4084e04fbb Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-text-alt.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-text-alt.png new file mode 100644 index 0000000000..65b7e20e5b Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-text-alt.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-text.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-text.png new file mode 100644 index 0000000000..501d02c23f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-text.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-word-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-word-secure.png new file mode 100644 index 0000000000..eefa42a689 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-word-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-word.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-word.png new file mode 100644 index 0000000000..45f04f1ee2 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file-word.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/file.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file.png new file mode 100644 index 0000000000..0c658c09ca Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/file.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-alt-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-alt-secure.png new file mode 100644 index 0000000000..d8a768ac21 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-alt-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-alt.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-alt.png new file mode 100644 index 0000000000..d096d08f68 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-alt.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-secure.png new file mode 100644 index 0000000000..d57efda247 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close.png new file mode 100644 index 0000000000..53c4f6672a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-close.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-alt-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-alt-secure.png new file mode 100644 index 0000000000..bb2d2f7463 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-alt-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-alt.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-alt.png new file mode 100644 index 0000000000..079e37ee4e Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-alt.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-secure.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-secure.png new file mode 100644 index 0000000000..60231bef00 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open-secure.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open.png new file mode 100644 index 0000000000..69b4d4811a Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder-open.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder.gif b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder.gif new file mode 100644 index 0000000000..21f367852c Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/folder.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/globe.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/globe.png new file mode 100644 index 0000000000..18820a4107 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/globe.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/home.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/home.png new file mode 100644 index 0000000000..c97fbda9ce Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/home.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/info.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/info.png new file mode 100644 index 0000000000..5fc69b0ecb Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/info.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/link.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/link.png new file mode 100644 index 0000000000..34b8bac39f Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/link.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/page-html.gif b/manager/media/style/MODxRE2_DropdownMenu/images/tree/page-html.gif new file mode 100644 index 0000000000..3d17ea0367 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/page-html.gif differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/sitemap.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/sitemap.png new file mode 100644 index 0000000000..494adab497 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/sitemap.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/time.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/time.png new file mode 100644 index 0000000000..f1aaf37b5d Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/time.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/images/tree/warning-sign.png b/manager/media/style/MODxRE2_DropdownMenu/images/tree/warning-sign.png new file mode 100644 index 0000000000..630c32b610 Binary files /dev/null and b/manager/media/style/MODxRE2_DropdownMenu/images/tree/warning-sign.png differ diff --git a/manager/media/style/MODxRE2_DropdownMenu/includes/footer.inc.php b/manager/media/style/MODxRE2_DropdownMenu/includes/footer.inc.php new file mode 100644 index 0000000000..ebc0db7b38 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/includes/footer.inc.php @@ -0,0 +1,37 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +global $SystemAlertMsgQueque; +// display system alert window if messages are available +if(count($SystemAlertMsgQueque) > 0) { + include "sysalert.display.inc.php"; +} +?> + +manager->action, array( + 85, + 27, + 4, + 72, + 13, + 11, + 12, + 87, + 88 +))) { + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); +} +?> + + + diff --git a/manager/media/style/MODxRE2_DropdownMenu/includes/header.inc.php b/manager/media/style/MODxRE2_DropdownMenu/includes/header.inc.php new file mode 100644 index 0000000000..c5ad201e79 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/includes/header.inc.php @@ -0,0 +1,205 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; + +// invoke OnManagerRegClientStartupHTMLBlock event +$evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock'); +$modx_textdir = isset($modx_textdir) ? $modx_textdir : null; +$onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; +$textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr'; +if(!isset($modx->config['mgr_jquery_path'])) { + $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js'; +} +if(!isset($modx->config['mgr_date_picker_path'])) { + $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; +} + +if(!empty($_COOKIE['MODX_themeColor'])) { + $body_class .= ' ' . $_COOKIE['MODX_themeColor']; +} + +?> + + + + MODX + + + + + ' . "\n", $modx->config['mgr_jquery_path']); ?> + + + + + + + + + + + + + class=""> diff --git a/manager/media/style/MODxRE2_DropdownMenu/includes/menu.class.inc.php b/manager/media/style/MODxRE2_DropdownMenu/includes/menu.class.inc.php new file mode 100644 index 0000000000..70f65af881 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/includes/menu.class.inc.php @@ -0,0 +1,126 @@ +Build('id','parent','name','link','alt','onclick','permission','target','divider 1/0','menuindex') +*/ + +class EVOmenu { + var $defaults = array(); + var $menu; + var $output; + + function Build($menu, $setting = array()) { + $this->defaults['outerClass'] = 'nav'; + $this->defaults['parentClass'] = 'dropdown'; + $this->defaults['parentLinkClass'] = 'dropdown-toggle'; + $this->defaults['parentLinkAttr'] = 'data-toggle="dropdown"'; + $this->defaults['parentLinkIn'] = ''; + $this->defaults['innerClass'] = 'subnav'; + + $this->defaults = $setting + $this->defaults; + $this->Structurise($menu); + $this->output = $this->DrawSub('main', 0); + echo $this->output; + } + + function Structurise($menu) { + foreach($menu as $key => $row) { + $data[$key] = $row[9]; + } + + array_multisort($data, SORT_ASC, $menu); + + foreach($menu as $key => $value) { + $new[$value[1]][] = $value; + } + + $this->menu = $new; + } + + function DrawSub($parentid, $level) { + global $modx; + + $output = ''; + + if(isset($this->menu[$parentid])) { + + $countChild = 0; + $itemTpl = ' +
                            • [+itemName+][+DrawSub+]
                            • '; + $outerTpl = '
                                [+output+]
                              '; + foreach($this->menu[$parentid] as $key => $value) { + if($value[6] !== '') { + $permissions = explode(',', $value[6]); + foreach($permissions as $val) { + if(!$modx->hasPermission($val)) { + continue; + } + } + } + + $countChild++; + $id = $value[0]; + $ph['id'] = $id; + $ph['li_class'] = $this->get_li_class($id) . $value[10]; + $ph['href'] = $value[3]; + $ph['alt'] = $value[4]; + $ph['target'] = $value[7]; + $ph['onclick'] = 'setLastClickedElement(0,0);' . $value[5]; + $ph['a_class'] = $this->get_a_class($id); + $ph['LinkAttr'] = $this->getLinkAttr($id); + $ph['itemName'] = $value[2] . $this->getItemName($id); + + if(isset($this->menu[$id])) { + $level++; + $ph['DrawSub'] = $this->DrawSub($id, $level); + $level--; + } else { + $ph['DrawSub'] = ''; + } + + $output .= $modx->parseText($itemTpl, $ph); + } + + $ph = array(); + if($countChild > 0) { + $ph['id'] = $level == 0 ? $this->defaults['outerClass'] : ''; + $ph['class'] = $level == 0 ? $this->defaults['outerClass'] : $this->defaults['innerClass']; + $ph['output'] = $output; + $output = $modx->parseText($outerTpl, $ph); + } + } + return $output; + } + + function get_li_class($id) { + if(isset($this->menu[$id])) { + return $this->defaults['parentClass'] . ' '; + } else { + return ''; + } + } + + function get_a_class($id) { + if(isset($this->menu[$id])) { + return ' class="' . $this->defaults['parentLinkClass'] . '"'; + } else { + return ''; + } + } + + function getLinkAttr($id) { + if(isset($this->menu[$id])) { + return $this->defaults['parentLinkAttr']; + } else { + return ''; + } + } + + function getItemName($id) { + if(isset($this->menu[$id])) { + return $this->defaults['parentLinkIn']; + } else { + return ''; + } + } +} diff --git a/manager/media/style/MODxRE2_DropdownMenu/includes/template.parser.class.inc.php b/manager/media/style/MODxRE2_DropdownMenu/includes/template.parser.class.inc.php new file mode 100644 index 0000000000..40b1f4c09a --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/includes/template.parser.class.inc.php @@ -0,0 +1,263 @@ +db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name + FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 + INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category + WHERE t1.action IN(' . $action . ') ' . $tab . ' + ORDER BY t1.tab ASC, t1.rank ASC'); + + if($modx->db->getRecordCount($sql)) { + $tabs = array(); + while($row = $modx->db->getRow($sql)) { + if(!$row['value'] && !empty($data[$row['name']])) { + $row['value'] = $data[$row['name']]; + } + $tabs[$row['tab']]['category_name'] = $row['category_name']; + $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); + } + + if(!empty($config['toArray'])) { + $output = $tabs; + } else { + $output .= '
                              '; + $output .= ' + '; + + foreach($tabs as $idTab => $tab) { + $output .= '
                              '; + $output .= ' +

                              ' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '

                              + '; + unset($tab['category_name']); + foreach($tab as $item) { + $output .= $item; + } + $output .= '
                              '; + } + $output .= '
                              '; + } + } + } + + return $output; + } + + private function render($data) { + global $modx, $_lang, $_country_lang; + + $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); + $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); + + $output = ''; + $output .= '
                              '; + + switch($data['type']) { + + case 'text': + $output .= ' +
                              + '; + $output .= $data['content']; + $output .= '
                              '; + + break; + + case 'textarea': + $output .= ' +
                              + '; + $output .= $data['content']; + $output .= '
                              '; + + break; + + case 'date': + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); + $output .= ' +
                              + '; + $output .= $data['content']; + $output .= '
                              '; + + break; + + case 'select': + $output .= ''; + $output .= '
                              '; + $output .= ''; + $output .= $data['content']; + $output .= '
                              '; + + break; + + case 'checkbox': + $output .= ''; + $output .= '
                              '; + $output .= ''; + if($data['elements']) { + $elements = explode('||', $data['elements']); + foreach($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
                              ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
                              '; + + break; + + case 'radio': + $output .= ''; + $output .= '
                              '; + $output .= ''; + if($data['elements']) { + $elements = explode('||', $data['elements']); + foreach($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
                              ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
                              '; + + break; + + case 'custom': + $output .= ''; + $output .= '
                              '; + $output .= $data['content']; + $output .= '
                              '; + + break; + } + + $output .= '
                              '; + + $output = $modx->parseText($output, $data); + + return $output; + } + +} + +?> + +config['manager_theme'] . '/includes/template.parser.class.inc.php'; + +echo TemplateParser::output(array('action' => 88), $userdata); + +*/ +?> + + + diff --git a/manager/media/style/MODxRE2_DropdownMenu/index.html b/manager/media/style/MODxRE2_DropdownMenu/index.html new file mode 100644 index 0000000000..fdd3791786 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/index.html @@ -0,0 +1,2 @@ +

                              Unauthorized access

                              +You're not allowed to access file folder \ No newline at end of file diff --git a/manager/media/style/MODxRE2_DropdownMenu/js/modx.js b/manager/media/style/MODxRE2_DropdownMenu/js/modx.js new file mode 100644 index 0000000000..c585b923f2 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/js/modx.js @@ -0,0 +1,1541 @@ +(function($, w, d, u) { + 'use strict'; + modx.extended({ + frameset: 'frameset', + minWidth: 840, + isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), + init: function() { + if(!localStorage.getItem('MODX_widthSideBar')) { + localStorage.setItem('MODX_widthSideBar', this.config.tree_width) + } + this.tree.init(); + this.mainMenu.init(); + if(w.location.hash) { + w.main.frameElement.contentWindow.location = 'index.php' + w.location.hash.substring(1) + } + this.resizer.init(); + this.search.init(); + this.setLastClickedElement(0, 0); + if(this.config.session_timeout > 0) { + w.setInterval(this.keepMeAlive, 1000 * 60 * this.config.session_timeout); + } + if(modx.config.mail_check_timeperiod > 0) { + setTimeout('modx.updateMail(true)', 1000 * modx.config.mail_check_timeperiod) + } + d.onclick = this.hideDropDown + }, + mainMenu: { + id: 'mainMenu', + init: function() { + //console.log('modx.mainMenu.init()'); + var $mm = $('#mainMenu'), timer; + $mm.on('click', 'a', function(e) { + if($(this).hasClass('dropdown-toggle')) { + $mm.addClass('show'); + e.target.dataset.toggle = '#mainMenu' + } + if($(this).closest('ul').hasClass('dropdown-menu')) { + $('.nav > .active').removeClass('active'); + $('.nav li.selected').removeClass('selected'); + $(this).closest('.nav > li').addClass('active'); + $(this).parent().addClass('selected'); + if(this.offsetParent.id) { + $('#' + this.offsetParent.id.substr(7)).addClass('selected') + } + } + }).on('mouseenter', '.nav > li', function(e) { + $('.nav > li.hover:not(:hover)').removeClass('hover'); + $(this).addClass('hover') + }).on('mouseenter', '.nav > li li', function(e) { + var self = this, ul; + $('.nav > li li.hover:not(:hover)').removeClass('hover'); + $(this).addClass('hover'); + clearTimeout(timer); + if($(this).closest('.nav > li').find('.sub-menu').length) { + ul = $(this).closest('.nav > li').find('.sub-menu').get(0) + } else { + ul = $('').get(0); + $(this).closest('.nav > li').append(ul) + } + timer = setTimeout(function() { + $('.nav .sub-menu.show').removeClass('show'); + if($(self).hasClass('toggle-dropdown')) { + if(ul.id === 'parent_' + self.id) { + $(ul).addClass('show') + } else { + $(ul).removeClass('show'); + timer = setTimeout(function() { + var href = $('a', self).attr('href') && $('a', self).attr('target') === 'main' ? $('a', self).attr('href').split('?')[1] + '&parent=' + self.id : ''; + $.post(modx.MODX_SITE_URL + modx.MGR_DIR + '/media/style/' + modx.config.theme + '/ajax.php', href, function(data) { + if(data) { + $(ul).attr('id', 'parent_' + self.id).html(data); + var id = w.location.hash.substr(2).replace(/=/g, '_').replace(/&/g, '__'); + if(w.location.hash) { + var el = d.getElementById(id); + if(el) { + el.parentNode.classList.add('selected'); + d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected') + } + $('li', ul).on('mouseenter', function(e) { + clearTimeout(timer); + $('.nav > li li.hover:not(:hover)').removeClass('hover'); + $(this).addClass('hover'); + $(self).addClass('hover'); + e.preventDefault(); + e.stopPropagation() + }); + $(ul).addClass('show'); + setTimeout(function() { + modx.mainMenu.search(href, ul) + }, 200) + } + } + }, 'html') + }, 85) + } + } else { + if($(ul).hasClass('open')) { + $(ul).removeClass('open'); + setTimeout(function() { + $(ul).remove() + }, 100) + } + } + }, 85); + e.preventDefault() + }) + }, + search: function(href, ul) { + var items, + input = ul.querySelector('input[name=filter]'), + index = -1; + if(input) { + input.focus(); + input.onkeyup = function(e) { + if(e.keyCode === 13 && ul.querySelector('.item.hover')) { + d.body.click(); + w.main.location.href = ul.querySelector('.item.hover').firstChild.href; + } else if(e.keyCode == 38 || e.keyCode == 40) { + input.selectionStart = input.value.length; + items = ul.querySelectorAll('.item'); + if(items.length) { + if(e.keyCode == 40) index++; + else index--; + if(index < 0) { + index = -1; + var el = ul.querySelector('.hover'); + if(el) el.classList.remove('hover'); + } else if(index > items.length - 1) { + index = items.length - 1 + } + if(index >= 0 && index < items.length) { + el = ul.querySelector('.hover'); + if(el) el.classList.remove('hover'); + items[index].classList.add('hover'); + } + } + } else { + $.post(modx.MODX_SITE_URL + modx.MGR_DIR + '/media/style/' + modx.config.theme + '/ajax.php', href + '&filter=' + input.value, function(data) { + index = -1; + $('.item', ul).remove(); + $(ul).append(data).on('mouseenter', '.item', function(e) { + $(this).addClass('hover').closest('ul').find('li:not(:hover)').removeClass('hover'); + e.stopPropagation() + }) + }, 'html') + } + } + } + } + }, + search: { + id: 'searchform', + idResult: 'searchresult', + idInput: 'searchid', + classResult: 'ajaxSearchResults', + classMask: 'mask', + timer: 0, + init: function() { + this.result = d.getElementById(this.idResult); + var t = this, + el = d.getElementById(this.idInput), + r = d.createElement('i'); + r.className = 'fa fa-refresh fa-spin fa-fw'; + el.parentNode.appendChild(r); + el.onkeyup = function(e) { + e.preventDefault(); + clearTimeout(t.timer); + if(el.value.length !== '' && el.value.length > 2) { + t.timer = setTimeout(function() { + var xhr = modx.XHR(); + xhr.open('GET', 'index.php?a=71&ajax=1&submitok=Search&searchid=' + el.value, true); + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); + xhr.onload = function() { + if(this.status === 200) { + r.style.display = 'none'; + var div = d.createElement('div'); + div.innerHTML = this.responseText; + var o = div.getElementsByClassName(t.classResult)[0]; + if(o) { + if(o.innerHTML !== '') { + t.result.innerHTML = o.outerHTML; + t.open(); + t.result.onclick = function(e) { + if(e.target.tagName === 'I') { + modx.openWindow({ + title: e.target.parentNode.innerText, + id: e.target.parentNode.id, + url: e.target.parentNode.href + }); + return false + } + var p = (e.target.tagName === 'A' && e.target) || e.target.parentNode; + if(p.tagName === 'A') { + var el = t.result.querySelector('.selected'); + if(el) el.className = ''; + p.className = 'selected'; + if(modx.isMobile) t.close() + } + } + } else { + t.empty() + } + } else { + t.empty() + } + } + }; + xhr.onloadstart = function() { + r.style.display = 'block' + }; + xhr.onerror = function() { + console.warn(this.status) + }; + xhr.send() + }, 300) + } else { + t.empty() + } + }; + if(modx.isMobile) { + el.onblur = function() { + t.close() + } + } + el.onfocus = function() { + t.open() + }; + el.onclick = function() { + t.open() + }; + el.onmouseenter = function() { + t.open() + }; + this.result.onmouseover = function() { + t.open() + }; + this.result.onmouseout = function() { + t.close() + }; + d.getElementById(this.id).getElementsByClassName(this.classMask)[0].onmouseenter = function() { + t.open() + }; + d.getElementById(this.id).getElementsByClassName(this.classMask)[0].onmouseout = function() { + t.close() + } + }, + open: function() { + if(this.result.getElementsByClassName(this.classResult)[0]) { + this.result.classList.add('open') + } + }, + close: function() { + this.result.classList.remove('open') + }, + empty: function() { + this.result.classList.remove('open'); + this.result.innerHTML = '' + } + }, + main: { + id: 'main', + idFrame: 'mainframe', + as: null, + onbeforeonload: function() { + }, + onload: function() { + this.tabRow.init(); + this.stopWork(); + this.scrollWork(); + w.main.onclick = modx.hideDropDown; + w.main.oncontextmenu = this.oncontextmenu; + w.location.hash = w.main.frameElement.contentWindow.location.search; + }, + oncontextmenu: function(e) { + if(e.ctrlKey) return; + var el = e.target; + if(/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)) { + var id = Date.now(), + name = el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`]/g, ''), + type = el.className.replace(/cm-modx/, ''), + n = !!name.replace(/^\d+$/, ''); + if(name && n) { + e.preventDefault(); + modx.post(modx.MODX_SITE_URL + modx.MGR_DIR + '/media/style/' + modx.config.theme + '/ajax.php', { + a: 'modxTagHelper', + name: name, + type: type + }, function(r) { + if(r) { + el.id = 'node' + id; + el.dataset.contextmenu = r; + modx.tree.showPopup(e, id, name) + } + }) + } + e.preventDefault() + } + }, + tabRow: { + init: function() { + var row = w.main.document.querySelector('.tab-pane > .tab-row'); + if(row) this.build(row); + }, + build: function(row) { + var rowContainer = d.createElement('div'), + sel = row.querySelector('.selected'); + rowContainer.className = 'tab-row-container'; + row.parentNode.insertBefore(rowContainer, row); + rowContainer.appendChild(row); + var p = d.createElement('i'); + p.className = 'fa fa-angle-left prev disable'; + p.onclick = function(e) { + e.stopPropagation(); + e.preventDefault(); + var sel = row.querySelector('.selected'); + if(sel.previousSibling) { + sel.previousSibling.click(); + modx.main.tabRow.scroll(row) + } + }; + rowContainer.appendChild(p); + var n = d.createElement('i'); + n.className = 'fa fa-angle-right next disable'; + n.onclick = function(e) { + e.stopPropagation(); + e.preventDefault(); + var sel = row.querySelector('.selected'); + if(sel.nextSibling) { + sel.nextSibling.click(); + modx.main.tabRow.scroll(row) + } + }; + rowContainer.appendChild(n); + setTimeout(function() { + sel = row.querySelector('.selected'); + modx.main.tabRow.scroll(row, sel); + w.main.onresize = function() { + modx.main.tabRow.scroll(row); + }; + if(sel) { + if(sel.previousSibling) p.classList.remove('disable'); + if(sel.nextSibling) n.classList.remove('disable'); + } + }, 100); + row.onclick = function(e) { + var sel = e.target.tagName === 'H2' ? e.target : (e.target.tagName === 'SPAN' ? e.target.parentNode : null); + if(sel) { + if(sel.previousSibling) this.parentNode.querySelector('i.prev').classList.remove('disable'); + else this.parentNode.querySelector('i.prev').classList.add('disable'); + if(sel.nextSibling) this.parentNode.querySelector('i.next').classList.remove('disable'); + else this.parentNode.querySelector('i.next').classList.add('disable'); + modx.main.tabRow.scroll(this, sel) + } + } + }, + scroll: function(row, sel) { + sel = sel || row.querySelector('.selected') || row.firstChild + var c = 0, + elms = row.childNodes, + p = row.offsetParent.querySelector('.prev'), + n = row.offsetParent.querySelector('.next'); + for(var i = 0; i < elms.length; i++) c += elms[i].offsetWidth; + if(row.scrollLeft > sel.offsetLeft) { + $(row).animate({ + scrollLeft: sel.offsetLeft - (sel.previousSibling ? 30 : 1) + }, 100) + } + if(sel.offsetLeft + sel.offsetWidth > row.offsetWidth + row.scrollLeft) { + $(row).animate({ + scrollLeft: (sel.offsetLeft - row.offsetWidth + sel.offsetWidth) + (sel.nextSibling ? 30 : 0) + }, 100) + } + if(c > row.offsetWidth) { + this.drag(row) + } + }, + drag: function(row) { + row.onmousedown = function(e) { + if(e.button === 0) { + e.preventDefault(); + var x = e.clientX, + f = row.scrollLeft; + w.main.document.body.focus(); + this.onmousemove = w.main.document.onmousemove = function(e) { + if(Math.abs(e.clientX - x) > 5) { + e.stopPropagation(); + row.scrollLeft = f - (e.clientX - x); + w.main.document.body.classList.add('drag') + } + }; + this.onmouseup = w.main.document.onmouseup = function(e) { + e.stopPropagation(); + row.onmousemove = null; + w.main.document.onmousemove = null; + w.main.document.body.classList.remove('drag') + } + } + } + } + }, + work: function() { + d.getElementById('mainloader').classList.add('show') + }, + stopWork: function() { + d.getElementById('mainloader').classList.remove('show') + }, + scrollWork: function() { + var a = w.main.frameElement.contentWindow, + b = localStorage.getItem('page_y'), + c = localStorage.getItem('page_url'); + if(b === u) { + localStorage.setItem('page_y', 0) + } + if(c === null) { + c = a.location.search.substring(1) + } + if((modx.main.getQueryVariable('a', c) === modx.main.getQueryVariable('a', a.location.search.substring(1))) && (modx.main.getQueryVariable('id', c) === modx.main.getQueryVariable('id', a.location.search.substring(1)))) { + a.scrollTo(0, b) + } + a.onscroll = function() { + if(a.pageYOffset > 0) { + localStorage.setItem('page_y', a.pageYOffset); + localStorage.setItem('page_url', a.location.search.substring(1)) + } + } + }, + getQueryVariable: function(v, q) { + var vars = q.split('&'); + for(var i = 0; i < vars.length; i++) { + var p = vars[i].split('='); + if(decodeURIComponent(p[0]) === v) { + return decodeURIComponent(p[1]) + } + } + } + }, + resizer: { + dragElement: null, + oldZIndex: 99, + newZIndex: 999, + left: modx.config.tree_width, + id: 'resizer', + switcher: 'hideMenu', + background: 'rgba(0, 0, 0, 0.1)', + mask: null, + init: function() { + modx.resizer.mask = d.createElement('div'); + modx.resizer.mask.id = 'mask_resizer'; + modx.resizer.mask.style.zIndex = modx.resizer.oldZIndex; + d.getElementById(modx.resizer.id).onmousedown = modx.resizer.onMouseDown; + d.getElementById(modx.resizer.id).onmouseup = modx.resizer.mask.onmouseup = modx.resizer.onMouseUp; + if(modx.isMobile) { + var x, y, tree = d.getElementById('tree'), h = tree.offsetWidth; + d.getElementById('frameset').appendChild(modx.resizer.mask); + w.addEventListener('touchstart', function(e) { + x = e.changedTouches[0].clientX; + y = e.changedTouches[0].clientY; + this.swipe = ''; + this.sidebar = !d.body.classList.contains('sidebar-closed'); + }, false); + w.addEventListener('touchmove', function(e) { + var touch = e.changedTouches[0]; + tree.style.transition = 'none'; + tree.style.WebkitTransition = 'none'; + modx.resizer.mask.style.transition = 'none'; + modx.resizer.mask.style.WebkitTransition = 'none'; + modx.resizer.mask.style.visibility = 'visible'; + var ax = touch.clientX - x; + var ay = touch.clientY - y; + if(Math.abs(ax) > Math.abs(ay)) { + if(ax < 0 && this.sidebar) { + if(Math.abs(ax) > h) ax = -h; + tree.style.transform = 'translate3d(' + ax + 'px, 0, 0)'; + tree.style.WebkitTransform = 'translate3d(' + ax + 'px, 0, 0)'; + modx.resizer.mask.style.opacity = (0.5 - (0.5 / -h) * ax).toFixed(2); + if(Math.abs(ax) > h / 3) this.swipe = 'left' + else this.swipe = 'right' + } else if(ax > 0 && !this.sidebar) { + if(Math.abs(ax) > h) ax = h; + tree.style.transform = 'translate3d(' + -(h - ax) + 'px, 0, 0)'; + tree.style.WebkitTransform = 'translate3d(' + -(h - ax) + 'px, 0, 0)'; + modx.resizer.mask.style.opacity = ((0.5 / h) * ax).toFixed(2); + if(Math.abs(ax) > h / 3) this.swipe = 'right' + else this.swipe = 'left' + } + } + }, false); + w.addEventListener('touchend', function(e) { + if(this.swipe === 'left') { + d.body.classList.add('sidebar-closed'); + modx.resizer.setWidth(0) + } + if(this.swipe === 'right') { + d.body.classList.remove('sidebar-closed'); + modx.resizer.setWidth(h) + } + tree.style.cssText = ''; + modx.resizer.mask.style.cssText = ''; + }, false) + } + }, + onMouseDown: function(e) { + e = e || w.event; + modx.resizer.dragElement = e.target !== null ? e.target : e.srcElement; + if((e.buttons === 1 || e.button === 0) && modx.resizer.dragElement.id === modx.resizer.id) { + modx.resizer.oldZIndex = modx.resizer.dragElement.style.zIndex; + modx.resizer.dragElement.style.zIndex = modx.resizer.newZIndex; + modx.resizer.dragElement.style.background = modx.resizer.background; + localStorage.setItem('MODX_widthSideBar', (modx.resizer.dragElement.offsetLeft > 0 ? modx.resizer.dragElement.offsetLeft : 0)); + d.body.appendChild(modx.resizer.mask); + d.onmousemove = modx.resizer.onMouseMove; + d.body.focus(); + d.body.classList.add('resizer_move'); + d.onselectstart = function() { + return false + }; + modx.resizer.dragElement.ondragstart = function() { + return false + }; + return false + } + }, + onMouseMove: function(e) { + e = e || w.event; + if(e.clientX > 0) { + modx.resizer.left = e.clientX + } else { + modx.resizer.left = 0 + } + modx.resizer.dragElement.style.left = modx.pxToRem(modx.resizer.left) + 'rem'; + d.getElementById('tree').style.width = modx.pxToRem(modx.resizer.left) + 'rem'; + d.getElementById('main').style.left = modx.pxToRem(modx.resizer.left) + 'rem'; + if(e.clientX < -2 || e.clientY < -2) { + modx.resizer.onMouseUp(e) + } + }, + onMouseUp: function(e) { + if(modx.resizer.dragElement !== null && e.button === 0 && modx.resizer.dragElement.id === modx.resizer.id) { + if(e.clientX > 0) { + d.body.classList.remove('sidebar-closed'); + modx.resizer.left = e.clientX + } else { + d.body.classList.add('sidebar-closed'); + modx.resizer.left = 0 + } + d.cookie = 'MODX_widthSideBar=' + modx.pxToRem(modx.resizer.left); + modx.resizer.dragElement.style.zIndex = modx.resizer.oldZIndex; + modx.resizer.dragElement.style.background = ''; + modx.resizer.dragElement.ondragstart = null; + modx.resizer.dragElement = null; + d.body.classList.remove('resizer_move'); + d.body.removeChild(modx.resizer.mask); + d.onmousemove = null; + d.onselectstart = null + } + }, + toggle: function() { + if(modx.isMobile) { + if(d.body.classList.contains('sidebar-closed')) { + d.body.classList.remove('sidebar-closed'); + localStorage.setItem('MODX_widthSideBar', 0); + d.cookie = 'MODX_widthSideBar=' + modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth)) + } else { + localStorage.setItem('MODX_widthSideBar', parseInt(d.getElementById('tree').offsetWidth)); + d.body.classList.add('sidebar-closed'); + d.cookie = 'MODX_widthSideBar=0' + } + } else { + var p = d.getElementById('tree').offsetWidth !== 0 ? 0 : (parseInt(localStorage.getItem('MODX_widthSideBar')) ? parseInt(localStorage.getItem('MODX_widthSideBar')) : modx.config.tree_width); + modx.resizer.setWidth(p) + } + }, + setWidth: function(a) { + if(a > 0) { + localStorage.setItem('MODX_widthSideBar', 0); + d.body.classList.remove('sidebar-closed') + } else { + localStorage.setItem('MODX_widthSideBar', parseInt(d.getElementById('tree').offsetWidth)); + d.body.classList.add('sidebar-closed') + } + d.cookie = 'MODX_widthSideBar=' + modx.pxToRem(a); + d.getElementById('tree').style.width = modx.pxToRem(a) + 'rem'; + d.getElementById('resizer').style.left = modx.pxToRem(a) + 'rem'; + d.getElementById('main').style.left = modx.pxToRem(a) + 'rem' + }, + setDefaultWidth: function() { + modx.resizer.setWidth(modx.config.tree_width) + } + }, + tree: { + ctx: null, + rpcNode: null, + itemToChange: null, + selectedObjectName: null, + selectedObject: 0, + selectedObjectDeleted: 0, + selectedObjectUrl: '', + drag: false, + init: function() { + this.restoreTree() + }, + draggable: function() { + var els = d.querySelectorAll('#treeRoot a:not(.empty)'); + for(var i = 0; i < els.length; i++) { + els[i].onmousedown = this.onmousedown; + els[i].ondragstart = this.ondragstart; + els[i].ondragenter = this.ondragenter; + els[i].ondragover = this.ondragover; + els[i].ondragleave = this.ondragleave; + els[i].ondrop = this.ondrop; + } + }, + onmousedown: function(e) { + if(e.ctrlKey) { + this.parentNode.removeAttribute('draggable'); + return; + } else { + this.parentNode.draggable = true + } + modx.tree.itemToChange = this.parentNode.id; + this.parentNode.ondragstart = modx.tree.ondragstart + }, + ondragstart: function(e) { + e.dataTransfer.effectAllowed = "all"; + e.dataTransfer.dropEffect = "all"; + e.dataTransfer.setData("text", this.id.substr(4)); + }, + ondragenter: function(e) { + if(d.getElementById(modx.tree.itemToChange) === (this.parentNode.closest('#' + modx.tree.itemToChange) || this.parentNode)) { + this.parentNode.className = ''; + e.dataTransfer.effectAllowed = "none"; + e.dataTransfer.dropEffect = "none"; + modx.tree.drag = false; + } else { + this.parentNode.className = 'dragenter'; + e.dataTransfer.effectAllowed = "copy"; + e.dataTransfer.dropEffect = "copy"; + modx.tree.drag = true; + } + e.preventDefault(); + }, + ondragover: function(e) { + if(modx.tree.drag) { + var a = e.clientY; + var b = parseInt(this.getBoundingClientRect().top); + var c = (a - b); + if(c > this.offsetHeight / 1.51) { + //this.parentNode.className = 'dragafter'; + this.parentNode.classList.add('dragafter'); + this.parentNode.classList.remove('dragbefore'); + this.parentNode.classList.remove('dragenter'); + e.dataTransfer.effectAllowed = "link"; + e.dataTransfer.dropEffect = "link"; + } else if(c < this.offsetHeight / 3) { + //this.parentNode.className = 'dragbefore'; + this.parentNode.classList.add('dragbefore'); + this.parentNode.classList.remove('dragafter'); + this.parentNode.classList.remove('dragenter'); + e.dataTransfer.effectAllowed = "link"; + e.dataTransfer.dropEffect = "link"; + } else { + //this.parentNode.className = 'dragenter'; + this.parentNode.classList.add('dragenter'); + this.parentNode.classList.remove('dragafter'); + this.parentNode.classList.remove('dragbefore'); + e.dataTransfer.effectAllowed = "copy"; + e.dataTransfer.dropEffect = "copy"; + } + } else { + e.dataTransfer.effectAllowed = "none"; + e.dataTransfer.dropEffect = "none"; + modx.tree.drag = false; + } + e.preventDefault() + }, + ondragleave: function(e) { + this.parentNode.className = ''; + this.parentNode.removeAttribute('draggable'); + e.preventDefault() + }, + ondrop: function(e) { + var el = d.getElementById(modx.tree.itemToChange), + els = null, + id = modx.tree.itemToChange.substr(4), + parent = 0, + menuindex = [], + index = 0, + level = 0, + indent = el.firstChild.querySelector('.indent'), + i = 0; + indent.innerHTML = ''; + el.removeAttribute('draggable'); + if(this.parentNode.classList.contains('dragenter')) { + parent = parseInt(this.parentNode.id.substr(4)); + level = parseInt(this.dataset.level) + 1; + for(i = 0; i < level; i++) indent.innerHTML += ''; + if(this.nextSibling) { + if(this.nextSibling.innerHTML) { + this.nextSibling.appendChild(el) + } else { + el.parentNode.removeChild(el) + } + els = this.parentNode.lastChild.children; + for(i = 0; i < els.length; i++) menuindex[i] = els[i].id.substr(4); + } else { + el.parentNode.removeChild(el); + d.querySelector('#node' + parent + ' .icon').innerHTML = (parseInt(this.dataset.private) ? modx.style.tree_folder_secure : modx.style.tree_folder) + } + modx.tree.ondragupdate(this, id, parent, menuindex) + } + if(this.parentNode.classList.contains('dragafter')) { + parent = /node/.test(this.parentNode.parentNode.parentNode.id) ? parseInt(this.parentNode.parentNode.parentNode.id.substr(4)) : 0; + level = parseInt(this.dataset.level); + for(i = 0; i < level; i++) indent.innerHTML += ''; + this.parentNode.parentNode.insertBefore(el, this.parentNode.nextSibling); + els = this.parentNode.parentNode.children; + for(i = 0; i < els.length; i++) menuindex[i] = els[i].id.substr(4); + modx.tree.ondragupdate(this, id, parent, menuindex) + } + if(this.parentNode.classList.contains('dragbefore')) { + parent = /node/.test(this.parentNode.parentNode.parentNode.id) ? parseInt(this.parentNode.parentNode.parentNode.id.substr(4)) : 0; + level = parseInt(this.dataset.level); + for(i = 0; i < level; i++) indent.innerHTML += ''; + this.parentNode.parentNode.insertBefore(el, this.parentNode); + els = this.parentNode.parentNode.children; + for(i = 0; i < els.length; i++) menuindex[i] = els[i].id.substr(4); + modx.tree.ondragupdate(this, id, parent, menuindex) + } + this.parentNode.removeAttribute('class'); + this.parentNode.removeAttribute('draggable'); + e.preventDefault(); + }, + ondragupdate: function(a, id, parent, menuindex) { + modx.post(modx.MODX_SITE_URL + modx.MGR_DIR + '/media/style/' + modx.config.theme + '/ajax.php', { + a: 'movedocument', + id: id, + parent: parent, + menuindex: menuindex + }, function() { + modx.tree.restoreTree() + }); + var b = w.main.frameElement.contentWindow.location.search.substr(1); + if(parseInt(modx.main.getQueryVariable('a', b)) === 27 && parseInt(modx.main.getQueryVariable('id', b)) === parseInt(id)) { + var index = menuindex.indexOf(id), + elMenuIndex = w.main.document.querySelector('#documentPane input[name=menuindex]'), + elParent = w.main.document.querySelector('#documentPane input[name=parent]'), + elParentName = w.main.document.querySelector('#documentPane #parentName'); + if(elMenuIndex && index >= 0) elMenuIndex.value = index; + if(elParent && elParentName) { + elParent.value = parent; + elParentName.innerHTML = parent + ' (' + d.querySelector('#node' + parent + ' > a').dataset.titleEsc + ')' + } + } + }, + toggleTheme: function(e) { + var myCodeMirrors = w.main.myCodeMirrors, key; + if(e.currentTarget.classList.contains('rotate180')) { + e.currentTarget.classList.remove('rotate180'); + d.body.classList.remove('dark'); + w.main.document.body.classList.remove('dark'); + d.cookie = 'MODX_themeColor='; + if(myCodeMirrors) { + for(key in myCodeMirrors) { + if(myCodeMirrors.hasOwnProperty(key)) { + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-' + myCodeMirrors[key].options.darktheme) + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-' + myCodeMirrors[key].options.defaulttheme) + } + } + } + } else { + e.currentTarget.classList.add('rotate180'); + d.body.classList.add('dark'); + w.main.document.body.classList.add('dark'); + d.cookie = 'MODX_themeColor=dark'; + if(myCodeMirrors) { + for(key in myCodeMirrors) { + if(myCodeMirrors.hasOwnProperty(key)) { + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-' + myCodeMirrors[key].options.darktheme) + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-' + myCodeMirrors[key].options.defaulttheme) + } + } + } + } + }, + toggleNode: function(e, id) { + e = e || w.event; + if(e.ctrlKey) return; + e.stopPropagation(); + var el = d.getElementById('node' + id).firstChild; + this.rpcNode = el.nextSibling; + var toggle = el.querySelector('.toggle'), + icon = el.querySelector('.icon'); + if(this.rpcNode.innerHTML === '') { + if(toggle) toggle.innerHTML = el.dataset.iconCollapsed; + icon.innerHTML = el.dataset.iconFolderOpen; + var rpcNodeText = this.rpcNode.innerHTML, + loadText = modx.lang.loading_doc_tree; + modx.openedArray[id] = 1; + if(rpcNodeText === "" || rpcNodeText.indexOf(loadText) > 0) { + var folderState = this.getFolderState(); + d.getElementById('treeloader').classList.add('visible'); + modx.get('index.php?a=1&f=nodes&indent=' + el.dataset.indent + '&parent=' + id + '&expandAll=' + el.dataset.expandall + folderState, function(r) { + modx.tree.rpcLoadData(r); + modx.tree.draggable() + }) + } + this.saveFolderState() + } else { + if(toggle) toggle.innerHTML = el.dataset.iconExpanded; + icon.innerHTML = el.dataset.iconFolderClose; + delete modx.openedArray[id]; + this.rpcNode.style.overflow = 'hidden'; + $(this.rpcNode.firstChild).animate({ + marginTop: -this.rpcNode.offsetHeight + 'px' + }, 100, function() { + this.parentNode.innerHTML = ''; + }); + this.saveFolderState() + } + e.preventDefault() + }, + rpcLoadData: function(a) { + if(this.rpcNode !== null) { + this.rpcNode.innerHTML = typeof a === 'object' ? a.responseText : a; + this.rpcNode.loaded = true; + if(this.rpcNode.id !== 'treeRoot') { + this.rpcNode.style.overflow = 'hidden'; + this.rpcNode.firstChild.style.marginTop = -this.rpcNode.offsetHeight + 'px' + $(this.rpcNode.firstChild).animate({ + marginTop: 0 + }, 100); + } + var el; + d.getElementById('treeloader').classList.remove('visible'); + if(this.rpcNode.id === 'treeRoot') { + el = d.getElementById('binFull'); + if(el) this.showBin(true); + else this.showBin(false) + } + el = d.getElementById('mx_loginbox'); + if(el) { + this.rpcNode.style.overflow = 'hidden'; + $(this.rpcNode.firstChild).animate({ + marginTop: -this.rpcNode.offsetHeight + 'px' + }, 100, function() { + this.parentNode.innerHTML = ''; + }); + w.location = 'index.php' + } + } + }, + treeAction: function(e, id, title) { + if(e.ctrlKey) return; + var el = d.getElementById('node' + id).firstChild, + treepageclick = parseInt(el.dataset.treepageclick), + showchildren = parseInt(el.dataset.showchildren), + openfolder = parseInt(el.dataset.openfolder); + title = title || (el.dataset && el.dataset.titleEsc); + if(tree.ca === "move") { + try { + this.setSelectedByContext(id); + w.main.setMoveValue(id, title) + } catch(oException) { + alert(modx.lang.unable_set_parent) + } + } + if(tree.ca === "open" || tree.ca === "") { + if(id === 0) { + w.main.location.href = "index.php?a=2" + } else { + var href = ''; + modx.setLastClickedElement(7, id); + if(!isNaN(treepageclick) && isFinite(treepageclick)) { + href = "index.php?a=" + treepageclick + "&r=1&id=" + id + (openfolder === 0 ? this.getFolderState() : '') + } else { + href = treepageclick; + } + if(openfolder === 2) { + if(showchildren !== 1) { + href = ''; + } + this.toggleNode(e, id) + } + if(href) { + if(e.shiftKey) { + w.getSelection().removeAllRanges(); + modx.openWindow(href); + this.restoreTree() + } else { + w.main.location.href = href; + if(modx.isMobile) modx.resizer.toggle() + } + } + } + var el = d.querySelector('#node' + id + '>.node'); + modx.tree.setSelected(el) + } + if(tree.ca === "parent") { + try { + this.setSelectedByContext(id); + w.main.setParent(id, title) + } catch(oException) { + alert(modx.lang.unable_set_parent) + } + } + if(tree.ca === "link") { + try { + this.setSelectedByContext(id); + w.main.setLink(id) + } catch(oException) { + alert(modx.lang.unable_set_link) + } + } + e.preventDefault(); + }, + showPopup: function(e, id, title) { + if(e.ctrlKey) return; + e.preventDefault(); + var tree = d.getElementById('tree'), + el = d.getElementById('node' + id) || e.target; + if(el) { + if(el.dataset.contextmenu) { + e.target.dataset.toggle = '#contextmenu'; + modx.hideDropDown(e); + this.ctx = d.createElement('div'); + this.ctx.id = 'contextmenu'; + this.ctx.className = 'dropdown-menu'; + d.getElementById(modx.frameset).appendChild(this.ctx); + this.setSelectedByContext(id); + var dataJson = JSON.parse(el.dataset.contextmenu); + for(var key in dataJson) { + if(dataJson.hasOwnProperty(key)) { + var item = d.createElement('div'); + for(var k in dataJson[key]) { + if(dataJson[key].hasOwnProperty(k)) { + if(k.substring(0, 2) === 'on') { + var onEvent = dataJson[key][k]; + item[k] = function(onEvent) { + return function() { + eval(onEvent) + } + }(onEvent) + } else { + item[k] = dataJson[key][k] + } + } + } + if(key.indexOf('header') === 0) item.className += ' menuHeader'; + if(key.indexOf('item') === 0) item.className += ' menuLink'; + if(key.indexOf('seperator') === 0 || key.indexOf('separator') === 0) item.className += ' seperator separator'; + this.ctx.appendChild(item) + } + } + var bodyHeight = tree.offsetHeight - modx.config.menu_height; + var x = e.clientX > 0 ? e.clientX : e.pageX; + var y = e.clientY > 0 ? e.clientY : e.pageY; + if(e.view.name === "main") { + x += tree.offsetWidth + } else { + if(e.target.parentNode.parentNode.classList.contains('node')) { + x += 50; + } + } + if(x > e.view.innerWidth) { + x = e.view.innerWidth - this.ctx.offsetWidth; + } + if(y + this.ctx.offsetHeight / 2 > bodyHeight) { + y = bodyHeight - this.ctx.offsetHeight - 5 + } else if(y - this.ctx.offsetHeight / 2 < tree.offsetTop) { + y = tree.offsetTop + 5 + } else { + y = y - this.ctx.offsetHeight / 2 + } + this.itemToChange = id; + this.selectedObjectName = title; + this.dopopup(this.ctx, x + 10, y) + } else { + el = el.firstChild; + var ctx = d.getElementById('mx_contextmenu'); + e.target.dataset.toggle = '#mx_contextmenu'; + modx.hideDropDown(e); + this.setSelectedByContext(id); + var i4 = d.getElementById('item4'), + i5 = d.getElementById('item5'), + i8 = d.getElementById('item8'), + i9 = d.getElementById('item9'), + i10 = d.getElementById('item10'), + i11 = d.getElementById('item11'); + if(modx.permission.publish_document === 1) { + i9.style.display = 'block'; + i10.style.display = 'block'; + if(parseInt(el.dataset.published) === 1) i9.style.display = 'none'; + else i10.style.display = 'none' + } else { + i5.style.display = 'none' + } + if(modx.permission.delete_document === 1) { + i4.style.display = 'block'; + i8.style.display = 'block'; + if(parseInt(el.dataset.deleted) === 1) { + i4.style.display = 'none'; + i9.style.display = 'none'; + i10.style.display = 'none' + } else { + i8.style.display = 'none' + } + } + if(parseInt(el.dataset.isfolder) === 1) i11.style.display = 'block'; + else i11.style.display = 'none'; + var bodyHeight = tree.offsetHeight + tree.offsetTop; + var x = e.clientX > 0 ? e.clientX : e.pageX; + var y = e.clientY > 0 ? e.clientY : e.pageY; + if(y + ctx.offsetHeight / 2 > bodyHeight) { + y = bodyHeight - ctx.offsetHeight - 5 + } else if(y - ctx.offsetHeight / 2 < tree.offsetTop) { + y = tree.offsetTop + 5 + } else { + y = y - ctx.offsetHeight / 2 + } + if(e.target.parentNode.parentNode.classList.contains('node')) x += 50; + this.itemToChange = id; + this.selectedObjectName = title; + this.dopopup(ctx, x + 10, y) + } + e.stopPropagation() + } + }, + dopopup: function(el, a, b) { + if(this.selectedObjectName.length > 30) { + this.selectedObjectName = this.selectedObjectName.substr(0, 30) + "..." + } + var f = d.getElementById("nameHolder"); + f.innerHTML = this.selectedObjectName; + el.style.left = a + (modx.config.textdir ? '-190' : '') + "px"; + el.style.top = b + "px"; + setTimeout(function() { + el.classList.add('show') + }, 150) + }, + menuHandler: function(a) { + switch(a) { + case 1: + this.setActiveFromContextMenu(this.itemToChange); + w.main.location.href = "index.php?a=3&id=" + this.itemToChange; + break; + case 2: + this.setActiveFromContextMenu(this.itemToChange); + w.main.location.href = "index.php?a=27&r=1&id=" + this.itemToChange; + break; + case 3: + w.main.location.href = "index.php?a=4&pid=" + this.itemToChange; + break; + case 4: + if(this.selectedObjectDeleted) { + alert("'" + this.selectedObjectName + "' " + modx.lang.already_deleted) + } else if(confirm("'" + this.selectedObjectName + "'\n\n" + modx.lang.confirm_delete_resource) === true) { + w.main.location.href = "index.php?a=6&id=" + this.itemToChange + } + break; + case 5: + this.setActiveFromContextMenu(this.itemToChange); + w.main.location.href = "index.php?a=51&id=" + this.itemToChange; + break; + case 6: + w.main.location.href = "index.php?a=72&pid=" + this.itemToChange; + break; + case 7: + if(confirm(modx.lang.confirm_resource_duplicate) === true) { + w.main.location.href = "index.php?a=94&id=" + this.itemToChange + } + break; + case 8: + if(d.getElementById('node' + this.itemToChange).firstChild.dataset.deleted) { + if(confirm("'" + this.selectedObjectName + "' " + modx.lang.confirm_undelete) === true) { + w.main.location.href = "index.php?a=63&id=" + this.itemToChange + } + } else { + alert("'" + this.selectedObjectName + "'" + modx.lang.not_deleted) + } + break; + case 9: + if(confirm("'" + this.selectedObjectName + "' " + modx.lang.confirm_publish) === true) { + w.main.location.href = "index.php?a=61&id=" + this.itemToChange + } + break; + case 10: + if(this.itemToChange !== modx.config.site_start) { + if(confirm("'" + this.selectedObjectName + "' " + modx.lang.confirm_unpublish) === true) { + w.main.location.href = "index.php?a=62&id=" + this.itemToChange + } + } else { + alert('Document is linked to site_start variable and cannot be unpublished!') + } + break; + case 11: + w.main.location.href = "index.php?a=56&id=" + this.itemToChange; + break; + case 12: + w.open(d.getElementById('node' + this.itemToChange).firstChild.dataset.href, 'previeWin'); + break; + default: + alert('Unknown operation command.') + } + }, + setSelected: function(a) { + var el = d.querySelector('#treeRoot .current'); + if(el) el.classList.remove('current'); + if(a) a.classList.add('current') + }, + setActiveFromContextMenu: function(a) { + var el = d.querySelector('#node' + a + '>.node'); + if(el) this.setSelected(el) + }, + setSelectedByContext: function(a) { + var el = d.querySelector('#treeRoot .selected'); + if(el) el.classList.remove('selected'); + el = d.querySelector('#node' + a + '>.node'); + if(el) el.classList.add('selected'); + }, + setItemToChange: function() { + var a = w.main.frameElement.contentWindow, + b = a.location.search.substring(1); + if((parseInt(modx.main.getQueryVariable('a', b)) === 27 || parseInt(modx.main.getQueryVariable('a', b)) === 3) && modx.main.getQueryVariable('id', b)) { + this.itemToChange = parseInt(modx.main.getQueryVariable('id', b)) + } else { + this.itemToChange = null + } + }, + restoreTree: function() { + console.log('modx.tree.restoreTree()'); + d.getElementById('treeloader').classList.add('visible'); + this.setItemToChange(); + this.rpcNode = d.getElementById('treeRoot'); + modx.get('index.php?a=1&f=nodes&indent=1&parent=0&expandAll=2&id=' + this.itemToChange, function(r) { + modx.tree.rpcLoadData(r); + modx.tree.draggable() + }) + }, + expandTree: function() { + this.rpcNode = d.getElementById('treeRoot'); + d.getElementById('treeloader').classList.add('visible'); + modx.get('index.php?a=1&f=nodes&indent=1&parent=0&expandAll=1&id=' + this.itemToChange, function(r) { + modx.tree.rpcLoadData(r); + modx.tree.saveFolderState(); + modx.tree.draggable() + }) + }, + collapseTree: function() { + this.rpcNode = d.getElementById('treeRoot'); + d.getElementById('treeloader').classList.add('visible'); + modx.get('index.php?a=1&f=nodes&indent=1&parent=0&expandAll=0&id=' + this.itemToChange, function(r) { + modx.openedArray = []; + modx.tree.saveFolderState(); + modx.tree.rpcLoadData(r); + modx.tree.draggable() + }) + }, + updateTree: function() { + this.rpcNode = d.getElementById('treeRoot'); + d.getElementById('treeloader').classList.add('visible'); + var a = d.sortFrm; + var b = 'a=1&f=nodes&indent=1&parent=0&expandAll=2&dt=' + a.dt.value + '&tree_sortby=' + a.sortby.value + '&tree_sortdir=' + a.sortdir.value + '&tree_nodename=' + a.nodename.value + '&id=' + this.itemToChange + '&showonlyfolders=' + a.showonlyfolders.value; + modx.get('index.php?' + b, function(r) { + modx.tree.rpcLoadData(r); + modx.tree.draggable() + }) + }, + getFolderState: function() { + var a; + if(modx.openedArray !== [0]) { + a = "&opened="; + for(var key in modx.openedArray) { + if(modx.openedArray[key]) { + a += key + "|" + } + } + } else { + a = "&opened=" + } + return a + }, + saveFolderState: function() { + modx.get('index.php?a=1&f=nodes&savestateonly=1' + this.getFolderState()) + }, + showSorter: function(e) { + e = e || w.event; + var el = d.getElementById('floater'); + e.target.dataset.toggle = '#floater'; + el.classList.toggle('show'); + el.onclick = function(e) { + e.stopPropagation() + } + }, + emptyTrash: function() { + if(confirm(modx.lang.confirm_empty_trash) === true) { + w.main.location.href = "index.php?a=64" + } + }, + showBin: function(a) { + var el = d.getElementById('treeMenu_emptytrash'); + if(el) { + if(a) { + el.title = modx.lang.empty_recycle_bin; + el.classList.remove('disabled'); + el.innerHTML = modx.style.empty_recycle_bin; + el.onclick = function() { + modx.tree.emptyTrash() + } + } else { + el.title = modx.lang.empty_recycle_bin_empty; + el.classList.add('disabled'); + el.innerHTML = modx.style.empty_recycle_bin_empty; + el.onclick = null + } + } + }, + unlockElement: function(a, b, c) { + var m = modx.lockedElementsTranslation.msg.replace('[+id+]', b).replace('[+element_type+]', modx.lockedElementsTranslation['type' + a]); + if(confirm(m) === true) { + modx.get('index.php?a=67&type=' + a + '&id=' + b, function(r) { + if(parseInt(r) === 1) c.parentNode.removeChild(c); + else alert(r) + }) + } + }, + resizeTree: function() { + }, + reloadElementsInTree: function() { + modx.get('index.php?a=1&f=tree', function(r) { + savePositions(); + var div = d.createElement('div'); + div.innerHTML = r; + var tabs = div.getElementsByClassName('tab-page'); + var el, p; + for(var i = 0; i < tabs.length; i++) { + if(tabs[i].id !== 'tabDoc') { + el = tabs[i].getElementsByClassName('panel-group')[0]; + el.style.display = 'none'; + el.classList.add('clone'); + p = d.getElementById(tabs[i].id); + r = p.getElementsByClassName('panel-group')[0]; + p.insertBefore(el, r) + } + } + setRememberCollapsedCategories(); + for(var i = 0; i < tabs.length; i++) { + if(tabs[i].id !== 'tabDoc') { + el = d.getElementById(tabs[i].id).getElementsByClassName('panel-group')[1]; + el.remove(); + el = d.getElementById(tabs[i].id).getElementsByClassName('panel-group')[0]; + el.classList.remove('clone'); + el.style.display = 'block' + } + } + loadPositions(); + for(var i = 0; i < tabIds.length; i++) { + initQuicksearch(tabIds[i]+'_search', tabIds[i]); + } + var at = d.querySelectorAll('#tree .accordion-toggle'); + for(var i = 0; i < at.length; i++) { + at[i].onclick = function(e) { + e.preventDefault(); + var thisItemCollapsed = $(this).hasClass("collapsed"); + if(e.shiftKey) { + var toggleItems = $(this).closest(".panel-group").find("> .panel .accordion-toggle"); + var collapseItems = $(this).closest(".panel-group").find("> .panel > .panel-collapse"); + if(thisItemCollapsed) { + toggleItems.removeClass("collapsed"); + collapseItems.collapse("show") + } else { + toggleItems.addClass("collapsed"); + collapseItems.collapse("hide") + } + toggleItems.each(function() { + var state = $(this).hasClass("collapsed") ? 1 : 0; + setLastCollapsedCategory($(this).data("cattype"), $(this).data("catid"), state) + }); + writeElementsInTreeParamsToStorage() + } else { + $(this).toggleClass("collapsed"); + $($(this).attr("href")).collapse("toggle"); + var state = thisItemCollapsed ? 0 : 1; + setLastCollapsedCategory($(this).data("cattype"), $(this).data("catid"), state); + writeElementsInTreeParamsToStorage() + } + } + } + }) + } + }, + setLastClickedElement: function(a, b) { + localStorage.setItem('MODX_lastClickedElement', '[' + parseInt(a) + ',' + parseInt(b) + ']') + }, + removeLocks: function() { + if(confirm(modx.lang.confirm_remove_locks) === true) { + w.main.location.href = "index.php?a=67" + } + }, + openCredits: function() { + w.main.location.href = "index.php?a=18"; + setTimeout('modx.main.stopWork()', 2000) + }, + keepMeAlive: function() { + modx.get('includes/session_keepalive.php?tok=' + d.getElementById('sessTokenInput').value + '&o=' + Math.random(), function(r) { + r = JSON.parse(r); + if(r.status !== 'ok') w.location.href = 'index.php?a=8' + }) + }, + updateMail: function(a) { + try { + if(a) { + this.post('index.php', { + updateMsgCount: true + }, function(r) { + var c = r.split(','), + el = d.getElementById('msgCounter'); + if(c[0] > 0) { + if(el) { + el.innerHTML = c[0]; + el.style.display = 'block' + } + } else { + if(el) el.style.display = 'none' + } + if(c[1] > 0) { + el = d.getElementById('newMail'); + if(el) { + el.innerHTML = '' + modx.style.email + modx.lang.inbox + ' (' + c[0] + ' / ' + c[1] + ')'; + el.style.display = 'block' + } + } + if(modx.config.mail_check_timeperiod > 0) setTimeout('modx.updateMail(true)', 1000 * modx.config.mail_check_timeperiod) + }) + } + } catch(oException) { + setTimeout('modx.updateMail(true)', 1000 * modx.config.mail_check_timeperiod) + } + }, + openWindow: function(a) { + if(typeof a !== 'object') { + a = { + "url": a + } + } + if(!a.width) a.width = parseInt(w.innerWidth * 0.9) + 'px'; + if(!a.height) a.height = parseInt(w.innerHeight * 0.8) + 'px'; + if(!a.left) a.left = parseInt(w.innerWidth * 0.05) + 'px'; + if(!a.top) a.top = parseInt(w.innerHeight * 0.1) + 'px'; + if(!a.title) a.title = Math.floor((Math.random() * 999999) + 1); + if(a.url) { + if(this.plugins.EVOmodal === 1) { + top.EVO.modal.show(a) + } else { + w.open(a.url, a.title, 'width=' + a.width + ',height=' + a.height + ',top=' + a.top + ',left=' + a.left + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no') + } + } + }, + getWindowDimension: function() { + var a = 0, + b = 0, + c = d.documentElement, + e = d.body; + if(typeof(w.innerWidth) === 'number') { + a = w.innerWidth; + b = w.innerHeight + } else if(c && (c.clientWidth || c.clientHeight)) { + a = c.clientWidth; + b = c.clientHeight + } else if(e && (e.clientWidth || e.clientHeight)) { + a = e.clientWidth; + b = e.clientHeight + } + return { + 'width': a, + 'height': b + } + }, + hideDropDown: function(e) { + e = e || w.event || w.main.event; + if(tree.ca === "open" || tree.ca === "") { + modx.tree.setSelectedByContext(); + } + if(modx.tree.ctx !== null) { + d.getElementById(modx.frameset).removeChild(modx.tree.ctx); + modx.tree.ctx = null + } + if(!(/dropdown\-item/.test(e.target.className)) + //&& !(e && ("click" === e.type && /form|label|input|textarea|select/i.test(e.target.tagName))) + ) { + var els = d.querySelectorAll('.dropdown'), + n = null, + t = e.target || e.target.parentNode; + if(t.dataset.toggle) n = d.querySelector(t.dataset.toggle); + else if(t.classList.contains('dropdown-toggle')) n = t.offsetParent; + for(var i = 0; i < els.length; i++) { + if(n !== els[i]) + els[i].classList.remove('show') + } + els = w.main.document.querySelectorAll('.dropdown'); + for(var i = 0; i < els.length; i++) { + if(n !== els[i]) + els[i].classList.remove('show') + } + } + }, + XHR: function() { + return ('XMLHttpRequest' in w) ? new XMLHttpRequest : new ActiveXObject('Microsoft.XMLHTTP'); + }, + get: function(a, b, c) { + var x = this.XHR(); + x.open('GET', a, true); + x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); + if(c) x.responseType = c; + x.onload = function() { + if(this.status === 200 && typeof b === 'function') { + return b(this.response) + } + }; + x.send() + }, + post: function(a, b, c) { + var x = this.XHR(), + f = ''; + if(typeof b === 'function') { + c = b; + } else if(typeof b === 'object') { + var e = [], + i = 0, + k; + for(k in b) { + if(b.hasOwnProperty(k)) e[i++] = k + '=' + b[k]; + } + f = e.join('&') + } else if(typeof b === 'string') { + f = b; + } + x.open('POST', a, true); + x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); + x.setRequestHeader('X-REQUESTED-WITH', 'XMLHttpRequest'); + x.onload = function() { + if(this.readyState === 4 && c !== u) { + return c(this.response) + } + }; + x.send(f) + }, + pxToRem: function(a) { + return a / parseInt(w.getComputedStyle(d.documentElement).fontSize) + } + }); + w.mainMenu = {}; + w.mainMenu.stopWork = function() { + modx.main.stopWork() + }; + w.mainMenu.work = function() { + modx.main.work() + }; + w.mainMenu.reloadtree = function() { + //console.log('mainMenu.reloadtree()'); + setTimeout('modx.tree.restoreTree()', 50) + }; + w.mainMenu.startrefresh = function(a) { + console.log('mainMenu.startrefresh(' + a + ')'); + if(a === 1) { + modx.tree.restoreTree() + } + if(a === 2) { + modx.tree.restoreTree() + } + if(a === 9) { + modx.tree.restoreTree() + } + if(a === 10) { + w.location.href = "../" + modx.MGR_DIR + } + }; + w.mainMenu.startmsgcount = function(a, b, c) { + modx.updateMail(c) + }; + w.tree = {}; + w.tree.ca = 'open'; + w.tree.document = document; + w.tree.saveFolderState = function() { + }; + w.tree.updateTree = function() { + //console.log('tree.updateTree()'); + modx.tree.updateTree() + }; + w.tree.restoreTree = function() { + //console.log('tree.restoreTree()'); + modx.tree.restoreTree() + }; + w.tree.reloadElementsInTree = function() { + //console.log('tree.reloadElementsInTree()'); + modx.tree.reloadElementsInTree() + }; + w.tree.resizeTree = function() { + console.log('tree.resizeTree() off') + }; + w.onbeforeunload = function() { + var a = w.main.frameElement.contentWindow; + if(parseInt(modx.main.getQueryVariable('a', a.location.search.substring(1))) === 27) { + modx.get('index.php?a=67&type=7&id=' + modx.main.getQueryVariable('id', a.location.search.substring(1))); + } + }; + d.addEventListener('DOMContentLoaded', function() { + modx.init() + }) +}) +(typeof jQuery !== 'undefined' ? jQuery : '', window, document, undefined); + +function setLastClickedElement(a, b) { + modx.setLastClickedElement(a, b) +} + +function reloadElementsInTree() { + modx.tree.reloadElementsInTree() +} + +(function() { + if(!Element.prototype.closest) { + Element.prototype.closest = function(a) { + var b = this, + c, d; + ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].some(function(fn) { + if(typeof document.body[fn] === 'function') { + c = fn; + return true + } + return false + }); + if(b && b[c](a)) return b; + while(b) { + d = b.parentElement; + if(d && d[c](a)) return d; + b = d + } + return null; + } + } +})(); \ No newline at end of file diff --git a/manager/media/style/MODxRE2_DropdownMenu/login.tpl b/manager/media/style/MODxRE2_DropdownMenu/login.tpl new file mode 100644 index 0000000000..458d25ef4f --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/login.tpl @@ -0,0 +1,121 @@ + + + + [(site_name)] (MODX CMF Manager Login) + + + + + + +
                              +
                              + [+OnManagerLoginFormPrerender+] +
                              + +
                              +
                              + + + + +

                              [+login_captcha_message+]

                              +

                              [+captcha_image+]

                              + [+captcha_input+] +
                              + + [+OnManagerLoginFormRender+] +
                              +
                              +
                              +

                              +
                              © 2005-2017 by the MODX. MODX™ is licensed under the GPL.
                              + + + diff --git a/manager/media/style/MODxRE2_DropdownMenu/manager.lockout.tpl b/manager/media/style/MODxRE2_DropdownMenu/manager.lockout.tpl new file mode 100644 index 0000000000..cda0a1d730 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/manager.lockout.tpl @@ -0,0 +1,66 @@ + + + + MODX Content Manager + + + + + + + + +
                              +
                              + +
                              + [+logo_slogan+] +
                              + +
                              +

                              [(site_name)]

                              +
                              [+manager_lockout_message+]
                              +
                              + +   + +
                              +
                              +
                              +
                              +
                              + + + +

                              MODX™ is licensed under the GPL license. © 2005-2017 MODX.

                              + + diff --git a/manager/media/style/MODxRE2_DropdownMenu/style.css b/manager/media/style/MODxRE2_DropdownMenu/style.css new file mode 100644 index 0000000000..c0f79fd8e8 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/style.css @@ -0,0 +1,574 @@ +@import "css/fonts.css"; +@import "css/tabpane.css"; +@import "css/contextmenu.css"; +@import "css/datepicker.css"; +@import "css/cols.css"; +@import "css/forms.css"; +@import "css/actionbuttons.css"; +@import "css/tables.css"; +@import "css/widgets.css"; +/* -------------------------[ Headers and Paragraphs ]--- */ +h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } +h1 .fa { margin-right: 0.25em; color: #1377c5; } +h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } +h1 .help:hover { color: rgba(0, 0, 0, 0.3); } +h1 small { margin-left: 0.5em; line-height: 1em } +.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } +#previewIframe { width: 100%; height: 400px; } +a[href=""], a:not([href]) { cursor: default } +.messageRead { color: #333; } +.messageUnread { color: #3CB371; font-weight: 500; } +.element-edit-message { display: none } +.element-edit-message p:last-child { margin-bottom: 0 } +/* -------------------------[ Forms ]--- */ +tbody, thead, tr { margin: 0; padding: 0; border: 0; } +form label { cursor: pointer; display: inline-block; margin-bottom: .5em } +form label:not([for]) { cursor: default } +fieldset { border: none; } +optgroup { font-style: normal; font-weight: 500; background-color: #ddd; } +optgroup option { font-weight: normal; background-color: #fff; } +#ta, .tmplvars textarea, textarea[name=introtext] { width: 100%; resize: vertical; } +/* -------------------------[ Misc stuff ]--- */ +.sectionBody fieldset { background: none repeat scroll 0 0 #FDFDFD; border: 1px solid #CCCCCC; padding: 1rem !important; } +.sectionBody legend { font-weight: 500; padding: 5px 1rem; background: #fff; border: 1px solid #ccc; -moz-box-shadow: 1px 1px 3px #ccc; -webkit-box-shadow: 1px 1px 3px #ccc; box-shadow: 1px 1px 3px #ccc; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } +.sectionBody fieldset h3 { font-size: 14px; color: #789; font-weight: 500; padding-bottom: 0; margin-bottom: 0; } +.sectionHeader, .showHideVisible { color: #333; margin: 0 1rem; padding: 5px 3px 5px; zoom: 1; font-weight: 500; text-shadow: 0 1px 0 #FFF; } +.sectionHeader + .sectionBody, .showHideVisible + .sectionBody { margin-top: -1px !important } +.tab-page .sectionHeader { margin: 1rem 3px 0; } +.sectionBody, .layerVisible { position: relative; } +.tab-page .sectionBody, .tab-page .section .sectionBody, .sectionBody .sectionBody { border-top: 1px solid #CCCCCC; margin: 0 3px 1rem; padding: 7px; } +.section .sectionBody { margin: 0 1rem 1rem; padding: 1rem; background-color: #fff; border: 1px solid #CCCCCC; } +.sectionBody > p:first-child { margin-left: 1rem; margin-right: 1rem } +.showHideVisible, .layerVisible { margin: 0 10px 4px; } +.comment { font-size: 11px; color: #999; padding: 4px 0; } +thead, .fancyrow { color: #333; height: 18px !important; background-color: #E4E4E4; } +thead td { color: #333; border-top: 1px solid #fff; } +.fancyrow2 { height: 18px !important; background: #F0A62F repeat-x top; border-bottom: 1px solid #fff; color: #fff; } +li { padding: 0; margin: 0; list-style: none; } +ul { margin: 0 20px 0 10px; } +.screen { border: 1px solid #ddd; text-align: center; } +a img { border: 0; } +.even { background: #D9E7C2; } +.odd { background: #fff; } +.show { display: block !important } +.hide { display: none !important } +/* -------------------------[ end sortable table ]--- */ +.disabledImage { width: 20px; opacity: 0.3; filter: alpha(opacity=30); } +.disabledImage img { border: 0; } +.editorCell { border-top: 1px solid #808080; text-align: left; vertical-align: baseline; } +/* */ +.unpublished a, .unpublish { color: #B68282; font-style: italic; } +.notInMenuNode { color: #39515d; text-decoration: none; } +#treeSplitter { width: 10px; height: 100%; position: absolute; right: -10px; } +.deleted { color: #A52A2A; text-decoration: line-through; } +label.disabled { color: #aaa; } +/* -------------------------[ grid style ]--- */ +.grid { width: 100%; background-color: #fff !important; border: 1px solid rgba(0, 0, 0, 0.1); border-collapse: collapse; } +.grid thead, .grid tfoot { background-color: #e9e9e9 } +.grid th, .grid td { padding: 0.375rem !important; border: 1px solid #ddd } +.gridHeader, .grid th { color: #333; font-weight: 500; white-space: nowrap; background-color: #e9e9e9; text-align: left; } +.grid > tbody > tr:nth-child(2n) > td { background-color: rgba(0, 0, 0, 0.03) } +.gridItem { background-color: #fff; padding: 3px; } +.gridAltItem { background-color: #f7f7f7; padding: 3px; } +.grid tbody tr:hover td { background: #E9EDF3; } +.gridRowIcon:hover { background-color: #f5f5dc; } +.grid a { text-decoration: none; } +.grid img { vertical-align: middle; padding-right: 4px; } +/* -------------------------[ search bar ]--- */ +.searchbar { width: 100%; } +.searchbar table { margin-top: -3px; } +/*.searchtext { margin-top: -5px !important; height: 18px; padding: 2px; }*/ +.searchbutton { width: 22px; padding: 5px; text-decoration: none; background: #fff; border: 1px solid #D1D8DF; } +.searchbutton:hover { text-decoration: none; background: #fff; border: 1px solid #88939E; } +.searchbutton img { vertical-align: middle; margin: 0; padding: 0 } +.searchtoolbarbtn { text-decoration: none; border: 1px solid #D1D8DF; text-decoration: none !important; background: #fff; padding: 5px 5px 5px 2px; } +.searchtoolbarbtn img { vertical-align: middle; padding: 3px; } +.searchtoolbarbtn:hover { text-decoration: none; border: 1px solid #88939E; background: #fff; } +/* -------------------------[ home page main links ]--- */ +/*a.hometblink, a.hometblink:active, .hometblink { text-decoration: underline; color: #333; font-weight: 500; font-size: 12px; } +a.hometblink:hover { text-decoration: underline; color: Gray; }*/ +.notice { width: 100%; padding: 5px; border: 1px solid #eee; background-color: #f5f5f5; color: #707070; } +#preLoader { position: absolute; z-index: 50000; width: 100%; height: 100%; text-align: center; vertical-align: middle; padding: 100px 0 0 0; background-color: rgba(0, 0, 0, 0.07); } +.preLoaderText { background-color: #fff; margin: auto; width: 400px; padding: 50px; border: 1px solid #dadada; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px; -webkit-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.2); box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.2); } +.preLoaderText p { font-size: 18px; } +.preLoaderText p:last-child { margin-bottom: 0 } +#loadingmask { display: none !important; } +/* -------------------------[ Settings Table ]--- */ +.filelist td { border-bottom: 1px solid #C2C3CF; } +/* -------------------------[ Tabs ]--- */ +.tab-pane { } +.tab-pane > .tab-page { display: none } +.tab-pane > .tab-page:first-child { display: block } +.tab-page { clear: both; overflow-x: auto; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } +.sectionBody > .tab-pane > .tab-page { padding: 1rem; } +.sectionHeader { padding: 7px 0px; } +.tab-page .sectionBody { padding: 12px 0px; } +.tab-page > table { width: 100%; border-collapse: collapse } +/* -------------------------[ Welcome Page ]--- */ +/*a.hometblink, a.hometblink img { border: 0 !important; text-decoration: none !important; } +.wm_header { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px dotted #bbb; } +.wm_header_title { margin: 0; } +.wm_button { display: inline-block; margin: 0 10px 10px 0; text-align: center; } +.wm_messages { margin-left: 20px; margin-top: 1rem; padding-top: 1rem; border-top: 1px dotted #bbb; } +.wm_messages .comment { font-size: 12px; } +.wm_messages_inbox_link { text-decoration: none !important; color: #333 !important; } +.wm_messages_inbox_link:hover { color: gray !important; } +.table--managerWelcome { width: 100%; }*/ +/* -------------------------[ Welcome Page ]--- */ +#mainActionPages { background: #f5f5f5; } +/* -------------------------[ New sortable table class ]--- */ +.sortabletable { width: 100%; border-collapse: collapse; } +.sortabletable thead tr { color: #333; font-weight: 500; white-space: nowrap; background-color: #d2d2d2; text-align: left; } +.sortabletable tr { background: #fff; } +.sortabletable tr.even { background: #f7f7f7; } +.sortabletable tbody tr:hover { background: #E9F0F3; } +.sortabletable td, .sortabletable th { padding: 5px !important; border: 1px solid #ccc; } +.sortabletable th { text-align: left; cursor: pointer; color: #333; } +.sortabletable th a { text-decoration: none; color: #333; } +.sortabletable th:active { background: #ccc; padding: 3px 4px 1px 6px; } +/* -------------------------[ Pagination table ]--- */ +#max-display-records { margin: 10px 0; } +#pagination { margin: 10px 0; } +#pagination ul { margin: 10px 0; display: inline; } +#pagination li { list-style: none; display: inline; width: 1rem; margin: 0 0 0 1px; } +#pagination li a { padding: 3px 8px; border: 1px solid #D9E7C2; text-decoration: none; color: #333; } +#pagination li.currentPage a, #pagination li a:hover { color: #060; border: 1px solid #060; } +fieldset.tab-page { border: 1px solid #e4e4e4 !important; } +h2#edit_document_title { font-size: 0.9rem; color: #f5f5f5; width: 100%; border-bottom: none; padding: 5px 10px; } +fieldset#preview h2.tab { float: right; } +/* -------------------------[ Action Buttons ]--- */ +.actionButtons { margin: 0; padding: 0; background: none; width: auto; white-space: nowrap; } +.actionButtons li { float: left; margin: 0; padding: 0; list-style: none; } +.actionButtons li:before, .mmTagList li:before, .rTable li:before, .tab-pane ul li ul li:before, .dashboard li:before, div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, .sectionBody .multitv .list li:before { display: none; content: ''; } +.actionButtons img { vertical-align: top; margin-top: 1px; filter: alpha(opacity=30); -moz-opacity: 0.3; opacity: 0.3; } +.actionButtons:hover img { filter: alpha(opacity=100); -moz-opacity: 1; opacity: 1; } +.actionButtons a:hover { border-color: #999; -moz-box-shadow: 1px 1px 2px #aaa; -webkit-box-shadow: 1px 1px 2px #aaa; box-shadow: 1px 1px 2px #aaa; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; -o-transition: all .3s ease; transition: .3s ease; background: -moz-linear-gradient(#FFFFFF, #F5F5F5); background: -webkit-gradient(linear, 0 0, 0 100%, from(#FFFFFF), to(#F5F5F5)); background: -o-linear-gradient(#FFFFFF, #F5F5F5); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#F5F5F5); +zoom: 1; text-decoration: none !important; } +.actionButtons a:active { background: #92aac4 bottom left; -webkit-box-shadow: 0 0 10px #b8c7d6; -moz-box-shadow: 0 0 10px #b8c7d6; box-shadow: 0 0 10px #b8c7d6; } +.actionButtons li.primary a, .actionButtons a.primary, .actionButtons a.default { color: #fff; border-color: #658f1a; text-shadow: 0 -1px 0 #2B5F0C; background: #66901b; background: -moz-linear-gradient(#8aae4b, #66901b); background: -webkit-gradient(linear, 0 0, 0 100%, from(#8aae4b), to(#66901b)); background: -o-linear-gradient(#8aae4b, #66901b); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#8aae4b, endColorstr=#66901b); +} +.actionButtons li.disabled a { color: #777; border: 0 solid #657587; pointer-events: none; } +.actionButtons li.disabled a img { opacity: .3; filter: alpha(opacity=30); } +.actionButtons .plus { margin: 0 2px 0 5px; color: #3b454f; font-weight: 500; } +/* +* Generic styles for all form elements + */ +form#mutate dt, form#mutate dd { margin-bottom: 10px; } +form#mutate dt label, form#mutate dt h3.label { font-size: 1em; display: inline; float: left; width: 200px; color: #821517 !important; font-weight: 500; } +form#mutate dd { margin-left: 210px; } +form#mutate input.disabled { background-color: #f5f5f5 !important; } +form#mutate select.inputBox { margin-right: 5px; } +form#mutate .multitv input[type="text"] { width: 300px; } +form#mutate .imageField { width: 50%; min-width: 300px; } +form#mutate input[name="menuindex"].inputBox { text-align: center; width: 80px; padding-left: 0; padding-right: 0; } +form#mutate input[name="ta"].inputBox { padding-left: 30px } +form#mutate input[name="ta"].inputBox + input[type=button], form#mutate input[name="ta"].inputBox + .CodeMirror + input[type=button] { position: relative; float: right; margin: -29px 0px 0 0; z-index: 1; height: 29px !important; border-radius: 0 3px 3px 0 !important; } +form#mutate input[name="ta"].inputBox:focus + input[type=button], form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { border-color: #1377c5 #1377c5 #1377c5 #bbb; } +form#mutate textarea.tv_textareamini { height: 100px; width: 300px; overflow-y: scroll; } +form#mutate textarea.tv_textarea { height: 100px; width: 100%; overflow-y: scroll; } +form#mutate #llock { position: relative; z-index: 1; float: left; width: 23px; height: 23px; margin: 3px -28px 0 5px; line-height: 25px; cursor: pointer; text-align: center; font-size: 14px; background-color: #fbfbfb; border-radius: 50%; } +form#mutate #llock + #ta { display: block !important } +form#mutate #llock + #ta + .CodeMirror { display: none !important; z-index: 0; clear: none; min-height: 29px; margin: 0; border-color: #ddd; border-radius: 3px; } +form#mutate #plock { width: 1.4em; cursor: pointer; font-size: 14px } +/* +* Styling for datepicker elements in settings and templavars +*/ +form#mutate input.date, form#mutate input.tvdate { margin-right: 10px; } +/* +* Individual Styles for fieldset#settings_page_settings +*/ +form#mutate fieldset#settings_page_settings input#pub_date, form#mutate fieldset#settings_page_settings input#unpub_date { width: 150px; } +form#mutate fieldset#settings_page_settings select { width: 155px; } +/* +* Individual Styles for fieldset#meta_keywords +*/ +form#mutate fieldset#meta_keywords select.inputBox { display: block; margin-bottom: 0; } +form#mutate fieldset#meta_keywords dl.keywords { float: left; margin-right: 30px; } +form#mutate fieldset#meta_keywords dl.metatags { float: left; } +form#mutate fieldset#meta_keywords dl dt label { width: 100px; } +form#mutate fieldset#meta_keywords dl dd { margin-left: 110px; } +/* +* Individual Styles for fieldset#preview +*/ +fieldset#preview iframe { width: 100%; margin: 0 auto; border: 1px solid #f5f5f5; } +/* +* Individual Styles for fieldset#document_content +*/ +fieldset#document_content textarea#ta { width: 100%; height: 400px; font-size: 1em; } +/* +* Individual Styles for fieldset#access_permissions +*/ +fieldset#access_permissions dt label { width: 200px; } +fieldset#access_permissions dd { margin-left: 210px; } +fieldset#access_permissions dl dd ul li { list-style-type: none; } +/* ppb: +* fieldset#settings_templvars +*/ +fieldset#settings_templvars .tv_url_select { width: 70px; margin-right: 10px; } +fieldset#settings_templvars .tv_url_input { width: 220px; } +fieldset#settings_templvars dd.tvCheckBox label input, fieldset#settings_templvars dd.tvRadioOptions label input { margin-right: 10px; } +fieldset#settings_templvars .tv_date { width: 150px; } +form#mutate select.tv_url_select { padding: 5px 3px; } +/* ppb: +* Style mootools tooltips +*/ +[data-tooltip] { cursor: help } +[data-tooltip]::after, .custom-tip { position: absolute; z-index: 13000; width: 13rem; margin-left: 1rem; padding: 0.9rem 1rem; font-size: 0.75rem; line-height: 1.5; font-family: sans-serif; text-align: left; color: #333; background-color: #fff; border: 1px solid #ccc; visibility: hidden; transition-duration: .3s; transform: translate3d(1rem, 0, 0); } +[data-tooltip]::after { opacity: 0; content: attr(data-tooltip); } +[data-tooltip]:hover::after { opacity: 1; visibility: visible; transform: translate3d(0, 0, 0); } +[data-tooltip].fa-question-circle { opacity: 0.15; } +[data-tooltip].fa-question-circle:hover { opacity: 1; } +th > [data-tooltip].fa-question-circle, td > [data-tooltip].fa-question-circle { float: right; } +/* ppb: +* Some styling for legacy mode fieldsets +*/ +fieldset.legacy { background: #fff; padding: 10px; margin: 10px 10px 35px; border: 1px solid #e4e4e4 !important; position: relative; } +fieldset.legacy h2 { width: 100%; background: #f5f5f5; margin: -10px -10px 1rem -10px; padding: 0 10px; border-bottom: 1px solid #e4e4e4 !important; } +/* System Alert Box ---------------------------------------------------------- */ +.cbOverlay { background-color: #000; z-index: 50000; } +.cbContainer { padding: 5px; background-color: white; z-index: 50000; } +.cbBox h3 { color: #000; background: #bee860 repeat-x top; padding: 5px; font-weight: 500; } +.cbBox p { margin: 3px; } +.cbBox .cbButtons { text-align: center; } +.sysAlert { width: 500px; height: 330px; white-space: nowrap; overflow: auto; } +.phptextarea { font-family: Consolas, 'Courier New', 'Courier', monospace; } +/* Custom */ +/* normalize some td paddings */ +#tabTemplate tbody td, .sectionBody td, .sectionBody th { padding: 1px 5px; text-align: left; vertical-align: top; } +.sectionBody .displayparams, .sectionBody .permissiongroup { margin-bottom: 0.15rem; background-color: #eee; border-collapse: separate; border-spacing: 1px; } +.sectionBody .displayparams th, .sectionBody .displayparams td { padding: 4px 4px; } +.sectionBody .displayparams thead td, .sectionBody .permissiongroup thead td { border-top: none; } +#displayparams table { background: #fff; } +#displayparams table tbody td { border-bottom: 1px dotted #d3d3d3; } +.permissiongroups { margin: 0; } +.permissiongroups ul { clear: both; margin: 0; padding: 0.5rem 0; } +.permissiongroup input[type=submit], .permissiongroup input[type=button], .permissiongroups input[type=submit], .permissiongroups input[type=button] { float: left; margin: 0.3em 0.3em 0 0; } +td#displayparams > table.displayparams { border: none; } +/* replace warning red color in tabs */ +strong[style*='color:#EF1D1D'] { color: yellow !important; } +.selected strong[style*='color:#ffeb00'] { color: red !important; } +#tabEvents table, #tabEvents td { padding: 2px; } +code { font-size: inherit; font-family: Consolas, 'Courier New', 'Courier', monospace; background-color: #eee; border: 1px solid #ccc; padding: 1px 2px; } +#resourcesPane .disabledPlugin a:hover { color: #aaa; } +/* breadcrumbs */ +ul.breadcrumbs { margin: 0 1rem 12px 1rem; padding: 0 0 9px 0; line-height: normal; font-size: 0; border-bottom: 1px dotted #CECACA; } +li.breadcrumbs__li { list-style: none; display: inline-block; padding: 0; margin: 0; } +a.breadcrumbs__a { font-size: 12px; text-decoration: none; } +.breadcrumbs__sep { font-size: 13px; margin: 0 6px; color: #777; } +li.breadcrumbs__li_current { font-size: 12px; font-weight: 500; } +/* end breadcrumbs */ +/* table styles*/ +.table, #documentPane #tv_body table, #documentPane [id*="table-"], #documentPane [id*="table-tv"] { width: 100%; } +#documentPane .tab-page > table > tr > td:first-child, #documentPane .tab-page > table > tbody > tr > td:first-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > th:first-child, #chunkPane .tab-page > table > tbody > tr > td:first-child, #chunkPane .tab-page > table > tbody > tr > th:first-child, #snipetPane .tab-page > table > tbody > tr > td:first-child, #snipetPane .tab-page > table > tbody > tr > th:first-child, #pluginPane .tab-page > table > tbody > tr > td:first-child, #pluginPane .tab-page > table > tbody > tr > th:first-child, #modulePane .tab-page > table > tbody > tr > td:first-child, #modulePane .tab-page > table > tbody > tr > th:first-child, #docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { width: 200px } +#documentPane .tab-page > table > tr > td:last-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { width: inherit !important } +#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { display: inline-block; width: calc(100% - 1rem); } +#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip].fa-question-circle { margin-top: 0.3rem; } +.table--edit { margin-bottom: 1rem; } +.table th, .table td { text-align: left; vertical-align: middle; } +table th { font-weight: 500; } +.table--edit th { width: 200px; color: #555; font-size: inherit; } +.table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } +.table th, .table td, .sectionBody td, .sectionBody th { padding: 0.15rem 0.25rem; } +.table tr:first-child > th, .table tr:first-child > td, .sectionBody tr:first-child > td, .sectionBody tr:first-child > th { /*border-top: none*/ } +/* STYLES FOR HELP */ +#helpPane h1 { font-size: 20px; display: block; border-bottom: 1px solid #888; margin-bottom: 1em; font-weight: 500; } +#helpPane li:not(:first-child) > strong { margin-top: 1.4em; } +#helpPane li > strong { display: block; font-size: 14px; } +#helpPane pre { font-size: 12px; border: 1px solid #888; border-radius: 5px; background-color: #fff; padding: 1em; margin: 10px 0; } +/* + * MODxRE2 styles + * css above is original MODxRE + * css below is basicaly MODxRE overrides to get MODxRE2 look + */ +/* nav */ +.alert-warning { color: #1377c5; } +.no-events { pointer-events: none; } +/* Required for Bootstrap3 Collapse */ +.fade { opacity: 0; -webkit-transition: opacity .15s linear; -o-transition: opacity .15s linear; transition: opacity .15s linear; } +.fade.in { opacity: 1; } +.collapse { display: none; } +.collapse.in { display: block; } +.collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition-timing-function: ease; -o-transition-timing-function: ease; transition-timing-function: ease; -webkit-transition-duration: .35s; -o-transition-duration: .35s; transition-duration: .35s; -webkit-transition-property: height, visibility; -o-transition-property: height, visibility; transition-property: height, visibility; } +.no-transition .collapsing { -webkit-transition: none; -o-transition: none; transition: none; } +.panel-title > a::before { content: "\f107"; /* fa-angle-down */ font-family: "FontAwesome"; } +.panel-title > a.collapsed::before { content: "\f105"; /* fa-angle-right */ padding: 0 1px 0 3px; } +.panel-title > a { font-size: 1.1em; color: #657587; display: block; padding: 3px 0; } +.panel-title > a:hover { text-decoration: none; color: #1377c5; background: rgba(255, 255, 255, 0.27); } +/* category icons in manage elements */ +#site_templates, #site_tmplvars, #site_htmlsnippets, #site_snippets, #site_plugins { padding-left: 0; } +#site_templates li, #site_tmplvars li, #site_htmlsnippets li, #site_snippets li, #site_snippets li, #site_plugins li, #categories_list li { list-style: none; margin-left: -21px; } +#site_templates li strong:before, #site_tmplvars li strong:before, #site_htmlsnippets li strong:before, #site_snippets li strong:before, #site_snippets li strong:before, #site_plugins li strong:before, #categories_list li strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #5b6f7a; padding: 0 5px 0 5px; content: '\f105'; } +.tab-pane ul li ul li strong:before { content: ''; } +/* elements icons in manage elements */ +.tab-pane ul li ul { } +.tab-pane ul li ul li { list-style: none; padding-left: 20px; } +a.man_el_name:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; font-size: 0.875rem; color: #5b6f7a; } +a.man_el_name.site_templates:before { content: '\f1ea'; } +a.man_el_name.site_tmplvars:before { content: '\f022'; } +a.man_el_name.site_htmlsnippets:before { content: '\f009'; } +a.man_el_name.site_snippets:before { content: '\f121'; } +a.man_el_name.site_plugins:before { content: '\f1e6'; } +a.man_el_name.site_modules:before { content: '\f085'; } +div#tabCategory.tab-page ul li ul li { padding-top: 7px; padding-bottom: 7px; } +/*Fake tables for providing dynamic amount of cells per row*/ +.rTable { display: table; width: 100%; padding: 0; } +.rTableRow { display: table-row; padding: 0; } +.rTableHeading { display: table-header-group; } +.rTableBody { display: table-row-group; } +.rTableFoot { display: table-footer-group; } +.lockCell, .mainCell, .btnCell, .rTableHead { display: table-cell; padding: 0; } +.lockCell { width: 2.5em; padding-left: 10px; } +.mainCell { width: auto; } +.btnCell { width: 6em; text-align: right; padding-right: 10px; } +.mainCell > span { display: block } +/* Manage elements general styles */ +a.man_el_name { display: block; padding: .1em 0 .1em 12px; } +a.man_el_name:hover { text-decoration: none; } +.lockCell + .mainCell a.man_el_name { padding-left: 0 !important; } +.lockCell + .mainCell a.man_el_name:before { display: none; } +.elements_descr { color: #222; margin-left: 1em; font-size: 0.88em; } +.resourceTable .panel-heading { margin: 0 -1rem !important; background-color: #f5f5f5; border-top: 1px dotted #dedede; border-bottom: 1px dotted #dedede; } +.resourceTable .panel-title > a { padding: 5px 0 5px 1rem; text-decoration: none } +.resourceTable ul.elements { margin: 0 -1rem; padding: 0 0 10px 0; } +.resourceTable ul.elements > li { padding: 0 !important; border-bottom: 1px dotted #dedede; border-left: 3px solid #FFF; transition: all 0.1s ease; margin: 0 !important; } +.resourceTable ul.elements > li:hover { background: #f9f9f9; border-left: 3px solid #1377c5; } +.resourceTable ul.elements > li::before { display: none } +#resourcesPane .panel-group ul { } +ul.resourceTable .category_name { float: none; display: block; clear: both; margin-top: 20px; } +/* Manager Elements Buttons bar*/ +ul.elements_buttonbar { list-style: none; margin: 0; padding: 0; display: table; table-layout: fixed; } +ul.elements_buttonbar li { display: table-cell; padding: 0 !important; width: 2em; } +ul.elements_buttonbar li a { display: block; width: 2em; padding: 4px 2px 2px 2px; margin: 1px; min-width: 22px; } +ul.elements_buttonbar .fa { font-size: 0.875rem; padding: 1px 1px 0; } +/* Manage elements views-form */ +.switchForm { display: block; width: 100%; float: left; clear: left; margin: 7px 0 7px -4px; padding: 5px; background-color: #fff; border: 1px solid #E4E4E4; border-radius: 3px; } +.switchForm h3.optionsTitle { color: #1377c5; padding-left: 7px; font-size: 16px; } +.switchForm label { color: #1377c5; font-weight: 700; } +.switchForm input.columns { width: 3em; color: #444; font-weight: normal; } +.switchForm input.fontsize { width: 4em; color: #444; font-weight: normal; } +.switchForm .cb_all { float: left; } +.switchForm .btn_reset { float: right; } +.switchForm .optionsLeft { float: left; padding: 4px 8px 4px 4px; } +.switchForm .optionsFull { display: block; clear: both; padding: 4px 8px 4px 4px; } +.switchForm .optionsRadios { padding-top: 6px; } +.switchForm .optionsChecks { padding-top: 10px; } +.switchForm .optionsFontsSize { margin-left: 9px; padding-left: 8px; border-left: 1px solid #ededed; } +.switchForm .optionsReset { margin-left: 8px; border-left: 1px solid #ededed; padding-left: 8px; } +.switchForm .optionsAllTabs { clear: left; padding-top: 10px; } +.switchForm .optionsClear { display: block; clear: both; padding-top: 8px; margin-bottom: 4px; border-bottom: 1px solid #ededed; } +/* Checkbox "Icons" */ +.noicons.tab-page ul li ul li a:before, .noicons .elements_description a:before { display: none !important; } +/* View-dependent styles */ +/* List-view */ +.resourceTable.list li { } +.sortableList > li::before { display: none } +/* Inline-view */ +.resourceTable.inline ul.elements { margin: 0 !important; } +.resourceTable.inline ul.elements > li { float: left; margin: 10px 10px 0 0 !important; padding: 0 !important; border: 1px dotted #dedede; } +.resourceTable.inline ul.elements_buttonbar { margin: 0 5px 0 0 !important; } +.resourceTable.inline a.man_el_name { padding: 5px 10px; } +.resourceTable.inline ul.elements > li:hover { border: 1px solid #aaa } +/* Flex-view */ +.resourceTable.flex ul.elements { -webkit-column-gap: 10px; -moz-column-gap: 10px; -o-column-gap: 10px; column-gap: 10px; } +.resourceTable.flex ul.elements { } +.resourceTable.flex ul.elements > li { overflow: hidden; /* fix for Firefox */ break-inside: avoid-column; -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -o-column-break-inside: avoid; -ms-column-break-inside: avoid; column-break-inside: avoid; page-break-inside: avoid } +.resourceTable.flex .elements_descr { display: block; margin-left: 1.5em; } +/* action buttons */ +.actionButtons a { float: left; padding: 5px 10px; height: 32px; font-size: 13px; font-weight: 500; } +.actionButtons a, .actionButtons li.primary a, .actionButtons a.primary, .actionButtons a.default { text-shadow: none; background: #fff; color: #555; border: 1px solid #E4E4E4; border-radius: 3px; /*box-shadow: 0 0 0 1px #E4E4E4;*/ box-shadow: none; transition: none; } +.actionButtons a:hover { background: #1377c5; box-shadow: none; border-color: #1377c5; color: #FFF !important; transition: none; } +.actionButtons a:active { background-color: #3189ba; border-color: #3189ba; } +.actionButtons li.primary a, .actionButtons a.primary { color: #fff; border-color: #32AB9A; background: #32AB9A linear-gradient(#32AB9A, #00948E); } +.actionButtons li.primary a:hover, .actionButtons a.primary:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } +.actionButtons li.primary a:active, .actionButtons a.primary:active { background: #32AB9A; border-color: #32AB9A; } +.actionButtons img { display: none; } +#treePane .actionButtons img { display: inline; } +.actionButtons--tableheader .fa { font-size: 14px; } +.sectionBody .actionButtons { padding-top: 0; min-height: 40px; } +.sectionBody .actionButtons li { margin-right: 10px; } +.sectionBody .actionButtons a { display: inline-block; padding: 9px 10px; line-height: 1; } +#range input#pids { width: 100% !important; } +#range input#pids + input[name=fsubmit] { margin-top: 0.5rem; } +#range::after { content: ""; display: table; width: 100% } +/* dashboard */ +/*.dashboard .wm_logo { margin: 1rem 1rem 10px 10px; } +.dashboard .wm_logo img { height: 56px; } +.wm_buttons a { font-weight: normal !important; color: #3d5764 !important; } +.wm_buttons .fa { margin-bottom: 5px; font-size: 2em; } +.dashboard h1 { margin-top: 30px; } +.widget-wrapper { border: 1px solid #ccc; } +.widget-wrapper .widget-title { border: 1px solid #ccc; border-width: 0 0 1px 0; } +.widget-stage .label, .widget-stage .label-info { background-color: transparent; color: inherit; font-size: 12px; } +.widget-stage .btn { background-color: rgba(0, 0, 0, 0) !important; color: #3d5764 !important; border-color: #ccc !important; padding: 0 .25em; line-height: 2em; height: 1.8em; } +.widget-stage .btn:hover { border-color: #1377c5 !important; } +.widget-stage .btn .fa { font-size: 13px } +#modxrecent_widget table { margin-bottom: 0; } +#modxrecent_widget .table-condensed > tbody > tr > td { padding: 2px 3px; } +#modxrecent_widget .table-condensed > tbody > tr > td.hiddenRow { padding: 0; border: none } +#modxrecent_widget table ul { margin: 0; padding: 0; } +#modxrecent_widget table li { padding: 3px 5px; } +#modxrecent_widget table li:last-child { border-bottom-width: 0; padding-bottom: 0; }*/ +#content_body #which_editor { margin-top: 12px; } +/* resource children list */ +#tabChildren .grid th, #tabChildren .grid tr > td:nth-child(5), #tabChildren .grid tr > td:nth-child(6) { text-align: center; white-space: nowrap } +#tabChildren .grid td { text-align: right; white-space: nowrap } +#tabChildren .grid tr > th:nth-child(2), #tabChildren .grid tr > td:nth-child(2) { text-align: left; white-space: normal } +#tabChildren .grid tr > td:nth-child(6) a { padding: 0 .2em; font-size: 0.9rem; color: #444; } +table.actionButtons { margin-top: 1rem; margin-bottom: 10px; } +table.actionButtons img { display: inline-block; } +table.actionButtons .searchtext { padding: 5px; height: 24px; width: 150px; } +/* backup */ +#tabBackup p.actionButtons { margin-top: 20px; margin-bottom: 1rem; } +/* filter elements */ +.filterElements-form { margin-bottom: 10px; margin-top: 5px; } +.actionButtons .filterElements-form { margin-top: 0; margin-bottom: 0; } +.filterElements-form .form-control { display: block; width: 100%; max-width: 500px; font-size: 13px; } +.actionButtons .filterElements-form .form-control { width: 200px; height: 33px; padding-left: 8px; box-sizing: border-box; } +/* pagetitle-icon */ +.pagetitle-icon { margin-right: 2px; color: #1377c5; } +/* element-edit-message */ +.msg-container { padding-bottom: 10px; border-bottom: 1px solid #ededed; margin-bottom: 1rem; color: #777; } +.btn-small { padding: 2px 4px !important; font-size: 11px !important; } +.relative { position: relative; } +.modx-alert { display: block; margin: 60px 10px 10px 10px; padding: 1em; } +.modx-alert.alert-error { background-color: #ffd0d0; border: 1px solid #ff0000; color: #000; } +tr.userIdle td { color: #aaa; } +tr.userIdle td strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #aaa; padding: 0 5px 0 0; content: '\f017'; } +#modxonline_widget td strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #3d5764; padding: 0 5px 0 0; content: '\f2be'; } +#modxonline_widget td strong.userMultipleSessions:before { color: #bf4949; content: '\f2bd'; } +#modxonline_widget tr.userIdle td strong.userMultipleSessions:before { color: #bf4949; content: '\f017'; } +/* c-roleslist */ +.c-roleslist { margin-bottom: 10px; margin-left: 12px; } +.c-roleslist-name { display: block; font-size: 13px; font-weight: 500; } +.c-roleslist-hyphen { display: none; } +.c-roleslist-description { color: #666; } +.c-roleslist-item { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #ddd; } +.c-roleslist-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom-width: 0; } +.c-roleslist-item--admin { font-style: italic; } +/*Manage Files*/ +#ManageFiles { padding-bottom: 1rem; } +#ManageFiles .breadcrumbs { } +#ManageFiles .breadcrumbs a, #ManageFiles .breadcrumbs span { display: inline-block; padding: 0 0.25em; } +#ManageFiles #imageviewer { text-align: center; } +#ManageFiles #imageviewer img { display: inline-block; max-width: 100%; margin-top: 1rem } +#FilesTable { width: 100%; margin-bottom: 1rem; border-bottom: 1px solid #ddd; background-color: #F9F9F9 } +#FilesTable tr { border-bottom: 1px solid #e8e8e8; cursor: default } +#FilesTable th { padding: 0.675rem 1rem; font-size: 0.675rem; font-weight: 400; text-transform: uppercase; text-align: center; color: #666; white-space: nowrap; vertical-align: middle } +#FilesTable tr > th:last-child::after { display: none } +#FilesTable td { padding: 0.25rem 0.5rem; white-space: nowrap; text-align: right; } +#FilesTable > thead { background: #f1f1f1; border-top: 1px solid #e8e8e8; } +#FilesTable > thead > tr > th:first-child, #FilesTable > tbody > tr > td:first-child { text-align: left; padding-left: 1rem !important; width: 100%; } +#FilesTable > tbody > tr > td:last-child { padding-right: 1rem !important; } +#FilesTable > thead > tr > th:first-child .fa, #FilesTable > tbody > tr > td:first-child .fa { float: left; margin: 0.3rem 0.5rem 0 0; } +#FilesTable > tbody > tr:nth-child(2n) { background-color: rgba(255, 255, 255, 0.64) } +#FilesTable > tbody > tr:hover { background-color: rgba(33, 150, 243, 0.1) } +#FilesTable > tbody > tr.viewRow, #FilesTable > tbody > tr.editRow { background-color: #1976D2; color: #fff; } +#FilesTable > tbody > tr.viewRow a, #FilesTable > tbody > tr.editRow a { color: #fff !important; } +#FilesTable > tbody > tr > td:last-child .fa { position: relative; width: 1.3rem; height: 1.3rem; line-height: 1.3rem; font-size: 0.9rem; text-align: center; border-radius: 50%; -webkit-transition: 0.15s; transition: 0.15s; } +#FilesTable > tbody > tr > td:last-child a:hover .fa, #FilesTable > tbody > tr > td:last-child span:not(.disabled):hover .fa { color: #000; background-color: #88bbe9 } +#FilesTable > tbody > tr > td:last-child a:hover .fa.fa-trash { color: #d80030 } +#FilesTable > tbody > tr > td:last-child span.disabled { visibility: hidden } +#FilesTable > tbody > tr > td:last-child a, #FilesTable > tbody > tr > td:last-child span { color: #666; } +#file_editfile.section .sectionHeader { margin: 0; padding: 0.5rem 1rem; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } +#file_editfile.section .sectionBody { margin: 0 !important; padding: 0 0 1rem; border: none; border-bottom: 1px solid #ddd; background-color: #F9F9F9 } +#file_editfile td { padding: 0 !important; } +#file_editfile #content { float: left; width: 100%; min-height: 25rem; border: none; border-bottom: 1px solid rgba(0, 0, 0, .15) } +/*responsive buttons*/ +.actionButtons .fa { display: none; text-align: center; font-size: 1em; line-height: 1em; width: 1.1em; vertical-align: initial } +.sectionBody .actionButtons .fa, .actionButtons--eit .fa { display: inline-block; } +.optionsTitle .fa { display: inline-block; } +@media (max-width: 900px) { +.actionButtons a { display: inline-block; padding: 6px 10px } +.tab-page .actionButtons a { margin-top: 0 !important } +.actionButtons a span { display: none; } +.actionButtons a .fa { display: inline-block; } +} +/* extras */ +.catalog_item select[name=link] { width: auto !important; margin-left: 0.5rem } +/* ManagerManager */ +.sectionHeader.minimizable { position: relative; z-index: 1; background-color: #fafafa; padding: 0.5rem; border: 1px solid rgba(0, 0, 0, 0.15); } +.dark .sectionHeader.minimizable { background-color: #f2f2f2 } +/* gridster */ +.gs-w:hover .gs-resize-handle, .resizing .gs-resize-handle { right: 7px; bottom: 0 } +.widget-controls .btn-group .btn { width: 28px } +/* MCE */ +.mce-container, .mce-container-body { box-sizing: border-box !important } +#editorRow_TinyMCE { background-color: #fff; } +#editorRow_TinyMCE tr { border: 1px dotted rgba(0, 0, 0, .05); } +#editorRow_TinyMCE th { white-space: nowrap } +#editorRow_TinyMCE th, #editorRow_TinyMCE td { padding: 0.5em; border: none !important } +/* codeMirror */ +.CodeMirror { width: 100%; margin: 0 !important; } +.CodeMirror pre { word-break: break-all !important; } +.CodeMirror > div:first-child > textarea { /*opacity: 0;*/ z-index: -1; left: -9999rem; } +div.CodeMirror-cursors { pointer-events: none; } +/* bootstrap */ +.dropdown-menu { display: none } +.show > .dropdown-menu { display: block } +/* SimpleGallery */ +#SimpleGallery .pagination { display: block } +#SimpleGallery .sg_image { width: auto } +/*multiTV*/ +.multitv .list li.element a.copy, .multitv .list li.element a.remove { +width: 25px !important; +text-align: center; +background: #fff !important; +top: -10px !important; +} +.multitv .list li.element { +border-radius: .25rem; +border: 1px solid rgba(0, 0, 0, .125); +background: #fefefe !important; +margin-bottom: 10px !important; +} +/*dark*/ +.dark .tab-page, .dark .tab-row .tab.selected, .dark .tab-row .tab.selected.hover, .dark .tab-row .tab.selected:before, .dark .tab-row .tab.selected span { +background: #F9F9F9; +} +.dark, .dark .resourceTable .panel-heading { background: #ecf0f1 !important; } +.dark .resourceTable .panel-heading:hover { background: #ecf0f1 !important; } +/*.dark form select, +.dark input[type="text"], +.dark input[type="email"], +.dark input[type="password"], +.dark input[type="url"], +.dark input[type="number"], +.dark textarea, +.dark form input[type="text"], +.dark form input[type="password"], +.dark form input[type="number"], +.dark form textarea, +.dark #tv_body select, +.dark #tv_body input[type="text"], +.dark #tv_body input[type="email"], +.dark #tv_body input[type="password"], +.dark #tv_body input[type="url"], +.dark #tv_body input[type="number"], +.dark #tv_body textarea { +background-color: #FFF; +}*/ +.dark .multitv .list li.element a.copy, .multitv .list li.element a.remove { +background: #F9F9F9 !important; +} +.dark .multitv .list li.element { +background: #FEFEFE !important; +} +.dark .split { border-color: rgba(0, 0, 0, .05) } +.dark hr { background: transparent; } +.dark .content-blocks .block { +background: #FEFEFE; +border: 1px solid #e3e3e3; +} +.dark .content-blocks .block .fields-group { +border: 1px dashed #e2e2e2; +} +.dark .content-blocks input[type="text"], +.dark .content-blocks input[type="password"], +.dark .content-blocks input[type="number"], +.dark .content-blocks textarea { +background-color: #FBFBFB !important; +border-color: #dbdbdb !important; +} +.dark .content-blocks .controls { +background: transparent !important; +} diff --git a/manager/media/style/MODxRE2_DropdownMenu/style.php b/manager/media/style/MODxRE2_DropdownMenu/style.php new file mode 100644 index 0000000000..96dc047151 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/style.php @@ -0,0 +1,458 @@ +config['manager_theme']/style.php + * Function: Manager style variables for images and icons. + * Encoding: UTF-8 + * Credit: icons by Mark James of FamFamFam http://www.famfamfam.com/lab/icons/ + * Date: 18-Mar-2010 + * Version: 1.1 + * MODX version: 1.0.3 + */ +$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; +$modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; +if(!$modx->config['lang_code']) { + global $modx_lang_attribute; + $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; +} + +if($_GET['a'] == 2) { + include_once('welcome.php'); +} + +// Tree Menu Toolbar +$_style['add_doc_tree'] = ''; +$_style['add_weblink_tree'] = ''; +$_style['collapse_tree'] = ''; +$_style['empty_recycle_bin'] = ''; +$_style['empty_recycle_bin_empty'] = ''; +$_style['expand_tree'] = ''; +$_style['hide_tree'] = ''; +$_style['refresh_tree'] = ''; +$_style['show_tree'] = $style_path.'tree/expand.png'; +$_style['sort_tree'] = ''; +$_style['sort_menuindex'] = ''; +$_style['element_management'] = ''; +$_style['images_management'] = ''; +$_style['files_management'] = ''; +$_style['email'] = ''; + +//Tree Contextual Menu Popup +$_style['ctx_new_document'] = 'fa fa-file-o'; +$_style['ctx_edit_document'] = 'fa fa-pencil-square-o'; +$_style['ctx_move_document'] = 'fa fa-arrows'; +$_style['ctx_resource_duplicate'] = 'fa fa-clone'; +$_style['ctx_sort_menuindex'] = 'fa fa-sort-numeric-asc'; +$_style['ctx_publish_document'] = 'fa fa-arrow-up'; +$_style['ctx_unpublish_resource'] = 'fa fa-arrow-down'; +$_style['ctx_delete'] = 'fa fa-trash'; +$_style['ctx_undelete_resource'] = 'fa fa-arrow-circle-o-up'; +$_style['ctx_weblink'] = 'fa fa-link'; +$_style['ctx_resource_overview'] = 'fa fa-info'; +$_style['ctx_preview_resource'] = 'fa fa-eye'; + +// Tree Icons +$_style['tree_deletedpage'] = ""; +$_style['tree_folder'] = $style_path.'tree/folder-close-alt.png'; /* folder.png */ +$_style['tree_folderopen'] = $style_path.'tree/folder-open-alt.png'; /* folder-open.png */ +$_style['tree_globe'] = $style_path.'tree/globe.png'; +$_style['tree_folder_new'] = ""; /* folder.png */ +$_style['tree_folderopen_new'] = ""; /* folder-open.png */ +$_style['tree_folder_secure'] = ""; +$_style['tree_folderopen_secure'] = ""; +$_style['tree_linkgo'] = ""; +$_style['tree_page'] = ""; +$_style['tree_page_home'] = ""; +$_style['tree_page_404'] = ""; +$_style['tree_page_hourglass'] = ""; +$_style['tree_page_info'] = ""; +$_style['tree_page_blank'] = ""; +$_style['tree_page_css'] = ""; +$_style['tree_page_html'] = ""; +$_style['tree_page_xml'] = ""; +$_style['tree_page_js'] = ""; +$_style['tree_page_rss'] = ""; +$_style['tree_page_pdf'] = ""; +$_style['tree_page_word'] = ""; +$_style['tree_page_excel'] = ""; + +$_style['tree_minusnode'] = "";//$style_path.'tree/angle-down.png'; +$_style['tree_plusnode'] = "";//$style_path.'tree/angle-right.png'; +$_style['tree_weblink'] = $style_path.'tree/link.png'; +$_style['tree_preview_resource'] = "";//$style_path.'icons/eye.png'; + +$_style['tree_showtree'] = ''; +$_style['tree_working'] = ''; +$_style['tree_info'] = ''; + +$_style['tree_page_secure'] = ""; +$_style['tree_page_blank_secure'] = ""; +$_style['tree_page_css_secure'] = ""; +$_style['tree_page_html_secure'] = ""; +$_style['tree_page_xml_secure'] = ""; +$_style['tree_page_js_secure'] = ""; +$_style['tree_page_rss_secure'] = ""; +$_style['tree_page_pdf_secure'] = ""; +$_style['tree_page_word_secure'] = ""; +$_style['tree_page_excel_secure'] = ""; + +//search +$_style['icons_external_link'] = ''; + +//View Resource data +$_style['icons_new_document'] = 'fa fa-file-o'; +$_style['icons_new_weblink'] = 'fa fa-link'; +$_style['icons_move_document'] = 'fa fa-arrows'; +$_style['icons_publish_document'] = 'fa fa-arrow-up'; +$_style['icons_unpublish_resource'] = 'fa fa-arrow-down'; +$_style['icons_delete_resource'] = 'fa fa-trash'; +$_style['icons_undelete_resource'] = 'fa fa-arrow-circle-o-up'; +$_style['icons_resource_overview'] = 'fa fa-info'; +$_style['icons_edit_resource'] = 'fa fa-pencil-square-o'; +//context menu +$_style['icons_resource_duplicate'] = $style_path.'icons/clone.png'; +$_style['icons_edit_document'] = $style_path.'icons/save.png'; +$_style['icons_delete_document'] = $style_path.'icons/trash.png'; +//locks +$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png'; +$_style['icons_secured'] = "";//$style_path.'icons/lock.png'; + +//file manager icons +$_style['files_save'] = 'fa fa-floppy-o'; +$_style['files_folder'] = 'fa fa-folder-o'; +$_style['files_deleted_folder'] = 'fa fa-folder-o'; +$_style['files_folder-open'] = 'fa fa-folder-open-o'; +$_style['files_page_php'] = 'fa fa-file-o'; +$_style['files_page_html'] = 'fa fa-file-o'; +$_style['files_cancel'] = 'fa fa-times-circle'; +$_style['files_top'] = 'fa fa-folder-open-o'; +$_style['files_add'] = 'fa fa-plus-circle'; +$_style['files_upload'] = 'fa fa-upload'; +$_style['files_delete'] = 'fa fa-trash'; +$_style['files_duplicate'] = 'fa fa-clone'; +$_style['files_rename'] = 'fa fa-i-cursor'; +$_style['files_view'] = 'fa fa-eye'; +$_style['files_download'] = 'fa fa-download'; +$_style['files_unzip'] = 'fa fa-file-archive-o'; +$_style['files_edit'] = 'fa fa-pencil-square-o'; + +//Action buttons +$_style['actions_save'] = 'fa fa-floppy-o'; +$_style['actions_duplicate'] = 'fa fa-clone'; +$_style['actions_delete'] = 'fa fa-trash'; +$_style['actions_cancel'] = 'fa fa-times-circle'; +$_style['actions_close'] = 'fa fa-times-circle'; +$_style['actions_add'] = 'fa fa-plus-circle'; +$_style['actions_preview'] = 'fa fa-eye'; +$_style['actions_run'] = 'fa fa-play'; +$_style['actions_stop'] = 'fa fa-stop'; +$_style['actions_new'] = 'fa fa-plus-circle'; +$_style['actions_help'] = 'fa fa-question-circle'; +$_style['actions_sort'] = 'fa fa-sort'; +$_style['actions_options'] = 'fa fa-check-square'; +$_style['actions_categories'] = 'fa fa-folder-open'; +$_style['actions_search'] = 'fa fa-search'; +$_style['actions_file'] = 'fa fa-file-o'; +$_style['actions_folder'] = 'fa fa-folder-o'; +$_style['actions_folder_open'] = 'fa fa-folder-open-o'; +$_style['actions_calendar'] = 'fa fa-calendar'; +$_style['actions_calendar_delete'] = 'fa fa-calendar-times-o'; +$_style['actions_angle_up'] = 'fa fa-angle-up'; +$_style['actions_angle_down'] = 'fa fa-angle-down'; +$_style['actions_angle_left'] = 'fa fa-angle-left'; +$_style['actions_angle_right'] = 'fa fa-angle-right'; +$_style['actions_chain'] = 'fa fa-chain'; +$_style['actions_chain_broken'] = 'fa fa-chain-broken'; +$_style['actions_edit'] = 'fa fa-edit'; +$_style['actions_move'] = 'fa fa-arrows'; +$_style['actions_pencil'] = 'fa fa-pencil'; +$_style['actions_reply'] = 'fa fa-reply'; +$_style['actions_plus'] = 'fa fa-plus'; +$_style['actions_refresh'] = 'fa fa-refresh'; +$_style['actions_error'] = 'fa fa-times-circle'; +$_style['actions_info'] = 'fa fa-info-circle'; +$_style['actions_triangle'] = 'fa fa-exclamation-triangle'; + +//for back compatibility + +$_style['icons_save'] = $style_path.'icons/save.png'; +$_style['icons_delete'] = $style_path.'icons/trash.png'; +$_style['icons_deleted_folder'] = $style_path.'tree/deletedfolder.png'; +$_style['icons_unzip'] = $style_path.'icons/download-alt.png'; + + +// Indicators +$_style['icons_tooltip'] = 'fa fa-question-circle'; +$_style['icons_tooltip_over'] = $style_path.'icons/question-sign.png'; +$_style['icons_cal'] = $style_path.'icons/calendar.png'; +$_style['icons_cal_nodate'] = $style_path.'icons/calendar.png'; +$_style['icons_set_parent'] = $style_path.'icons/folder-open.png'; + +//modules +$_style['icons_modules'] = 'fa fa-cogs'; //$style_path.'icons/modules.png'; +$_style['icons_run'] = $style_path.'icons/play.png'; + +//users and webusers +$_style['icons_user'] = 'fa fa-user'; //$style_path.'icons/user.png'; + +//Messages +$_style['icons_message_unread'] = $style_path.'icons/email.png'; +$_style['icons_message_forward'] = $style_path.'icons/forward.png'; +$_style['icons_message_reply'] = $style_path.'icons/reply.png'; + +// Icons +$_style['icons_add'] = $style_path.'icons/add.png'; +$_style['icons_cancel'] = $style_path.'icons/cancel.png'; +$_style['icons_close'] = $style_path.'icons/stop.png'; +$_style['icons_refresh'] = $style_path.'icons/refresh.png'; +$_style['icons_table'] = $style_path.'icons/table.png'; + +// top bar +$_style['icons_loading_doc_tree'] = $style_path.'icons/info-sign.png'; +$_style['icons_mail'] = $style_path.'icons/email.png'; +$_style['icons_working'] = $style_path.'icons/exclamation.png'; + +//event log +$_style['icons_event1'] = $style_path.'icons/event1.png'; +$_style['icons_event2'] = $style_path.'icons/event2.png'; +$_style['icons_event3'] = $style_path.'icons/event3.png'; + + +//nowhere in the manager +$_style['icons_folder'] = $style_path.'icons/folder.png'; +$_style['icons_email'] = $style_path.'icons/email.png'; +$_style['icons_home'] = $style_path.'icons/home.png'; +$_style['icons_sort_menuindex'] = $style_path.'icons/sort_index.png'; +$_style['icons_weblink'] = $style_path.'icons/world_link.png'; +$_style['icons_tab_preview'] = $style_path.'icons/preview.png'; // Tabs +$_style['icons_information'] = $style_path.'icons/info-sign.png'; + + +// Miscellaneous +$_style['ajax_loader'] = '

                              '.$_lang['loading_page'].'

                              '; +$_style['tx'] = $style_path.'misc/_tx_.gif'; +$_style['icons_right_arrow'] = $style_path.'icons/arrow-right.png'; +$_style['fade'] = $style_path.'misc/fade.gif'; +$_style['ed_save'] = $style_path.'misc/ed_save.gif'; + +// actions buttons templates +$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; +$stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; +$addnew = 0; +$run = 0; +switch($action) { + case '3': + case '4': + case '27': + case '72': + if($modx->hasPermission('new_document')) { + $addnew = 1; + } + break; + case '16': + case '19': + if($modx->hasPermission('new_template')) { + $addnew = 1; + } + break; + case '300': + case '301': + if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { + $addnew = 1; + } + break; + case '77': + case '78': + if($modx->hasPermission('new_chunk')) { + $addnew = 1; + } + break; + case '22': + case '23': + if($modx->hasPermission('new_snippet')) { + $addnew = 1; + } + break; + case '101': + case '102': + if($modx->hasPermission('new_plugin')) { + $addnew = 1; + } + break; + case '106': + case '107': + case '108': + if($modx->hasPermission('new_module')) { + $addnew = 1; + } + if($modx->hasPermission('exec_module')) { + $run = 1; + } + break; + case '88': + if($modx->hasPermission('new_web_user')) { + $addnew = 1; + } + break; +} + +$disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : ''; + +$_style['actionbuttons'] = array( + 'dynamic' => array( + 'document' => '
                              +
                              +
                              + + ' . $_lang['save'] . ' + + + +
                              ' . + ($addnew ? ' + + ' . $_lang['duplicate'] . ' + + ' : '') . ' + + ' . $_lang['delete'] . ' + + + ' . $_lang['cancel'] . ' + + + ' . $_lang['preview'] . ' + +
                              +
                              ', + 'user' => '
                              +
                              +
                              + + ' . $_lang['save'] . ' + + + +
                              + + ' . $_lang['delete'] . ' + + + ' . $_lang['cancel'] . ' + +
                              +
                              ', + 'element' => '
                              +
                              +
                              + + ' . $_lang['save'] . ' + + + +
                              + ' . ($addnew ? ' + + ' . $_lang['duplicate'] . ' + + ' : '') . ' + + ' . $_lang['delete'] . ' + + + ' . $_lang['cancel'] . ' + + ' . ($run ? ' + + ' . $_lang['run_module'] . ' + + ' : '') . ' +
                              +
                              ', + 'newmodule' => '
                              +
                              + ' . ($addnew ? ' + + ' . $_lang['new_module'] . ' + + ' : '') . ' +
                              +
                              ', + 'close' => '', + 'save' => '', + 'savedelete' => '', + ), + 'static' => array( + 'document' => '' + ) +); diff --git a/manager/media/style/MODxRE2_DropdownMenu/welcome.php b/manager/media/style/MODxRE2_DropdownMenu/welcome.php new file mode 100644 index 0000000000..90fcf67f33 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/welcome.php @@ -0,0 +1,21 @@ +config['enable_filter'] = 1; + +$modx->addSnippet('hasPermission','return $modx->hasPermission($key);'); + +if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) + $hasAnyPermission = 1; +else $hasAnyPermission = 0; +$modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;'); +$modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();'); +$code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'\' . $_SESSION["nrnewmessages"] . "") : $_lang["messages_no_messages"];'; +$modx->addSnippet('getMessageCount',$code); + +// Large Icons +$_style['icons_backup_large'] = 'fa fa-database fa-fw fa-2x'; +$_style['icons_mail_large'] = 'fa fa-envelope fa-fw fa-2x'; +$_style['icons_modules_large'] = 'fa fa-cogs fa-fw fa-2x'; +$_style['icons_resources_large'] = 'fa fa-th fa-fw fa-2x'; +$_style['icons_security_large'] = 'fa fa-lock fa-fw fa-2x'; +$_style['icons_webusers_large'] = 'fa fa-users fa-fw fa-2x'; +$_style['icons_help_large'] = 'fa fa-question-circle fa-fw fa-2x'; diff --git a/manager/media/style/MODxRE2_DropdownMenu/welcome.tpl b/manager/media/style/MODxRE2_DropdownMenu/welcome.tpl new file mode 100644 index 0000000000..1605487de9 --- /dev/null +++ b/manager/media/style/MODxRE2_DropdownMenu/welcome.tpl @@ -0,0 +1,37 @@ + + +[[@OnManagerWelcomePrerender]] + +
                              + + +
                              +
                              + [+logout_reminder_msg+] +
                              +
                              + + +
                              +
                              + [+multiple_sessions_msg+] +
                              +
                              + + +
                              +
                              + [+config_check_results+] +
                              +
                              + + +
                              + [+widgets+] +
                              + + +
                              + +[[@OnManagerWelcomeRender]] diff --git a/manager/media/style/common/bootstrap/css/bootstrap.min.css b/manager/media/style/common/bootstrap/css/bootstrap.min.css index 4980b42726..06cf582157 100644 --- a/manager/media/style/common/bootstrap/css/bootstrap.min.css +++ b/manager/media/style/common/bootstrap/css/bootstrap.min.css @@ -1,5 +1,7 @@ /*! - * Bootstrap v3.3.7 (http://getbootstrap.com) + * Bootstrap v4.0.0-alpha.5 (https://getbootstrap.com) + * Copyright 2011-2016 The Bootstrap Authors * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover,a.text-primary:focus{color:#286090}.text-success{color:#3c763d}a.text-success:hover,a.text-success:focus{color:#2b542c}.text-info{color:#31708f}a.text-info:hover,a.text-info:focus{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover,a.text-warning:focus{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover,a.text-danger:focus{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover,a.bg-primary:focus{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover,a.bg-success:focus{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover,a.bg-info:focus{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover,a.bg-warning:focus{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover,a.bg-danger:focus{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:34px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:30px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:46px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:34px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:focus,.btn-default.focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:focus,.btn-primary.focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:focus,.btn-success.focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#fff;background-color:#398439;border-color:#255625}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:focus,.btn-info.focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:focus,.btn-warning.focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:focus,.btn-danger.focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#337ab7;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#337ab7;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#fff;background-color:#337ab7;border-color:#337ab7;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#eee;color:#777;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform 0.6s ease-in-out;-o-transition:-o-transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}} \ No newline at end of file + *//*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:700}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}@media print{*,::after,::before,::first-letter,blockquote::first-line,div::first-line,li::first-line,p::first-line{text-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.tag{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}html{-webkit-box-sizing:border-box;box-sizing:border-box}*,::after,::before{-webkit-box-sizing:inherit;box-sizing:inherit}@-ms-viewport{width:device-width}html{font-size:16px;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;line-height:1.5;color:#373a3c;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #818a91}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}a{color:#0275d8;text-decoration:none}a:focus,a:hover{color:#014c8c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle}[role=button]{cursor:pointer}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse;background-color:transparent}caption{padding-top:.75rem;padding-bottom:.75rem;color:#818a91;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,select,textarea{line-height:inherit}input[type=checkbox]:disabled,input[type=radio]:disabled{cursor:not-allowed}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit}input[type=search]{-webkit-appearance:none}output{display:inline-block}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300}.display-2{font-size:5.5rem;font-weight:300}.display-3{font-size:4.5rem;font-weight:300}.display-4{font-size:3.5rem;font-weight:300}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:5px}.initialism{font-size:90%;text-transform:uppercase}.blockquote{padding:.5rem 1rem;margin-bottom:1rem;font-size:1.25rem;border-left:.25rem solid #eceeef}.blockquote-footer{display:block;font-size:80%;color:#818a91}.blockquote-footer::before{content:"\2014 \00A0"}.blockquote-reverse{padding-right:1rem;padding-left:0;text-align:right;border-right:.25rem solid #eceeef;border-left:0}.blockquote-reverse .blockquote-footer::before{content:""}.blockquote-reverse .blockquote-footer::after{content:"\00A0 \2014"}dl.row>dd+dt{clear:left}.carousel-inner>.carousel-item>a>img,.carousel-inner>.carousel-item>img,.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #ddd;border-radius:.25rem;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#818a91}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{padding:.2rem .4rem;font-size:90%;color:#bd4147;background-color:#f7f7f9;border-radius:.25rem}kbd{padding:.2rem .4rem;font-size:90%;color:#fff;background-color:#333;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;margin-top:0;margin-bottom:1rem;font-size:90%;color:#373a3c}pre code{padding:0;font-size:inherit;color:inherit;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px}.container::after{content:"";display:table;clear:both}@media (min-width:576px){.container{width:540px;max-width:100%}}@media (min-width:768px){.container{width:720px;max-width:100%}}@media (min-width:992px){.container{width:960px;max-width:100%}}@media (min-width:1200px){.container{width:1140px;max-width:100%}}.container-fluid{margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px}.container-fluid::after{content:"";display:table;clear:both}.row{margin-right:-15px;margin-left:-15px}.row::after{content:"";display:table;clear:both}@media (min-width:576px){.row{margin-right:-15px;margin-left:-15px}}@media (min-width:768px){.row{margin-right:-15px;margin-left:-15px}}@media (min-width:992px){.row{margin-right:-15px;margin-left:-15px}}@media (min-width:1200px){.row{margin-right:-15px;margin-left:-15px}}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}@media (min-width:576px){.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{padding-right:15px;padding-left:15px}}@media (min-width:768px){.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{padding-right:15px;padding-left:15px}}@media (min-width:992px){.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{padding-right:15px;padding-left:15px}}@media (min-width:1200px){.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{padding-right:15px;padding-left:15px}}.col-xs-1{float:left;width:8.333333%}.col-xs-2{float:left;width:16.666667%}.col-xs-3{float:left;width:25%}.col-xs-4{float:left;width:33.333333%}.col-xs-5{float:left;width:41.666667%}.col-xs-6{float:left;width:50%}.col-xs-7{float:left;width:58.333333%}.col-xs-8{float:left;width:66.666667%}.col-xs-9{float:left;width:75%}.col-xs-10{float:left;width:83.333333%}.col-xs-11{float:left;width:91.666667%}.col-xs-12{float:left;width:100%}.pull-xs-0{right:auto}.pull-xs-1{right:8.333333%}.pull-xs-2{right:16.666667%}.pull-xs-3{right:25%}.pull-xs-4{right:33.333333%}.pull-xs-5{right:41.666667%}.pull-xs-6{right:50%}.pull-xs-7{right:58.333333%}.pull-xs-8{right:66.666667%}.pull-xs-9{right:75%}.pull-xs-10{right:83.333333%}.pull-xs-11{right:91.666667%}.pull-xs-12{right:100%}.push-xs-0{left:auto}.push-xs-1{left:8.333333%}.push-xs-2{left:16.666667%}.push-xs-3{left:25%}.push-xs-4{left:33.333333%}.push-xs-5{left:41.666667%}.push-xs-6{left:50%}.push-xs-7{left:58.333333%}.push-xs-8{left:66.666667%}.push-xs-9{left:75%}.push-xs-10{left:83.333333%}.push-xs-11{left:91.666667%}.push-xs-12{left:100%}.offset-xs-1{margin-left:8.333333%}.offset-xs-2{margin-left:16.666667%}.offset-xs-3{margin-left:25%}.offset-xs-4{margin-left:33.333333%}.offset-xs-5{margin-left:41.666667%}.offset-xs-6{margin-left:50%}.offset-xs-7{margin-left:58.333333%}.offset-xs-8{margin-left:66.666667%}.offset-xs-9{margin-left:75%}.offset-xs-10{margin-left:83.333333%}.offset-xs-11{margin-left:91.666667%}@media (min-width:576px){.col-sm-1{float:left;width:8.333333%}.col-sm-2{float:left;width:16.666667%}.col-sm-3{float:left;width:25%}.col-sm-4{float:left;width:33.333333%}.col-sm-5{float:left;width:41.666667%}.col-sm-6{float:left;width:50%}.col-sm-7{float:left;width:58.333333%}.col-sm-8{float:left;width:66.666667%}.col-sm-9{float:left;width:75%}.col-sm-10{float:left;width:83.333333%}.col-sm-11{float:left;width:91.666667%}.col-sm-12{float:left;width:100%}.pull-sm-0{right:auto}.pull-sm-1{right:8.333333%}.pull-sm-2{right:16.666667%}.pull-sm-3{right:25%}.pull-sm-4{right:33.333333%}.pull-sm-5{right:41.666667%}.pull-sm-6{right:50%}.pull-sm-7{right:58.333333%}.pull-sm-8{right:66.666667%}.pull-sm-9{right:75%}.pull-sm-10{right:83.333333%}.pull-sm-11{right:91.666667%}.pull-sm-12{right:100%}.push-sm-0{left:auto}.push-sm-1{left:8.333333%}.push-sm-2{left:16.666667%}.push-sm-3{left:25%}.push-sm-4{left:33.333333%}.push-sm-5{left:41.666667%}.push-sm-6{left:50%}.push-sm-7{left:58.333333%}.push-sm-8{left:66.666667%}.push-sm-9{left:75%}.push-sm-10{left:83.333333%}.push-sm-11{left:91.666667%}.push-sm-12{left:100%}.offset-sm-0{margin-left:0%}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md-1{float:left;width:8.333333%}.col-md-2{float:left;width:16.666667%}.col-md-3{float:left;width:25%}.col-md-4{float:left;width:33.333333%}.col-md-5{float:left;width:41.666667%}.col-md-6{float:left;width:50%}.col-md-7{float:left;width:58.333333%}.col-md-8{float:left;width:66.666667%}.col-md-9{float:left;width:75%}.col-md-10{float:left;width:83.333333%}.col-md-11{float:left;width:91.666667%}.col-md-12{float:left;width:100%}.pull-md-0{right:auto}.pull-md-1{right:8.333333%}.pull-md-2{right:16.666667%}.pull-md-3{right:25%}.pull-md-4{right:33.333333%}.pull-md-5{right:41.666667%}.pull-md-6{right:50%}.pull-md-7{right:58.333333%}.pull-md-8{right:66.666667%}.pull-md-9{right:75%}.pull-md-10{right:83.333333%}.pull-md-11{right:91.666667%}.pull-md-12{right:100%}.push-md-0{left:auto}.push-md-1{left:8.333333%}.push-md-2{left:16.666667%}.push-md-3{left:25%}.push-md-4{left:33.333333%}.push-md-5{left:41.666667%}.push-md-6{left:50%}.push-md-7{left:58.333333%}.push-md-8{left:66.666667%}.push-md-9{left:75%}.push-md-10{left:83.333333%}.push-md-11{left:91.666667%}.push-md-12{left:100%}.offset-md-0{margin-left:0%}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg-1{float:left;width:8.333333%}.col-lg-2{float:left;width:16.666667%}.col-lg-3{float:left;width:25%}.col-lg-4{float:left;width:33.333333%}.col-lg-5{float:left;width:41.666667%}.col-lg-6{float:left;width:50%}.col-lg-7{float:left;width:58.333333%}.col-lg-8{float:left;width:66.666667%}.col-lg-9{float:left;width:75%}.col-lg-10{float:left;width:83.333333%}.col-lg-11{float:left;width:91.666667%}.col-lg-12{float:left;width:100%}.pull-lg-0{right:auto}.pull-lg-1{right:8.333333%}.pull-lg-2{right:16.666667%}.pull-lg-3{right:25%}.pull-lg-4{right:33.333333%}.pull-lg-5{right:41.666667%}.pull-lg-6{right:50%}.pull-lg-7{right:58.333333%}.pull-lg-8{right:66.666667%}.pull-lg-9{right:75%}.pull-lg-10{right:83.333333%}.pull-lg-11{right:91.666667%}.pull-lg-12{right:100%}.push-lg-0{left:auto}.push-lg-1{left:8.333333%}.push-lg-2{left:16.666667%}.push-lg-3{left:25%}.push-lg-4{left:33.333333%}.push-lg-5{left:41.666667%}.push-lg-6{left:50%}.push-lg-7{left:58.333333%}.push-lg-8{left:66.666667%}.push-lg-9{left:75%}.push-lg-10{left:83.333333%}.push-lg-11{left:91.666667%}.push-lg-12{left:100%}.offset-lg-0{margin-left:0%}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl-1{float:left;width:8.333333%}.col-xl-2{float:left;width:16.666667%}.col-xl-3{float:left;width:25%}.col-xl-4{float:left;width:33.333333%}.col-xl-5{float:left;width:41.666667%}.col-xl-6{float:left;width:50%}.col-xl-7{float:left;width:58.333333%}.col-xl-8{float:left;width:66.666667%}.col-xl-9{float:left;width:75%}.col-xl-10{float:left;width:83.333333%}.col-xl-11{float:left;width:91.666667%}.col-xl-12{float:left;width:100%}.pull-xl-0{right:auto}.pull-xl-1{right:8.333333%}.pull-xl-2{right:16.666667%}.pull-xl-3{right:25%}.pull-xl-4{right:33.333333%}.pull-xl-5{right:41.666667%}.pull-xl-6{right:50%}.pull-xl-7{right:58.333333%}.pull-xl-8{right:66.666667%}.pull-xl-9{right:75%}.pull-xl-10{right:83.333333%}.pull-xl-11{right:91.666667%}.pull-xl-12{right:100%}.push-xl-0{left:auto}.push-xl-1{left:8.333333%}.push-xl-2{left:16.666667%}.push-xl-3{left:25%}.push-xl-4{left:33.333333%}.push-xl-5{left:41.666667%}.push-xl-6{left:50%}.push-xl-7{left:58.333333%}.push-xl-8{left:66.666667%}.push-xl-9{left:75%}.push-xl-10{left:83.333333%}.push-xl-11{left:91.666667%}.push-xl-12{left:100%}.offset-xl-0{margin-left:0%}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;max-width:100%;margin-bottom:1rem}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #eceeef}.table thead th{vertical-align:bottom;border-bottom:2px solid #eceeef}.table tbody+tbody{border-top:2px solid #eceeef}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #eceeef}.table-bordered td,.table-bordered th{border:1px solid #eceeef}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table-success,.table-success>td,.table-success>th{background-color:#dff0d8}.table-hover .table-success:hover{background-color:#d0e9c6}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#d0e9c6}.table-info,.table-info>td,.table-info>th{background-color:#d9edf7}.table-hover .table-info:hover{background-color:#c4e3f3}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#c4e3f3}.table-warning,.table-warning>td,.table-warning>th{background-color:#fcf8e3}.table-hover .table-warning:hover{background-color:#faf2cc}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#faf2cc}.table-danger,.table-danger>td,.table-danger>th{background-color:#f2dede}.table-hover .table-danger:hover{background-color:#ebcccc}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#ebcccc}.thead-inverse th{color:#fff;background-color:#373a3c}.thead-default th{color:#55595c;background-color:#eceeef}.table-inverse{color:#eceeef;background-color:#373a3c}.table-inverse td,.table-inverse th,.table-inverse thead th{border-color:#55595c}.table-inverse.table-bordered{border:0}.table-responsive{display:block;width:100%;min-height:0%;overflow-x:auto}.table-reflow thead{float:left}.table-reflow tbody{display:block;white-space:nowrap}.table-reflow td,.table-reflow th{border-top:1px solid #eceeef;border-left:1px solid #eceeef}.table-reflow td:last-child,.table-reflow th:last-child{border-right:1px solid #eceeef}.table-reflow tbody:last-child tr:last-child td,.table-reflow tbody:last-child tr:last-child th,.table-reflow tfoot:last-child tr:last-child td,.table-reflow tfoot:last-child tr:last-child th,.table-reflow thead:last-child tr:last-child td,.table-reflow thead:last-child tr:last-child th{border-bottom:1px solid #eceeef}.table-reflow tr{float:left}.table-reflow tr td,.table-reflow tr th{display:block!important;border:1px solid #eceeef}.form-control{display:block;width:100%;padding:.5rem .75rem;font-size:1rem;line-height:1.25;color:#55595c;background-color:#fff;background-image:none;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#55595c;background-color:#fff;border-color:#66afe9;outline:0}.form-control::-webkit-input-placeholder{color:#999;opacity:1}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999;opacity:1}.form-control::placeholder{color:#999;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#eceeef;opacity:1}.form-control:disabled{cursor:not-allowed}select.form-control:not([size]):not([multiple]){height:calc(2.5rem - 2px)}select.form-control:focus::-ms-value{color:#55595c;background-color:#fff}.form-control-file,.form-control-range{display:block}.col-form-label{padding-top:.5rem;padding-bottom:.5rem;margin-bottom:0}.col-form-label-lg{padding-top:.75rem;padding-bottom:.75rem;font-size:1.25rem}.col-form-label-sm{padding-top:.25rem;padding-bottom:.25rem;font-size:.875rem}.col-form-legend{padding-top:.5rem;padding-bottom:.5rem;margin-bottom:0;font-size:1rem}.form-control-static{padding-top:.5rem;padding-bottom:.5rem;line-height:1.25;border:solid transparent;border-width:1px 0}.form-control-static.form-control-lg,.form-control-static.form-control-sm,.input-group-lg>.form-control-static.form-control,.input-group-lg>.form-control-static.input-group-addon,.input-group-lg>.input-group-btn>.form-control-static.btn,.input-group-sm>.form-control-static.form-control,.input-group-sm>.form-control-static.input-group-addon,.input-group-sm>.input-group-btn>.form-control-static.btn{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.input-group-sm>.input-group-btn>select.btn:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),.input-group-sm>select.input-group-addon:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:1.8125rem}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:.3rem}.input-group-lg>.input-group-btn>select.btn:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),.input-group-lg>select.input-group-addon:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:3.166667rem}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-check{position:relative;display:block;margin-bottom:.75rem}.form-check+.form-check{margin-top:-.25rem}.form-check.disabled .form-check-label{color:#818a91;cursor:not-allowed}.form-check-label{padding-left:1.25rem;margin-bottom:0;cursor:pointer}.form-check-input{position:absolute;margin-top:.25rem;margin-left:-1.25rem}.form-check-input:only-child{position:static}.form-check-inline{position:relative;display:inline-block;padding-left:1.25rem;margin-bottom:0;vertical-align:middle;cursor:pointer}.form-check-inline+.form-check-inline{margin-left:.75rem}.form-check-inline.disabled{color:#818a91;cursor:not-allowed}.form-control-feedback{margin-top:.25rem}.form-control-danger,.form-control-success,.form-control-warning{padding-right:2.25rem;background-repeat:no-repeat;background-position:center right .625rem;-webkit-background-size:1.25rem 1.25rem;background-size:1.25rem 1.25rem}.has-success .custom-control,.has-success .form-check-inline,.has-success .form-check-label,.has-success .form-control-feedback,.has-success .form-control-label{color:#5cb85c}.has-success .form-control{border-color:#5cb85c}.has-success .form-control:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #a3d7a3;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #a3d7a3}.has-success .input-group-addon{color:#5cb85c;border-color:#5cb85c;background-color:#eaf6ea}.has-success .form-control-success{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#5cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E")}.has-warning .custom-control,.has-warning .form-check-inline,.has-warning .form-check-label,.has-warning .form-control-feedback,.has-warning .form-control-label{color:#f0ad4e}.has-warning .form-control{border-color:#f0ad4e}.has-warning .form-control:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #f8d9ac;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #f8d9ac}.has-warning .input-group-addon{color:#f0ad4e;border-color:#f0ad4e;background-color:#fff}.has-warning .form-control-warning{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E")}.has-danger .custom-control,.has-danger .form-check-inline,.has-danger .form-check-label,.has-danger .form-control-feedback,.has-danger .form-control-label{color:#d9534f}.has-danger .form-control{border-color:#d9534f}.has-danger .form-control:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #eba5a3;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #eba5a3}.has-danger .input-group-addon{color:#d9534f;border-color:#d9534f;background-color:#fdf7f7}.has-danger .form-control-danger{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E")}@media (min-width:576px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;width:auto;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .form-control-label{margin-bottom:0;vertical-align:middle}.form-inline .form-check{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .form-check-label{padding-left:0}.form-inline .form-check-input{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.btn{display:inline-block;font-weight:400;line-height:1.25;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.5rem 1rem;font-size:1rem;border-radius:.25rem}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:focus,.btn:hover{text-decoration:none}.btn.focus{text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0}.btn.disabled,.btn:disabled{cursor:not-allowed;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#0275d8;border-color:#0275d8}.btn-primary:hover{color:#fff;background-color:#025aa5;border-color:#01549b}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#025aa5;border-color:#01549b}.btn-primary.active,.btn-primary:active,.open>.btn-primary.dropdown-toggle{color:#fff;background-color:#025aa5;border-color:#01549b;background-image:none}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.btn-primary.dropdown-toggle.focus,.open>.btn-primary.dropdown-toggle:focus,.open>.btn-primary.dropdown-toggle:hover{color:#fff;background-color:#014682;border-color:#01315a}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary:disabled.focus,.btn-primary:disabled:focus{background-color:#0275d8;border-color:#0275d8}.btn-primary.disabled:hover,.btn-primary:disabled:hover{background-color:#0275d8;border-color:#0275d8}.btn-secondary{color:#373a3c;background-color:#fff;border-color:#ccc}.btn-secondary:hover{color:#373a3c;background-color:#e6e6e6;border-color:#adadad}.btn-secondary.focus,.btn-secondary:focus{color:#373a3c;background-color:#e6e6e6;border-color:#adadad}.btn-secondary.active,.btn-secondary:active,.open>.btn-secondary.dropdown-toggle{color:#373a3c;background-color:#e6e6e6;border-color:#adadad;background-image:none}.btn-secondary.active.focus,.btn-secondary.active:focus,.btn-secondary.active:hover,.btn-secondary:active.focus,.btn-secondary:active:focus,.btn-secondary:active:hover,.open>.btn-secondary.dropdown-toggle.focus,.open>.btn-secondary.dropdown-toggle:focus,.open>.btn-secondary.dropdown-toggle:hover{color:#373a3c;background-color:#d4d4d4;border-color:#8c8c8c}.btn-secondary.disabled.focus,.btn-secondary.disabled:focus,.btn-secondary:disabled.focus,.btn-secondary:disabled:focus{background-color:#fff;border-color:#ccc}.btn-secondary.disabled:hover,.btn-secondary:disabled:hover{background-color:#fff;border-color:#ccc}.btn-info{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#2aabd2}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#2aabd2}.btn-info.active,.btn-info:active,.open>.btn-info.dropdown-toggle{color:#fff;background-color:#31b0d5;border-color:#2aabd2;background-image:none}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.btn-info.dropdown-toggle.focus,.open>.btn-info.dropdown-toggle:focus,.open>.btn-info.dropdown-toggle:hover{color:#fff;background-color:#269abc;border-color:#1f7e9a}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info:disabled.focus,.btn-info:disabled:focus{background-color:#5bc0de;border-color:#5bc0de}.btn-info.disabled:hover,.btn-info:disabled:hover{background-color:#5bc0de;border-color:#5bc0de}.btn-success{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#419641}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#419641}.btn-success.active,.btn-success:active,.open>.btn-success.dropdown-toggle{color:#fff;background-color:#449d44;border-color:#419641;background-image:none}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.btn-success.dropdown-toggle.focus,.open>.btn-success.dropdown-toggle:focus,.open>.btn-success.dropdown-toggle:hover{color:#fff;background-color:#398439;border-color:#2d672d}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success:disabled.focus,.btn-success:disabled:focus{background-color:#5cb85c;border-color:#5cb85c}.btn-success.disabled:hover,.btn-success:disabled:hover{background-color:#5cb85c;border-color:#5cb85c}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#eb9316}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#eb9316}.btn-warning.active,.btn-warning:active,.open>.btn-warning.dropdown-toggle{color:#fff;background-color:#ec971f;border-color:#eb9316;background-image:none}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.btn-warning.dropdown-toggle.focus,.open>.btn-warning.dropdown-toggle:focus,.open>.btn-warning.dropdown-toggle:hover{color:#fff;background-color:#d58512;border-color:#b06d0f}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning:disabled.focus,.btn-warning:disabled:focus{background-color:#f0ad4e;border-color:#f0ad4e}.btn-warning.disabled:hover,.btn-warning:disabled:hover{background-color:#f0ad4e;border-color:#f0ad4e}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d9534f}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#c12e2a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#c12e2a}.btn-danger.active,.btn-danger:active,.open>.btn-danger.dropdown-toggle{color:#fff;background-color:#c9302c;border-color:#c12e2a;background-image:none}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.btn-danger.dropdown-toggle.focus,.open>.btn-danger.dropdown-toggle:focus,.open>.btn-danger.dropdown-toggle:hover{color:#fff;background-color:#ac2925;border-color:#8b211e}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger:disabled.focus,.btn-danger:disabled:focus{background-color:#d9534f;border-color:#d9534f}.btn-danger.disabled:hover,.btn-danger:disabled:hover{background-color:#d9534f;border-color:#d9534f}.btn-outline-primary{color:#0275d8;background-image:none;background-color:transparent;border-color:#0275d8}.btn-outline-primary:hover{color:#fff;background-color:#0275d8;border-color:#0275d8}.btn-outline-primary.focus,.btn-outline-primary:focus{color:#fff;background-color:#0275d8;border-color:#0275d8}.btn-outline-primary.active,.btn-outline-primary:active,.open>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#0275d8;border-color:#0275d8}.btn-outline-primary.active.focus,.btn-outline-primary.active:focus,.btn-outline-primary.active:hover,.btn-outline-primary:active.focus,.btn-outline-primary:active:focus,.btn-outline-primary:active:hover,.open>.btn-outline-primary.dropdown-toggle.focus,.open>.btn-outline-primary.dropdown-toggle:focus,.open>.btn-outline-primary.dropdown-toggle:hover{color:#fff;background-color:#014682;border-color:#01315a}.btn-outline-primary.disabled.focus,.btn-outline-primary.disabled:focus,.btn-outline-primary:disabled.focus,.btn-outline-primary:disabled:focus{border-color:#43a7fd}.btn-outline-primary.disabled:hover,.btn-outline-primary:disabled:hover{border-color:#43a7fd}.btn-outline-secondary{color:#ccc;background-image:none;background-color:transparent;border-color:#ccc}.btn-outline-secondary:hover{color:#fff;background-color:#ccc;border-color:#ccc}.btn-outline-secondary.focus,.btn-outline-secondary:focus{color:#fff;background-color:#ccc;border-color:#ccc}.btn-outline-secondary.active,.btn-outline-secondary:active,.open>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#ccc;border-color:#ccc}.btn-outline-secondary.active.focus,.btn-outline-secondary.active:focus,.btn-outline-secondary.active:hover,.btn-outline-secondary:active.focus,.btn-outline-secondary:active:focus,.btn-outline-secondary:active:hover,.open>.btn-outline-secondary.dropdown-toggle.focus,.open>.btn-outline-secondary.dropdown-toggle:focus,.open>.btn-outline-secondary.dropdown-toggle:hover{color:#fff;background-color:#a1a1a1;border-color:#8c8c8c}.btn-outline-secondary.disabled.focus,.btn-outline-secondary.disabled:focus,.btn-outline-secondary:disabled.focus,.btn-outline-secondary:disabled:focus{border-color:#fff}.btn-outline-secondary.disabled:hover,.btn-outline-secondary:disabled:hover{border-color:#fff}.btn-outline-info{color:#5bc0de;background-image:none;background-color:transparent;border-color:#5bc0de}.btn-outline-info:hover{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.btn-outline-info.focus,.btn-outline-info:focus{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.btn-outline-info.active,.btn-outline-info:active,.open>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#5bc0de;border-color:#5bc0de}.btn-outline-info.active.focus,.btn-outline-info.active:focus,.btn-outline-info.active:hover,.btn-outline-info:active.focus,.btn-outline-info:active:focus,.btn-outline-info:active:hover,.open>.btn-outline-info.dropdown-toggle.focus,.open>.btn-outline-info.dropdown-toggle:focus,.open>.btn-outline-info.dropdown-toggle:hover{color:#fff;background-color:#269abc;border-color:#1f7e9a}.btn-outline-info.disabled.focus,.btn-outline-info.disabled:focus,.btn-outline-info:disabled.focus,.btn-outline-info:disabled:focus{border-color:#b0e1ef}.btn-outline-info.disabled:hover,.btn-outline-info:disabled:hover{border-color:#b0e1ef}.btn-outline-success{color:#5cb85c;background-image:none;background-color:transparent;border-color:#5cb85c}.btn-outline-success:hover{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.btn-outline-success.focus,.btn-outline-success:focus{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.btn-outline-success.active,.btn-outline-success:active,.open>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#5cb85c;border-color:#5cb85c}.btn-outline-success.active.focus,.btn-outline-success.active:focus,.btn-outline-success.active:hover,.btn-outline-success:active.focus,.btn-outline-success:active:focus,.btn-outline-success:active:hover,.open>.btn-outline-success.dropdown-toggle.focus,.open>.btn-outline-success.dropdown-toggle:focus,.open>.btn-outline-success.dropdown-toggle:hover{color:#fff;background-color:#398439;border-color:#2d672d}.btn-outline-success.disabled.focus,.btn-outline-success.disabled:focus,.btn-outline-success:disabled.focus,.btn-outline-success:disabled:focus{border-color:#a3d7a3}.btn-outline-success.disabled:hover,.btn-outline-success:disabled:hover{border-color:#a3d7a3}.btn-outline-warning{color:#f0ad4e;background-image:none;background-color:transparent;border-color:#f0ad4e}.btn-outline-warning:hover{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.btn-outline-warning.focus,.btn-outline-warning:focus{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.btn-outline-warning.active,.btn-outline-warning:active,.open>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#f0ad4e;border-color:#f0ad4e}.btn-outline-warning.active.focus,.btn-outline-warning.active:focus,.btn-outline-warning.active:hover,.btn-outline-warning:active.focus,.btn-outline-warning:active:focus,.btn-outline-warning:active:hover,.open>.btn-outline-warning.dropdown-toggle.focus,.open>.btn-outline-warning.dropdown-toggle:focus,.open>.btn-outline-warning.dropdown-toggle:hover{color:#fff;background-color:#d58512;border-color:#b06d0f}.btn-outline-warning.disabled.focus,.btn-outline-warning.disabled:focus,.btn-outline-warning:disabled.focus,.btn-outline-warning:disabled:focus{border-color:#f8d9ac}.btn-outline-warning.disabled:hover,.btn-outline-warning:disabled:hover{border-color:#f8d9ac}.btn-outline-danger{color:#d9534f;background-image:none;background-color:transparent;border-color:#d9534f}.btn-outline-danger:hover{color:#fff;background-color:#d9534f;border-color:#d9534f}.btn-outline-danger.focus,.btn-outline-danger:focus{color:#fff;background-color:#d9534f;border-color:#d9534f}.btn-outline-danger.active,.btn-outline-danger:active,.open>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#d9534f;border-color:#d9534f}.btn-outline-danger.active.focus,.btn-outline-danger.active:focus,.btn-outline-danger.active:hover,.btn-outline-danger:active.focus,.btn-outline-danger:active:focus,.btn-outline-danger:active:hover,.open>.btn-outline-danger.dropdown-toggle.focus,.open>.btn-outline-danger.dropdown-toggle:focus,.open>.btn-outline-danger.dropdown-toggle:hover{color:#fff;background-color:#ac2925;border-color:#8b211e}.btn-outline-danger.disabled.focus,.btn-outline-danger.disabled:focus,.btn-outline-danger:disabled.focus,.btn-outline-danger:disabled:focus{border-color:#eba5a3}.btn-outline-danger.disabled:hover,.btn-outline-danger:disabled:hover{border-color:#eba5a3}.btn-link{font-weight:400;color:#0275d8;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link:disabled{background-color:transparent}.btn-link,.btn-link:active,.btn-link:focus{border-color:transparent}.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#014c8c;text-decoration:underline;background-color:transparent}.btn-link:disabled:focus,.btn-link:disabled:hover{color:#818a91;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height;-o-transition-property:height;transition-property:height}.dropdown,.dropup{position:relative}.dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.3em;vertical-align:middle;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-left:.3em solid transparent}.dropdown-toggle:focus{outline:0}.dropup .dropdown-toggle::after{border-top:0;border-bottom:.3em solid}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#373a3c;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-divider{height:1px;margin:.5rem 0;overflow:hidden;background-color:#e5e5e5}.dropdown-item{display:block;width:100%;padding:3px 1.5rem;clear:both;font-weight:400;color:#373a3c;text-align:inherit;white-space:nowrap;background:0 0;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#2b2d2f;text-decoration:none;background-color:#f5f5f5}.dropdown-item.active,.dropdown-item.active:focus,.dropdown-item.active:hover{color:#fff;text-decoration:none;background-color:#0275d8;outline:0}.dropdown-item.disabled,.dropdown-item.disabled:focus,.dropdown-item.disabled:hover{color:#818a91}.dropdown-item.disabled:focus,.dropdown-item.disabled:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:"progid:DXImageTransform.Microsoft.gradient(enabled = false)"}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#818a91;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:.3em solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:.125rem}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left;margin-bottom:0}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:2}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-.5rem}.btn-toolbar::after{content:"";display:table;clear:both}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:.5rem}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn+.dropdown-toggle-split::after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:1.125rem;padding-left:1.125rem}.btn .caret{margin-left:0}.btn-group-lg>.btn .caret,.btn-lg .caret{border-width:.3em .3em 0;border-bottom-width:0}.dropup .btn-group-lg>.btn .caret,.dropup .btn-lg .caret{border-width:0 .3em .3em}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group::after{content:"";display:table;clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;width:100%;display:table;border-collapse:separate}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:active,.input-group .form-control:focus,.input-group .form-control:hover{z-index:3}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.25;color:#55595c;text-align:center;background-color:#eceeef;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.input-group-addon.form-control-sm,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.input-group-addon.btn{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.input-group-addon.form-control-lg,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.input-group-addon.btn{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:.3rem}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:not(:last-child),.input-group-addon:not(:last-child),.input-group-btn:not(:first-child)>.btn-group:not(:last-child)>.btn,.input-group-btn:not(:first-child)>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:not(:last-child)>.btn,.input-group-btn:not(:last-child)>.btn-group>.btn,.input-group-btn:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:not(:last-child){border-right:0}.input-group .form-control:not(:first-child),.input-group-addon:not(:first-child),.input-group-btn:not(:first-child)>.btn,.input-group-btn:not(:first-child)>.btn-group>.btn,.input-group-btn:not(:first-child)>.dropdown-toggle,.input-group-btn:not(:last-child)>.btn-group:not(:first-child)>.btn,.input-group-btn:not(:last-child)>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.form-control+.input-group-addon:not(:first-child){border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:3}.input-group-btn:not(:last-child)>.btn,.input-group-btn:not(:last-child)>.btn-group{margin-right:-1px}.input-group-btn:not(:first-child)>.btn,.input-group-btn:not(:first-child)>.btn-group{z-index:2;margin-left:-1px}.input-group-btn:not(:first-child)>.btn-group:active,.input-group-btn:not(:first-child)>.btn-group:focus,.input-group-btn:not(:first-child)>.btn-group:hover,.input-group-btn:not(:first-child)>.btn:active,.input-group-btn:not(:first-child)>.btn:focus,.input-group-btn:not(:first-child)>.btn:hover{z-index:3}.custom-control{position:relative;display:inline-block;padding-left:1.5rem;cursor:pointer}.custom-control+.custom-control{margin-left:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-indicator{color:#fff;background-color:#0074d9}.custom-control-input:focus~.custom-control-indicator{-webkit-box-shadow:0 0 0 .075rem #fff,0 0 0 .2rem #0074d9;box-shadow:0 0 0 .075rem #fff,0 0 0 .2rem #0074d9}.custom-control-input:active~.custom-control-indicator{color:#fff;background-color:#84c6ff}.custom-control-input:disabled~.custom-control-indicator{cursor:not-allowed;background-color:#eee}.custom-control-input:disabled~.custom-control-description{color:#767676;cursor:not-allowed}.custom-control-indicator{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#ddd;background-repeat:no-repeat;background-position:center center;-webkit-background-size:50% 50%;background-size:50% 50%}.custom-checkbox .custom-control-indicator{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-indicator{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-indicator{background-color:#0074d9;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-radio .custom-control-indicator{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-indicator{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#fff'/%3E%3C/svg%3E")}.custom-controls-stacked .custom-control{float:left;clear:left}.custom-controls-stacked .custom-control+.custom-control{margin-left:0}.custom-select{display:inline-block;max-width:100%;height:calc(2.5rem - 2px);padding:.375rem 1.75rem .375rem .75rem;padding-right:.75rem\9;color:#55595c;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-image:none\9;-webkit-background-size:8px 10px;background-size:8px 10px;border:1px solid rgba(0,0,0,.15);border-radius:.25rem;-moz-appearance:none;-webkit-appearance:none}.custom-select:focus{border-color:#51a7e8;outline:0}.custom-select:focus::-ms-value{color:#55595c;background-color:#fff}.custom-select:disabled{color:#818a91;cursor:not-allowed;background-color:#eceeef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{padding-top:.375rem;padding-bottom:.375rem;font-size:75%}.custom-file{position:relative;display:inline-block;max-width:100%;height:2.5rem;cursor:pointer}.custom-file-input{min-width:14rem;max-width:100%;margin:0;filter:alpha(opacity=0);opacity:0}.custom-file-control{position:absolute;top:0;right:0;left:0;z-index:5;height:2.5rem;padding:.5rem 1rem;line-height:1.5;color:#555;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;border:1px solid #ddd;border-radius:.25rem}.custom-file-control:lang(en)::after{content:"Choose file..."}.custom-file-control::before{position:absolute;top:-1px;right:-1px;bottom:-1px;z-index:6;display:block;height:2.5rem;padding:.5rem 1rem;line-height:1.5;color:#555;background-color:#eee;border:1px solid #ddd;border-radius:0 .25rem .25rem 0}.custom-file-control:lang(en)::before{content:"Browse"}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:inline-block}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#818a91}.nav-link.disabled,.nav-link.disabled:focus,.nav-link.disabled:hover{color:#818a91;cursor:not-allowed;background-color:transparent}.nav-inline .nav-item{display:inline-block}.nav-inline .nav-item+.nav-item,.nav-inline .nav-link+.nav-link{margin-left:1rem}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs::after{content:"";display:table;clear:both}.nav-tabs .nav-item{float:left;margin-bottom:-1px}.nav-tabs .nav-item+.nav-item{margin-left:.2rem}.nav-tabs .nav-link{display:block;padding:.5em 1em;border:1px solid transparent;border-top-right-radius:.25rem;border-top-left-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#eceeef #eceeef #ddd}.nav-tabs .nav-link.disabled,.nav-tabs .nav-link.disabled:focus,.nav-tabs .nav-link.disabled:hover{color:#818a91;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.open .nav-link,.nav-tabs .nav-item.open .nav-link:focus,.nav-tabs .nav-item.open .nav-link:hover,.nav-tabs .nav-link.active,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-link.active:hover{color:#55595c;background-color:#fff;border-color:#ddd #ddd transparent}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.nav-pills::after{content:"";display:table;clear:both}.nav-pills .nav-item{float:left}.nav-pills .nav-item+.nav-item{margin-left:.2rem}.nav-pills .nav-link{display:block;padding:.5em 1em;border-radius:.25rem}.nav-pills .nav-item.open .nav-link,.nav-pills .nav-item.open .nav-link:focus,.nav-pills .nav-item.open .nav-link:hover,.nav-pills .nav-link.active,.nav-pills .nav-link.active:focus,.nav-pills .nav-link.active:hover{color:#fff;cursor:default;background-color:#0275d8}.nav-stacked .nav-item{display:block;float:none}.nav-stacked .nav-item+.nav-item{margin-top:.2rem;margin-left:0}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar::after{content:"";display:table;clear:both}@media (min-width:576px){.navbar{border-radius:.25rem}}.navbar-full{z-index:1000}@media (min-width:576px){.navbar-full{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:576px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0}.navbar-fixed-bottom{bottom:0}.navbar-sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1030;width:100%}@media (min-width:576px){.navbar-sticky-top{border-radius:0}}.navbar-brand{float:left;padding-top:.25rem;padding-bottom:.25rem;margin-right:1rem;font-size:1.25rem;line-height:inherit}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-divider{float:left;width:1px;padding-top:.425rem;padding-bottom:.425rem;margin-right:1rem;margin-left:1rem;overflow:hidden}.navbar-divider::before{content:"\00a0"}.navbar-text{display:inline-block;padding-top:.425rem;padding-bottom:.425rem}.navbar-toggler{width:2.5em;height:2em;padding:.5rem .75rem;font-size:1.25rem;line-height:1;background:transparent no-repeat center center;-webkit-background-size:24px 24px;background-size:24px 24px;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggleable-xs::after{content:"";display:table;clear:both}@media (max-width:575px){.navbar-toggleable-xs .navbar-brand{display:block;float:none;margin-top:.5rem;margin-right:0}.navbar-toggleable-xs .navbar-nav{margin-top:.5rem;margin-bottom:.5rem}.navbar-toggleable-xs .navbar-nav .dropdown-menu{position:static;float:none}}@media (min-width:576px){.navbar-toggleable-xs{display:block}}.navbar-toggleable-sm::after{content:"";display:table;clear:both}@media (max-width:767px){.navbar-toggleable-sm .navbar-brand{display:block;float:none;margin-top:.5rem;margin-right:0}.navbar-toggleable-sm .navbar-nav{margin-top:.5rem;margin-bottom:.5rem}.navbar-toggleable-sm .navbar-nav .dropdown-menu{position:static;float:none}}@media (min-width:768px){.navbar-toggleable-sm{display:block}}.navbar-toggleable-md::after{content:"";display:table;clear:both}@media (max-width:991px){.navbar-toggleable-md .navbar-brand{display:block;float:none;margin-top:.5rem;margin-right:0}.navbar-toggleable-md .navbar-nav{margin-top:.5rem;margin-bottom:.5rem}.navbar-toggleable-md .navbar-nav .dropdown-menu{position:static;float:none}}@media (min-width:992px){.navbar-toggleable-md{display:block}}.navbar-toggleable-lg::after{content:"";display:table;clear:both}@media (max-width:1199px){.navbar-toggleable-lg .navbar-brand{display:block;float:none;margin-top:.5rem;margin-right:0}.navbar-toggleable-lg .navbar-nav{margin-top:.5rem;margin-bottom:.5rem}.navbar-toggleable-lg .navbar-nav .dropdown-menu{position:static;float:none}}@media (min-width:1200px){.navbar-toggleable-lg{display:block}}.navbar-toggleable-xl{display:block}.navbar-toggleable-xl::after{content:"";display:table;clear:both}.navbar-toggleable-xl .navbar-brand{display:block;float:none;margin-top:.5rem;margin-right:0}.navbar-toggleable-xl .navbar-nav{margin-top:.5rem;margin-bottom:.5rem}.navbar-toggleable-xl .navbar-nav .dropdown-menu{position:static;float:none}.navbar-nav .nav-item{float:left}.navbar-nav .nav-link{display:block;padding-top:.425rem;padding-bottom:.425rem}.navbar-nav .nav-link+.nav-link{margin-left:1rem}.navbar-nav .nav-item+.nav-item{margin-left:1rem}.navbar-light .navbar-brand,.navbar-light .navbar-toggler{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover,.navbar-light .navbar-toggler:focus,.navbar-light .navbar-toggler:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .active>.nav-link:focus,.navbar-light .navbar-nav .active>.nav-link:hover,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.active:focus,.navbar-light .navbar-nav .nav-link.active:hover,.navbar-light .navbar-nav .nav-link.open,.navbar-light .navbar-nav .nav-link.open:focus,.navbar-light .navbar-nav .nav-link.open:hover,.navbar-light .navbar-nav .open>.nav-link,.navbar-light .navbar-nav .open>.nav-link:focus,.navbar-light .navbar-nav .open>.nav-link:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");border-color:rgba(0,0,0,.1)}.navbar-light .navbar-divider{background-color:rgba(0,0,0,.075)}.navbar-dark .navbar-brand,.navbar-dark .navbar-toggler{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover,.navbar-dark .navbar-toggler:focus,.navbar-dark .navbar-toggler:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .active>.nav-link:focus,.navbar-dark .navbar-nav .active>.nav-link:hover,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.active:focus,.navbar-dark .navbar-nav .nav-link.active:hover,.navbar-dark .navbar-nav .nav-link.open,.navbar-dark .navbar-nav .nav-link.open:focus,.navbar-dark .navbar-nav .nav-link.open:hover,.navbar-dark .navbar-nav .open>.nav-link,.navbar-dark .navbar-nav .open>.nav-link:focus,.navbar-dark .navbar-nav .open>.nav-link:hover{color:#fff}.navbar-dark .navbar-toggler{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-divider{background-color:rgba(255,255,255,.075)}.navbar-toggleable-xs::after{content:"";display:table;clear:both}@media (max-width:575px){.navbar-toggleable-xs .navbar-nav .nav-item{float:none;margin-left:0}}@media (min-width:576px){.navbar-toggleable-xs{display:block!important}}.navbar-toggleable-sm::after{content:"";display:table;clear:both}@media (max-width:767px){.navbar-toggleable-sm .navbar-nav .nav-item{float:none;margin-left:0}}@media (min-width:768px){.navbar-toggleable-sm{display:block!important}}.navbar-toggleable-md::after{content:"";display:table;clear:both}@media (max-width:991px){.navbar-toggleable-md .navbar-nav .nav-item{float:none;margin-left:0}}@media (min-width:992px){.navbar-toggleable-md{display:block!important}}.card{position:relative;display:block;margin-bottom:.75rem;background-color:#fff;border-radius:.25rem;border:1px solid rgba(0,0,0,.125)}.card-block{padding:1.25rem}.card-block::after{content:"";display:table;clear:both}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card>.list-group:first-child .list-group-item:first-child{border-top-right-radius:.25rem;border-top-left-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:#f5f5f5;border-bottom:1px solid rgba(0,0,0,.125)}.card-header::after{content:"";display:table;clear:both}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:#f5f5f5;border-top:1px solid rgba(0,0,0,.125)}.card-footer::after{content:"";display:table;clear:both}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-primary{background-color:#0275d8;border-color:#0275d8}.card-primary .card-footer,.card-primary .card-header{background-color:transparent}.card-success{background-color:#5cb85c;border-color:#5cb85c}.card-success .card-footer,.card-success .card-header{background-color:transparent}.card-info{background-color:#5bc0de;border-color:#5bc0de}.card-info .card-footer,.card-info .card-header{background-color:transparent}.card-warning{background-color:#f0ad4e;border-color:#f0ad4e}.card-warning .card-footer,.card-warning .card-header{background-color:transparent}.card-danger{background-color:#d9534f;border-color:#d9534f}.card-danger .card-footer,.card-danger .card-header{background-color:transparent}.card-outline-primary{background-color:transparent;border-color:#0275d8}.card-outline-secondary{background-color:transparent;border-color:#ccc}.card-outline-info{background-color:transparent;border-color:#5bc0de}.card-outline-success{background-color:transparent;border-color:#5cb85c}.card-outline-warning{background-color:transparent;border-color:#f0ad4e}.card-outline-danger{background-color:transparent;border-color:#d9534f}.card-inverse .card-footer,.card-inverse .card-header{border-color:rgba(255,255,255,.2)}.card-inverse .card-blockquote,.card-inverse .card-footer,.card-inverse .card-header,.card-inverse .card-title{color:#fff}.card-inverse .card-blockquote .blockquote-footer,.card-inverse .card-link,.card-inverse .card-subtitle,.card-inverse .card-text{color:rgba(255,255,255,.65)}.card-inverse .card-link:focus,.card-inverse .card-link:hover{color:#fff}.card-blockquote{padding:0;margin-bottom:0;border-left:0}.card-img{border-radius:calc(.25rem - 1px)}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img-top{border-top-right-radius:calc(.25rem - 1px);border-top-left-radius:calc(.25rem - 1px)}.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}@media (min-width:576px){.card-deck{display:table;width:100%;margin-bottom:.75rem;table-layout:fixed;border-spacing:1.25rem 0}.card-deck .card{display:table-cell;margin-bottom:0;vertical-align:top}.card-deck-wrapper{margin-right:-1.25rem;margin-left:-1.25rem}}@media (min-width:576px){.card-group{display:table;width:100%;table-layout:fixed}.card-group .card{display:table-cell;vertical-align:top}.card-group .card+.card{margin-left:0;border-left:0}.card-group .card:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.card-group .card:first-child .card-img-top{border-top-right-radius:0}.card-group .card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group .card:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.card-group .card:last-child .card-img-top{border-top-left-radius:0}.card-group .card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group .card:not(:first-child):not(:last-child){border-radius:0}.card-group .card:not(:first-child):not(:last-child) .card-img-bottom,.card-group .card:not(:first-child):not(:last-child) .card-img-top{border-radius:0}}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#eceeef;border-radius:.25rem}.breadcrumb::after{content:"";display:table;clear:both}.breadcrumb-item{float:left}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#818a91;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#818a91}.pagination{display:inline-block;padding-left:0;margin-top:1rem;margin-bottom:1rem;border-radius:.25rem}.page-item{display:inline}.page-item:first-child .page-link{margin-left:0;border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.page-item:last-child .page-link{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.page-item.active .page-link,.page-item.active .page-link:focus,.page-item.active .page-link:hover{z-index:2;color:#fff;cursor:default;background-color:#0275d8;border-color:#0275d8}.page-item.disabled .page-link,.page-item.disabled .page-link:focus,.page-item.disabled .page-link:hover{color:#818a91;pointer-events:none;cursor:not-allowed;background-color:#fff;border-color:#ddd}.page-link{position:relative;float:left;padding:.5rem .75rem;margin-left:-1px;color:#0275d8;text-decoration:none;background-color:#fff;border:1px solid #ddd}.page-link:focus,.page-link:hover{color:#014c8c;background-color:#eceeef;border-color:#ddd}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem}.pagination-lg .page-item:first-child .page-link{border-bottom-left-radius:.3rem;border-top-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-bottom-right-radius:.3rem;border-top-right-radius:.3rem}.pagination-sm .page-link{padding:.275rem .75rem;font-size:.875rem}.pagination-sm .page-item:first-child .page-link{border-bottom-left-radius:.2rem;border-top-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-bottom-right-radius:.2rem;border-top-right-radius:.2rem}.tag{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.tag:empty{display:none}.btn .tag{position:relative;top:-1px}a.tag:focus,a.tag:hover{color:#fff;text-decoration:none;cursor:pointer}.tag-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.tag-default{background-color:#818a91}.tag-default[href]:focus,.tag-default[href]:hover{background-color:#687077}.tag-primary{background-color:#0275d8}.tag-primary[href]:focus,.tag-primary[href]:hover{background-color:#025aa5}.tag-success{background-color:#5cb85c}.tag-success[href]:focus,.tag-success[href]:hover{background-color:#449d44}.tag-info{background-color:#5bc0de}.tag-info[href]:focus,.tag-info[href]:hover{background-color:#31b0d5}.tag-warning{background-color:#f0ad4e}.tag-warning[href]:focus,.tag-warning[href]:hover{background-color:#ec971f}.tag-danger{background-color:#d9534f}.tag-danger[href]:focus,.tag-danger[href]:hover{background-color:#c9302c}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#eceeef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-hr{border-top-color:#d0d5d8}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:2.5rem}.alert-dismissible .close{position:relative;top:-.125rem;right:-1.25rem;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d0e9c6;color:#3c763d}.alert-success hr{border-top-color:#c1e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bcdff1;color:#31708f}.alert-info hr{border-top-color:#a6d5ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faf2cc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7ecb5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebcccc;color:#a94442}.alert-danger hr{border-top-color:#e4b9b9}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:block;width:100%;height:1rem;margin-bottom:1rem}.progress[value]{background-color:#eee;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem}.progress[value]::-ms-fill{background-color:#0074d9;border:0}.progress[value]::-moz-progress-bar{background-color:#0074d9;border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.progress[value]::-webkit-progress-value{background-color:#0074d9;border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.progress[value="100"]::-moz-progress-bar{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.progress[value="100"]::-webkit-progress-value{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.progress[value]::-webkit-progress-bar{background-color:#eee;border-radius:.25rem}.progress[value],base::-moz-progress-bar{background-color:#eee;border-radius:.25rem}@media screen and (min-width:0\0){.progress{background-color:#eee;border-radius:.25rem}.progress-bar{display:inline-block;height:1rem;text-indent:-999rem;background-color:#0074d9;border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.progress[width="100%"]{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}}.progress-striped[value]::-webkit-progress-value{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:1rem 1rem;background-size:1rem 1rem}.progress-striped[value]::-moz-progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-striped[value]::-ms-fill{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}@media screen and (min-width:0\0){.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:1rem 1rem;background-size:1rem 1rem}}.progress-animated[value]::-webkit-progress-value{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-animated[value]::-moz-progress-bar{animation:progress-bar-stripes 2s linear infinite}@media screen and (min-width:0\0){.progress-animated .progress-bar-striped{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}}.progress-success[value]::-webkit-progress-value{background-color:#5cb85c}.progress-success[value]::-moz-progress-bar{background-color:#5cb85c}.progress-success[value]::-ms-fill{background-color:#5cb85c}@media screen and (min-width:0\0){.progress-success .progress-bar{background-color:#5cb85c}}.progress-info[value]::-webkit-progress-value{background-color:#5bc0de}.progress-info[value]::-moz-progress-bar{background-color:#5bc0de}.progress-info[value]::-ms-fill{background-color:#5bc0de}@media screen and (min-width:0\0){.progress-info .progress-bar{background-color:#5bc0de}}.progress-warning[value]::-webkit-progress-value{background-color:#f0ad4e}.progress-warning[value]::-moz-progress-bar{background-color:#f0ad4e}.progress-warning[value]::-ms-fill{background-color:#f0ad4e}@media screen and (min-width:0\0){.progress-warning .progress-bar{background-color:#f0ad4e}}.progress-danger[value]::-webkit-progress-value{background-color:#d9534f}.progress-danger[value]::-moz-progress-bar{background-color:#d9534f}.progress-danger[value]::-ms-fill{background-color:#d9534f}@media screen and (min-width:0\0){.progress-danger .progress-bar{background-color:#d9534f}}.media,.media-body{overflow:hidden}.media-body{width:10000px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right{padding-left:10px}.media-left{padding-right:10px}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:0}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:.25rem;border-top-left-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#818a91;cursor:not-allowed;background-color:#eceeef}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#818a91}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;text-decoration:none;background-color:#0275d8;border-color:#0275d8}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#a8d6fe}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-item-action{width:100%;color:#555;text-align:inherit}.list-group-item-action .list-group-item-heading{color:#333}.list-group-item-action:focus,.list-group-item-action:hover{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9{padding-bottom:42.857143%}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.embed-responsive-1by1{padding-bottom:100%}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out,-o-transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.in{opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header::after{content:"";display:table;clear:both}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.5}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer::after{content:"";display:table;clear:both}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:600px;margin:30px auto}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.in{opacity:.9}.tooltip.bs-tether-element-attached-bottom,.tooltip.tooltip-top{padding:5px 0;margin-top:-3px}.tooltip.bs-tether-element-attached-bottom .tooltip-inner::before,.tooltip.tooltip-top .tooltip-inner::before{bottom:0;left:50%;margin-left:-5px;content:"";border-width:5px 5px 0;border-top-color:#000}.tooltip.bs-tether-element-attached-left,.tooltip.tooltip-right{padding:0 5px;margin-left:3px}.tooltip.bs-tether-element-attached-left .tooltip-inner::before,.tooltip.tooltip-right .tooltip-inner::before{top:50%;left:0;margin-top:-5px;content:"";border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.bs-tether-element-attached-top,.tooltip.tooltip-bottom{padding:5px 0;margin-top:3px}.tooltip.bs-tether-element-attached-top .tooltip-inner::before,.tooltip.tooltip-bottom .tooltip-inner::before{top:0;left:50%;margin-left:-5px;content:"";border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bs-tether-element-attached-right,.tooltip.tooltip-left{padding:0 5px;margin-left:-3px}.tooltip.bs-tether-element-attached-right .tooltip-inner::before,.tooltip.tooltip-left .tooltip-inner::before{top:50%;right:0;margin-top:-5px;content:"";border-width:5px 0 5px 5px;border-left-color:#000}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.tooltip-inner::before{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;padding:1px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;font-size:.875rem;word-wrap:break-word;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover.bs-tether-element-attached-bottom,.popover.popover-top{margin-top:-10px}.popover.bs-tether-element-attached-bottom::after,.popover.bs-tether-element-attached-bottom::before,.popover.popover-top::after,.popover.popover-top::before{left:50%;border-bottom-width:0}.popover.bs-tether-element-attached-bottom::before,.popover.popover-top::before{bottom:-11px;margin-left:-11px;border-top-color:rgba(0,0,0,.25)}.popover.bs-tether-element-attached-bottom::after,.popover.popover-top::after{bottom:-10px;margin-left:-10px;border-top-color:#fff}.popover.bs-tether-element-attached-left,.popover.popover-right{margin-left:10px}.popover.bs-tether-element-attached-left::after,.popover.bs-tether-element-attached-left::before,.popover.popover-right::after,.popover.popover-right::before{top:50%;border-left-width:0}.popover.bs-tether-element-attached-left::before,.popover.popover-right::before{left:-11px;margin-top:-11px;border-right-color:rgba(0,0,0,.25)}.popover.bs-tether-element-attached-left::after,.popover.popover-right::after{left:-10px;margin-top:-10px;border-right-color:#fff}.popover.bs-tether-element-attached-top,.popover.popover-bottom{margin-top:10px}.popover.bs-tether-element-attached-top::after,.popover.bs-tether-element-attached-top::before,.popover.popover-bottom::after,.popover.popover-bottom::before{left:50%;border-top-width:0}.popover.bs-tether-element-attached-top::before,.popover.popover-bottom::before{top:-11px;margin-left:-11px;border-bottom-color:rgba(0,0,0,.25)}.popover.bs-tether-element-attached-top::after,.popover.popover-bottom::after{top:-10px;margin-left:-10px;border-bottom-color:#f7f7f7}.popover.bs-tether-element-attached-top .popover-title::before,.popover.popover-bottom .popover-title::before{position:absolute;top:0;left:50%;display:block;width:20px;margin-left:-10px;content:"";border-bottom:1px solid #f7f7f7}.popover.bs-tether-element-attached-right,.popover.popover-left{margin-left:-10px}.popover.bs-tether-element-attached-right::after,.popover.bs-tether-element-attached-right::before,.popover.popover-left::after,.popover.popover-left::before{top:50%;border-right-width:0}.popover.bs-tether-element-attached-right::before,.popover.popover-left::before{right:-11px;margin-top:-11px;border-left-color:rgba(0,0,0,.25)}.popover.bs-tether-element-attached-right::after,.popover.popover-left::after{right:-10px;margin-top:-10px;border-left-color:#fff}.popover-title{padding:8px 14px;margin:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:.2375rem .2375rem 0 0}.popover-title:empty{display:none}.popover-content{padding:9px 14px}.popover::after,.popover::before{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover::before{content:"";border-width:11px}.popover::after{content:"";border-width:10px}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.carousel-item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.carousel-item>a>img,.carousel-inner>.carousel-item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.carousel-item{-webkit-transition:-webkit-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out,-o-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.carousel-item.active.right,.carousel-inner>.carousel-item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.carousel-item.active.left,.carousel-inner>.carousel-item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.carousel-item.active,.carousel-inner>.carousel-item.next.left,.carousel-inner>.carousel-item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);opacity:.5}.carousel-control.left{background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0%,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0%,rgba(0,0,0,.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,.5) 0%,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{right:0;left:auto;background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0%,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0%,rgba(0,0,0,.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0%,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;width:20px;height:20px;margin-top:-10px;font-family:serif;line-height:1}.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-prev::before{content:"\2039"}.carousel-control .icon-next::before{content:"\203a"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:transparent;border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media (min-width:576px){.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .icon-prev{margin-left:-15px}.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-faded{background-color:#f7f7f9}.bg-primary{background-color:#0275d8!important}a.bg-primary:focus,a.bg-primary:hover{background-color:#025aa5!important}.bg-success{background-color:#5cb85c!important}a.bg-success:focus,a.bg-success:hover{background-color:#449d44!important}.bg-info{background-color:#5bc0de!important}a.bg-info:focus,a.bg-info:hover{background-color:#31b0d5!important}.bg-warning{background-color:#f0ad4e!important}a.bg-warning:focus,a.bg-warning:hover{background-color:#ec971f!important}.bg-danger{background-color:#d9534f!important}a.bg-danger:focus,a.bg-danger:hover{background-color:#c9302c!important}.bg-inverse{background-color:#373a3c!important}a.bg-inverse:focus,a.bg-inverse:hover{background-color:#1f2021!important}.rounded{border-radius:.25rem}.rounded-top{border-top-right-radius:.25rem;border-top-left-radius:.25rem}.rounded-right{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.rounded-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-left{border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.rounded-circle{border-radius:50%}.clearfix::after{content:"";display:table;clear:both}.d-block{display:block!important}.d-inline-block{display:inline-block!important}.d-inline{display:inline!important}.float-xs-left{float:left!important}.float-xs-right{float:right!important}.float-xs-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.w-100{width:100%!important}.h-100{height:100%!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.m-0{margin:0 0!important}.mt-0{margin-top:0!important}.mr-0{margin-right:0!important}.mb-0{margin-bottom:0!important}.ml-0{margin-left:0!important}.mx-0{margin-right:0!important;margin-left:0!important}.my-0{margin-top:0!important;margin-bottom:0!important}.m-1{margin:1rem 1rem!important}.mt-1{margin-top:1rem!important}.mr-1{margin-right:1rem!important}.mb-1{margin-bottom:1rem!important}.ml-1{margin-left:1rem!important}.mx-1{margin-right:1rem!important;margin-left:1rem!important}.my-1{margin-top:1rem!important;margin-bottom:1rem!important}.m-2{margin:1.5rem 1.5rem!important}.mt-2{margin-top:1.5rem!important}.mr-2{margin-right:1.5rem!important}.mb-2{margin-bottom:1.5rem!important}.ml-2{margin-left:1.5rem!important}.mx-2{margin-right:1.5rem!important;margin-left:1.5rem!important}.my-2{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.m-3{margin:3rem 3rem!important}.mt-3{margin-top:3rem!important}.mr-3{margin-right:3rem!important}.mb-3{margin-bottom:3rem!important}.ml-3{margin-left:3rem!important}.mx-3{margin-right:3rem!important;margin-left:3rem!important}.my-3{margin-top:3rem!important;margin-bottom:3rem!important}.p-0{padding:0 0!important}.pt-0{padding-top:0!important}.pr-0{padding-right:0!important}.pb-0{padding-bottom:0!important}.pl-0{padding-left:0!important}.px-0{padding-right:0!important;padding-left:0!important}.py-0{padding-top:0!important;padding-bottom:0!important}.p-1{padding:1rem 1rem!important}.pt-1{padding-top:1rem!important}.pr-1{padding-right:1rem!important}.pb-1{padding-bottom:1rem!important}.pl-1{padding-left:1rem!important}.px-1{padding-right:1rem!important;padding-left:1rem!important}.py-1{padding-top:1rem!important;padding-bottom:1rem!important}.p-2{padding:1.5rem 1.5rem!important}.pt-2{padding-top:1.5rem!important}.pr-2{padding-right:1.5rem!important}.pb-2{padding-bottom:1.5rem!important}.pl-2{padding-left:1.5rem!important}.px-2{padding-right:1.5rem!important;padding-left:1.5rem!important}.py-2{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.p-3{padding:3rem 3rem!important}.pt-3{padding-top:3rem!important}.pr-3{padding-right:3rem!important}.pb-3{padding-bottom:3rem!important}.pl-3{padding-left:3rem!important}.px-3{padding-right:3rem!important;padding-left:3rem!important}.py-3{padding-top:3rem!important;padding-bottom:3rem!important}.pos-f-t{position:fixed;top:0;right:0;left:0;z-index:1030}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-xs-left{text-align:left!important}.text-xs-right{text-align:right!important}.text-xs-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-normal{font-weight:400}.font-weight-bold{font-weight:700}.font-italic{font-style:italic}.text-white{color:#fff!important}.text-muted{color:#818a91!important}a.text-muted:focus,a.text-muted:hover{color:#687077!important}.text-primary{color:#0275d8!important}a.text-primary:focus,a.text-primary:hover{color:#025aa5!important}.text-success{color:#5cb85c!important}a.text-success:focus,a.text-success:hover{color:#449d44!important}.text-info{color:#5bc0de!important}a.text-info:focus,a.text-info:hover{color:#31b0d5!important}.text-warning{color:#f0ad4e!important}a.text-warning:focus,a.text-warning:hover{color:#ec971f!important}.text-danger{color:#d9534f!important}a.text-danger:focus,a.text-danger:hover{color:#c9302c!important}.text-gray-dark{color:#373a3c!important}a.text-gray-dark:focus,a.text-gray-dark:hover{color:#1f2021!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.invisible{visibility:hidden!important}.hidden-xs-up{display:none!important}@media (max-width:575px){.hidden-xs-down{display:none!important}}@media (min-width:576px){.hidden-sm-up{display:none!important}}@media (max-width:767px){.hidden-sm-down{display:none!important}}@media (min-width:768px){.hidden-md-up{display:none!important}}@media (max-width:991px){.hidden-md-down{display:none!important}}@media (min-width:992px){.hidden-lg-up{display:none!important}}@media (max-width:1199px){.hidden-lg-down{display:none!important}}@media (min-width:1200px){.hidden-xl-up{display:none!important}}.hidden-xl-down{display:none!important}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/manager/media/style/common/bootstrap/css/bootstrap.min.css.map b/manager/media/style/common/bootstrap/css/bootstrap.min.css.map new file mode 100644 index 0000000000..e69de29bb2 diff --git a/manager/media/style/common/login.tpl b/manager/media/style/common/login.tpl old mode 100755 new mode 100644 index 9b6d6e360a..8edd88d635 --- a/manager/media/style/common/login.tpl +++ b/manager/media/style/common/login.tpl @@ -325,7 +325,7 @@ -
                              [+site_name+]MODX Evolution
                              +
                              [(site_name)]MODX Evolution
                              @@ -348,7 +348,7 @@
                              - © 2005-2016 by MODX®, and licensed under the GPL. + © 2005-2017 by MODX®, and licensed under the GPL.
                              diff --git a/manager/media/style/common/manager.lockout.tpl b/manager/media/style/common/manager.lockout.tpl index 25a9401366..dd77f5bb21 100644 --- a/manager/media/style/common/manager.lockout.tpl +++ b/manager/media/style/common/manager.lockout.tpl @@ -1,89 +1,84 @@ - - + + -MODX Content Manager - - - - - - - + MODX Content Manager + + + + + + +
                              -
                              - - -
                              - [+logo_slogan+] -
                              - + + +
                              + [%logo_slogan%] +
                              + +
                              +

                              [(site_name)]

                              -
                              -

                              [+site_name+]

                              +
                              [+manager_lockout_message+]
                              -
                              [+manager_lockout_message+]
                              +
                              +   + +
                              +
                              -
                              +
                              -   - -
                              -
                              - -
                              - -
                              +
                              -

                              - MODX™ is licensed under the GPL license. © 2005-2016 MODX. + MODX™ is licensed under the GPL license. © 2005-2017 MODX.

                              - diff --git a/manager/media/style/common/welcome.tpl b/manager/media/style/common/welcome.tpl index 6622e93117..853f9de43c 100644 --- a/manager/media/style/common/welcome.tpl +++ b/manager/media/style/common/welcome.tpl @@ -1,108 +1,112 @@
                              -
                              - [+logout_reminder_msg+] -
                              - -
                              - [+multiple_sessions_msg+] -
                              - - +
                              + [+logout_reminder_msg+] +
                              + +
                              + [+multiple_sessions_msg+] +
                              +
                              - +
                              -[+OnManagerWelcomePrerender+] -

                              [+site_name+]

                              - -
                              [+welcome_title+]
                              + [+OnManagerWelcomePrerender+] +

                              [(site_name)]

                              + +
                              [%welcome_title%]
                              - - - - - - - - -
                              -

                              [+site_name+]

                              - [+welcome_title+] -
                              - [+logo_slogan+] -

                              -
                              - [+SecurityIcon+] - [+WebUserIcon+] - [+ModulesIcon+] - [+ResourcesIcon+] - [+BackupIcon+] -

                              - [+MessageInfo+] -
                              + + + + + + + + +
                              +

                              [(site_name)]

                              + [%welcome_title%] +
                              + [%logo_slogan%] +

                              +
                              + [+SecurityIcon+] + [+WebUserIcon+] + [+ModulesIcon+] + [+ResourcesIcon+] + [+BackupIcon+] +

                              + [+MessageInfo+] +
                              -[+OnManagerWelcomeHome+] + [+OnManagerWelcomeHome+]
                              - +
                              -

                              [+settings_config+]

                              - -
                              [+configcheck_title+]
                              +

                              [%settings_config%]

                              + +
                              [%configcheck_title%]
                              - + [+config_check_results+]
                              - +
                              -

                              [+modx_news+]

                              - -
                              [+modx_news_title+]
                              +

                              [%modx_news_tab%]

                              + +
                              [%modx_news_title%]
                              +
                              [+modx_news_content+]
                              -
                              +
                              -

                              [+modx_security_notices+]

                              - -
                              [+modx_security_notices_title+]
                              +

                              [%security_notices_tab%]

                              + +
                              [%security_notices_title%]
                              +
                              [+modx_security_notices_content+]
                              -

                              [+recent_docs+]

                              - -
                              [+activity_title+]
                              +

                              [%recent_docs%]

                              + +
                              [%activity_title%]
                              +
                              [+RecentInfo+]
                              -

                              [+info+]

                              - -
                              [+yourinfo_title+]
                              +

                              [%info%]

                              + +
                              [%yourinfo_title%]
                              +
                              [+UserInfo+]
                              -

                              [+online+]

                              - -
                              [+onlineusers_title+]
                              +

                              [%online%]

                              + +
                              [%onlineusers_title%]
                              +
                              [+OnlineInfo+]
                              -[+OnManagerWelcomeRender+] + [+OnManagerWelcomeRender+]
                              -
                              \ No newline at end of file +
                              diff --git a/manager/processors/cache_sync.class.processor.php b/manager/processors/cache_sync.class.processor.php index f8d3287056..17fa6e9c1c 100644 --- a/manager/processors/cache_sync.class.processor.php +++ b/manager/processors/cache_sync.class.processor.php @@ -180,13 +180,20 @@ public function buildCache($modx) { // get aliases modx: support for alias path $tmpPath = ''; $tmpPHP .= '$this->aliasListing=array();'; - $tmpPHP .= '$a=&$this->aliasListing;'; - $tmpPHP .= '$d=&$this->documentListing;'; - $tmpPHP .= '$m=&$this->documentMap;'; + $tmpPHP .= '$a=&$this->aliasListing;'; + $tmpPHP .= '$d=&$this->documentListing;'; + $tmpPHP .= '$m=&$this->documentMap;'; + + $tableName = $modx->getFullTableName( 'site_content' ); + if ($config['aliaslistingfolder'] == 1) { - $rs = $modx->db->select('IF(alias=\'\', id, alias) AS alias, id, parent, isfolder, alias_visible', $modx->getFullTableName('site_content'), 'deleted=0 and isfolder=1', 'parent, menuindex'); + $rs = $modx->db->query( "SELECT IF( c.alias = '', c.id, c.alias) AS alias, c.id, c.parent, c.isfolder, c.alias_visible + FROM $tableName c + LEFT JOIN $tableName p ON p.id = c.parent + WHERE c.deleted = '0' AND ( c.isfolder = '1' OR p.alias_visible = '0' ) + ORDER BY c.parent, c.menuindex" ); }else{ - $rs = $modx->db->select('IF(alias=\'\', id, alias) AS alias, id, parent, isfolder, alias_visible', $modx->getFullTableName('site_content'), 'deleted=0', 'parent, menuindex'); + $rs = $modx->db->select('IF(alias=\'\', id, alias) AS alias, id, parent, isfolder, alias_visible', $tableName, 'deleted=0', 'parent, menuindex'); } while ($tmp1 = $modx->db->getRow($rs)) { if ($config['friendly_urls'] == 1 && $config['use_alias_path'] == 1) { @@ -201,7 +208,7 @@ public function buildCache($modx) { } // get content types - $rs = $modx->db->select('id, contentType', $modx->getFullTableName('site_content'), "contentType != 'text/html'"); + $rs = $modx->db->select('id, contentType', $tableName, "contentType != 'text/html'"); $tmpPHP .= '$c = &$this->contentTypes;'; while ($tmp1 = $modx->db->getRow($rs)) { $tmpPHP .= '$c[' . $tmp1['id'] . ']' . " = '" . $this->escapeSingleQuotes($tmp1['contentType']) . "';"; diff --git a/manager/processors/delete_content.processor.php b/manager/processors/delete_content.processor.php old mode 100755 new mode 100644 index 7ada6d5302..e0b9dc91c3 --- a/manager/processors/delete_content.processor.php +++ b/manager/processors/delete_content.processor.php @@ -121,6 +121,6 @@ function getChildren($parent) { $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?r=1&a=7&id=$pid&dv=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); ?> \ No newline at end of file diff --git a/manager/processors/delete_template.processor.php b/manager/processors/delete_template.processor.php old mode 100755 new mode 100644 index 96c351c3f2..df888fc216 --- a/manager/processors/delete_template.processor.php +++ b/manager/processors/delete_template.processor.php @@ -1,39 +1,46 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('delete_template')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$id = isset($_GET['id'])? intval($_GET['id']) : 0; -if($id==0) { +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; +if($id == 0) { $modx->webAlertAndQuit($_lang["error_no_id"]); } // delete the template, but first check it doesn't have any documents using it $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); $limit = $modx->db->getRecordCount($rs); -if($limit>0) { +if($limit > 0) { include "header.inc.php"; - ?>

                              -
                              -
                              -

                              This template is in use.

                              -

                              Please set the documents using the template to another template.

                              -

                              Documents using this template:

                              -
                                - db->getRow($rs)) { - echo '
                              • '.$row['pagetitle'].''.($row['introtext']!='' ? ' - '.$row['introtext'] : '').'
                              • '; - } ?> -
                              -
                              + +

                              + +
                              +
                              +
                              +

                              This template is in use.

                              +

                              Please set the documents using the template to another template.

                              +

                              Documents using this template:

                              +
                                + db->getRow($rs)) { + echo '
                              • ' . $row['pagetitle'] . '' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '
                              • '; + } + ?> +
                              +
                              +
                              webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); } @@ -42,9 +49,8 @@ $_SESSION['itemname'] = $name; // invoke OnBeforeTempFormDelete event -$modx->invokeEvent("OnBeforeTempFormDelete", - array( - "id" => $id +$modx->invokeEvent("OnBeforeTempFormDelete", array( + "id" => $id )); // delete the document. @@ -53,15 +59,14 @@ $modx->db->delete($modx->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // invoke OnTempFormDelete event -$modx->invokeEvent("OnTempFormDelete", - array( - "id" => $id +$modx->invokeEvent("OnTempFormDelete", array( + "id" => $id )); // empty cache $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?a=76&r=2"; +$header = "Location: index.php?a=76&r=2"; header($header); ?> \ No newline at end of file diff --git a/manager/processors/delete_tmplvars.processor.php b/manager/processors/delete_tmplvars.processor.php old mode 100755 new mode 100644 index 169b84fe36..448c5eea63 --- a/manager/processors/delete_tmplvars.processor.php +++ b/manager/processors/delete_tmplvars.processor.php @@ -1,57 +1,56 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('delete_template')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$id = isset($_GET['id'])? intval($_GET['id']) : 0; -if($id==0) { +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; +if($id == 0) { $modx->webAlertAndQuit($_lang["error_no_id"]); } -$forced = isset($_GET['force'])? $_GET['force'] : 0; +$forced = isset($_GET['force']) ? $_GET['force'] : 0; // check for relations if(!$forced) { - $drs = $modx->db->select( - 'sc.id, sc.pagetitle,sc.description', - $modx->getFullTableName('site_content')." AS sc - INNER JOIN ".$modx->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", - "stcv.tmplvarid='{$id}'" - ); + $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc + INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); $count = $modx->db->getRecordCount($drs); - if($count>0){ + if($count > 0) { include_once "header.inc.php"; -?> - -

                              + ?> + -
                              - -
                              +

                              -
                              -
                              -
                              -".$_lang['tmplvar_inuse']."

                              "; +
                              + +
                              + +
                              +
                              +
                              + " . $_lang['tmplvar_inuse'] . "

                              "; echo "
                                "; - while ($row = $modx->db->getRow($drs)) { - echo '
                              • '.$row['pagetitle'].''.($row['description']!='' ? ' - '.$row['description'] : '').'
                              • '; + while($row = $modx->db->getRow($drs)) { + echo '
                              • ' . $row['pagetitle'] . '' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '
                              • '; } echo "
                              "; echo '
                              '; - echo '
                              '; + echo '
                              '; include_once "footer.inc.php"; exit; - } + } } // Set the item name for logger @@ -59,9 +58,8 @@ function deletedocument() { $_SESSION['itemname'] = $name; // invoke OnBeforeTVFormDelete event -$modx->invokeEvent("OnBeforeTVFormDelete", - array( - "id" => $id +$modx->invokeEvent("OnBeforeTVFormDelete", array( + "id" => $id )); // delete variable @@ -77,15 +75,14 @@ function deletedocument() { $modx->db->delete($modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // invoke OnTVFormDelete event -$modx->invokeEvent("OnTVFormDelete", - array( - "id" => $id +$modx->invokeEvent("OnTVFormDelete", array( + "id" => $id )); // empty cache $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?a=76&r=2"; +$header = "Location: index.php?a=76&r=2"; header($header); ?> \ No newline at end of file diff --git a/manager/processors/login.processor.php b/manager/processors/login.processor.php index 93572509f9..aa1106ea18 100755 --- a/manager/processors/login.processor.php +++ b/manager/processors/login.processor.php @@ -24,9 +24,6 @@ $modx->getSettings(); $etomite = &$modx; -// get the settings from the database -include_once("{$core_path}settings.inc.php"); - // include_once the language file $_lang = array(); include_once("{$core_path}lang/english.inc.php"); diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php old mode 100755 new mode 100644 index 5d0b1815e7..dae281b419 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -94,7 +94,7 @@ function allChildren($currDocID) { // empty cache & sync site $modx->clearCache('full'); - $header="Location: index.php?r=1&id={$documentID}&a=7"; + $header="Location: index.php?a=3&id={$documentID}&r=1"; header($header); } else { $modx->webAlertAndQuit("You cannot move a document to a child document!"); diff --git a/manager/processors/publish_content.processor.php b/manager/processors/publish_content.processor.php old mode 100755 new mode 100644 index 64901777e4..fb5864abc1 --- a/manager/processors/publish_content.processor.php +++ b/manager/processors/publish_content.processor.php @@ -55,10 +55,7 @@ // empty cache $modx->clearCache('full'); -//$header="Location: index.php?r=1&id=$id&a=7"; - -// webber -$header="Location: index.php?r=1&id=$pid&a=7&dv=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); ?> \ No newline at end of file diff --git a/manager/processors/remove_content.processor.php b/manager/processors/remove_content.processor.php old mode 100755 new mode 100644 index 83bcd40f98..fa06b5d643 --- a/manager/processors/remove_content.processor.php +++ b/manager/processors/remove_content.processor.php @@ -40,6 +40,6 @@ $modx->clearCache('full'); // finished emptying cache - redirect - $header="Location: index.php?r=1&a=7"; + $header="Location: index.php?a=2&r=1"; header($header); ?> \ No newline at end of file diff --git a/manager/processors/remove_locks.processor.php b/manager/processors/remove_locks.processor.php old mode 100755 new mode 100644 index b31ad28e39..f42715fd48 --- a/manager/processors/remove_locks.processor.php +++ b/manager/processors/remove_locks.processor.php @@ -7,7 +7,7 @@ // Remove all locks $modx->db->truncate($modx->getFullTableName('active_user_locks')); - $header = "Location: index.php?a=7"; + $header = "Location: index.php?a=2"; header($header); } else { // Remove single locks via AJAX / window.onbeforeunload diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index 2551ae4621..d0e4e3dd24 100644 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -437,7 +437,7 @@ $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; } else { - $header = "Location: index.php?r=1&id=$key&a=7&dv=1"; + $header = "Location: index.php?a=3&id=$key&r=1"; } if (headers_sent()) { @@ -677,7 +677,7 @@ } $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; } else { - $header = "Location: index.php?r=1&id=$id&a=7&dv=1".$add_path; + $header = "Location: index.php?a=3&id=$id&r=1".$add_path; } } if (headers_sent()) { @@ -727,4 +727,4 @@ function saveMETAKeywords($id) { } } -?> +?> \ No newline at end of file diff --git a/manager/processors/save_password.processor.php b/manager/processors/save_password.processor.php old mode 100755 new mode 100644 index e39704370d..3bf6bd12b0 --- a/manager/processors/save_password.processor.php +++ b/manager/processors/save_password.processor.php @@ -16,7 +16,7 @@ $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); } - $pass1 = htmlspecialchars($pass1, ENT_NOQUOTES, $modx->config['modx_charset']); + $pass1 = $modx->htmlspecialchars($pass1, ENT_NOQUOTES); $tbl_manager_users = $modx->getFullTableName('manager_users'); $uid = $modx->getLoginUserID(); $modx->loadExtension('phpass'); @@ -30,6 +30,6 @@ 'userpassword' => $pass1 )); -$header="Location: index.php?a=7"; +$header="Location: index.php?a=2"; header($header); ?> \ No newline at end of file diff --git a/manager/processors/save_role.processor.php b/manager/processors/save_role.processor.php old mode 100755 new mode 100644 index 70986a47ec..68360fae00 --- a/manager/processors/save_role.processor.php +++ b/manager/processors/save_role.processor.php @@ -1,136 +1,137 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if (!$modx->hasPermission('save_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('save_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } extract($_POST); -if ($name == '' || !isset ($name)) { - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}".($mode=35?"&id={$id}":"")); +if($name == '' || !isset ($name)) { + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); } // setup fields -$fields = array ( - 'name' => $name, - 'description' => $description, - 'frames' => $frames, - 'home' => $home, - 'view_document' => $view_document, - 'new_document' => $new_document, - 'save_document' => $save_document, - 'publish_document' => $publish_document, - 'delete_document' => $delete_document, - 'empty_trash' => $empty_trash, - 'action_ok' => $action_ok, - 'logout' => $logout, - 'help' => $help, - 'messages' => $messages, - 'new_user' => $new_user, - 'edit_user' => $edit_user, - 'logs' => $logs, - 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', - 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', - 'edit_template' => $edit_template, - 'settings' => $settings, - 'credits' => $credits, - 'new_template' => $new_template, - 'save_template' => $save_template, - 'delete_template' => $delete_template, - 'edit_snippet' => $edit_snippet, - 'new_snippet' => $new_snippet, - 'save_snippet' => $save_snippet, - 'delete_snippet' => $delete_snippet, - 'edit_chunk' => $edit_chunk, - 'new_chunk' => $new_chunk, - 'save_chunk' => $save_chunk, - 'delete_chunk' => $delete_chunk, - 'empty_cache' => $empty_cache, - 'edit_document' => $edit_document, - 'change_password' => $change_password, - 'error_dialog' => $error_dialog, - 'about' => $about, - 'file_manager' => $file_manager, - 'assets_files' => $assets_files, - 'assets_images' => $assets_images, - 'save_user' => $save_user, - 'delete_user' => $delete_user, - 'save_password' => $save_password, - 'edit_role' => $edit_role, - 'save_role' => $save_role, - 'delete_role' => $delete_role, - 'new_role' => $new_role, - 'access_permissions' => $access_permissions, - 'bk_manager' => $bk_manager, - 'new_plugin' => $new_plugin, - 'edit_plugin' => $edit_plugin, - 'save_plugin' => $save_plugin, - 'delete_plugin' => $delete_plugin, - 'new_module' => $new_module, - 'edit_module' => $edit_module, - 'save_module' => $save_module, - 'delete_module' => $delete_module, - 'exec_module' => $exec_module, - 'view_eventlog' => $view_eventlog, - 'delete_eventlog' => $delete_eventlog, - 'manage_metatags' => $manage_metatags, - 'edit_doc_metatags' => $edit_doc_metatags, - 'new_web_user' => $new_web_user, - 'edit_web_user' => $edit_web_user, - 'save_web_user' => $save_web_user, - 'delete_web_user' => $delete_web_user, - 'web_access_permissions' => $web_access_permissions, - 'view_unpublished' => $view_unpublished, +$fields = array( + 'name' => $name, + 'description' => $description, + 'frames' => $frames, + 'home' => $home, + 'view_document' => $view_document, + 'new_document' => $new_document, + 'save_document' => $save_document, + 'publish_document' => $publish_document, + 'delete_document' => $delete_document, + 'empty_trash' => $empty_trash, + 'action_ok' => $action_ok, + 'logout' => $logout, + 'help' => $help, + 'messages' => $messages, + 'new_user' => $new_user, + 'edit_user' => $edit_user, + 'logs' => $logs, + 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', + 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', + 'edit_template' => $edit_template, + 'settings' => $settings, + 'credits' => $credits, + 'new_template' => $new_template, + 'save_template' => $save_template, + 'delete_template' => $delete_template, + 'edit_snippet' => $edit_snippet, + 'new_snippet' => $new_snippet, + 'save_snippet' => $save_snippet, + 'delete_snippet' => $delete_snippet, + 'edit_chunk' => $edit_chunk, + 'new_chunk' => $new_chunk, + 'save_chunk' => $save_chunk, + 'delete_chunk' => $delete_chunk, + 'empty_cache' => $empty_cache, + 'edit_document' => $edit_document, + 'change_password' => $change_password, + 'error_dialog' => $error_dialog, + 'about' => $about, + 'file_manager' => $file_manager, + 'assets_files' => $assets_files, + 'assets_images' => $assets_images, + 'save_user' => $save_user, + 'delete_user' => $delete_user, + 'save_password' => $save_password, + 'edit_role' => $edit_role, + 'save_role' => $save_role, + 'delete_role' => $delete_role, + 'new_role' => $new_role, + 'access_permissions' => $access_permissions, + 'bk_manager' => $bk_manager, + 'new_plugin' => $new_plugin, + 'edit_plugin' => $edit_plugin, + 'save_plugin' => $save_plugin, + 'delete_plugin' => $delete_plugin, + 'new_module' => $new_module, + 'edit_module' => $edit_module, + 'save_module' => $save_module, + 'delete_module' => $delete_module, + 'exec_module' => $exec_module, + 'view_eventlog' => $view_eventlog, + 'delete_eventlog' => $delete_eventlog, + 'manage_metatags' => $manage_metatags, + 'edit_doc_metatags' => $edit_doc_metatags, + 'new_web_user' => $new_web_user, + 'edit_web_user' => $edit_web_user, + 'save_web_user' => $save_web_user, + 'delete_web_user' => $delete_web_user, + 'web_access_permissions' => $web_access_permissions, + 'view_unpublished' => $view_unpublished, 'import_static' => $import_static, 'export_static' => $export_static, - 'remove_locks' => $remove_locks, - 'display_locks' => $display_locks, - 'change_resourcetype' => $change_resourcetype + 'remove_locks' => $remove_locks, + 'display_locks' => $display_locks, + 'change_resourcetype' => $change_resourcetype, + 'category_manager' => $category_manager ); $fields = $modx->db->escape($fields); -switch ($_POST['mode']) { - case '38' : - $tbl = $modx->getFullTableName("user_roles"); +switch($_POST['mode']) { + case '38' : + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); - if ($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(38); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); + if($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(38); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); + } - $modx->db->insert($fields, $tbl); + $modx->db->insert($fields, $tbl); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - case '35' : - $tbl = $modx->getFullTableName("user_roles"); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + case '35' : + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); - if ($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(35); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); + if($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(35); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); + } - $modx->db->update($fields, $tbl, "id='{$id}'"); + $modx->db->update($fields, $tbl, "id='{$id}'"); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - default : + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + default : $modx->webAlertAndQuit("No operation set in request."); } $modx->unlockElement(8, $id); - -?> \ No newline at end of file diff --git a/manager/processors/save_template.processor.php b/manager/processors/save_template.processor.php old mode 100755 new mode 100644 index 91570babf6..bc6c727542 --- a/manager/processors/save_template.processor.php +++ b/manager/processors/save_template.processor.php @@ -143,30 +143,30 @@ } function saveTemplateAccess($id) { - global $modx; - - $newAssignedTvs = $_POST['assignedTv']; - - // Preserve rankings of already assigned TVs - $rs = $modx->db->select( "tmplvarid, rank", $modx->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'", "" ); - - $ranksArr = array(); - $highest = 0; - while($row = $modx->db->getRow($rs)) { - $ranksArr[$row['tmplvarid']] = $row['rank']; - $highest = $highest < $row['rank'] ? $row['rank'] : $highest; - }; - - $modx->db->delete($modx->getFullTableName('site_tmplvar_templates'),"templateid='{$id}'"); - if(empty($newAssignedTvs)) return; - foreach($newAssignedTvs as $tvid){ - if(!$id || !$tvid) continue; // Dont link zeros - $modx->db->insert( - array( - 'templateid' => $id, - 'tmplvarid' => $tvid, - 'rank' => isset($ranksArr[$tvid]) ? $ranksArr[$tvid] : $highest += 1 // append TVs to rank - ), $modx->getFullTableName('site_tmplvar_templates')); - } + if ($_POST['tvsDirty'] == 1) { + $newAssignedTvs = $_POST['assignedTv']; + + // Preserve rankings of already assigned TVs + $rs = $modx->db->select( "tmplvarid, rank", $modx->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'", "" ); + + $ranksArr = array(); + $highest = 0; + while($row = $modx->db->getRow($rs)) { + $ranksArr[$row['tmplvarid']] = $row['rank']; + $highest = $highest < $row['rank'] ? $row['rank'] : $highest; + }; + + $modx->db->delete($modx->getFullTableName('site_tmplvar_templates'),"templateid='{$id}'"); + if(empty($newAssignedTvs)) return; + foreach($newAssignedTvs as $tvid){ + if(!$id || !$tvid) continue; // Dont link zeros + $modx->db->insert( + array( + 'templateid' => $id, + 'tmplvarid' => $tvid, + 'rank' => isset($ranksArr[$tvid]) ? $ranksArr[$tvid] : $highest += 1 // append TVs to rank + ), $modx->getFullTableName('site_tmplvar_templates')); + } + } } diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php old mode 100755 new mode 100644 index 7621b9fa31..47b6e2f536 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -1,117 +1,117 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if (!$modx->hasPermission('save_user')) { +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('save_user')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $modx->loadExtension('phpass'); -$tbl_manager_users = $modx->getFullTableName('manager_users'); +$tbl_manager_users = $modx->getFullTableName('manager_users'); $tbl_user_attributes = $modx->getFullTableName('user_attributes'); -$tbl_member_groups = $modx->getFullTableName('member_groups'); +$tbl_member_groups = $modx->getFullTableName('member_groups'); $input = $_POST; -$id = intval($input['id']); -$oldusername = $input['oldusername']; -$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; -$fullname = $input['fullname']; -$genpassword = $input['newpassword']; -$passwordgenmethod = $input['passwordgenmethod']; +$id = intval($input['id']); +$oldusername = $input['oldusername']; +$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; +$fullname = $input['fullname']; +$genpassword = $input['newpassword']; +$passwordgenmethod = $input['passwordgenmethod']; $passwordnotifymethod = $input['passwordnotifymethod']; -$specifiedpassword = $input['specifiedpassword']; -$email = $input['email']; -$oldemail = $input['oldemail']; -$phone = $input['phone']; -$mobilephone = $input['mobilephone']; -$fax = $input['fax']; -$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; -$country = $input['country']; -$street = $input['street']; -$city = $input['city']; -$state = $input['state']; -$zip = $input['zip']; -$gender = !empty($input['gender']) ? $input['gender'] : 0; -$photo = $input['photo']; -$comment = $input['comment']; -$role = !empty($input['role']) ? $input['role'] : 0; -$failedlogincount = !empty($input['failedlogincount']) ? $input['failedlogincount'] : 0; -$blocked = !empty($input['blocked']) ? $input['blocked'] : 0; -$blockeduntil = !empty($input['blockeduntil']) ? $modx->toTimeStamp($input['blockeduntil']) : 0; -$blockedafter = !empty($input['blockedafter']) ? $modx->toTimeStamp($input['blockedafter']) : 0; -$user_groups = $input['user_groups']; +$specifiedpassword = $input['specifiedpassword']; +$email = $input['email']; +$oldemail = $input['oldemail']; +$phone = $input['phone']; +$mobilephone = $input['mobilephone']; +$fax = $input['fax']; +$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$country = $input['country']; +$street = $input['street']; +$city = $input['city']; +$state = $input['state']; +$zip = $input['zip']; +$gender = !empty($input['gender']) ? $input['gender'] : 0; +$photo = $input['photo']; +$comment = $input['comment']; +$role = !empty($input['role']) ? $input['role'] : 0; +$failedlogincount = !empty($input['failedlogincount']) ? $input['failedlogincount'] : 0; +$blocked = !empty($input['blocked']) ? $input['blocked'] : 0; +$blockeduntil = !empty($input['blockeduntil']) ? $modx->toTimeStamp($input['blockeduntil']) : 0; +$blockedafter = !empty($input['blockedafter']) ? $modx->toTimeStamp($input['blockedafter']) : 0; +$user_groups = $input['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { +if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { webAlertAndQuit("Password typed is mismatched"); } // verify email -if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { +if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { webAlertAndQuit("E-mail address doesn't seem to be valid!"); } // verify admin security -if ($_SESSION['mgrRole'] != 1) { +if($_SESSION['mgrRole'] != 1) { // Check to see if user tried to spoof a "1" (admin) role - if (!$modx->hasPermission('save_role')) { + if(!$modx->hasPermission('save_role')) { webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); } // Verify that the user being edited wasn't an admin and the user ID got spoofed $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("You cannot alter an administrative user."); - } + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("You cannot alter an administrative user."); + } } -switch ($input['mode']) { +switch($input['mode']) { case '11' : // new user // check if this user name already exist $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); $limit = $modx->db->getValue($rs); - if ($limit > 0) { + if($limit > 0) { webAlertAndQuit("User name is already in use!"); } // check if the email address already exist $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); } // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == "spec") { - if (strlen($specifiedpassword) < 6) { + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { webAlertAndQuit("Password is too short!"); } else { $newpassword = $specifiedpassword; } - } - elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { webAlertAndQuit("You didn't specify a password for this user!"); - } - elseif ($passwordgenmethod == 'g') { + } elseif($passwordgenmethod == 'g') { $newpassword = generate_password(8); } else { webAlertAndQuit("No password generation method specified!"); } // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array ( + $modx->invokeEvent("OnBeforeUserFormSave", array( "mode" => "new", )); // create the user account - $internalKey = $modx->db->insert(array('username'=>$modx->db->escape($newusername)), $tbl_manager_users); + $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); $field = array(); $field['password'] = $modx->phpass->HashPassword($newpassword); $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); - - $field = compact('internalKey','fullname','role','email','phone','mobilephone','fax','zip','street','city','state','country','gender','dob','photo','comment','blocked','blockeduntil','blockedafter'); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); $field = $modx->db->escape($field); $modx->db->insert($field, $tbl_user_attributes); @@ -119,7 +119,7 @@ saveUserSettings($internalKey); // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array ( + $modx->invokeEvent("OnManagerSaveUser", array( "mode" => "new", "userid" => $internalKey, "username" => $newusername, @@ -130,7 +130,7 @@ )); // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array ( + $modx->invokeEvent("OnUserFormSave", array( "mode" => "new", "id" => $internalKey )); @@ -141,21 +141,21 @@ /*******************************************************************************/ // put the user in the user_groups he/ she should be in // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (count($user_groups) > 0) { - for ($i = 0; $i < count($user_groups); $i++) { + if($use_udperms == 1) { + if(count($user_groups) > 0) { + for($i = 0; $i < count($user_groups); $i++) { $f = array(); $f['user_group'] = intval($user_groups[$i]); - $f['member'] = $internalKey; + $f['member'] = $internalKey; $modx->db->insert($f, $tbl_member_groups); } } } // end of user_groups stuff! - if ($passwordnotifymethod == 'e') { + if($passwordnotifymethod == 'e') { sendMailMessage($email, $newusername, $newpassword, $fullname); - if ($input['stay'] != '') { + if($input['stay'] != '') { $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; header($header); @@ -164,76 +164,76 @@ header($header); } } else { - if ($input['stay'] != '') { + if($input['stay'] != '') { $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; } else { $stayUrl = "index.php?a=75&r=2"; } - + include_once "header.inc.php"; -?> + ?> +

                              - -
                              -
                              -
                              -
                              -
                              -

                              - htmlspecialchars($newusername), $modx->htmlspecialchars($newpassword)); ?> -

                              +
                              + +
                              +
                              +
                              +
                              +

                              + htmlspecialchars($newusername), $modx->htmlspecialchars($newpassword)); ?> +

                              +
                              +
                              -
                              - db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); } // check if the email address already exists $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); } // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array ( + $modx->invokeEvent("OnBeforeUserFormSave", array( "mode" => "upd", "id" => $id )); @@ -242,10 +242,10 @@ $field = array(); $field['username'] = $modx->db->escape($newusername); if($genpassword == 1) { - $field['password'] = $modx->phpass->HashPassword($newpassword); + $field['password'] = $modx->phpass->HashPassword($newpassword); } $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); - $field = compact('fullname','role','email','phone','mobilephone','fax','zip','street','city','state','country','gender','dob','photo','comment','failedlogincount','blocked','blockeduntil','blockedafter'); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); $field = $modx->db->escape($field); $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); @@ -256,7 +256,7 @@ $_SESSION['itemname'] = $newusername; // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array ( + $modx->invokeEvent("OnManagerSaveUser", array( "mode" => "upd", "userid" => $id, "username" => $newusername, @@ -266,11 +266,11 @@ "userroleid" => $role, "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), "olduseremail" => (($oldemail != $email) ? $oldemail : "") - )); + )); // invoke OnManagerChangePassword event - if ($genpassword == 1) { - $modx->invokeEvent("OnManagerChangePassword", array ( + if($genpassword == 1) { + $modx->invokeEvent("OnManagerChangePassword", array( "userid" => $id, "username" => $newusername, "userpassword" => $newpassword @@ -278,7 +278,7 @@ } // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array ( + $modx->invokeEvent("OnUserFormSave", array( "mode" => "upd", "id" => $id )); @@ -286,53 +286,55 @@ /*******************************************************************************/ // put the user in the user_groups he/ she should be in // first, check that up_perms are switched on! - if ($use_udperms == 1) { + if($use_udperms == 1) { // as this is an existing user, delete his/ her entries in the groups before saving the new groups $modx->db->delete($tbl_member_groups, "member='{$id}'"); - if (count($user_groups) > 0) { - for ($i = 0; $i < count($user_groups); $i++) { + if(count($user_groups) > 0) { + for($i = 0; $i < count($user_groups); $i++) { $field = array(); $field['user_group'] = intval($user_groups[$i]); - $field['member'] = $id; + $field['member'] = $id; $modx->db->insert($field, $tbl_member_groups); } } } // end of user_groups stuff! /*******************************************************************************/ - if ($id == $modx->getLoginUserID() && ($genpassword !==1 && $passwordnotifymethod !='s')) { + if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); } - if ($genpassword == 1 && $passwordnotifymethod == 's') { - if ($input['stay'] != '') { + if($genpassword == 1 && $passwordnotifymethod == 's') { + if($input['stay'] != '') { $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; } else { $stayUrl = "index.php?a=75&r=2"; } - + include_once "header.inc.php"; -?> + ?> +

                              -
                              -
                              -
                              -
                              -

                              htmlspecialchars($newusername), $modx->htmlspecialchars($newpassword)).(($id == $modx->getLoginUserID()) ? ' '.$_lang['user_changeddata'] : ''); ?>

                              +
                              + +
                              +
                              +
                              +
                              +

                              htmlspecialchars($newusername), $modx->htmlspecialchars($newpassword)) . (($id == $modx->getLoginUserID()) ? ' ' . $_lang['user_changeddata'] : ''); ?>

                              +
                              +
                              -
                              - "; + $param['from'] = "{$site_name}<{$emailsender}>"; $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; $rs = $modx->sendmail($param); - if (!$rs) { + if(!$rs) { $modx->manager->saveFormValues(); $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); } @@ -378,7 +380,7 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { // Save User Settings function saveUserSettings($id) { global $modx; - $tbl_user_settings = $modx->getFullTableName('user_settings'); + $tbl_user_settings = $modx->getFullTableName('user_settings'); $ignore = array( 'id', @@ -427,32 +429,34 @@ function saveUserSettings($id) { ); // get user setting field names - $settings= array (); - foreach ($_POST as $n => $v) { - if (in_array($n, $ignore) || (!in_array($n, $defaults) && trim($v) == '')) continue; // ignore blacklist and empties + $settings = array(); + foreach($_POST as $n => $v) { + if(in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { + continue; + } // ignore blacklist and empties $settings[$n] = $v; // this value should be saved } - foreach ($defaults as $k) { - if (isset($settings['default_'.$k]) && $settings['default_'.$k] == '1') { + foreach($defaults as $k) { + if(isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { unset($settings[$k]); } - unset($settings['default_'.$k]); + unset($settings['default_' . $k]); } - $modx->db->delete($tbl_user_settings,"user='{$id}'"); + $modx->db->delete($tbl_user_settings, "user='{$id}'"); - foreach ($settings as $n => $vl) { - if (is_array($vl)) { + foreach($settings as $n => $vl) { + if(is_array($vl)) { $vl = implode(",", $vl); } - if ($vl != '') { - $f = array(); - $f['user'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_user_settings); + if($vl != '') { + $f = array(); + $f['user'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_user_settings); } } } @@ -471,8 +475,8 @@ function generate_password($length = 10) { $ps_len = strlen($allowable_characters); mt_srand((double) microtime() * 1000000); $pass = ""; - for ($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len -1)]; + for($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; } return $pass; } diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php old mode 100755 new mode 100644 index a3ed989fdb..b0712c90b1 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -1,97 +1,97 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if (!$modx->hasPermission('save_web_user')) { +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('save_web_user')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$tbl_web_users = $modx->getFullTableName('web_users'); +$tbl_web_users = $modx->getFullTableName('web_users'); $tbl_web_user_attributes = $modx->getFullTableName('web_user_attributes'); -$tbl_web_groups = $modx->getFullTableName('web_groups'); +$tbl_web_groups = $modx->getFullTableName('web_groups'); $input = $_POST; -foreach($input as $k=>$v) { - if($k!=='comment') { - $v = sanitize($v); - } - $input[$k] = $v; +foreach($input as $k => $v) { + if($k !== 'comment') { + $v = sanitize($v); + } + $input[$k] = $v; } -$id = intval($input['id']); -$oldusername = $input['oldusername']; -$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; -$esc_newusername = $modx->db->escape($newusername); -$fullname = $input['fullname']; -$genpassword = $input['newpassword']; -$passwordgenmethod = $input['passwordgenmethod']; +$id = intval($input['id']); +$oldusername = $input['oldusername']; +$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; +$esc_newusername = $modx->db->escape($newusername); +$fullname = $input['fullname']; +$genpassword = $input['newpassword']; +$passwordgenmethod = $input['passwordgenmethod']; $passwordnotifymethod = $input['passwordnotifymethod']; -$specifiedpassword = $input['specifiedpassword']; -$email = $input['email']; -$esc_email = $modx->db->escape($email); -$oldemail = $input['oldemail']; -$phone = $input['phone']; -$mobilephone = $input['mobilephone']; -$fax = $input['fax']; -$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; -$country = $input['country']; -$street = $input['street']; -$city = $input['city']; -$state = $input['state']; -$zip = $input['zip']; -$gender = !empty($input['gender']) ? $input['gender'] : 0; -$photo = $input['photo']; -$comment = $input['comment']; -$role = !empty($input['role']) ? $input['role'] : 0; -$failedlogincount = !empty($input['failedlogincount']) ? $input['failedlogincount'] : 0; -$blocked = !empty($input['blocked']) ? $input['blocked'] : 0; -$blockeduntil = !empty($input['blockeduntil']) ? $modx->toTimeStamp($input['blockeduntil']) : 0; -$blockedafter = !empty($input['blockedafter']) ? $modx->toTimeStamp($input['blockedafter']) : 0; -$user_groups = $input['user_groups']; +$specifiedpassword = $input['specifiedpassword']; +$email = $input['email']; +$esc_email = $modx->db->escape($email); +$oldemail = $input['oldemail']; +$phone = $input['phone']; +$mobilephone = $input['mobilephone']; +$fax = $input['fax']; +$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$country = $input['country']; +$street = $input['street']; +$city = $input['city']; +$state = $input['state']; +$zip = $input['zip']; +$gender = !empty($input['gender']) ? $input['gender'] : 0; +$photo = $input['photo']; +$comment = $input['comment']; +$role = !empty($input['role']) ? $input['role'] : 0; +$failedlogincount = !empty($input['failedlogincount']) ? $input['failedlogincount'] : 0; +$blocked = !empty($input['blocked']) ? $input['blocked'] : 0; +$blockeduntil = !empty($input['blockeduntil']) ? $modx->toTimeStamp($input['blockeduntil']) : 0; +$blockedafter = !empty($input['blockedafter']) ? $modx->toTimeStamp($input['blockedafter']) : 0; +$user_groups = $input['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { +if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { webAlertAndQuit("Password typed is mismatched"); } // verify email -if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { +if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { webAlertAndQuit("E-mail address doesn't seem to be valid!"); } -switch ($input['mode']) { +switch($input['mode']) { case '87' : // new user // check if this user name already exist $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); $limit = $modx->db->getValue($rs); - if ($limit > 0) { + if($limit > 0) { webAlertAndQuit("User name is already in use!"); } // check if the email address already exist $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); } // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == "spec") { - if (strlen($specifiedpassword) < 6) { + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { webAlertAndQuit("Password is too short!"); } else { $newpassword = $specifiedpassword; } - } - elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { webAlertAndQuit("You didn't specify a password for this user!"); - } - elseif ($passwordgenmethod == 'g') { + } elseif($passwordgenmethod == 'g') { $newpassword = generate_password(8); } else { webAlertAndQuit("No password generation method specified!"); } // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array ( + $modx->invokeEvent("OnBeforeWUsrFormSave", array( "mode" => "new", )); @@ -101,15 +101,15 @@ $field['password'] = md5($newpassword); $internalKey = $modx->db->insert($field, $tbl_web_users); - $field = compact('internalKey','fullname','role','email','phone','mobilephone','fax','zip','street','city','state','country','gender','dob','photo','comment','blocked','blockeduntil','blockedafter'); - $field = $modx->db->escape($field); + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); $modx->db->insert($field, $tbl_web_user_attributes); // Save User Settings saveUserSettings($internalKey); // invoke OnWebSaveUser event - $modx->invokeEvent("OnWebSaveUser", array ( + $modx->invokeEvent("OnWebSaveUser", array( "mode" => "new", "userid" => $internalKey, "username" => $newusername, @@ -119,7 +119,7 @@ )); // invoke OnWUsrFormSave event - $modx->invokeEvent("OnWUsrFormSave", array ( + $modx->invokeEvent("OnWUsrFormSave", array( "mode" => "new", "id" => $internalKey )); @@ -130,21 +130,21 @@ /*******************************************************************************/ // put the user in the user_groups he/ she should be in // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (count($user_groups) > 0) { - for ($i = 0; $i < count($user_groups); $i++) { + if($use_udperms == 1) { + if(count($user_groups) > 0) { + for($i = 0; $i < count($user_groups); $i++) { $f = array(); $f['webgroup'] = intval($user_groups[$i]); - $f['webuser'] = $internalKey; + $f['webuser'] = $internalKey; $modx->db->insert($f, $tbl_web_groups); } } } // end of user_groups stuff! - if ($passwordnotifymethod == 'e') { + if($passwordnotifymethod == 'e') { sendMailMessage($email, $newusername, $newpassword, $fullname); - if ($input['stay'] != '') { + if($input['stay'] != '') { $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; header($header); @@ -153,76 +153,76 @@ header($header); } } else { - if ($input['stay'] != '') { + if($input['stay'] != '') { $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; } else { $stayUrl = "index.php?a=99&r=2"; } - + include_once "header.inc.php"; -?> + ?> +

                              - -
                              -
                              -
                              -
                              -
                              -

                              - -

                              +
                              + +
                              +
                              +
                              +
                              +

                              + +

                              +
                              +
                              -
                              - db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); } // check if the email address already exists $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); } // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array ( + $modx->invokeEvent("OnBeforeWUsrFormSave", array( "mode" => "upd", "id" => $id )); @@ -231,10 +231,10 @@ $field = array(); $field['username'] = $esc_newusername; if($genpassword == 1) { - $field['password'] = md5($newpassword); + $field['password'] = md5($newpassword); } $modx->db->update($field, $tbl_web_users, "id='{$id}'"); - $field = compact('fullname','role','email','phone','mobilephone','fax','zip','street','city','state','country','gender','dob','photo','comment','failedlogincount','blocked','blockeduntil','blockedafter'); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); $field = $modx->db->escape($field); $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); @@ -245,7 +245,7 @@ $_SESSION['itemname'] = $newusername; // invoke OnWebSaveUser event - $modx->invokeEvent("OnWebSaveUser", array ( + $modx->invokeEvent("OnWebSaveUser", array( "mode" => "upd", "userid" => $id, "username" => $newusername, @@ -254,11 +254,11 @@ "userfullname" => $fullname, "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), "olduseremail" => (($oldemail != $email) ? $oldemail : "") - )); + )); // invoke OnWebChangePassword event - if ($genpassword == 1) { - $modx->invokeEvent("OnWebChangePassword", array ( + if($genpassword == 1) { + $modx->invokeEvent("OnWebChangePassword", array( "userid" => $id, "username" => $newusername, "userpassword" => $newpassword @@ -266,7 +266,7 @@ } // invoke OnWUsrFormSave event - $modx->invokeEvent("OnWUsrFormSave", array ( + $modx->invokeEvent("OnWUsrFormSave", array( "mode" => "upd", "id" => $id )); @@ -274,14 +274,14 @@ /*******************************************************************************/ // put the user in the user_groups he/ she should be in // first, check that up_perms are switched on! - if ($use_udperms == 1) { + if($use_udperms == 1) { // as this is an existing user, delete his/ her entries in the groups before saving the new groups $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); - if (count($user_groups) > 0) { - for ($i = 0; $i < count($user_groups); $i++) { + if(count($user_groups) > 0) { + for($i = 0; $i < count($user_groups); $i++) { $field = array(); $field['webgroup'] = intval($user_groups[$i]); - $field['webuser'] = $id; + $field['webuser'] = $id; $modx->db->insert($field, $tbl_web_groups); } } @@ -289,36 +289,38 @@ // end of user_groups stuff! /*******************************************************************************/ - if ($genpassword == 1 && $passwordnotifymethod == 's') { - if ($input['stay'] != '') { + if($genpassword == 1 && $passwordnotifymethod == 's') { + if($input['stay'] != '') { $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; } else { $stayUrl = "index.php?a=99&r=2"; } - + include_once "header.inc.php"; -?> + ?> +

                              - -
                              -
                              -
                              -
                              -
                              -

                              +
                              + +
                              +
                              +
                              +
                              +

                              +
                              +
                              -
                              - "; + $param['from'] = "{$site_name}<{$emailsender}>"; $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; $rs = $modx->sendmail($param); - if (!$rs) { + if(!$rs) { $modx->manager->saveFormValues(); $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); } @@ -374,28 +377,28 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { // Save User Settings function saveUserSettings($id) { global $modx; - $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); - - $settings = array ( + $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); + + $settings = array( "login_home", "allowed_ip", "allowed_days" ); - $modx->db->delete($tbl_web_user_settings,"webuser='{$id}'"); + $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); - foreach ($settings as $n) { + foreach($settings as $n) { $vl = $_POST[$n]; - if (is_array($vl)) { + if(is_array($vl)) { $vl = implode(",", $vl); } - if ($vl != '') { - $f = array(); - $f['webuser'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_web_user_settings); + if($vl != '') { + $f = array(); + $f['webuser'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_web_user_settings); } } } @@ -414,24 +417,23 @@ function generate_password($length = 10) { $ps_len = strlen($allowable_characters); mt_srand((double) microtime() * 1000000); $pass = ""; - for ($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len -1)]; + for($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; } return $pass; } -function sanitize($str='',$safecount=0) { +function sanitize($str = '', $safecount = 0) { global $modx; $safecount++; - if (1000 < $safecount) { + if(1000 < $safecount) { exit("error too many loops '{$safecount}'"); } if(is_array($str)) { - foreach($str as $i=>$v) { - $str[$i] = sanitize($v,$safecount); + foreach($str as $i => $v) { + $str[$i] = sanitize($v, $safecount); } - } - else { + } else { // $str = strip_tags($str); // LEAVE < and > intact $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); } diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php old mode 100755 new mode 100644 index f1fdb97997..32b12e7dc0 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -80,10 +80,8 @@ function getChildren($parent) { // empty cache $modx->clearCache('full'); - // finished emptying cache - redirect - //$header="Location: index.php?r=1&a=7&id=$id&dv=1"; -// webber - $header="Location: index.php?r=1&a=7&id=$pid&dv=1".$add_path; + // finished emptying cache - redirect + $header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); ?> \ No newline at end of file diff --git a/manager/processors/unpublish_content.processor.php b/manager/processors/unpublish_content.processor.php old mode 100755 new mode 100644 index ff411eb841..980941fda4 --- a/manager/processors/unpublish_content.processor.php +++ b/manager/processors/unpublish_content.processor.php @@ -55,10 +55,7 @@ // empty cache $modx->clearCache('full'); -//$header="Location: index.php?r=1&id=$id&a=7"; - -// webber -$header="Location: index.php?r=1&id=$pid&a=7&dv=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); ?> \ No newline at end of file diff --git a/manager/processors/user_documents_permissions.class.php b/manager/processors/user_documents_permissions.class.php index affcc974eb..ff74c679af 100755 --- a/manager/processors/user_documents_permissions.class.php +++ b/manager/processors/user_documents_permissions.class.php @@ -23,19 +23,14 @@ function checkPermissions() { return true; // administrator - grant all document permissions } - if($document==0 && ($udperms_allowroot==1 || $modx->hasPermission('edit_document'))) { - return true; - } - - $permissionsok = false; // set permissions to false - if($modx->config['use_udperms']==0 || $modx->config['use_udperms']=="" || !isset($modx->config['use_udperms'])) { return true; // permissions aren't in use } $parent = $modx->db->getValue($modx->db->select('parent', $tblsc, "id='{$this->document}'")); - if ($this->duplicateDoc==true && $parent==0 && $udperms_allowroot==0) { - return false; // deny duplicate document at root if Allow Root is No + if($document == 0 && $parent == NULL && $udperms_allowroot == 1) return true; // User is allowed to create new document in root + if (($this->duplicateDoc==true || $document==0) && $parent==0 && $udperms_allowroot==0) { + return false; // deny duplicate || create new document at root if Allow Root is No } // get document groups for current user @@ -51,6 +46,8 @@ function checkPermissions() { are private to the manager users will not be private to web users if the document group is not assigned to a web user group and visa versa. */ + $permissionsok = false; // set permissions to false + $rs = $modx->db->select( 'count(DISTINCT sc.id)', "{$tblsc} AS sc diff --git a/vendor/.gitignore b/vendor/.gitignore new file mode 100644 index 0000000000..e69de29bb2

                              - -
                              - - - -
                              -

                              - - - - - - - - - - - - - - - - - - -
                                
                              -
                              (32x32)
                              class="inputBox" onclick="documentDirty=true;" />
                              value="on" class="inputBox" /> - '.$_lang['module_disabled'].'' : $_lang['module_disabled']?>
                              class="inputBox" /> -
                              - - -
                              - class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> - -
                              -
                              - -
                              - -
                              - - -
                              -

                              - -

                              - - - - - -
                              -
                                -
                              -
                               
                              -
                              - -
                              -

                              - - - - - - - - - - - -
                              class="inputBox" onclick="documentDirty=true;" />
                              -
                              -
                              -
                              -
                              -manager->action == '108'): ?> - -
                              -

                              - - - - -



                              - " align="absmiddle" />

                              -db->select( - "smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, - CASE smd.type - WHEN 10 THEN 'Chunk' - WHEN 20 THEN 'Document' - WHEN 30 THEN 'Plugin' - WHEN 40 THEN 'Snippet' - WHEN 50 THEN 'Template' - WHEN 60 THEN 'TV' - END AS type", - "{$tbl_site_module_depobj} AS smd - LEFT JOIN {$tbl_site_htmlsnippets} AS sc ON sc.id = smd.resource AND smd.type = 10 - LEFT JOIN {$tbl_site_content} AS sd ON sd.id = smd.resource AND smd.type = 20 - LEFT JOIN {$tbl_site_plugins} AS sp ON sp.id = smd.resource AND smd.type = 30 - LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = 40 - LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 - LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", - "smd.module='{$id}'", - 'smd.type,name'); - include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = 'grid'; - $grd->columnHeaderClass = 'gridHeader'; - $grd->itemClass = 'gridItem'; - $grd->altItemClass = 'gridAltItem'; - $grd->columns = $_lang['element_name']." ,".$_lang['type']; - $grd->fields = "name,type"; - echo $grd->render(); -?> -
                              -
                              - - -
                              -

                              - -
                              - -db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); - $groupsarray = $modx->db->getColumn('usergroup', $rs); - - if($modx->hasPermission('access_permissions')) { ?> - -
                              -
                              -
                              - -

                              -db->select('name, id', $tbl_membergroup_names, '', 'name'); - while ($row = $modx->db->getRow($rs)) { - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); - $checked = in_array($row['id'], $groupsarray); - if($modx->hasPermission('access_permissions')) { - if ($checked) $notPublic = true; - $chks .= ''.$row['name']."
                              \n"; - } else { - if ($checked) $chks = '' . "\n" . $chks; - } - } - if($modx->hasPermission('access_permissions')) { - $chks = ''.$_lang['all_usr_groups'].'
                              ' . "\n" . $chks; - } - echo $chks; -?> -
                              -
                              - -
                              -
                              - -
                              -

                              - -
                              - -
                              -
                              - - -invokeEvent('OnModFormRender', array('id' => $id)); -if(is_array($evtOut)) echo implode('',$evtOut); -?> + invokeEvent('OnModFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + // Prepare internal params & info-tab via parseDocBlock + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; + $docBlock = $modx->parseDocBlockFromString($modulecode); + $docBlockList = $modx->convertDocBlockIntoList($docBlock); + $internal = array(); + ?> + + + +

                              + +

                              + +
                              +
                                +
                              • + + "> + + + + +
                              • + manager->action == '107') { ?> +
                              • ">
                              • +
                              • ">
                              • + +
                              • ">
                              • +
                              • ">
                              • + +
                              • ">
                              • + hasPermission('exec_module')) { ?> +
                              • ">
                              • + +
                              +
                              + + +
                              +

                              + +
                              + + + +
                              +

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                
                              +
                              (32x32)
                              class="inputBox" onclick="documentDirty=true;" />
                              value="on" class="inputBox" /> + ' . $_lang['module_disabled'] . '' : $_lang['module_disabled'] ?>
                              class="inputBox" /> +
                              + + +
                              + class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> + +
                              +
                              + +
                              + +
                              + + +
                              +

                              + +

                              + + + + + + + +
                              +
                                +
                              +
                               
                              +
                              + +
                              +

                              + + + + + + + + + + + + + + + + + +
                              class="inputBox" onclick="documentDirty=true;" />
                              +
                              +
                                +
                              • + +
                              • +
                              +
                              +
                              + manager->action == '108'): ?> + +
                              +

                              + + + + + + + + +
                              +



                              + + "> +

                              +

                              +
                              + db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, + CASE smd.type + WHEN 10 THEN 'Chunk' + WHEN 20 THEN 'Document' + WHEN 30 THEN 'Plugin' + WHEN 40 THEN 'Snippet' + WHEN 50 THEN 'Template' + WHEN 60 THEN 'TV' + END AS type", "{$tbl_site_module_depobj} AS smd + LEFT JOIN {$tbl_site_htmlsnippets} AS sc ON sc.id = smd.resource AND smd.type = 10 + LEFT JOIN {$tbl_site_content} AS sd ON sd.id = smd.resource AND smd.type = 20 + LEFT JOIN {$tbl_site_plugins} AS sp ON sp.id = smd.resource AND smd.type = 30 + LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = 40 + LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 + LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); + + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = 'grid'; + $grd->columnHeaderClass = 'gridHeader'; + $grd->itemClass = 'gridItem'; + $grd->altItemClass = 'gridAltItem'; + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; + $grd->fields = "name,type"; + echo $grd->render(); + ?> +
                              +
                              + + +
                              +

                              + +
                              + + db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); + $groupsarray = $modx->db->getColumn('usergroup', $rs); + + if($modx->hasPermission('access_permissions')) { ?> + +
                              +
                              +
                              + +

                              + db->select('name, id', $tbl_membergroup_names, '', 'name'); + while($row = $modx->db->getRow($rs)) { + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); + $checked = in_array($row['id'], $groupsarray); + if($modx->hasPermission('access_permissions')) { + if($checked) { + $notPublic = true; + } + $chks .= '' . $row['name'] . "
                              \n"; + } else { + if($checked) { + $chks = '' . "\n" . $chks; + } + } + } + if($modx->hasPermission('access_permissions')) { + $chks = '' . $_lang['all_usr_groups'] . '
                              ' . "\n" . $chks; + } + echo $chks; + ?> +
                              +
                              + +
                              +
                              + +
                              +

                              + +
                              + +
                              +
                              + + + invokeEvent('OnModFormRender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> - + diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index 94c4a5d4b6..833f0f2292 100644 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -1,56 +1,69 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} -if (!$modx->hasPermission('edit_module')) { +if(!$modx->hasPermission('edit_module')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; // Get table names (alphabetical) -$tbl_active_users = $modx->getFullTableName('active_users'); -$tbl_site_content = $modx->getFullTableName('site_content'); -$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); +$tbl_active_users = $modx->getFullTableName('active_users'); +$tbl_site_content = $modx->getFullTableName('site_content'); +$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj'); -$tbl_site_modules = $modx->getFullTableName('site_modules'); -$tbl_site_plugins = $modx->getFullTableName('site_plugins'); -$tbl_site_snippets = $modx->getFullTableName('site_snippets'); -$tbl_site_templates = $modx->getFullTableName('site_templates'); -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +$tbl_site_modules = $modx->getFullTableName('site_modules'); +$tbl_site_plugins = $modx->getFullTableName('site_plugins'); +$tbl_site_snippets = $modx->getFullTableName('site_snippets'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // check to see the editor isn't locked -$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'"); - if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); - } +$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); +} // end check for lock // take action -switch ($_REQUEST['op']) { +switch($_REQUEST['op']) { case 'add': // convert ids to numbers $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); - if (count($opids)>0){ + if(count($opids) > 0) { // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs $rt = strtolower($_REQUEST["rt"]); - if ($rt == 'chunk') $type = 10; - if ($rt == 'doc') $type = 20; - if ($rt == 'plug') $type = 30; - if ($rt == 'snip') $type = 40; - if ($rt == 'tpl') $type = 50; - if ($rt == 'tv') $type = 60; - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',',$opids).") AND type='{$type}'"); - foreach ($opids as $opid) { - $modx->db->insert( - array( - 'module' => $id, - 'resource' => $opid, - 'type' => $type, - ), $tbl_site_module_depobj); + if($rt == 'chunk') { + $type = 10; + } + if($rt == 'doc') { + $type = 20; + } + if($rt == 'plug') { + $type = 30; + } + if($rt == 'snip') { + $type = 40; + } + if($rt == 'tpl') { + $type = 50; + } + if($rt == 'tv') { + $type = 60; + } + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); + foreach($opids as $opid) { + $modx->db->insert(array( + 'module' => $id, + 'resource' => $opid, + 'type' => $type, + ), $tbl_site_module_depobj); } } break; @@ -59,24 +72,33 @@ $opids = array_filter(array_map('intval', $_REQUEST['depid'])); // get resources that needs to be removed - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (".implode(",",$opids).")"); - // loop through resources and look for plugins and snippets - $plids=array(); $snid=array(); - while ($row=$modx->db->getRow($ds)){ - if($row['type']=='30') $plids[$i]=$row['resource']; - if($row['type']=='40') $snids[$i]=$row['resource']; + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); + // loop through resources and look for plugins and snippets + $plids = array(); + $snid = array(); + while($row = $modx->db->getRow($ds)) { + if($row['type'] == '30') { + $plids[$i] = $row['resource']; + } + if($row['type'] == '40') { + $snids[$i] = $row['resource']; } - // get guid - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); - $guid = $modx->db->getValue($ds); - // reset moduleguid for deleted resources - if (($cp=count($plids)) || ($cs=count($snids))) { - if ($cp) $modx->db->update(array('moduleguid'=>''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'"); - if ($cs) $modx->db->update(array('moduleguid'=>''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'"); - // reset cache - $modx->clearCache('full'); + } + // get guid + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); + $guid = $modx->db->getValue($ds); + // reset moduleguid for deleted resources + if(($cp = count($plids)) || ($cs = count($snids))) { + if($cp) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); + } + if($cs) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); } - $modx->db->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")"); + // reset cache + $modx->clearCache('full'); + } + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); break; } @@ -86,8 +108,8 @@ if(!$content) { $modx->webAlertAndQuit("Module not found for id '{$id}'."); } -$_SESSION['itemname']=$content['name']; -if($content['locked']==1 && $_SESSION['mgrRole']!=1) { +$_SESSION['itemname'] = $content['name']; +if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -95,52 +117,52 @@
                              - - - - -

                              - - - - - - -

                              -
                              - -
                              - -
                              -
                              -
                              -

                              -
                              - - - - + + +
                              - db->select( - "smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, + + + + + +

                              + +

                              + +
                              + +
                              + +
                              +
                              +
                              +

                              +
                              + + + + - - -
                              + db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -191,41 +209,38 @@ function openSelector(resource,mode,callback,w,h){ WHEN 40 THEN 'Snippet' WHEN 50 THEN 'Template' WHEN 60 THEN 'TV' - END as type", - "{$tbl_site_module_depobj} AS smd + END as type", "{$tbl_site_module_depobj} AS smd LEFT JOIN {$tbl_site_htmlsnippets} AS sc ON sc.id = smd.resource AND smd.type = '10' LEFT JOIN {$tbl_site_content} AS sd ON sd.id = smd.resource AND smd.type = '20' LEFT JOIN {$tbl_site_plugins} AS sp ON sp.id = smd.resource AND smd.type = '30' LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' - LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", - "smd.module={$id}", - "smd.type,name"); - include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; - $grd = new DataGrid('',$ds,0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass="grid"; - $grd->columnHeaderClass="gridHeader"; - $grd->itemClass="gridItem"; - $grd->altItemClass="gridAltItem"; - $grd->columns=$_lang["element_name"]." ,".$_lang["type"]; - $grd->colTypes = "template: [+value+]"; - $grd->fields="name,type"; - echo $grd->render(); - ?> - - " align="absmiddle" />
                              - " align="absmiddle" />
                              - " align="absmiddle" />
                              - " align="absmiddle" />
                              - " align="absmiddle" />
                              - " align="absmiddle" />
                              - " align="absmiddle" />
                              -
                              -
                              -
                              - + LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; + $grd->colTypes = "template: [+value+]"; + $grd->fields = "name,type"; + echo $grd->render(); + ?> +
                              + ">
                              + ">
                              + ">
                              + ">
                              + ">
                              + ">
                              + ">
                              +
                              +
                              +
                              +
                              diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index 5b143010f0..9f95dd02b4 100644 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,38 +1,43 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('change_password')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> -

                              +

                              + +
                              -
                              -
                              -
                              - +
                              +
                              + + -

                              +

                              - - - - - - - - - - -
                              : 
                              : 
                              + + + + + + + + + + + +
                              : 
                              : 
                              - - -
                              + + +
                              diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index bceb089ba5..7e8254f697 100644 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -1,653 +1,673 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} switch($modx->manager->action) { - case 102: - if(!$modx->hasPermission('edit_plugin')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 101: - if(!$modx->hasPermission('new_plugin')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); + case 102: + if(!$modx->hasPermission('edit_plugin')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 101: + if(!$modx->hasPermission('new_plugin')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; -$tbl_site_plugins = $modx->getFullTableName('site_plugins'); +$tbl_site_plugins = $modx->getFullTableName('site_plugins'); $tbl_site_plugin_events = $modx->getFullTableName('site_plugin_events'); -$tbl_system_eventnames = $modx->getFullTableName('system_eventnames'); +$tbl_system_eventnames = $modx->getFullTableName('system_eventnames'); // check to see the plugin isn't locked -if ($lockedEl = $modx->elementIsLocked(5, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['plugin'])); +if($lockedEl = $modx->elementIsLocked(5, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['plugin'])); } // end check for lock // Lock plugin for other users to edit $modx->lockElement(5, $id); -if(isset($_GET['id'])) -{ - $rs = $modx->db->select('*',$tbl_site_plugins,"id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - header("Location: {$modx->config['site_url']}"); - } - $_SESSION['itemname']=$content['name']; - if($content['locked']==1 && $modx->hasPermission('save_role')!=1) - { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - $content['properties'] = str_replace("&", "&", $content['properties']); -} -else -{ - $_SESSION['itemname']=$_lang["new_plugin"]; +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_plugins, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + header("Location: {$modx->config['site_url']}"); + } + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + $content['properties'] = str_replace("&", "&", $content['properties']); +} else { + $_SESSION['itemname'] = $_lang["new_plugin"]; + $content['category'] = intval($_REQUEST['catid']); } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 5; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); -?> - - -
                              - - - - -

                              - - - - - - -

                              - -
                              - -
                              - -
                              - - -
                              - - - -
                              -

                              - - -

                              - -

                              - - - - - - - - - - - - - - - - - - - - - -hasPermission('save_role')):?> - - - - - - - -
                                -
                              -
                              - -
                              -
                              -   class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> - -
                              -
                              - -
                              -
                              - -
                              - - -
                              -

                              - - - - - - - - -
                              -
                                -
                              -
                               
                              -
                              - - -
                              -

                              - - - - - "; + } else { + while($row = $modx->db->getRow($rs)) { + // display records + if($srv != $row['service']) { + $srv = $row['service']; + if(count($evtnames) > 0) { + echoEventRows($evtnames); + } + echo ""; + echo ""; + } + // display group name + if($grp != $row['groupname']) { + $grp = $row['groupname']; + if(count($evtnames) > 0) { + echoEventRows($evtnames); + } + echo ""; + echo ""; + } + $evtnames[] = '' . "\n"; + if(count($evtnames) == 2) { + echoEventRows($evtnames); + } + } + } + if(count($evtnames) > 0) { + echoEventRows($evtnames); + } + + function echoEventRows(&$evtnames) { + echo ""; + $evtnames = array(); + } + + ?> +
                              + + +

                              + +

                              + +
                              + +
                              + +
                              + +
                              + + + +
                              +

                              + + +

                              + +

                              + + + + + + + + + + + + + + + + + + + + + + hasPermission('save_role')): ?> + + + + + + + +
                                + +
                              +
                              + +
                              +
                              +   class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> + +
                              +
                              + +
                              +
                              + +
                              + + +
                              +

                              + + + + + + + + +
                              +
                                +
                              +
                               
                              +
                              + + +
                              +

                              + + + + + + + + + + + + + +
                              +

                              +
                                +
                              • +
                              +
                              +
                              + + +
                              +

                              + +

                              + + 0) { + $rs = $modx->db->select('evtid', $tbl_site_plugin_events, "pluginid='{$id}'"); + $evts = $modx->db->getColumn('evtid', $rs); + } else { + if(isset($content['sysevents']) && is_array($content['sysevents'])) { + $evts = $content['sysevents']; + } else { + $evts = array(); + } + } + + // display system events + $evtnames = array(); + $services = array( + "Parser Service Events", + "Manager Access Events", + "Web Access Service Events", + "Cache Service Events", + "Template Service Events", + "User Defined Events" ); - while($row = $modx->db->getRow($ds)){ - echo ""; - } - ?> - - - - - - - - - - -

                              -
                              -
                              -
                              - - -
                              -

                              - -

                              - - 0) { - $rs = $modx->db->select('evtid',$tbl_site_plugin_events,"pluginid='{$id}'"); - $evts = $modx->db->getColumn('evtid', $rs); - } else { - if(isset($content['sysevents']) && is_array($content['sysevents'])) { - $evts = $content['sysevents']; - } else { - $evts = array(); - } - } - - // display system events - $evtnames = array(); - $services = array( - "Parser Service Events", - "Manager Access Events", - "Web Access Service Events", - "Cache Service Events", - "Template Service Events", - "User Defined Events" - ); - $rs = $modx->db->select('*',$tbl_system_eventnames,'','service DESC, groupname, name'); - $limit = $modx->db->getRecordCount($rs); - if($limit==0) echo ""; - else while ($row = $modx->db->getRow($rs)) { - // display records - if($srv!=$row['service']){ - $srv=$row['service']; - if(count($evtnames)>0) echoEventRows($evtnames); - echo ""; - echo ""; - } - // display group name - if($grp!=$row['groupname']){ - $grp=$row['groupname']; - if(count($evtnames)>0) echoEventRows($evtnames); - echo ""; - echo ""; - } - $evtnames[] = ''."\n"; - if(count($evtnames)==2) echoEventRows($evtnames); - } - if(count($evtnames)>0) echoEventRows($evtnames); - - function echoEventRows(&$evtnames) { - echo ""; - $evtnames = array(); - } -?> -
                               
                              ".$services[$srv-1]."
                              ".$row['groupname']."
                              ".implode("",$evtnames)."
                              -
                              - - -
                              -

                              - -
                              - -
                              -
                              - -
                              - -
                              + $rs = $modx->db->select('*', $tbl_system_eventnames, '', 'service DESC, groupname, name'); + $limit = $modx->db->getRecordCount($rs); + if($limit == 0) { + echo "
                               
                              " . $services[$srv - 1] . "
                              " . $row['groupname'] . "
                              " . implode("", $evtnames) . "
                              +
                              + + +
                              +

                              + +
                              + +
                              +
                              + +
                              + +
                              + invokeEvent("OnPluginFormRender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
                              + invokeEvent("OnPluginFormRender",array("id" => $id)); -if(is_array($evtOut)) echo implode("",$evtOut); -?> - - -INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('save_plugin')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -9,157 +11,138 @@ $updateMsg = ''; if(isset($_POST['listSubmitted'])) { - $updateMsg .= "Updated!

                              "; + $updateMsg .= "Updated!

                              "; $tbl = $modx->getFullTableName('site_plugin_events'); - foreach ($_POST as $listName=>$listValue) { - if ($listName == 'listSubmitted') continue; - $orderArray = explode(',', $listValue); - $listName = ltrim($listName, 'list_'); - if (count($orderArray) > 0) { - foreach($orderArray as $key => $item) { - if ($item == '') continue; - $pluginId = ltrim($item, 'item_'); - $modx->db->update(array('priority'=>$key), $tbl, "pluginid='{$pluginId}' AND evtid='{$listName}'"); - } - } - } - // empty cache - $modx->clearCache('full'); + foreach($_POST as $listName => $listValue) { + if($listName == 'listSubmitted') { + continue; + } + $orderArray = explode(',', $listValue); + $listName = ltrim($listName, 'list_'); + if(count($orderArray) > 0) { + foreach($orderArray as $key => $item) { + if($item == '') { + continue; + } + $pluginId = ltrim($item, 'item_'); + $modx->db->update(array('priority' => $key), $tbl, "pluginid='{$pluginId}' AND evtid='{$listName}'"); + } + } + } + // empty cache + $modx->clearCache('full'); } -$rs = $modx->db->select( - "sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", - $modx->getFullTableName('system_eventnames')." sysevt - INNER JOIN ".$modx->getFullTableName('site_plugin_events')." pe ON pe.evtid = sysevt.id - INNER JOIN ".$modx->getFullTableName('site_plugins')." plugs ON plugs.id = pe.pluginid", - '', - 'sysevt.name,pe.priority' - ); +$rs = $modx->db->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames') . " sysevt + INNER JOIN " . $modx->getFullTableName('site_plugin_events') . " pe ON pe.evtid = sysevt.id + INNER JOIN " . $modx->getFullTableName('site_plugins') . " plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority'); $insideUl = 0; $preEvt = ''; $evtLists = ''; $sortables = array(); - while ($plugins = $modx->db->getRow($rs)) { - if ($preEvt !== $plugins['evtid']) { - $sortables[] = $plugins['evtid']; - $evtLists .= $insideUl? '
                              ': ''; - $evtLists .= ''.$plugins['evtname'].'
                                '; - $insideUl = 1; - } - $evtLists .= '
                              • '.$plugins['name'].($plugins['disabled']?' (hide)':'').'
                              • '; - $preEvt = $plugins['evtid']; - } - if ($insideUl) $evtLists .= '
                              '; - - -$header = ' - - - MODX - - - - - + + - - -

                              '.$_lang['plugin_priority_title'].'

                              +

                              -
                              '.$_lang['plugin_priority'].'
                              -
                              -

                              '.$_lang['plugin_priority_instructions'].'

                              -'; - -echo $header; - -echo $updateMsg . "Updating...

                              "; - -echo $evtLists; - -echo '
                              - '; - -foreach ($sortables as $list) { - echo ''; -} - -echo '
                              +
                              +
                              +

                              + + + + + +
                              + + + + +
                              -'; -?> \ No newline at end of file diff --git a/manager/actions/mutate_role.dynamic.php b/manager/actions/mutate_role.dynamic.php index 747f8080aa..b6f0879e42 100644 --- a/manager/actions/mutate_role.dynamic.php +++ b/manager/actions/mutate_role.dynamic.php @@ -1,17 +1,16 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} -switch((int) $modx->manager->action) -{ +switch((int) $modx->manager->action) { case 35: - if(!$modx->hasPermission('edit_role')) - { + if(!$modx->hasPermission('edit_role')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } break; case 38: - if(!$modx->hasPermission('new_role')) - { + if(!$modx->hasPermission('new_role')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } break; @@ -21,296 +20,299 @@ $role = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; -$tbl_user_roles = $modx->getFullTableName('user_roles'); +$tbl_user_roles = $modx->getFullTableName('user_roles'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(8, $role)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['role'])); +if($lockedEl = $modx->elementIsLocked(8, $role)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(8, $role); -if($modx->manager->action=='35') -{ - $rs = $modx->db->select('*',$tbl_user_roles, "id='{$role}'"); +if($modx->manager->action == '35') { + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); $roledata = $modx->db->getRow($rs); if(!$roledata) { $modx->webAlertAndQuit("No role returned!"); } - $_SESSION['itemname']=$roledata['name']; + $_SESSION['itemname'] = $roledata['name']; } else { $roledata = 0; - $_SESSION['itemname']=$_lang["new_role"]; + $_SESSION['itemname'] = $_lang["new_role"]; } // Add lock-element JS-Script $lockElementId = $role; $lockElementType = 8; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); ?> - -
                              - - + function deletedocument() { + if(confirm("") == true) { + document.location.href = "index.php?id=" + document.userform.id.value + "&a=37"; + } + } -

                              + + + + -
                              - - manager->action=='38') { ?> - - -
                              +

                              -
                              -
                              +
                              + + manager->action == '38') { ?> + + +
                              -
                              - - - - - - - - - -
                              :
                              :
                              -
                              +
                              +
                              - - - - - - - -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              +
                              + + + + + + + + + +
                              :
                              :
                              +
                              - - - - - - - -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              + + + + + + + +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              +

                              + +
                              +
                              - - - - -
                              -
                              -

                              - -
                              -
                              + + + + + + + +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              - - - - - - - -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              + + + + +
                              +
                              +

                              + +
                              +
                              - - - - - -
                              -
                              -

                              - -
                              -
                              -
                              -

                              - -
                              -
                              + + + + + + + +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              - - -
                              -
                              + + + + + +
                              +
                              +

                              + +
                              +
                              +
                              +

                              + +
                              +
                              + + +
                              +
                              @@ -319,22 +321,22 @@ function render_form($name, $label, $status='') EOT; - $checked = ($roledata[$name]==1) ? 'checked' : ''; - $value = ($roledata[$name]==1) ? 1 : 0; - if($status=='disabled') - { + $checked = ($roledata[$name] == 1) ? 'checked' : ''; + $value = ($roledata[$name] == 1) ? 1 : 0; + if($status == 'disabled') { $checked = 'checked'; - $value = 1; - $set = 'fix'; + $value = 1; + $set = 'fix'; + } else { + $set = 'set'; } - else $set = 'set'; - + $output = $tpl; - $output = str_replace('[+name+]', $name, $output); + $output = str_replace('[+name+]', $name, $output); $output = str_replace('[+checked+]', $checked, $output); - $output = str_replace('[+status+]', $status, $output); - $output = str_replace('[+value+]', $value, $output); - $output = str_replace('[+label+]', $label, $output); - $output = str_replace('[+set+]', $set, $output); + $output = str_replace('[+status+]', $status, $output); + $output = str_replace('[+value+]', $value, $output); + $output = str_replace('[+label+]', $label, $output); + $output = str_replace('[+set+]', $set, $output); return $output; } diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index 26721cc9c8..0b3197e60e 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -1,14 +1,18 @@ INCLUDE_ORDERING_ERROR
                              Please use the MODX Content Manager instead of accessing this file directly."); -if(!$modx->hasPermission('settings')) $modx->webAlertAndQuit($_lang['error_no_privileges']); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR
                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('settings')) { + $modx->webAlertAndQuit($_lang['error_no_privileges']); +} include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php'); // check to see the edit settings page isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'"); - if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'],$username)); - } +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); +} // end check for lock // reload system settings from the database. @@ -16,100 +20,123 @@ $settings = array(); include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); -while ($row = $modx->db->getRow($rs)) { - $settings[$row['setting_name']] = $row['setting_value']; +while($row = $modx->db->getRow($rs)) { + $settings[$row['setting_name']] = $row['setting_value']; } $settings['filemanager_path'] = preg_replace('@^' . MODX_BASE_PATH . '@', '[(base_path)]', $settings['filemanager_path']); -$settings['rb_base_dir'] = preg_replace('@^' . MODX_BASE_PATH . '@', '[(base_path)]', $settings['rb_base_dir']); +$settings['rb_base_dir'] = preg_replace('@^' . MODX_BASE_PATH . '@', '[(base_path)]', $settings['rb_base_dir']); extract($settings, EXTR_OVERWRITE); // load languages and keys $lang_keys = array(); $dir = dir('includes/lang'); -while ($file = $dir->read()) { - if(strpos($file, '.inc.php')>0) { - $endpos = strpos ($file, '.'); - $languagename = substr($file, 0, $endpos); - $lang_keys[$languagename] = get_lang_keys($file); - } +while($file = $dir->read()) { + if(strpos($file, '.inc.php') > 0) { + $endpos = strpos($file, '.'); + $languagename = substr($file, 0, $endpos); + $lang_keys[$languagename] = get_lang_keys($file); + } } $dir->close(); -$displayStyle = ($_SESSION['browser']==='modern') ? 'table-row' : 'block' ; +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; ?> - - - - -
                              -

                              - - - - - - -

                              -
                              - -
                              + -
                              - - - - getVersionData('version')) { ?> -

                              - -
                              - + + + +

                              + +

                              + +
                              + +
                              + +
                              + + + + getVersionData('version')) { ?> +

                              + +
                              + + + +
                              +
                              + + -
                              -
                              - - -tpSettings.setSelectedIndex( '.$_GET['tab'].' );'; +if(is_numeric($_GET['tab'])) { + echo ''; } diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index 7cef1ffec9..3d87f7e186 100644 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -43,32 +43,6 @@ - -   - - - -
                              - - - - - - -   - - - -
                              - - - - - - -   - -
                              @@ -131,7 +105,47 @@
                              $modx->config['emailsender']));?> + +
                              + + + + +
                              + + + + +   + + + +   + + + +
                              + + + + + + +   + + + +
                              + + + + + + +   + +
                              @@ -158,21 +172,6 @@   - - -
                              - - - - -
                              - - - - - -   -
                              diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index bcc49f5874..9313eac468 100644 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -1,31 +1,33 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} switch($modx->manager->action) { - case 22: - if(!$modx->hasPermission('edit_snippet')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 23: - if(!$modx->hasPermission('new_snippet')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); + case 22: + if(!$modx->hasPermission('edit_snippet')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 23: + if(!$modx->hasPermission('new_snippet')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; // Get table Names (alphabetical) $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj'); -$tbl_site_modules = $modx->getFullTableName('site_modules'); -$tbl_site_snippets = $modx->getFullTableName('site_snippets'); +$tbl_site_modules = $modx->getFullTableName('site_modules'); +$tbl_site_snippets = $modx->getFullTableName('site_snippets'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(4, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['snippet'])); +if($lockedEl = $modx->elementIsLocked(4, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['snippet'])); } // end check for lock @@ -34,22 +36,25 @@ $content = array(); if(isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_snippets, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - header("Location: ".MODX_SITE_URL."index.php?id=".$site_start); - } - $_SESSION['itemname']=$content['name']; - if($content['locked']==1 && $_SESSION['mgrRole']!=1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - $content['properties'] = str_replace("&", "&", $content['properties']); + $rs = $modx->db->select('*', $tbl_site_snippets, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + header("Location: " . MODX_SITE_URL . "index.php?id=" . $site_start); + } + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + $content['properties'] = str_replace("&", "&", $content['properties']); +} else if(isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; } else { - $_SESSION['itemname']=$_lang["new_snippet"]; + $_SESSION['itemname'] = $_lang["new_snippet"]; + $content['category'] = intval($_REQUEST['catid']); } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -57,494 +62,499 @@ // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 4; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); ?>
                              -invokeEvent("OnSnipFormPrerender",array("id" => $id)); - if(is_array($evtOut)) echo implode("",$evtOut); - - // Prepare info-tab via parseDocBlock - $snippetcode = isset($content['snippet']) ? $modx->db->escape($content['snippet']) : ''; - $parsed = $modx->parseDocBlockFromString($snippetcode); - $docBlockList = $modx->convertDocBlockIntoList($parsed); -?> - - - -
                              - -
                              - -

                              - - - - - - -

                              - -
                              - - - -
                              - - - -
                              -

                              - - -

                              - -

                              - - - - - - - - - - - - - - - - - - -hasPermission('save_role')):?> - - - - - - - -
                              [[  ]]  -
                              -
                              - -
                              -
                              - class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> - -
                              -
                              - -
                              -
                              - -
                              - - -
                              -

                              - - - - - - - - -
                              -
                                -
                              -
                               
                              -
                              - - -
                              -

                              - - - - - + + + + + + + + +
                              + + +

                              + +

                              + +
                              + +
                              + +
                              + + + +
                              + + + +
                              +

                              + + +

                              + +

                              + + + + + + + + + + + + + + + + + + + hasPermission('save_role')): ?> + + + + + + + +
                              [[  ]]  + +
                              +
                              + +
                              +
                              + class="inputBox" onclick="setTextWrap(document.mutate.post,this.checked)" /> + +
                              +
                              + +
                              +
                              + +
                              + + +
                              +

                              + + + + + + + + +
                              +
                                +
                              +
                               
                              +
                              + + +
                              +

                              + + + + + - - - - - - - - -
                              -
                               

                              -
                              -
                              -
                              - - -
                              -

                              - -
                              - -
                              -
                              - -
                              - -invokeEvent("OnSnipFormRender",array("id" => $id)); -if(is_array($evtOut)) echo implode("",$evtOut); -?> + INNER JOIN {$tbl_site_snippets} AS ss ON ss.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams=1", 'sm.name'); + while($row = $modx->db->getRow($ds)) { + echo ""; + } + ?> + +
                               

                              +
                                +
                              • +
                              +
                              +
                              + + +
                              +

                              + +
                              + +
                              +
                              + +
                              + + invokeEvent("OnSnipFormRender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index fbae3e4877..5056e2784d 100644 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('save_template')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -7,54 +9,56 @@ $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; -$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $siteURL = $modx->config['site_url']; $updateMsg = ''; if(isset($_POST['listSubmitted'])) { - $updateMsg .= 'Updated!

                              '; - foreach ($_POST as $listName=>$listValue) { - if ($listName == 'listSubmitted' || $listName == 'reset') continue; - $orderArray = explode(';', rtrim($listValue, ';')); - foreach($orderArray as $key => $item) { - if (strlen($item) == 0) continue; - $key = $reset ? 0 : $key; - $tmplvar = ltrim($item, 'item_'); - $modx->db->update(array('rank'=>$key), $tbl_site_tmplvar_templates, "tmplvarid='{$tmplvar}' AND templateid='{$id}'"); - } - } - // empty cache - $modx->clearCache('full'); + $updateMsg .= 'Updated!

                              '; + foreach($_POST as $listName => $listValue) { + if($listName == 'listSubmitted' || $listName == 'reset') { + continue; + } + $orderArray = explode(';', rtrim($listValue, ';')); + foreach($orderArray as $key => $item) { + if(strlen($item) == 0) { + continue; + } + $key = $reset ? 0 : $key; + $tmplvar = ltrim($item, 'item_'); + $modx->db->update(array('rank' => $key), $tbl_site_tmplvar_templates, "tmplvarid='{$tmplvar}' AND templateid='{$id}'"); + } + } + // empty cache + $modx->clearCache('full'); } -$rs = $modx->db->select( - "tv.name AS name, tv.caption AS caption, tv.id AS id, tr.templateid, tr.rank, tm.templatename", - "{$tbl_site_tmplvar_templates} AS tr +$rs = $modx->db->select("tv.name AS name, tv.caption AS caption, tv.id AS id, tr.templateid, tr.rank, tm.templatename", "{$tbl_site_tmplvar_templates} AS tr INNER JOIN {$tbl_site_tmplvars} AS tv ON tv.id = tr.tmplvarid - INNER JOIN {$tbl_site_templates} AS tm ON tr.templateid = tm.id", - "tr.templateid='{$id}'", - "tr.rank DESC, tv.rank DESC, tv.id DESC" // workaround for correct sort of none-existing ranks - ); + INNER JOIN {$tbl_site_templates} AS tm ON tr.templateid = tm.id", "tr.templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tv.id DESC" // workaround for correct sort of none-existing ranks +); $limit = $modx->db->getRecordCount($rs); -if($limit>1) { - $tvsArr = array(); - while ($row = $modx->db->getRow($rs)) { - $tvsArr[] = $row; - } - $tvsArr = array_reverse($tvsArr,true); // reverse ORDERBY DESC - - $i = 0; - foreach($tvsArr as $row) { - if ($i++ == 0) $evtLists .= ''.$row['templatename'].'
                                '; +if($limit > 1) { + $tvsArr = array(); + while($row = $modx->db->getRow($rs)) { + $tvsArr[] = $row; + } + $tvsArr = array_reverse($tvsArr, true); // reverse ORDERBY DESC + + $i = 0; + foreach($tvsArr as $row) { + if($i++ == 0) { + $evtLists .= '' . $row['templatename'] . '
                                  '; + } $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; - $evtLists .= '
                                • '.$caption.' [*'.$row['name'].'*]
                                • '; - } - $evtLists .= '
                                '; + $evtLists .= '
                              • ' . $caption . ' [*' . $row['name'] . '*]
                              • '; + } + $evtLists .= '
                              '; } $header = ' @@ -84,7 +88,7 @@ padding: 3px 5px; margin: 4px 0px; border: 1px solid #CCCCCC; - background: url("'.$_style['fade'].'") center repeat-x; + background: url("' . $_style['fade'] . '") center repeat-x; background-size: auto 100%; display:inline-block; } @@ -143,7 +147,7 @@ function sort() { } function resetSortOrder() { - if (confirm("'.$_lang["confirm_reset_sort_order"].'")==true) { + if (confirm("' . $_lang["confirm_reset_sort_order"] . '")==true) { documentDirty=false; var input = document.createElement("input"); input.type = "hidden"; @@ -158,20 +162,20 @@ function resetSortOrder() { $header .= ' -

                              '.$_lang["template_tv_edit_title"].'

                              +

                              ' . $_lang["template_tv_edit_title"] . '

                              -
                              '.$_lang['template_tv_edit'].'
                              +
                              ' . $_lang['template_tv_edit'] . '
                              - -

                              '.$_lang["template_tv_edit_message"].' ('.$_lang["sort_alphabetically"].')

                              '; + +

                              ' . $_lang["template_tv_edit_message"] . ' (' . $_lang["sort_alphabetically"] . ')

                              '; echo $header; @@ -186,6 +190,3 @@ function resetSortOrder() { '; - - -?> \ No newline at end of file diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 2ead173b8c..cb5567b7ea 100644 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -1,19 +1,21 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} switch($modx->manager->action) { - case 16: - if(!$modx->hasPermission('edit_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 19: - if(!$modx->hasPermission('new_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); + case 16: + if(!$modx->hasPermission('edit_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 19: + if(!$modx->hasPermission('new_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; @@ -21,8 +23,8 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(1, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['template'])); +if($lockedEl = $modx->elementIsLocked(1, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); } // end check for lock @@ -31,22 +33,23 @@ $content = array(); if(!empty($id)) { - $rs = $modx->db->select('*',$tbl_site_templates,"id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - $modx->webAlertAndQuit("No database record has been found for this template."); - } - - $_SESSION['itemname']=$content['templatename']; - if($content['locked']==1 && $_SESSION['mgrRole']!=1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("No database record has been found for this template."); + } + + $_SESSION['itemname'] = $content['templatename']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname']=$_lang["new_template"]; + $_SESSION['itemname'] = $_lang["new_template"]; + $content['category'] = intval($_REQUEST['catid']); } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -55,232 +58,228 @@ // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 1; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); ?>
                              -invokeEvent("OnTempFormPrerender",array("id" => $id)); - if(is_array($evtOut)) echo implode("",$evtOut); -?> - - - + invokeEvent("OnTempFormPrerender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + -

                              - - - - - - -

                              +

                              + +

                              -
                              - -
                              +
                              + +
                              - -
                              -
                              - -
                              -

                              - +
                              +
                              + -

                              - -

                              - - - - - - - - - - - - - - - - - - -hasPermission('save_role')):?> - - - - - - - -
                              - config['default_template']) echo ' '.$_lang['defaulttemplate_title'].''; ?> -
                              -
                              - -
                              -
                              - -
                              -
                              - -
                              -
                              - - +
                              +

                              + -db->select( - sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), - sprintf("%s tv +

                              + +

                              + + + + + + + + + + + + + + + + + + + hasPermission('save_role')): ?> + + + + + + + +
                              + config['default_template']) { + echo ' ' . $_lang['defaulttemplate_title'] . ''; + } ?> + +
                              +
                              + +
                              +
                              + +
                              +
                              + +
                              +
                              + + + + db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid - LEFT JOIN %s cat ON tv.category=cat.id", - $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), - "templateid='{$id}'", - "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks - ); - while ($row = $modx->db->getRow($rs)) { - $selectedTvs[$row['tvid']] = $row; - } - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC -} + LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks + ); + while($row = $modx->db->getRow($rs)) { + $selectedTvs[$row['tvid']] = $row; + } + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC + } -$unselectedTvs = array(); -$rs = $modx->db->select( - sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), - sprintf("%s tv + $unselectedTvs = array(); + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid - LEFT JOIN %s cat ON tv.category=cat.id", - $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'),$modx->getFullTableName('categories')), - "", - "category, tvcaption" -); -while($row = $modx->db->getRow($rs)) { - $unselectedTvs[$row['tvid']] = $row; -} + LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); + while($row = $modx->db->getRow($rs)) { + $unselectedTvs[$row['tvid']] = $row; + } -// Catch checkboxes if form not validated -if( isset($_POST['assignedTv']) ) { - $selectedTvs = array(); - foreach($_POST['assignedTv'] as $tvid) { - if(isset($unselectedTvs[$tvid])) - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; - }; -} + // Catch checkboxes if form not validated + if(isset($_POST['assignedTv'])) { + $selectedTvs = array(); + foreach($_POST['assignedTv'] as $tvid) { + if(isset($unselectedTvs[$tvid])) { + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; + } + }; + } -$total = count($selectedTvs); -?> -
                              -
                              -

                              - - 0) echo '

                              ' . $_lang['template_tv_msg'] . '

                              '; -if($modx->hasPermission('save_template') && $total > 1 && $id) { - echo sprintf('',$id,$_lang['template_tv_edit']); -} + $total = count($selectedTvs); + ?> +
                              +
                              +

                              + + + 0) { + echo '

                              ' . $_lang['template_tv_msg'] . '

                              '; + } + if($modx->hasPermission('save_template') && $total > 1 && $id) { + echo sprintf('', $id, $_lang['template_tv_edit']); + } -// Selected TVs -$tvList = '
                              '; -if($total>0) { - $tvList .= '
                                '; - foreach($selectedTvs as $row) { - $desc = !empty($row['tvdescription']) ? '  ('.$row['tvdescription'].')' : ''; - $locked = $row['tvlocked'] ? ' ('.$_lang['locked'].')' : "" ; - $tvList .= sprintf('
                              • %s %s
                              • ', - $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - } - $tvList .= '
                              '; + // Selected TVs + $tvList = '
                              '; + if($total > 0) { + $tvList .= '
                                '; + foreach($selectedTvs as $row) { + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
                              • %s %s
                              • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + } + $tvList .= '
                              '; -} else { - echo $_lang['template_no_tv']; -} -echo $tvList; + } else { + echo $_lang['template_no_tv']; + } + echo $tvList; -// Unselected TVs -$tvList = '


                              '.$_lang['template_notassigned_tv'].'

                                '; -$preCat = ''; -$insideUl = 0; -while ($row = array_shift($unselectedTvs)) { - if(isset($selectedTvs[$row['tvid']])) continue; // Skip selected - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $tvList .= $insideUl? '
                              ': ''; - $tvList .= '
                            • '.$row['category']. ($row['catid']!='' ? ' ('.$row['catid'].')' : '') .'
                                '; - $insideUl = 1; - } + // Unselected TVs + $tvList = '


                                ' . $_lang['template_notassigned_tv'] . '

                                  '; + $preCat = ''; + $insideUl = 0; + while($row = array_shift($unselectedTvs)) { + if(isset($selectedTvs[$row['tvid']])) { + continue; + } // Skip selected + $row['category'] = stripslashes($row['category']); //pixelchutes + if($preCat !== $row['category']) { + $tvList .= $insideUl ? '
                                ' : ''; + $tvList .= '
                              • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
                                  '; + $insideUl = 1; + } - $desc = !empty($row['tvdescription']) ? '  ('.$row['tvdescription'].')' : ''; - $locked = $row['tvlocked'] ? ' ('.$_lang['locked'].')' : "" ; - $tvList .= sprintf('
                                • %s %s
                                • ', - $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $_lang['edit']); - $tvList .= ''; + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
                                • %s %s
                                • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $_lang['edit']); + $tvList .= ''; - $preCat = $row['category']; -} -$tvList .= $insideUl? '
                                ': ''; -$tvList .= '
                              '; -echo $tvList; + $preCat = $row['category']; + } + $tvList .= $insideUl ? '' : ''; + $tvList .= ''; + echo $tvList; -?>
                            • -invokeEvent("OnTempFormRender",array("id" => $id)); -if(is_array($evtOut)) echo implode("",$evtOut); -?> -
                              -
                              + ?>
                              + invokeEvent("OnTempFormRender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
                              +
                              diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 2335fe7e0a..7c50dfe9a2 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -1,9 +1,11 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); -if(!$modx->hasPermission('edit_template') && $modx->manager->action=='301') { +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -if(!$modx->hasPermission('new_template') && $modx->manager->action=='300') { +if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -11,14 +13,14 @@ $origin = isset($_REQUEST['or']) ? intval($_REQUEST['or']) : 76; $originId = isset($_REQUEST['oid']) ? intval($_REQUEST['oid']) : NULL; -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); -$tbl_site_templates = $modx->getFullTableName('site_templates'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +$tbl_site_templates = $modx->getFullTableName('site_templates'); $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); -$tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); +$tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(2, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'],$lockedEl['username'],$_lang['tmplvar'])); +if($lockedEl = $modx->elementIsLocked(2, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); } // end check for lock @@ -27,27 +29,26 @@ global $content; $content = array(); -if(isset($_GET['id'])) -{ - $rs = $modx->db->select('*',$tbl_site_tmplvars,"id='{$id}'"); +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); $content = $modx->db->getRow($rs); if(!$content) { - header("Location: ".MODX_SITE_URL."index.php?id={$site_start}"); + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); } - + $_SESSION['itemname'] = $content['caption']; - if($content['locked']==1 && $modx->hasPermission('save_role')!=1) - { + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -} -else -{ - $_SESSION['itemname']=$_lang["new_tmplvars"]; +} else if(isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; +} else { + $_SESSION['itemname'] = $_lang["new_tmplvars"]; + $content['category'] = intval($_REQUEST['catid']); } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -55,533 +56,531 @@ // Add lock-element JS-Script $lockElementId = $id; $lockElementType = 2; -require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); +require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); // get available RichText Editors $RTEditors = ''; -$evtOut = $modx->invokeEvent('OnRichTextEditorRegister',array('forfrontend' => 1)); -if(is_array($evtOut)) $RTEditors = implode(',',$evtOut); +$evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); +if(is_array($evtOut)) { + $RTEditors = implode(',', $evtOut); +} ?> + function setParameter(key, dt, ctrl) { + var v; + if(!ctrl) return null; + switch(dt) { + case 'int': + ctrl.value = parseInt(ctrl.value); + if(isNaN(ctrl.value)) ctrl.value = 0; + v = ctrl.value; + break; + case 'float': + ctrl.value = parseFloat(ctrl.value); + if(isNaN(ctrl.value)) ctrl.value = 0; + v = ctrl.value; + break; + case 'list': + v = ctrl.options[ctrl.selectedIndex].value; + break; + case 'textarea': + v = ctrl.value + ''; + break; + default: + v = ctrl.value + ''; + break; + } + currentParams[key] = v; + implodeParameters(); + } -
                              -invokeEvent('OnTVFormPrerender',array('id' => $id)); - if(is_array($evtOut)) echo implode("",$evtOut); -?> - - - - - - - -

                              - - - - - - -

                              - -
                              - -
                              - - -
                              -
                              - -
                              -

                              - - -

                              - -

                              - - - - - - - - - - - - - - - - - - - - - - - -hasPermission('save_role')):?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              [* *]   
                              -
                              -
                               
                              -
                              " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />
                              " onmouseover="this.src='';" onmouseout="this.src='';" alt="" onclick="alert(this.alt);" style="cursor:help" />
                              - -
                              <?php echo $_lang['tmplvars_reset_params']; ?>
                               
                               
                              -
                              -
                              -

                              -
                                -
                              • -
                              • -
                              • -
                              - - -db->select( - sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), - sprintf("%s as tpl - LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' - LEFT JOIN %s as cat ON tpl.category=cat.id", - $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), - '', - "category, templatename" - ); -?> - - - -
                              -'; -$preCat = ''; -$insideUl = 0; -while ($row = $modx->db->getRow($rs)) { - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $tplList .= $insideUl? '': ''; - $tplList .= '
                            • '.$row['category']. ($row['catid']!='' ? ' ('.$row['catid'].')' : '') .'
                                '; - $insideUl = 1; - } - - if($modx->manager->action=='300' && $modx->config['default_template']==$row['id']) - { - $checked = true; - } - elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) - { - $checked = true; - } - elseif($id == 0 && is_array($_POST['template'])) - { - $checked = in_array($row['id'], $_POST['template']); - } - else - { - $checked = $row['tmplvarid']; - } - $selectable = !$row['selectable'] ? ' class="disabled"':''; - $checked = $checked ? ' checked="checked"':''; - $tplId = ' (' . $row['id'] . ')'; - $desc = !empty($row['tpldescription']) ? ' - '.$row['tpldescription'] : ''; - - $tplInfo = array(); - if($row['tpllocked']) $tplInfo[] = $_lang['locked']; - if($row['id'] == $modx->config['default_template']) $tplInfo[] = $_lang['defaulttemplate_title']; - $tplInfo = !empty($tplInfo) ? ' ('.join(', ', $tplInfo).')' : ''; - - $tplList .= sprintf('
                              • %s%s%s%s
                              • ', - $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo ); - $tplList .= ''; - - $preCat = $row['category']; -} -$tplList .= $insideUl? '
                              ': ''; -$tplList .= ''; -echo $tplList; + function encode(s) { + s = s + ''; + s = s.replace(/\=/g, '%3D'); // = + s = s.replace(/\&/g, '%26'); // & + return s; + } -?> -
                            • -
                              - - db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); - $groupsarray = $modx->db->getColumn('documentgroup', $rs); + function decode(s) { + s = s + ''; + s = s.replace(/\%3D/g, '='); // = + s = s.replace(/\%26/g, '&'); // & + return s; + } -?> -hasPermission('access_permissions')) { ?> -
                              - -

                              -db->select('name, id', $tbl_documentgroup_names); - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { - $groupsarray = $_POST['docgroups']; - } - while ($row=$modx->db->getRow($rs)) { - $checked = in_array($row['id'], $groupsarray); - if($modx->hasPermission('access_permissions')) { - if($checked) $notPublic = true; - $chks.= ""; - } - else { - if($checked) echo ""; - } - } - if($modx->hasPermission('access_permissions')) { - $chks = "".$chks; - } - echo $chks; - ?> -
                              - + + invokeEvent('OnTVFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + + + + + +

                              + +

                              + +
                              +
                              - - - -invokeEvent('OnTVFormRender',array('id' => $id)); - if(is_array($evtOut)) echo implode('',$evtOut); -?> -
                              -
                              +
                              +
                              + + +
                              +

                              + + +

                              + +

                              + + + + + + + + + + + + + + + + + + + + + + + + hasPermission('save_role')): ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              [* *]   
                              + +
                              +
                               
                              +
                              " data-tooltip="">
                              " data-tooltip="">
                              + +
                              +
                              +
                               
                               
                              +
                              +
                              +

                              +
                                +
                              • +
                              • +
                              • +
                              + + + db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl + LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' + LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); + ?> + + + +
                              + '; + $preCat = ''; + $insideUl = 0; + while($row = $modx->db->getRow($rs)) { + $row['category'] = stripslashes($row['category']); //pixelchutes + if($preCat !== $row['category']) { + $tplList .= $insideUl ? '' : ''; + $tplList .= '
                            • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
                                '; + $insideUl = 1; + } + + if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { + $checked = true; + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { + $checked = true; + } elseif($id == 0 && is_array($_POST['template'])) { + $checked = in_array($row['id'], $_POST['template']); + } else { + $checked = $row['tmplvarid']; + } + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; + $checked = $checked ? ' checked="checked"' : ''; + $tplId = ' (' . $row['id'] . ')'; + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; + + $tplInfo = array(); + if($row['tpllocked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template']) { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $tplInfo = !empty($tplInfo) ? ' (' . join(', ', $tplInfo) . ')' : ''; + + $tplList .= sprintf('
                              • %s%s%s%s
                              • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); + $tplList .= ''; + + $preCat = $row['category']; + } + $tplList .= $insideUl ? '
                              ' : ''; + $tplList .= ''; + echo $tplList; + + ?> +
                            • +
                              + + db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); + $groupsarray = $modx->db->getColumn('documentgroup', $rs); + + ?> + hasPermission('access_permissions')) { ?> +
                              + +

                              + db->select('name, id', $tbl_documentgroup_names); + if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { + $groupsarray = $_POST['docgroups']; + } + while($row = $modx->db->getRow($rs)) { + $checked = in_array($row['id'], $groupsarray); + if($modx->hasPermission('access_permissions')) { + if($checked) { + $notPublic = true; + } + $chks .= ""; + } else { + if($checked) { + echo ""; + } + } + } + if($modx->hasPermission('access_permissions')) { + $chks = "" . $chks; + } + echo $chks; + ?> +
                              + + +
                              + + + + + invokeEvent('OnTVFormRender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> +
                              +
                              - + diff --git a/manager/actions/mutate_tv_rank.dynamic.php b/manager/actions/mutate_tv_rank.dynamic.php index 502f01badd..ce49e9b371 100644 --- a/manager/actions/mutate_tv_rank.dynamic.php +++ b/manager/actions/mutate_tv_rank.dynamic.php @@ -1,54 +1,57 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('save_template')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; -$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); +$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $siteURL = $modx->config['site_url']; $updateMsg = ''; if(isset($_POST['listSubmitted'])) { - $updateMsg .= 'Updated!

                              '; - foreach ($_POST as $listName=>$listValue) { - if ($listName == 'listSubmitted' || $listName == 'reset') continue; - $orderArray = explode(';', rtrim($listValue, ';')); - foreach($orderArray as $key => $item) { - if (strlen($item) == 0) continue; - $key = $reset ? 0 : $key; - $id = ltrim($item, 'item_'); - $modx->db->update(array('rank'=>$key), $tbl_site_tmplvars, "id='{$id}'"); - } - } - // empty cache - $modx->clearCache('full'); + $updateMsg .= 'Updated!

                              '; + foreach($_POST as $listName => $listValue) { + if($listName == 'listSubmitted' || $listName == 'reset') { + continue; + } + $orderArray = explode(';', rtrim($listValue, ';')); + foreach($orderArray as $key => $item) { + if(strlen($item) == 0) { + continue; + } + $key = $reset ? 0 : $key; + $id = ltrim($item, 'item_'); + $modx->db->update(array('rank' => $key), $tbl_site_tmplvars, "id='{$id}'"); + } + } + // empty cache + $modx->clearCache('full'); } -$rs = $modx->db->select( - "name, caption, id, rank", - $tbl_site_tmplvars, - "", - "rank ASC, id ASC" - ); +$rs = $modx->db->select("name, caption, id, rank", $tbl_site_tmplvars, "", "rank ASC, id ASC"); $limit = $modx->db->getRecordCount($rs); -if($limit>1) { - $tvsArr = array(); - while ($row = $modx->db->getRow($rs)) { - $tvsArr[] = $row; - } - - $i = 0; - foreach($tvsArr as $row) { - if ($i++ == 0) $evtLists .= ''.$row['templatename'].'
                                '; +if($limit > 1) { + $tvsArr = array(); + while($row = $modx->db->getRow($rs)) { + $tvsArr[] = $row; + } + + $i = 0; + foreach($tvsArr as $row) { + if($i++ == 0) { + $evtLists .= '' . $row['templatename'] . '
                                  '; + } $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; - $evtLists .= '
                                • '.$caption.' [*'.$row['name'].'*]
                                • '; - } - $evtLists .= '
                                '; + $evtLists .= '
                              • ' . $caption . ' [*' . $row['name'] . '*]
                              • '; + } + $evtLists .= '
                              '; } $header = ' @@ -77,7 +80,7 @@ padding: 3px 5px; margin: 4px 0px; border: 1px solid #CCCCCC; - background: url("'.$_style['fade'].'") center repeat-x; + background: url("' . $_style['fade'] . '") center repeat-x; background-size: auto 100%; display:inline-block; } @@ -136,7 +139,7 @@ function sort() { } function resetSortOrder() { - if (confirm("'.$_lang["confirm_reset_sort_order"].'")==true) { + if (confirm("' . $_lang["confirm_reset_sort_order"] . '")==true) { documentDirty=false; var input = document.createElement("input"); input.type = "hidden"; @@ -151,22 +154,22 @@ function resetSortOrder() { $header .= ' -

                              '.$_lang["template_tv_edit_title"].'

                              +

                              ' . $_lang["template_tv_edit_title"] . '

                              -
                              '.$_lang['template_tv_edit'].'
                              +
                              ' . $_lang['template_tv_edit'] . '
                              -

                              '.$_lang["tmplvars_rank_edit_message"].'

                              +

                              ' . $_lang["tmplvars_rank_edit_message"] . '

                              '; echo $header; @@ -182,6 +185,3 @@ function resetSortOrder() { '; - - -?> \ No newline at end of file diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 0dca822b58..19ff3f3e0b 100644 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -1,994 +1,770 @@ -INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); - -switch($modx->manager->action) { - case 12: - if (!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 11: - if (!$modx->hasPermission('new_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -$user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - -// check to see the snippet editor isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); -if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); -} -// end check for lock - -if ($modx->manager->action == '12') { - // get user attribute - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if (!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); - $usersettings = array (); - while ($row = $modx->db->getRow($rs)) - $usersettings[$row['setting_name']] = $row['setting_value']; - // manually extract so that user display settings are not overwritten - foreach ($usersettings as $k => $v) { - if ($k != 'manager_language' && $k!='manager_theme') { - ${$k} = $v; - } - } - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if (!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; -} else { - $userdata = array (); - $usersettings = array (); - $usernamedata = array (); - $_SESSION['itemname'] = $_lang["new_user"]; -} - -// avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key=>$val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); -}; -$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); - -// restore saved form -$formRestored = false; -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); -} - -// include the country list language file -$_country_lang = array(); -include_once "lang/country/english_country.inc.php"; -if($manager_language!="english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")){ - include_once "lang/country/".$manager_language."_country.inc.php"; -} - -$displayStyle = ($_SESSION['browser']==='modern') ? 'table-row' : 'block' ; -?> - - - -
                              - invokeEvent("OnUserFormPrerender", array ( - "id" => $user - )); - if (is_array($evtOut)) - echo implode("", $evtOut); - ?> - - - " /> - -

                              - - - - - - -

                              -
                              - -
                              - -
                              - " /> - -
                              - -
                              -

                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - manager->action=='12') { ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              - time() && $userdata['blockeduntil']!=0) || $userdata['failedlogins']>3) { ?>
                              -
                              - " alt="." /> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername']:$usernamedata['username']); ?> - - -
                              -
                              : 
                              manager->action=='11' ? $_lang['password'].":" : $_lang['change_password_new'].":" ; ?> manager->action=="11" ? " checked disabled": "" ; ?>>" onchange="documentDirty=true;" />
                              - " id="passwordBlock"> -
                              - - />
                              - >
                              -
                              - -
                              - -
                              - -
                              -
                              -
                              -
                              - - />
                              - /> -
                              -
                              -
                              : 
                              :  - - -
                              :  - db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); - ?> - -
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              :  - -
                              :  - " onblur='documentDirty=true;'> - " border="0" alt="" /> -
                              :  -
                              :  - -
                              : 
                              : toDateFormat($userdata['lastlogin']+$server_offset_time) ?>
                              :    []
                              : time() && $userdata['blockeduntil']!=0)) ? " checked": "" ; ?>>
                              :  - " onblur='documentDirty=true;' readonly="readonly"> - " border="0" alt="" /> -
                              :  - " onblur='documentDirty=true;' readonly="readonly"> - " border="0" alt="" /> -
                              - getLoginUserID()) { ?>

                              -
                              - - -
                              -

                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              - -
                               
                               
                              - />
                              - /> -
                               
                               
                              -
                              -
                              -
                              -
                              -
                              -
                              -
                              -
                               
                               
                              - -
                               
                              - "> -
                               
                              - "> -    />
                              -
                               
                              - "> -    />
                              -
                               
                              - "> -    />
                              -
                               
                              - "> -    />
                              -
                               
                              - "> -
                               
                              - -
                               
                              " /> -
                               
                              " /> -
                               
                              " /> -
                               
                              - - invokeEvent("OnInterfaceSettingsRender"); - if (is_array($evtOut)) - echo implode("", $evtOut); - ?> - -
                              - - -
                              -

                              - - - - - - - - - - - - - - - - - -
                               
                              -
                              - - - manager->action == '12') { // only do this bit if the user is being edited - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); - $groupsarray = $modx->db->getColumn('user_group', $rs); - } - - // retain selected doc groups between post - if (is_array($_POST['user_groups'])) { - foreach ($_POST['user_groups'] as $n => $v) - $groupsarray[] = $v; - } - ?> -
                              -

                              - -
                              -
                              - " . $_lang['access_permissions_user_message'] . "

                              "; - $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); - while ($row=$modx->db->getRow($rs)) { - echo "
                              "; - } - ?> -
                              - -
                              - -
                              -
                              - - - invokeEvent("OnUserFormRender", array ( - "id" => $user - )); - if (is_array($evtOut)) - echo implode("", $evtOut); - ?> -
                              +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 12: + if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 11: + if(!$modx->hasPermission('new_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); +} +// end check for lock + +if($modx->manager->action == '12') { + // get user attribute + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + // manually extract so that user display settings are not overwritten + foreach($usersettings as $k => $v) { + if($k != 'manager_language' && $k != 'manager_theme') { + ${$k} = $v; + } + } + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +}; +$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +include_once "lang/country/english_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +?> + + +
                              + invokeEvent("OnUserFormPrerender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + " /> +

                              +
                              +
                                +
                              • "> + + +
                              • + manager->action == '11') { ?> +
                              • ">
                              • + +
                              • ">
                              • + +
                              • ">
                              • +
                              +
                              + +
                              + " /> +
                              + +
                              +

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '12') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              + time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
                              "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
                              : 
                              manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
                              + " id="passwordBlock"> +
                              + + /> + +
                              + > + +
                              +
                              + + +
                              + + +
                              +
                              +
                              +
                              +
                              + + /> + +
                              + /> + +
                              +
                              : 
                              :  +
                              : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); + ?> +
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : " onBlur='documentDirty=true;' > + " data-tooltip="">
                              : 
                              : 
                              : 
                              : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
                              :  +    []
                              :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> +
                              : " onBlur='documentDirty=true;' readonly > + " data-tooltip="">
                              : " onBlur='documentDirty=true;' readonly > + " data-tooltip="">
                              + getLoginUserID()) { ?> +

                              + +
                              + + +
                              +

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                               
                               
                              /> + +
                              + /> +
                               
                               
                              +
                              + +
                              + +
                              + +
                              + +
                              + +
                              + +
                               
                              +
                               
                               
                              " >
                               
                              " > +    + /> + +
                               
                              " > +    + /> + +
                               
                              " > +    + /> + +
                               
                              " > +    + /> + +
                               
                              " >
                               
                               
                              " />
                               
                              " />
                               
                              " />
                               
                              + invokeEvent("OnInterfaceSettingsRender"); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
                              + + +
                              +

                              + + + + + + + + + + + + + + +
                              +
                               
                              +
                              + manager->action == '12') { // only do this bit if the user is being edited + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); + $groupsarray = $modx->db->getColumn('user_group', $rs); + } + // retain selected doc groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
                              +

                              + +

                              + db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo "
                              "; + } + } + ?> +
                              +
                              +
                              + + invokeEvent("OnUserFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
                              diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index 9927016b6d..fdf3677ec9 100644 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -1,656 +1,537 @@ -INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); - -switch($modx->manager->action) { - case 88: - if(!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 87: - if(!$modx->hasPermission('new_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -$user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - - -// check to see the snippet editor isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); -if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); -} -// end check for lock - -if($modx->manager->action=='88') { - // get user attributes - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if(!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); - $usersettings = array(); - while($row=$modx->db->getRow($rs)) $usersettings[$row['setting_name']]=$row['setting_value']; - extract($usersettings, EXTR_OVERWRITE); - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if(!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname']=$usernamedata['username']; -} else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_web_user"]; -} - -// avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key=>$val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); -}; -$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); - -// restore saved form -$formRestored = false; -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata,$_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings,$userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); -} - -// include the country list language file -$_country_lang = array(); -if($manager_language!="english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")){ - include_once "lang/country/".$manager_language."_country.inc.php"; -} else { - include_once "lang/country/english_country.inc.php"; -} - -$displayStyle = ($_SESSION['browser']==='modern') ? 'table-row' : 'block' ; -?> - - - -
                              - invokeEvent("OnWUsrFormPrerender",array("id" => $user)); - if(is_array($evtOut)) echo implode("",$evtOut); - ?> - - - " /> - -

                              - - - - - - -

                              -
                              -
                                -
                              • - - " /> + - -
                              • - manager->action == '87') { ?> -
                              • " />
                              • - -
                              • " />
                              • - -
                              • " />
                              • -
                              -
                              - - -
                              - " /> - -
                              - -
                              -

                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - manager->action=='88') { ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              - time() && $userdata['blockeduntil']!=0)|| ($userdata['blockedafter']3) { ?>
                              -
                              - " alt="." /> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername']:$usernamedata['username']); ?> - - -
                              -
                              : 
                              manager->action=='87' ? $_lang['password'].":" : $_lang['change_password_new'].":" ; ?> manager->action=="87" ? " checked disabled": "" ; ?>>" onchange="documentDirty=true;" />
                              - " id="passwordBlock"> -
                              - - />
                              - >
                              -
                              - -
                              - -
                              - -
                              -
                              -
                              -
                              - - />
                              - /> -
                              -
                              -
                              : 
                              :  - - -
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              :  - -
                              :  - " onblur='documentDirty=true;'> - " border="0" alt="" /> -
                              :  -
                              :  - -
                              : 
                              : toDateFormat($userdata['lastlogin']+$server_offset_time) ?>
                              :    []
                              : time() && $userdata['blockeduntil']!=0)||($userdata['blockedafter'] />
                              :  - " onblur='documentDirty=true;' readonly="readonly"> - " border="0" alt="" /> -
                              :  - " onblur='documentDirty=true;' readonly="readonly"> - " border="0" alt="" /> -
                              -
                              - - -
                              -

                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                               
                               
                              -
                              -
                              -
                              -
                              -
                              -
                              -
                              -
                               
                              -
                              - - -
                              -

                              - - - - - - - - - - - - - - - - - - - - - - -
                               
                              " />
                              -
                              - - manager->action=='88') { // only do this bit if the user is being edited - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); - $groupsarray = $modx->db->getColumn('webgroup', $rs); - } - - // retain selected user groups between post - if(is_array($_POST['user_groups'])) { - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; - } - - echo '
                              -

                              '.$_lang['web_access_permissions'].'

                              - - '; - echo '
                              '. $_lang['web_access_permissions'] . '
                              '; - echo '
                              '; - echo '

                              '. $_lang['access_permissions_user_message'] . '

                              '; - $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); - while ($row=$modx->db->getRow($rs)) { - echo '
                              '; - } - - echo '
                              '; - echo '
                              '; - - } - - echo ''; - - // invoke OnWUsrFormRender event - $evtOut = $modx->invokeEvent("OnWUsrFormRender",array("id" => $user)); - if(is_array($evtOut)) echo implode("",$evtOut); - - ?> - -
                              -
                              -
                              +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 88: + if(!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 87: + if(!$modx->hasPermission('new_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); +} +// end check for lock + +if($modx->manager->action == '88') { + // get user attributes + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + extract($usersettings, EXTR_OVERWRITE); + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_web_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +}; +$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} else { + include_once "lang/country/english_country.inc.php"; +} + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +?> + + +
                              + invokeEvent("OnWUsrFormPrerender", array("id" => $user)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + " /> +

                              +
                              +
                                +
                              • "> + + +
                              • + manager->action == '87') { ?> +
                              • ">
                              • + +
                              • ">
                              • + +
                              • ">
                              • +
                              +
                              + + +
                              + " /> +
                              + +
                              +

                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '88') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              + time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
                              "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
                              : 
                              manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "87" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
                              + " id="passwordBlock"> +
                              + + /> + +
                              + > + +
                              +
                              + + +
                              + + +
                              +
                              +
                              +
                              +
                              + + /> + +
                              + /> + +
                              +
                              : 
                              :  +
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : 
                              : " onBlur='documentDirty=true;' > + " data-tooltip="">
                              : 
                              : 
                              : 
                              : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
                              :  +    []
                              :  time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0)) ? " checked='checked'" : ""; ?> /> +
                              : " onBlur='documentDirty=true;' readonly > + " data-tooltip="">
                              : " onBlur='documentDirty=true;' readonly > + " data-tooltip="">
                              +
                              + + +
                              +

                              + + + + + + + + + + + + + + + + + + + + + + + + + + +
                               
                               
                              +
                              + +
                              + +
                              + +
                              + +
                              + +
                              + +
                               
                              +
                              + + +
                              +

                              + + + + + + + + + + + + + + +
                              +
                               
                              " />
                              +
                              + manager->action == '88') { // only do this bit if the user is being edited + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); + $groupsarray = $modx->db->getColumn('webgroup', $rs); + } + // retain selected user groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
                              +

                              + +

                              + db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo '
                              '; + } + } + ?> +
                              +
                              +
                              + + invokeEvent("OnWUsrFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
                              diff --git a/manager/actions/refresh_site.dynamic.php b/manager/actions/refresh_site.dynamic.php index 0b4c1d7d63..c2394e8f6b 100644 --- a/manager/actions/refresh_site.dynamic.php +++ b/manager/actions/refresh_site.dynamic.php @@ -1,30 +1,33 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} // (un)publishing of documents, version 2! // first, publish document waiting to be published $ctime = time(); $sctable = $modx->getFullTableName('site_content'); -$modx->db->update(array('published'=>1), $sctable, "pub_date < {$ctime} AND pub_date!=0 AND unpub_date > {$ctime}"); +$modx->db->update(array('published' => 1), $sctable, "pub_date < {$ctime} AND pub_date!=0 AND unpub_date > {$ctime}"); $num_rows_pub = $modx->db->getAffectedRows(); -$modx->db->update(array('published'=>0), $sctable, "unpub_date < {$ctime} AND unpub_date!=0 AND published=1"); +$modx->db->update(array('published' => 0), $sctable, "unpub_date < {$ctime} AND unpub_date!=0 AND published=1"); $num_rows_unpub = $modx->db->getAffectedRows(); ?>

                              +
                              -
                              -".$_lang["refresh_published"]."

                              ", $num_rows_pub) ?> -".$_lang["refresh_unpublished"]."

                              ", $num_rows_unpub) ?> -clearCache('full', true); +
                              + " . $_lang["refresh_published"] . "

                              ", $num_rows_pub) ?> + " . $_lang["refresh_unpublished"] . "

                              ", $num_rows_unpub) ?> + clearCache('full', true); -// invoke OnSiteRefresh event -$modx->invokeEvent("OnSiteRefresh"); + // invoke OnSiteRefresh event + $modx->invokeEvent("OnSiteRefresh"); -?> -
                              + ?> +
                              diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 65ffa8055b..8e581ea9b5 100644 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('edit_module')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -8,223 +10,199 @@ ?> -> +> - <?php echo $content["name"]." ".$_lang['element_selector_title']; ?> + <?php echo $content["name"] . " " . $_lang['element_selector_title']; ?> - " /> - - + - + ?> db->escape($query); - - // select SQL - switch($rt){ - case "snip": - $title = $_lang["snippet"]; - $ds = $modx->db->select( - 'id,name,description', - $modx->getFullTableName("site_snippets"), - ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - 'name' - ); - break; - - case "tpl": - $title = $_lang["template"]; - $ds = $modx->db->select( - 'id,templatename as name,description', - $modx->getFullTableName("site_templates"), - ($sqlQuery ? "(templatename LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - 'templatename' - ); - break; - - case("tv"): - $title = $_lang["tv"]; - $ds = $modx->db->select( - 'id,name,description', - $modx->getFullTableName("site_tmplvars"), - ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - 'name' - ); - break; - - case("chunk"): - $title = $_lang["chunk"]; - $ds = $modx->db->select( - 'id,name,description', - $modx->getFullTableName("site_htmlsnippets"), - ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - 'name' - ); - break; - - case("plug"): - $title = $_lang["plugin"]; - $ds = $modx->db->select( - 'id,name,description', - $modx->getFullTableName("site_plugins"), - ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')":""), - 'name' - ); - break; - - case("doc"): - $title = $_lang["resource"]; - $ds = $modx->db->select( - 'id,pagetitle as name,longtitle as description', - $modx->getFullTableName("site_content"), - ($sqlQuery ? "(pagetitle LIKE '%{$sqlQuery}%') OR (longtitle LIKE '%{$sqlQuery}%')":""), - 'pagetitle' - ); - break; - - } - +/** + * Resource Selector + * Created by Raymond Irving May, 2005 + * + * Selects a resource and returns the id values to the window.opener["callback"]() function as an array. + * The name of the callback function is passed via the url as &cb + */ + +// get name of callback function +$cb = $_REQUEST['cb']; + +// get resource type +$rt = strtolower($_REQUEST['rt']); + +// get selection method: s - single (default), m - multiple +$sm = strtolower($_REQUEST['sm']); + +// get search string +$query = $_REQUEST['search']; +$sqlQuery = $modx->db->escape($query); + +// select SQL +switch($rt) { + case "snip": + $title = $_lang["snippet"]; + $ds = $modx->db->select('id,name,description', $modx->getFullTableName("site_snippets"), ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), 'name'); + break; + + case "tpl": + $title = $_lang["template"]; + $ds = $modx->db->select('id,templatename as name,description', $modx->getFullTableName("site_templates"), ($sqlQuery ? "(templatename LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), 'templatename'); + break; + + case("tv"): + $title = $_lang["tv"]; + $ds = $modx->db->select('id,name,description', $modx->getFullTableName("site_tmplvars"), ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), 'name'); + break; + + case("chunk"): + $title = $_lang["chunk"]; + $ds = $modx->db->select('id,name,description', $modx->getFullTableName("site_htmlsnippets"), ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), 'name'); + break; + + case("plug"): + $title = $_lang["plugin"]; + $ds = $modx->db->select('id,name,description', $modx->getFullTableName("site_plugins"), ($sqlQuery ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), 'name'); + break; + + case("doc"): + $title = $_lang["resource"]; + $ds = $modx->db->select('id,pagetitle as name,longtitle as description', $modx->getFullTableName("site_content"), ($sqlQuery ? "(pagetitle LIKE '%{$sqlQuery}%') OR (longtitle LIKE '%{$sqlQuery}%')" : ""), 'pagetitle'); + break; + +} + ?>
                              - - - - - - - - -
                              -
                              -

                              -
                              - - - - - - - - -
                              - -
                              - noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass="grid"; - $grd->columnHeaderClass="gridHeader"; - $grd->itemClass="gridItem"; - $grd->altItemClass="gridAltItem"; - $grd->columns=$_lang["name"]." ,".$_lang["description"]; - $grd->colTypes = "template: [+value+]"; - $grd->colWidths = "45%"; - $grd->fields="name,description"; - if($_REQUEST['listmode']=='1') $grd->pageSize=0; - echo $grd->render(); - ?> -
                              -
                              +
                              - + \ No newline at end of file diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index a3dc96c43a..144efaa5f4 100644 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -1,464 +1,72 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); - -function createResourceList($resourceTable,$action,$nameField = 'name') { - global $modx, $_lang, $_style, $modx_textdir; - - $pluginsql = $resourceTable == 'site_plugins' ? $resourceTable.'.disabled, ' : ''; - - $tvsql = ''; - $tvjoin = ''; - if($resourceTable == 'site_tmplvars') { - $tvsql = 'site_tmplvars.caption, '; - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; - } - else $sttfield = ''; - - //$orderby = $resourceTable == 'site_plugins' ? '6,2' : '5,1'; - - switch($resourceTable) { - case 'site_plugins': - $orderby= '6,2'; break; - case 'site_tmplvars': - $orderby= '7,3'; break; - case 'site_templates': - $orderby= '6,1'; break; - default: - $orderby= '5,1'; - } - - $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : ""; - - $rs = $modx->db->select( - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($resourceTable)." AS {$resourceTable} - LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", - "", - $orderby - ); - $limit = $modx->db->getRecordCount($rs); - if($limit<1){ - echo $_lang['no_results']; - } else { - $output = '
                                '; - $preCat = ''; - $insideUl = 0; - while ($row = $modx->db->getRow($rs)) { - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $output .= $insideUl? '
                              ': ''; - $output .= '
                            • '.$row['category']. ($row['catid']!=''? ' ('.$row['catid'].')' : '') .'
                                '; - $insideUl = 1; - } - - if ($resourceTable == 'site_templates') { - $class = $row['selectable'] ? '' : ' class="disabledPlugin"'; - $lockElementType = 1; - } - if ($resourceTable == 'site_tmplvars') { - $class = $row['reltpl'] ? '' : ' class="disabledPlugin"'; - $lockElementType = 2; - } - if ($resourceTable == 'site_htmlsnippets') { - $lockElementType = 3; - } - if ($resourceTable == 'site_snippets') { - $lockElementType = 4; - } - if ($resourceTable == 'site_plugins') { - $class = $row['disabled'] ? ' class="disabledPlugin"' : ''; - $lockElementType = 5; - } - - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); - if($rowLock && $modx->hasPermission('display_locks')) { - if($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array('element_type'=>$_lang["lock_element_type_".$lockElementType],'lasthit_df'=>$rowLock['lasthit_df'])); - $lockedByUser = ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array('element_type'=>$_lang["lock_element_type_".$lockElementType], 'username'=>$rowLock['username'], 'lasthit_df'=>$rowLock['lasthit_df'])); - if($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - - $output .= '
                              • '.$lockedByUser.''.$row['name'].' (' . $row['id'] . ')'.($modx_textdir ? '‏' : '').''; - - if ($resourceTable == 'site_tmplvars') { - $output .= !empty($row['description']) ? ' - '.$row['caption'].'   ('.$row['description'].')' : ' - '.$row['caption']; - }else{ - $output .= !empty($row['description']) ? ' - '.$row['description'] : '' ; - } - - $tplInfo = array(); - if($row['locked']) $tplInfo[] = $_lang['locked']; - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') $tplInfo[] = $_lang['defaulttemplate_title']; - $output .= !empty($tplInfo) ? ' ('.join(', ', $tplInfo).')' : ''; - - $output .= '
                              • '; - - $preCat = $row['category']; - } - $output .= $insideUl? '
                              ': ''; - $output .= ''; -} - return $output; +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); } +include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); +include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); + +$resources = new mgrResources(); + +// Prepare lang-strings for "Lock Elements" +$unlockTranslations = array( + 'msg' => $_lang["unlock_element_id_warning"], + 'type1' => $_lang["lock_element_type_1"], + 'type2' => $_lang["lock_element_type_2"], + 'type3' => $_lang["lock_element_type_3"], + 'type4' => $_lang["lock_element_type_4"], + 'type5' => $_lang["lock_element_type_5"], + 'type6' => $_lang["lock_element_type_6"], + 'type7' => $_lang["lock_element_type_7"], + 'type8' => $_lang["lock_element_type_8"] +); +foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); + +// Prepare lang-strings for mgrResAction() +$mraTranslations = array( + 'create_new' => $_lang["create_new"], + 'edit' => $_lang["edit"], + 'duplicate' => $_lang["duplicate"], + 'remove' => $_lang["remove"], + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], + 'confirm_delete_template' => $_lang["confirm_delete_template"], + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], + 'confirm_delete_module' => $_lang["confirm_delete_module"], +); +foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); ?> + + - - + + + -

                              - - - - - - +

                              +

                              -
                              - - - - -hasPermission('new_template') || $modx->hasPermission('edit_template')) { ?> -
                              -

                              - - - -
                                -
                              • -
                                - -
                                -
                              • -
                              • -
                              • -
                              - - - - -
                              - - - -hasPermission('new_template') || $modx->hasPermission('edit_template')) { ?> -
                              -

                              - - - - -
                                -
                              • -
                                - -
                                -
                              • -
                              • -
                              • -
                              • -
                              - - - - -
                              - - - -hasPermission('new_chunk') || $modx->hasPermission('edit_chunk')) { ?> -
                              -

                              - - - -
                                -
                              • -
                                - -
                                -
                              • -
                              • -
                              • -
                              - - - - -
                              - - - -hasPermission('new_snippet') || $modx->hasPermission('edit_snippet')) { ?> -
                              -

                              - - - -
                                -
                              • -
                                - -
                                -
                              • -
                              • -
                              • -
                              - - - - -
                              - - - -hasPermission('new_plugin') || $modx->hasPermission('edit_plugin')) { ?> -
                              -

                              - - - -
                                -
                              • -
                                - -
                                -
                              • - hasPermission('new_plugin')) { ?>
                              • - hasPermission('save_plugin')) { ?>
                              • -hasPermission('delete_plugin') && $_SESSION['mgrRole'] == 1) { - $tbl_site_plugins = $modx->getFullTableName('site_plugins'); - if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { ?> -
                              • - -
                              • -
                              - - - - -
                              - - - -
                              -

                              - - - -
                                -
                              • -
                                - -
                                -
                              • -
                              • -
                              - -
                              - hasPermission('edit_plugin') || $modx->hasPermission('new_plugin')) { - $displayInfo['plugin'] = array('table'=>'site_plugins','action'=>102,'name'=>$_lang['manage_plugins']); - $hasPermission = 1; - } - if($modx->hasPermission('edit_snippet') || $modx->hasPermission('new_snippet')) { - $displayInfo['snippet'] = array('table'=>'site_snippets','action'=>22,'name'=>$_lang['manage_snippets']); - $hasPermission = 1; - } - if($modx->hasPermission('edit_chunk') || $modx->hasPermission('new_chunk')) { - $displayInfo['htmlsnippet'] = array('table'=>'site_htmlsnippets','action'=>78,'name'=>$_lang['manage_htmlsnippets']); - $hasPermission = 1; - } - if($modx->hasPermission('edit_template') || $modx->hasPermission('new_template')) { - $displayInfo['templates'] = array('table'=>'site_templates','action'=>16,'name'=>$_lang['manage_templates']); - $displayInfo['tmplvars'] = array('table'=>'site_tmplvars','action'=>301,'name'=>$_lang['tmplvars']); - $hasPermission = 1; - } - if($modx->hasPermission('edit_module') || $modx->hasPermission('new_module')) { - $displayInfo['modules'] = array('table'=>'site_modules','action'=>108,'name'=>$_lang['modules']); - $hasPermission = 1; - } - - //Category Delete permission check - $delPerm = 0; - if($modx->hasPermission('save_plugin') || - $modx->hasPermission('save_snippet') || - $modx->hasPermission('save_chunk') || - $modx->hasPermission('save_template') || - $modx->hasPermission('save_module')) { - $delPerm = 1; - } - - if($hasPermission) { - $finalInfo = array(); - - foreach ($displayInfo as $n => $v) { - $nameField = ($v['table'] == 'site_templates')? 'templatename': 'name'; - $pluginsql = $v['table'] == 'site_plugins' ? $v['table'].'.disabled, ' : ''; - $rs = $modx->db->select( - "{$pluginsql} {$nameField} as name, {$v['table']}.id, description, locked, IF(isnull(categories.category), '{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($v['table'])." AS {$v['table']} - LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$v['table']}.category = categories.id", - "", - "5,1" - ); - while ($row = $modx->db->getRow($rs)) { - $row['type'] = $v['name']; - $row['action'] = $v['action']; - if (empty($row['category'])) {$row['category'] = $_lang['no_category'];} - $finalInfo[] = $row; - } - } - - foreach($finalInfo as $n => $v) { - $category[$n] = $v['category']; - $name[$n] = $v['name']; - } - - $category_lowercase = array_map('strtolower', $category); - $name_lowercase = array_map('strtolower', $name); - array_multisort($category_lowercase, SORT_ASC, SORT_STRING, $name_lowercase, SORT_ASC, SORT_STRING, $finalInfo); - - echo '
                                '; - $preCat = ''; - $insideUl = 0; - foreach($finalInfo as $n => $v) { - if ($preCat !== $v['category']) { - echo $insideUl? '
                              ': ''; - if ($v['category'] == $_lang['no_category'] || !$delPerm) { - echo '
                            • '.$v['category']. ($v['catid']!='' ? ' ('.$v['catid'].')' : '') .'
                                '; - } else { - echo '
                              • '.$v['category']. ($v['catid']!='' ? ' ('.$v['catid'].')' : '') .' - '.$_lang['delete'].'
                                  '; - } - $insideUl = 1; - } - $class = array_key_exists('disabled',$v) && $v['disabled'] ? ' class="disabledPlugin"' : ''; - if ($v['id']) { - ?> -
                                • >('.$_lang['locked'].')' : "" ; ?>
                                • - ': ''; - ?> - -
                            • - -
                              - tpResources.setSelectedIndex( '.$_GET['tab'].' );'; - } -?> -
                              +
                              + + + tpResources.setSelectedIndex( ' . $_GET['tab'] . ' );'; + } + ?> +
                              \ No newline at end of file diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php new file mode 100644 index 0000000000..e433ebc5b7 --- /dev/null +++ b/manager/actions/resources/functions.inc.php @@ -0,0 +1,228 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +$tpl = array( + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') +); + +function parsePh($tpl, $ph) { + global $modx, $_lang; + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); + return $modx->parseText($tpl, $ph); +} + +function renderViewSwitchButtons($cssId) { + global $modx, $_lang, $tpl; + + return parsePh($tpl['viewForm'], array( + 'cssId' => $cssId + )); +} + +function createResourceList($resourceTable, $resources) { + global $modx, $_lang, $_style, $modx_textdir, $tpl; + + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + + if(!$items) { + return $_lang['no_results']; + } + + // Prepare elements- and categories-list + $elements = array(); + $categories = array(); + foreach($items as $row) { + $catid = $row['catid'] ? $row['catid'] : 0; + $categories[$catid] = array('name' => stripslashes($row['category'])); + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); + } + + // Now render categories / panel-collapse + $panelGroup = ''; + foreach($elements as $catid => $elList) { + // Add panel-heading / category-collapse to output + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => $resourceTable, + 'category' => $categories[$catid]['name'], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); + + // Prepare content for panel-collapse + $panelCollapse = ''; + foreach($elList as $el) { + $panelCollapse .= parsePh($tpl['elementsRow'], $el); + } + + // Add panel-collapse with elements to output + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => $resourceTable, + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } + + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => $resourceTable, + 'wrapper' => $panelGroup + )); +} + +function createCombinedView($resources) { + global $modx, $_lang, $_style, $modx_textdir; + + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; + $types = isset($resources->types) ? $resources->types : false; + $categories = isset($resources->categories) ? $resources->categories : false; + + if(!$itemsPerCategory) { + return $_lang['no_results']; + } + + $tpl = array( + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), + ); + + // Easily loop through $itemsPerCategory-Array + $panelGroup = ''; + foreach($categories as $catid => $category) { + // Prepare collapse content / elements-list + $panelCollapse = ''; + foreach($itemsPerCategory[$catid] as $el) { + $resourceTable = $el['type']; + $ph = prepareElementRowPh($el, $resourceTable, $resources); + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); + } + + // Add panel-heading / button + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => 'categories_list', + 'category' => $categories[$catid], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); + + // Add panel + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => 'categories_list', + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } + + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => 'categories_list', + 'wrapper' => $panelGroup + )); +} + +function prepareElementRowPh($row, $resourceTable, $resources) { + global $modx, $modx_textdir, $_style, $_lang; + + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + + $class = ''; + if($resourceTable == 'site_templates') { + $class = $row['selectable'] ? '' : 'disabledPlugin'; + $lockElementType = 1; + } + if($resourceTable == 'site_tmplvars') { + $class = $row['reltpl'] ? '' : 'disabledPlugin'; + $lockElementType = 2; + } + if($resourceTable == 'site_htmlsnippets') { + $lockElementType = 3; + } + if($resourceTable == 'site_snippets') { + $lockElementType = 4; + } + if($resourceTable == 'site_plugins') { + $class = $row['disabled'] ? 'disabledPlugin' : ''; + $lockElementType = 5; + } + + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); + if($rowLock && $modx->hasPermission('display_locks')) { + if($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'username' => $rowLock['username'], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if($modx->hasPermission('remove_locks')) { + $lockedByUser = ''; + } else { + $lockedByUser = ''; + } + } + } + if($lockedByUser) { + $lockedByUser = '
                              ' . $lockedByUser . '
                              '; + } + + // Caption + if($resourceTable == 'site_tmplvars') { + $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; + } else { + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; + } + + // Special marks + $tplInfo = array(); + if($row['locked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $marks = !empty($tplInfo) ? ' (' . join(', ', $tplInfo) . ')' : ''; + + /* row buttons */ + $buttons = ''; + if($modx->hasPermission($types['actions']['edit'][1])) { + $buttons .= '
                            • '; + } + if($modx->hasPermission($types['actions']['duplicate'][1])) { + $buttons .= '
                            • '; + } + if($modx->hasPermission($types['actions']['remove'][1])) { + $buttons .= '
                            • '; + } + $buttons = $buttons ? '
                                ' . $buttons . '
                              ' : ''; + + $catid = $row['catid'] ? $row['catid'] : 0; + + // Placeholders for elements-row + return array( + 'class' => $class ? ' class="' . $class . '"' : '', + 'lockedByUser' => $lockedByUser, + 'name' => $row['name'], + 'caption' => $caption, + 'buttons' => $buttons, + 'marks' => $marks, + 'id' => $row['id'], + 'resourceTable' => $resourceTable, + 'actionEdit' => $types['actions']['edit'][0], + 'catid' => $catid, + 'textdir' => $modx_textdir ? '‏' : '', + ); +} + diff --git a/manager/actions/resources/functions.js b/manager/actions/resources/functions.js new file mode 100644 index 0000000000..5061023db6 --- /dev/null +++ b/manager/actions/resources/functions.js @@ -0,0 +1,379 @@ +function unlockElement(type, id, domEl) { + var msg = trans.msg.replace('[+id+]',id).replace('[+element_type+]',trans['type'+type]); + if(confirm(msg)==true) { + jQuery.get( 'index.php?a=67&type='+type+'&id='+id, function( data ) { + if(data == 1) { + jQuery(domEl).fadeOut(); + } + else alert( data ); + }); + } +} + +// Switch Views +var version = 1; + +function initViews(pre, helppre, target) { + jQuery( "#"+helppre+"-help" ).click(function() { + jQuery( '#'+helppre+'-info').toggle(400); + }); +} + +function setColumnCount(targetEl, count) { + targetEl.find('.panel-collapse > ul').css({ + '-moz-column-count': count, + '-webkit-column-count': count, + 'column-count': count, + }); +} + +function getViewOpts(form) { + viewOpts = {}; + // Options + viewOpts.cb_buttons = form.find("input:checkbox[name=cb_buttons]").is(':checked'); + viewOpts.cb_description = form.find("input:checkbox[name=cb_description]").is(':checked'); + viewOpts.cb_icons = form.find("input:checkbox[name=cb_icons]").is(':checked'); + + // Views + viewOpts.view = form.find("input[name=view]:checked").val(); + viewOpts.columns = form.find("input[name=columns]").val(); + + viewOpts.fontsize = form.find("input[name=fontsize]").val(); + + return viewOpts; +} + +function setView(viewOpts, targetEl, target) { + // Options + if(viewOpts.cb_buttons) { + targetEl.find('.btnCell').show(); + } else { + targetEl.find('.btnCell').hide(); + } + if(viewOpts.cb_description) { + targetEl.find('span.elements_descr').show(); + } else { + targetEl.find('span.elements_descr').hide(); + } + if(viewOpts.cb_icons) { + targetEl.removeClass('noicons'); + } else { + targetEl.addClass('noicons'); + } + + // Views + switch(viewOpts.view) { + case 'inline': + targetEl.removeClass('flex list'); + targetEl.addClass('inline'); + setColumnCount(targetEl, 1); + break; + case 'flex': + targetEl.removeClass('inline list'); + targetEl.addClass('flex'); + setColumnCount(targetEl, viewOpts.columns); + break; + case 'list': + default: + targetEl.removeClass('flex inline'); + targetEl.addClass('list'); + setColumnCount(targetEl, 1); + break; + } + + // Set font-size + targetEl.css('font-size', viewOpts.fontsize/10 + 'em'); + + // Save view-options to localStorage + viewOpts.version = version; // Provides version of options-obj to allow easy resetting of localStorage on future updates + localStorage.setItem('MODX_mgrResources_'+target, JSON.stringify(viewOpts)); + + // console.log('save', viewOpts); +} + +function setAllViews(viewOpts) { + jQuery(".switchForm").each(function() { + var form = jQuery(this); + var target = form.data('target'); + var targetEl = jQuery('#'+target); + setView(viewOpts, targetEl, target); + setViewOptions(form, viewOpts); + }); +} + +function setViewOptions(form, viewOpts) { + form.find("input:checkbox[name=cb_buttons]") .attr('checked', viewOpts.cb_buttons).prop("checked", viewOpts.cb_buttons); + form.find("input:checkbox[name=cb_description]").attr('checked', viewOpts.cb_description).prop("checked", viewOpts.cb_description); + form.find("input:checkbox[name=cb_icons]") .attr('checked', viewOpts.cb_icons).prop("checked", viewOpts.cb_icons); + form.find("input:radio[name=view][value="+viewOpts.view+"]").attr('checked', true).prop("checked", true); + form.find("input[name=columns]").val(viewOpts.columns); + form.find("input[name=fontsize]").val(viewOpts.fontsize); +} + +function setViewDefaultOptions(form) { + var viewOpts = {}; + viewOpts.cb_buttons = 1; + viewOpts.cb_description = 1; + viewOpts.cb_icons = 1; + viewOpts.view = 'list'; + viewOpts.columns = 3; + viewOpts.fontsize = 10; + setViewOptions(form, viewOpts); +} + +// Add switch-view functionality +jQuery( document ).ready(function() { + jQuery(".switchForm").each(function() { + var form = jQuery(this); + var target = form.data('target'); + var targetEl = jQuery('#'+target); + + form.change(function() { + var viewOpts = getViewOpts(form); + if(form.find("input:checkbox[name=cb_all]").is(':checked')) { + // Set view in all tabs + setAllViews(viewOpts); + } else { + // Set view in single tab + setView(viewOpts, targetEl, target); + } + }); + + // Get parameters from localStorage + var viewOpts = JSON.parse(localStorage.getItem('MODX_mgrResources_'+target)); + + // console.log('load', viewOpts.version, '==', version); + // console.log(viewOpts); + + // Set views - if version is different, defaults will be set up + if(viewOpts && viewOpts.version == version) { + setViewOptions(form, viewOpts); + } else { + setViewDefaultOptions(form); + } + + // Now restore settings + form.trigger('change'); + + // Add reset-button + form.find(".btn_reset").click(function(e) { + e.preventDefault(); + setViewDefaultOptions(form); + form.trigger('change'); + }); + + // Prevent sending form + form.submit(function(e){ + e.preventDefault(); + }); + }); + + // Add switchForm-toggle + jQuery('.switchform-btn').each(function() { + jQuery(this).click(function() { + var target = jQuery(this).data('target'); + jQuery('#'+target).toggle(400); + }); + }); + + jQuery(function() { + var context = jQuery("#resourcesPane").nuContextMenu({ + hideAfterClick: true, + items: ".man_el_name", + callback: function(action, element) { + var el = jQuery(element); + var name = el.text().trim(); + var cm = el.closest(".man_el_name"); + mgrResAction(name, action, cm.data("type"), cm.data("id"), cm.data("catid")); + }, + menu: [ + { name: "create", title: mraTrans.create_new, icon: "plus", }, + { name: "edit", title: mraTrans.edit, icon: "edit", }, + { name: "duplicate", title: mraTrans.duplicate, icon: "clone", }, + { name: "void" }, + { name: "remove", title: mraTrans.remove, icon: "trash", }, + ] + }); + }); + + function mgrResAction(name, action, type, id, catid) { + var actionIds, deleteMsg; + + switch(type) { + case "site_templates" : + actionsIds = { "create":19, "edit":16, "duplicate":96, "remove":21 }; + deleteMsg = mraTrans.confirm_delete_template; + break; + case "site_tmplvars" : + actionsIds = { "create":300, "edit":301, "duplicate":304, "remove":303 }; + deleteMsg = mraTrans.confirm_delete_tmplvars; + break; + case "site_htmlsnippets" : + actionsIds = { "create":77, "edit":78, "duplicate":97, "remove":80 }; + deleteMsg = mraTrans.confirm_delete_htmlsnippet; + break; + case "site_snippets" : + actionsIds = { "create":23, "edit":22, "duplicate":98, "remove":25 }; + deleteMsg = mraTrans.confirm_delete_snippet; + break; + case "site_plugins" : + actionsIds = { "create":101, "edit":102, "duplicate":105, "remove":104 }; + deleteMsg = mraTrans.confirm_delete_plugin; + break; + case "site_modules" : + actionsIds = { "create":107, "edit":108, "duplicate":111, "remove":110 }; + deleteMsg = mraTrans.confirm_delete_module; + break; + default : + alert("Unknown type"); + return; + } + + // Actions that need confirmation + var confirmMsg = false; + switch(action) { + case "create" : id = false; break; + case "edit" : break; + case "duplicate" : confirmMsg = mraTrans.confirm_duplicate_record; break; + case "remove" : confirmMsg = deleteMsg; break; + } + + if(confirmMsg) { + confirmMsg += " \n \n " + name; // + " ("+id+")" + var r = confirm(confirmMsg); + if (r != true) return; + } + + var target = "index.php?a="+actionsIds[action]+ (id ? "&id="+id : "")+ (catid ? "&catid="+catid : ""); + + if(top.main) top.main.document.location.href=target; + else document.location.href=target; + } +}); + +function initQuicksearch(inputId, listId) { + jQuery("#"+inputId).quicksearch("#"+listId+" ul.elements > li", { + selector: ".man_el_name", + "show": function () { jQuery(this).removeClass("hide"); }, + "hide": function () { jQuery(this).addClass("hide"); }, + "bind":"keyup", + "onAfter": function() { + jQuery("#"+listId).find(".panel-collapse").each( function() { + var parentLI = jQuery(this); + var totalLI = jQuery(this).find("ul.elements > li").length; + var hiddenLI = jQuery(this).find("ul.elements > li.hide").length; + if (hiddenLI == totalLI) { parentLI.prev(".panel-heading").addClass("hide"); } + else { parentLI.prev(".panel-heading").removeClass("hide"); } + }); + } + }); + jQuery(".filterElements-form").keydown(function (e) { + if (e.keyCode == 13) { + e.preventDefault(); + } + }); +} + +var storageKey = "MODX_mgrResources"; + +// localStorage reset : +// localStorage.removeItem(storageKey); + +// Prepare remember collapsed categories function +var storage = localStorage.getItem(storageKey); +var elementsInTreeParams = {}; +var searchFieldCache = {}; + +try { + if(storage != null) { + try { + elementsInTreeParams = JSON.parse( storage ); + } catch(err) { + console.log(err); + elementsInTreeParams = { "cat_collapsed": {} }; + } + } else { + elementsInTreeParams = { "cat_collapsed": {} }; + } + + // Remember collapsed categories functions + function setRememberCollapsedCategories(obj) { + obj = obj == null ? elementsInTreeParams.cat_collapsed : obj; + for (var type in obj) { + if (!elementsInTreeParams.cat_collapsed.hasOwnProperty(type)) continue; + for (var category in elementsInTreeParams.cat_collapsed[type]) { + if (!elementsInTreeParams.cat_collapsed[type].hasOwnProperty(category)) continue; + state = elementsInTreeParams.cat_collapsed[type][category]; + if(state == null) continue; + var collapseItem = jQuery("#collapse" + type + category); + var toggleItem = jQuery("#toggle" + type + category); + if(state == 0) { + // Collapsed + collapseItem.collapse("hide"); + toggleItem.addClass("collapsed"); + } else { + // Open + collapseItem.collapse("show"); + toggleItem.removeClass("collapsed"); + } + } + } + // Avoid first category collapse-flicker on reload + setTimeout(function() { + jQuery(".panel-group").removeClass("no-transition"); + }, 50); + } + + function setLastCollapsedCategory(type, id, state) { + state = state != 1 ? 1 : 0; + if(typeof elementsInTreeParams.cat_collapsed[type] == "undefined") elementsInTreeParams.cat_collapsed[type] = {}; + elementsInTreeParams.cat_collapsed[type][id] = state; + } + function writeElementsInTreeParamsToStorage() { + var jsonString = JSON.stringify(elementsInTreeParams); + localStorage.setItem(storageKey, jsonString ); + } + + jQuery(document).ready(function() { + + jQuery(".filterElements-form").keydown(function (e) { + if(e.keyCode == 13) e.preventDefault(); + }); + + // Shift-Mouseclick opens/collapsed all categories + jQuery(".accordion-toggle").click(function(e) { + e.preventDefault(); + var thisItemCollapsed = jQuery(this).hasClass("collapsed"); + if (e.shiftKey) { + // Shift-key pressed + var toggleItems = jQuery(this).closest(".panel-group").find("> .panel .accordion-toggle"); + var collapseItems = jQuery(this).closest(".panel-group").find("> .panel > .panel-collapse"); + if(thisItemCollapsed) { + toggleItems.removeClass("collapsed"); + collapseItems.collapse("show"); + } else { + toggleItems.addClass("collapsed"); + collapseItems.collapse("hide"); + } + // Save states to localStorage + toggleItems.each(function() { + state = jQuery(this).hasClass("collapsed") ? 1 : 0; + setLastCollapsedCategory(jQuery(this).data("cattype"), jQuery(this).data("catid"), state); + }); + writeElementsInTreeParamsToStorage(); + } else { + jQuery(this).toggleClass("collapsed"); + jQuery(jQuery(this).attr("href")).collapse("toggle"); + // Save state to localStorage + state = thisItemCollapsed ? 0 : 1; + setLastCollapsedCategory(jQuery(this).data("cattype"), jQuery(this).data("catid"), state); + writeElementsInTreeParamsToStorage(); + } + }); + + setRememberCollapsedCategories(); + + }); +} catch(err) { + alert("document.ready error: " + err); +} diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php new file mode 100644 index 0000000000..500a0eaec9 --- /dev/null +++ b/manager/actions/resources/mgrResources.class.php @@ -0,0 +1,140 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); + +class mgrResources { + var $types = array(); + var $items = array(); + var $categories = array(); + var $itemsPerCategory = array(); + + function __construct() { + $this->setTypes(); + $this->queryItemsFromDB(); + $this->prepareCategoryArrays(); + } + + function setTypes() { + global $_lang; + $this->types['site_templates'] = array( + 'title'=>$_lang["manage_templates"], + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), + 'permissions'=>array('new_template','edit_template'), + 'name'=>'templatename' + ); + $this->types['site_tmplvars'] = array( + 'title'=>$_lang["tmplvars"], + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), + 'permissions'=>array('new_template','edit_template'), + ); + $this->types['site_htmlsnippets'] = array( + 'title'=>$_lang["manage_htmlsnippets"], + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), + 'permissions'=>array('new_chunk','edit_chunk'), + ); + $this->types['site_snippets'] = array( + 'title'=>$_lang["manage_snippets"], + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), + 'permissions'=>array('new_snippet','edit_snippet'), + ); + $this->types['site_plugins'] = array( + 'title'=>$_lang["manage_plugins"], + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), + 'permissions'=>array('new_plugin','edit_plugin'), + ); + $this->types['site_modules'] = array( + 'title'=>$_lang["manage_modules"], + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), + 'permissions'=>array('new_module','edit_module'), + ); + } + + function queryItemsFromDB() { + foreach($this->types as $resourceTable=>$type) { + if($this->hasAnyPermissions($type['permissions'])) { + $nameField = isset($type['name']) ? $type['name'] : 'name'; + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); + } + } + } + + function hasAnyPermissions($permissions) { + global $modx; + + foreach($permissions as $p) + if($modx->hasPermission($p)) return true; + + return false; + } + + function queryResources($resourceTable, $nameField = 'name') { + global $modx, $_lang; + + $pluginsql = $resourceTable == 'site_plugins' ? $resourceTable . '.disabled, ' : ''; + + $tvsql = ''; + $tvjoin = ''; + if ($resourceTable == 'site_tmplvars') { + $tvsql = 'site_tmplvars.caption, '; + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; + } + else $sttfield = ''; + + //$orderby = $resourceTable == 'site_plugins' ? '6,2' : '5,1'; + + switch ($resourceTable) { + case 'site_plugins': + $orderby = '6,2'; + break; + case 'site_tmplvars': + $orderby = '7,3'; + break; + case 'site_templates': + $orderby = '6,1'; + break; + default: + $orderby = '5,1'; + } + + $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : ""; + + $rs = $modx->db->select( + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} + LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", + "", + $orderby + ); + $limit = $modx->db->getRecordCount($rs); + + if($limit < 1) return false; + + $result = array(); + while ($row = $modx->db->getRow($rs)) { + $result[] = $row; + } + return $result; + } + + function prepareCategoryArrays() { + foreach($this->items as $type=>$items) { + foreach((array)$items as $item) { + $catid = $item['catid'] ? $item['catid'] : 0; + $this->categories[$catid] = $item['category']; + + $item['type'] = $type; + $this->itemsPerCategory[$catid][] = $item; + } + } + + // Sort categories by name + natcasesort($this->categories); + + // Now sort by name + foreach($this->itemsPerCategory as $catid=>$items) { + usort($this->itemsPerCategory[$catid], function ($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + } + } +} diff --git a/manager/actions/resources/tab1_templates.inc.php b/manager/actions/resources/tab1_templates.inc.php new file mode 100644 index 0000000000..26cecc20d0 --- /dev/null +++ b/manager/actions/resources/tab1_templates.inc.php @@ -0,0 +1,34 @@ + +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +if(isset($resources->items['site_templates'])) { ?> +
                              +

                              + + + +
                                +
                              • +
                                + +
                                +
                              • +
                              • ">
                              • +
                              • ">
                              • + +
                              + + + + +
                              + \ No newline at end of file diff --git a/manager/actions/resources/tab2_templatevars.inc.php b/manager/actions/resources/tab2_templatevars.inc.php new file mode 100644 index 0000000000..b889f6bddf --- /dev/null +++ b/manager/actions/resources/tab2_templatevars.inc.php @@ -0,0 +1,39 @@ + +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +if(isset($resources->items['site_tmplvars'])) { ?> +
                              +

                              + + + + +
                                +
                              • +
                                + +
                                +
                              • +
                              • ">
                              • +
                              • ">
                              • +
                              • ">
                              • + +
                              + + + + +
                              + \ No newline at end of file diff --git a/manager/actions/resources/tab3_chunks.inc.php b/manager/actions/resources/tab3_chunks.inc.php new file mode 100644 index 0000000000..5e103a8d79 --- /dev/null +++ b/manager/actions/resources/tab3_chunks.inc.php @@ -0,0 +1,34 @@ + +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +if(isset($resources->items['site_htmlsnippets'])) { ?> +
                              +

                              + + + +
                                +
                              • +
                                + +
                                +
                              • +
                              • ">
                              • +
                              • ">
                              • + +
                              + + + + +
                              + \ No newline at end of file diff --git a/manager/actions/resources/tab4_snippets.inc.php b/manager/actions/resources/tab4_snippets.inc.php new file mode 100644 index 0000000000..bd89babf85 --- /dev/null +++ b/manager/actions/resources/tab4_snippets.inc.php @@ -0,0 +1,34 @@ + +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +if(isset($resources->items['site_snippets'])) { ?> +
                              +

                              + + + +
                                +
                              • +
                                + +
                                +
                              • +
                              • ">
                              • +
                              • ">
                              • + +
                              + + + + +
                              + \ No newline at end of file diff --git a/manager/actions/resources/tab5_plugins.inc.php b/manager/actions/resources/tab5_plugins.inc.php new file mode 100644 index 0000000000..300174e770 --- /dev/null +++ b/manager/actions/resources/tab5_plugins.inc.php @@ -0,0 +1,43 @@ + +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} + +if(isset($resources->items['site_plugins'])) { ?> +
                              +

                              + + + +
                                +
                              • +
                                + +
                                +
                              • + hasPermission('new_plugin')) { ?> +
                              • ">
                              • + hasPermission('save_plugin')) { ?> +
                              • ">
                              • + hasPermission('delete_plugin') && $_SESSION['mgrRole'] == 1) { + $tbl_site_plugins = $modx->getFullTableName('site_plugins'); + if($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { ?> +
                              • + +
                              • ">
                              • + +
                              + + + + +
                              + \ No newline at end of file diff --git a/manager/actions/resources/tab6_categoryview.inc.php b/manager/actions/resources/tab6_categoryview.inc.php new file mode 100644 index 0000000000..56f30dd689 --- /dev/null +++ b/manager/actions/resources/tab6_categoryview.inc.php @@ -0,0 +1,31 @@ +INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} ?> + + +
                              +

                              + + + +
                                +
                              • +
                                + +
                                +
                              • +
                              • ">
                              • +
                              • ">
                              • + +
                              + + + + +
                              \ No newline at end of file diff --git a/manager/actions/resources/tpl_elementsRow.tpl b/manager/actions/resources/tpl_elementsRow.tpl new file mode 100644 index 0000000000..c8447eb5fd --- /dev/null +++ b/manager/actions/resources/tpl_elementsRow.tpl @@ -0,0 +1,15 @@ +
                            • +
                              +
                              + [+lockedByUser+] + + [+buttons+] +
                              +
                              +
                            • \ No newline at end of file diff --git a/manager/actions/resources/tpl_panelCollapse.tpl b/manager/actions/resources/tpl_panelCollapse.tpl new file mode 100644 index 0000000000..354e1ed1ff --- /dev/null +++ b/manager/actions/resources/tpl_panelCollapse.tpl @@ -0,0 +1,5 @@ +
                              +
                                + [+wrapper+] +
                              +
                              \ No newline at end of file diff --git a/manager/actions/resources/tpl_panelGroup.tpl b/manager/actions/resources/tpl_panelGroup.tpl new file mode 100644 index 0000000000..18fe8c6c6a --- /dev/null +++ b/manager/actions/resources/tpl_panelGroup.tpl @@ -0,0 +1,7 @@ +
                              +
                              +
                              + [+wrapper+] +
                              +
                              +
                              \ No newline at end of file diff --git a/manager/actions/resources/tpl_panelHeading.tpl b/manager/actions/resources/tpl_panelHeading.tpl new file mode 100644 index 0000000000..08e80030d1 --- /dev/null +++ b/manager/actions/resources/tpl_panelHeading.tpl @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/manager/actions/resources/tpl_viewForm.tpl b/manager/actions/resources/tpl_viewForm.tpl new file mode 100644 index 0000000000..e8f5788b1c --- /dev/null +++ b/manager/actions/resources/tpl_viewForm.tpl @@ -0,0 +1,26 @@ +
                            • [%btn_view_options%]
                            • + \ No newline at end of file diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index eb8657dc87..1351f4a3f4 100644 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('edit_user')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -7,38 +9,34 @@ ?> -

                              - - - - - - +

                              +

                              +
                              -
                              -

                              +
                              +

                              -
                                -
                              • -
                              - +
                            • hide4desktop">
                            • + + db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); -$limit = $modx->db->getRecordCount($rs); -if($limit<1){ - echo "

                              The request returned no roles!

                              "; -} else { - echo '
                                '; - while ($row = $modx->db->getRow($rs)) { - if($row['id']==1) { - echo '
                              • ' . $row['name'] . ' - ' . $_lang['administrator_role_message'] . '
                              • '; + $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + echo "

                                The request returned no roles!

                                "; } else { - echo '
                              • ' . $row['name'] . ' - ' . $row['description'] . '
                              • '; + echo '
                                  '; + while($row = $modx->db->getRow($rs)) { + if($row['id'] == 1) { + echo '
                                • ' . $row['name'] . ' - ' . $_lang['administrator_role_message'] . '
                                • '; + } else { + echo '
                                • ' . $row['name'] . ' - ' . $row['description'] . '
                                • '; + } + } + echo '
                                '; } - } - echo '
                              '; -} -?> -
                              + ?> +
                              diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index fc3499df25..d7e5b0cde3 100644 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -1,242 +1,378 @@ - -

                              - - - - - - -

                              - -
                              - -
                              - - -
                              -
                              -
                              - - - - - - - - - - - - db->select('*',$modx->getFullTableName('site_templates')); - $option[] = ''; - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? intval($_REQUEST['templateid']) : ''; - $selected = $templateid === 0 ? ' selected="selected"' : ''; - $option[] = ''; - while($row=$modx->db->getRow($rs)) - { - $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); - $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; - $option[] = sprintf('', $row['id'], $selected, $templatename, $row['id']); - } - $tpls = sprintf('', join("\n",$option)); - ?> - - - - - - - - - - - - - - - - - - -
                               
                               
                              URL 
                               
                              - -
                              - - -
                              -
                              -
                              +

                              + +

                              +
                              + +
                              + +
                              +
                              +
                              + + + + + + + + + + + db->select('*', $modx->getFullTableName('site_templates')); + $option[] = ''; + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? intval($_REQUEST['templateid']) : ''; + $selected = $templateid === 0 ? ' selected="selected"' : ''; + $option[] = ''; + while($row = $modx->db->getRow($rs)) { + $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); + $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; + $option[] = sprintf('', $row['id'], $selected, $templatename, $row['id']); + } + $tpls = sprintf('', join("\n", $option)); + ?> + + + + + + + + + + + + + + + + + + +
                                + +
                               
                              URL  + +
                                + +
                              + +
                              + +
                              +
                              +
                              getFullTableName('site_content'); - -$searchfields = htmlentities($_POST['searchfields'], ENT_QUOTES, $modx_manager_charset); -$searchlongtitle = $modx->db->escape($_REQUEST['searchfields']); -$search_alias = $modx->db->escape($_REQUEST['searchfields']); -$templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? intval($_REQUEST['templateid']) : ''; -$searchcontent = $modx->db->escape($_REQUEST['content']); - -$sqladd = ""; - -// Handle Input "Search by exact URL" -$idFromAlias = false; -if (isset($_REQUEST['url']) && $_REQUEST['url'] !== '') { - $url = $modx->db->escape($_REQUEST['url']); - $friendly_url_suffix = $modx->config['friendly_url_suffix']; - $base_url = $modx->config['base_url']; - $site_url = $modx->config['site_url']; - $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); - if ($url[0] === '/') $url = preg_replace('@^' . $base_url . '@', '', $url); - if (substr($url, 0, 4) === 'http') $url = preg_replace('@^' . $site_url . '@', '', $url); - $idFromAlias = $modx->getIdFromAlias($url); -} + $tbl_site_content = $modx->getFullTableName('site_content'); -// Handle Input "Search in main fields" -if($searchfields != '') { - if (ctype_digit($searchfields)) { - $sqladd .= "id='{$searchfields}'"; - } - if($idFromAlias) { - $sqladd .= $sqladd != '' ? ' OR ' : ''; - $sqladd .= "id='{$idFromAlias}'"; - } - - $sqladd = $sqladd ? "({$sqladd})" : $sqladd; - - if(!ctype_digit($searchfields)) { - $sqladd .= $sqladd != '' ? ' AND' : ''; - $sqladd .= " pagetitle LIKE '%{$searchfields}%'"; - $sqladd .= " OR longtitle LIKE '%{$searchlongtitle}%'"; - $sqladd .= " OR alias LIKE '%{$search_alias}%'"; - } -} else if($idFromAlias) { - $sqladd .= " id='{$idFromAlias}'"; -} + $searchfields = htmlentities($_POST['searchfields'], ENT_QUOTES, $modx_manager_charset); + $searchlongtitle = $modx->db->escape($_REQUEST['searchfields']); + $search_alias = $modx->db->escape($_REQUEST['searchfields']); + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? intval($_REQUEST['templateid']) : ''; + $searchcontent = $modx->db->escape($_REQUEST['content']); -// Handle Input "Search by template ID" -if($templateid !== '') { - $sqladd .= $sqladd != '' ? ' AND' : ''; - $sqladd .= " template='{$templateid}'"; -} + $sqladd = ""; -// Handle Input "Search by content" -if ($searchcontent !== '') { - $sqladd .= $sqladd != '' ? ' AND' : ''; - $sqladd .= $searchcontent != '' ? " content LIKE '%{$searchcontent}%'" : ''; -} + // Handle Input "Search by exact URL" + $idFromAlias = false; + if(isset($_REQUEST['url']) && $_REQUEST['url'] !== '') { + $url = $modx->db->escape($_REQUEST['url']); + $friendly_url_suffix = $modx->config['friendly_url_suffix']; + $base_url = $modx->config['base_url']; + $site_url = $modx->config['site_url']; + $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); + if($url[0] === '/') { + $url = preg_replace('@^' . $base_url . '@', '', $url); + } + if(substr($url, 0, 4) === 'http') { + $url = preg_replace('@^' . $site_url . '@', '', $url); + } + $idFromAlias = $modx->getIdFromAlias($url); + } -$fields = 'id, contenttype, pagetitle, description, deleted, published, isfolder, type'; -$where = $sqladd; + // Handle Input "Search in main fields" + if($searchfields != '') { + if(ctype_digit($searchfields)) { + $sqladd .= "id='{$searchfields}'"; + } + if($idFromAlias) { + $sqladd .= $sqladd != '' ? ' OR ' : ''; + $sqladd .= "id='{$idFromAlias}'"; + } -if($where) { - $rs = $modx->db->select($fields, $tbl_site_content, $where, 'id'); - $limit = $modx->db->getRecordCount($rs); -} else { - $limit = 0; -} + $sqladd = $sqladd ? "({$sqladd})" : $sqladd; -?> -
                              -
                              - '.$_lang['search_results_returned_msg'].'

                              ', $limit); - ?> - - - - - - - - - - - - - $_style["tree_page_rss"], - 'application/pdf' => $_style["tree_page_pdf"], - 'application/vnd.ms-word' => $_style["tree_page_word"], - 'application/vnd.ms-excel' => $_style["tree_page_excel"], - 'text/css' => $_style["tree_page_css"], - 'text/html' => $_style["tree_page_html"], - 'text/plain' => $_style["tree_page"], - 'text/xml' => $_style["tree_page_xml"], - 'text/javascript' => $_style["tree_page_js"], - 'image/gif' => $_style["tree_page_gif"], - 'image/jpg' => $_style["tree_page_jpg"], - 'image/png' => $_style["tree_page_png"] - ); - - while ($row = $modx->db->getRow($rs)) { - // figure out the icon for the document... - $icon = ""; - if ($row['type']=='reference') { - $icon .= $_style["tree_linkgo"]; - } elseif ($row['isfolder'] == 0) { - $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; - } else { - $icon .= $_style['tree_folder']; - } - - $tdClass = ""; - if($row['published'] == 0) { - $tdClass .= ' class="unpublishedNode"'; - } - if($row['deleted'] == 1) { - $tdClass .= ' class="deletedNode"'; - } - ?> - - - - - >70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ; ?> - >70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ; ?> - - >20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ; ?> - >35 ? substr($row['description'], 0, 35).'...' : $row['description'] ; ?> - - - - - -
                              - db->select($fields, $tbl_site_content, $where, 'id'); + $limit = $modx->db->getRecordCount($rs); + } else { + $limit = 0; + } + + ?> +
                              +
                              +
                              + ' . $_lang['search_results_returned_msg'] . '

                              ', $limit); + ?> + + + + + + + + + + + + + $_style["tree_page_rss"], + 'application/pdf' => $_style["tree_page_pdf"], + 'application/vnd.ms-word' => $_style["tree_page_word"], + 'application/vnd.ms-excel' => $_style["tree_page_excel"], + 'text/css' => $_style["tree_page_css"], + 'text/html' => $_style["tree_page_html"], + 'text/plain' => $_style["tree_page"], + 'text/xml' => $_style["tree_page_xml"], + 'text/javascript' => $_style["tree_page_js"], + 'image/gif' => $_style["tree_page_gif"], + 'image/jpg' => $_style["tree_page_jpg"], + 'image/png' => $_style["tree_page_png"] + ); + + while($row = $modx->db->getRow($rs)) { + // figure out the icon for the document... + $icon = ""; + if($row['type'] == 'reference') { + $icon .= $_style["tree_linkgo"]; + } elseif($row['isfolder'] == 0) { + $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; + } else { + $icon .= $_style['tree_folder_new']; + } + + $tdClass = ""; + if($row['published'] == 0) { + $tdClass .= ' class="unpublishedNode"'; + } + if($row['deleted'] == 1) { + $tdClass .= ' class="deletedNode"'; + } + ?> + + + + + > + 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle']; ?> + + > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description']; ?> + + > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle']; ?> + > 35 ? substr($row['description'], 0, 35) . '...' : $row['description']; ?> + + + + + +
                              + +
                              + db->getRecordCount($rs); + if($docscounts > 0) { + $output .= '
                            • ' . $_lang["manage_documents"] . ' (' . $docscounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['pagetitle'] . ' (' . $row['id'] . ')', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + + //templates + $rs = $modx->db->select("id,templatename", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' + OR `templatename` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `content` like '%" . $searchfields . "%'"); + $templatecounts = $modx->db->getRecordCount($rs); + if($templatecounts > 0) { + $output .= '
                            • ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + + //tvs + $rs = $modx->db->select("id,name", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `type` like '%" . $searchfields . "%' + OR `elements` like '%" . $searchfields . "%' + OR `display` like '%" . $searchfields . "%' + OR `display_params` like '%" . $searchfields . "%' + OR `default_text` like '%" . $searchfields . "%'"); + $tvscounts = $modx->db->getRecordCount($rs); + if($tvscounts > 0) { + $output .= '
                            • ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + // + + //Chunks + $rs = $modx->db->select("id,name", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `snippet` like '%" . $searchfields . "%'"); + $chunkscounts = $modx->db->getRecordCount($rs); + if($chunkscounts > 0) { + $output .= '
                            • ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + + //Snippets + $rs = $modx->db->select("id,name", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `snippet` like '%" . $searchfields . "%' + OR `properties` like '%" . $searchfields . "%' + OR `moduleguid` like '%" . $searchfields . "%'"); + $snippetscounts = $modx->db->getRecordCount($rs); + if($snippetscounts > 0) { + $output .= '
                            • ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + //plugins + $rs = $modx->db->select("id,name", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `plugincode` like '%" . $searchfields . "%' + OR `properties` like '%" . $searchfields . "%' + OR `moduleguid` like '%" . $searchfields . "%'"); + $pluginscounts = $modx->db->getRecordCount($rs); + if($pluginscounts > 0) { + $output .= '
                            • ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + //modules + $rs = $modx->db->select("id,name", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' + OR `name` like '%" . $searchfields . "%' + OR `description` like '%" . $searchfields . "%' + OR `modulecode` like '%" . $searchfields . "%' + OR `properties` like '%" . $searchfields . "%' + OR `guid` like '%" . $searchfields . "%' + OR `resourcefile` like '%" . $searchfields . "%'"); + $modulescounts = $modx->db->getRecordCount($rs); + if($modulescounts > 0) { + $output .= '
                            • ' . $_lang["modules"] . ' (' . $modulescounts . ')
                            • '; + while($row = $modx->db->getRow($rs)) { + $output .= '
                            • ' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '
                            • '; + } + } + + echo $output ? '
                                ' . $output . '
                              ' : '1'; + } + + ?> +
                              +
                              + -
                              -
                              -$1', $text); } -?> \ No newline at end of file diff --git a/manager/actions/site_schedule.static.php b/manager/actions/site_schedule.static.php index c2142293ad..97bd1e229e 100644 --- a/manager/actions/site_schedule.static.php +++ b/manager/actions/site_schedule.static.php @@ -1,131 +1,132 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('view_eventlog')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> -

                              - - - - - - + +

                              +

                              -
                              -db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > ".time()."", 'pub_date ASC'); -$limit = $modx->db->getRecordCount($rs); -if($limit<1) { - echo "

                              ".$_lang["no_docs_pending_publishing"]."

                              "; -} else { -?> - - - - - - - - - -db->getRow($rs)) { -?> - - - - - - - -
                              toDateFormat($row['pub_date']+$server_offset_time)?>
                              - +
                              +
                              + db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + echo "

                              " . $_lang["no_docs_pending_publishing"] . "

                              "; + } else { + ?> + + + + + + + + + + db->getRow($rs)) { + ?> + + + + + + + +
                              toDateFormat($row['pub_date'] + $server_offset_time) ?>
                              + -
                              +
                              -
                              db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > ".time()."", 'unpub_date ASC'); -$limit = $modx->db->getRecordCount($rs); -if($limit<1) { - echo "

                              ".$_lang["no_docs_pending_unpublishing"]."

                              "; -} else { -?> - - - - - - - - - -db->getRow($rs)) { -?> - - - - - - - -
                              toDateFormat($row['unpub_date']+$server_offset_time) ;?>
                              - +
                              +
                              db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + echo "

                              " . $_lang["no_docs_pending_unpublishing"] . "

                              "; + } else { + ?> + + + + + + + + + + db->getRow($rs)) { + ?> + + + + + + + +
                              toDateFormat($row['unpub_date'] + $server_offset_time); ?>
                              + -
                              +
                              -
                              db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); -$limit = $modx->db->getRecordCount($rs); -if($limit<1) { - echo "

                              ".$_lang["no_docs_pending_pubunpub"]."

                              "; -} else { -?> - - - - - - - - - - -db->getRow($rs)) { -?> - - - - - - - - -
                              toDateFormat($row['pub_date']+$server_offset_time)?>toDateFormat($row['unpub_date']+$server_offset_time)?>
                              - -
                              +
                              +
                              db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + echo "

                              " . $_lang["no_docs_pending_pubunpub"] . "

                              "; + } else { + ?> + + + + + + + + + + + db->getRow($rs)) { + ?> + + + + + + + + +
                              toDateFormat($row['pub_date'] + $server_offset_time) ?>toDateFormat($row['unpub_date'] + $server_offset_time) ?>
                              + +
                              diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index dd845b60cc..b29598d66b 100644 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('logs')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -10,129 +12,126 @@ $collation = $modx->db->getRow($res, 'num'); $serverArr = array( - $_lang['modx_version'] => $modx->getVersionData('version'). ' '.$newversiontext, - $_lang['release_date'] => $modx->getVersionData('release_date'), - 'PHP Version' => phpversion(), - 'phpInfo()' => ''.$_lang['view'].'', - $_lang['access_permissions'] => ($use_udperms==1 ? $_lang['enabled'] : $_lang['disabled']), - $_lang['servertime'] => strftime('%H:%M:%S', time()), - $_lang['localtime'] => strftime('%H:%M:%S', time()+$server_offset_time), - $_lang['serveroffset'] => $server_offset_time/(60*60) . ' h', - $_lang['database_name'] => trim($dbase,'`'), - $_lang['database_server'] => $database_server, - $_lang['database_version'] => $modx->db->getVersion(), - $_lang['database_charset'] => $charset[1], + $_lang['modx_version'] => $modx->getVersionData('version') . ' ' . $newversiontext, + $_lang['release_date'] => $modx->getVersionData('release_date'), + 'PHP Version' => phpversion(), + 'phpInfo()' => '' . $_lang['view'] . '', + $_lang['access_permissions'] => ($use_udperms == 1 ? $_lang['enabled'] : $_lang['disabled']), + $_lang['servertime'] => strftime('%H:%M:%S', time()), + $_lang['localtime'] => strftime('%H:%M:%S', time() + $server_offset_time), + $_lang['serveroffset'] => $server_offset_time / (60 * 60) . ' h', + $_lang['database_name'] => trim($dbase, '`'), + $_lang['database_server'] => $database_server, + $_lang['database_version'] => $modx->db->getVersion(), + $_lang['database_charset'] => $charset[1], $_lang['database_collation'] => $collation[1], - $_lang['table_prefix'] => $modx->db->config['table_prefix'], - $_lang['cfg_base_path'] => MODX_BASE_PATH, - $_lang['cfg_base_url'] => MODX_BASE_URL, - $_lang['cfg_manager_url'] => MODX_MANAGER_URL, - $_lang['cfg_manager_path'] => MODX_MANAGER_PATH, - $_lang['cfg_site_url'] => MODX_SITE_URL + $_lang['table_prefix'] => $modx->db->config['table_prefix'], + $_lang['cfg_base_path'] => MODX_BASE_PATH, + $_lang['cfg_base_url'] => MODX_BASE_URL, + $_lang['cfg_manager_url'] => MODX_MANAGER_URL, + $_lang['cfg_manager_path'] => MODX_MANAGER_PATH, + $_lang['cfg_site_url'] => MODX_SITE_URL ); ?> -

                              - - - - - - + +

                              +

                              -
                              Server
                              +
                              Server
                              +
                              - $value){ - echo ' - + $value) { + echo ' + - + '; - } - ?> + } + ?>
                              '.$key.'
                              ' . $key . '  '.$value.'' . $value . '
                              -
                              +
                              -
                              +
                              +

                              - - - - - - - - - - - - - + + + + + + + + + + + + db->escape($modx->db->config['table_prefix'])."%';"; - $rs = $modx->db->query($sql); - $i = 0; - while ($log_status = $modx->db->getRow($rs)) { - $bgcolor = ($i++ % 2) ? '#EEEEEE' : '#FFFFFF'; -?> - - - + $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';"; + $rs = $modx->db->query($sql); + $i = 0; + while($log_status = $modx->db->getRow($rs)) { + $bgcolor = ($i++ % 2) ? '#EEEEEE' : '#FFFFFF'; + ?> + + + -db->config['table_prefix'].'event_log', - $modx->db->config['table_prefix'].'manager_log', - ); - if($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { - echo ""; - } - else { - echo ""; - } + db->config['table_prefix'] . 'event_log', + $modx->db->config['table_prefix'] . 'manager_log', + ); + if($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { + echo ""; + } else { + echo ""; + } - if($modx->hasPermission('settings')) { - echo ""; - } - else { - echo ""; - } -?> - - - - - - - - - - - - - + if($modx->hasPermission('settings')) { + echo ""; + } else { + echo ""; + } + ?> + + + + + + + + + + + + +
                              "; - echo "".$modx->nicesize($log_status['Data_length']+$log_status['Data_free']).""; - echo "".$modx->nicesize($log_status['Data_length']+$log_status['Data_free']).""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "".($log_status['Data_free']>0 ? "".$modx->nicesize($log_status['Data_free'])."" : "-")."".($log_status['Data_free']>0 ? $modx->nicesize($log_status['Data_free']) : "-")."nicesize($log_status['Data_length']-$log_status['Data_free']); ?>nicesize($log_status['Index_length']); ?>nicesize($log_status['Index_length']+$log_status['Data_length']+$log_status['Data_free']); ?>
                               0 ? "".$modx->nicesize($totaloverhead)."
                              (".number_format($totaloverhead)." B)" : "-"; ?>
                               ".$modx->nicesize($total)."
                              (".number_format($total)." B)"; ?>
                              " . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "nicesize($log_status['Data_length'] - $log_status['Data_free']); ?>nicesize($log_status['Index_length']); ?>nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']); ?>
                                0 ? "" . $modx->nicesize($totaloverhead) . "
                              (" . number_format($totaloverhead) . " B)" : "-"; ?>
                               " . $modx->nicesize($total) . "
                              (" . number_format($total) . " B)"; ?>
                              -0) { ?> -

                              + 0) { ?> +

                              -
                              +
                              +
                              diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index e94c0ab6e4..ec0ba23189 100644 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('edit_user')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } @@ -8,150 +10,157 @@ $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op']=='reset') { +if($_REQUEST['op'] == 'reset') { $query = ''; - $_PAGE['vs']['search']=''; -} -else { - $query = isset($_REQUEST['search'])? $_REQUEST['search']:$_PAGE['vs']['search']; + $_PAGE['vs']['search'] = ''; +} else { + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; $sqlQuery = $modx->db->escape($query); $_PAGE['vs']['search'] = $query; } // get & save listmode -$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode']:$_PAGE['vs']['lm']; +$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : $_PAGE['vs']['lm']; $_PAGE['vs']['lm'] = $listmode; // context menu -include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; +include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; $cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang["edit"],"js:menuAction(1)",$_style["icons_edit_document"],(!$modx->hasPermission('edit_user') ? 1:0)); -$cm->addItem($_lang["delete"], "js:menuAction(2)",$_style["icons_delete"],(!$modx->hasPermission('delete_user') ? 1:0)); +$cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0)); +$cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0)); echo $cm->render(); ?>
                              - - - + + + -

                              - - - - - - -

                              -
                              -
                              -

                              - -
                              - hasPermission('save_role')) - $where .= (empty($where)?"":" AND ") . "mua.role != 1"; - if (!empty($sqlQuery)) - $where .= (empty($where)?"":" AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; - $ds = $modx->db->select( - "mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", - $modx->getFullTableName('manager_users')." AS mu - INNER JOIN ".$modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id - LEFT JOIN ".$modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", - $where, - 'mua.blocked ASC, mua.thislogin DESC' - ); - include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; - $grd = new DataGrid('',$ds,$modx->config['number_of_results']); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass="grid"; - $grd->columnHeaderClass="gridHeader"; - $grd->itemClass="gridItem"; - $grd->altItemClass="gridAltItem"; - $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; - $grd->columns = implode(',', array($_lang["icon"],$_lang["name"],$_lang["user_full_name"],$_lang['role'], - $_lang["email"],$_lang["user_gender"],$_lang["user_block"],$_lang["login_button"])); - $grd->colAligns="center,,,,,center,center"; - $grd->colTypes = implode('||',array( - 'template:', - 'template:[+value+]', - 'template:[+fullname+]', - 'template:[+role+]', - 'template:[+email+]', - 'template:[+gender+]', - 'template:[+blocked+]', - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M')); - if($listmode=='1') - $grd->pageSize=0; - if($_REQUEST['op']=='reset') - $grd->pageNumber = 1; - // render grid - echo $grd->render(); - ?> +
                              +
                              + hasPermission('save_role')) { + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; + } + if(!empty($sqlQuery)) { + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; + } + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu + INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id + LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; + $grd->columns = implode(',', array( + $_lang["icon"], + $_lang["name"], + $_lang["user_full_name"], + $_lang['role'], + $_lang["email"], + $_lang["user_gender"], + $_lang["user_block"], + $_lang["login_button"] + )); + $grd->colAligns = "center,,,,,center,center"; + $grd->colTypes = implode('||', array( + 'template:', + 'template:[+value+]', + 'template:[+fullname+]', + 'template:[+role+]', + 'template:[+email+]', + 'template:[+gender+]', + 'template:[+blocked+]', + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' + )); + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
                              +
                              -
                              diff --git a/manager/actions/wait.static.php b/manager/actions/wait.static.php index 81ce367b62..340d68246e 100644 --- a/manager/actions/wait.static.php +++ b/manager/actions/wait.static.php @@ -1,31 +1,33 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} /*********************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; +$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; +$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; +$add_path = $sd . $sb . $pg; /**********************/ ?>

                              -
                              -

                              - -
                              + document.location.href = "index.php?a=3&id="; + + document.location.href = "index.php?a=2"; + + } + x = window.setTimeout('goHome()', 1000); + +
                              diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index 1ceeba0896..928de1000f 100644 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -1,272 +1,258 @@ INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +if(IN_MANAGER_MODE != "true") { + die("INCLUDE_ORDERING_ERROR

                              Please use the MODX Content Manager instead of accessing this file directly."); +} if(!$modx->hasPermission('web_access_permissions')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // find all document groups, for the select :) $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { +if($modx->db->getRecordCount($rs) < 1) { $docgroupselector = "[no groups to add]"; } else { - $docgroupselector = '' . "\n"; + while($row = $modx->db->getRow($rs)) { + $docgroupselector .= "\t" . '\n"; } $docgroupselector .= "\n"; } $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { +if($modx->db->getRecordCount($rs) < 1) { $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '' . "\n"; + while($row = $modx->db->getRow($rs)) { + $usrgroupselector .= "\t" . '\n"; } $usrgroupselector .= "\n"; } ?> - -

                              - - - - - - +

                              +

                              -

                              '.$_lang['access_permissions_off'].'

                              ' : '' ;?> +

                              ' . $_lang['access_permissions_off'] . '

                              ' : ''; ?> -
                              - + function deletegroup(groupid, type) { + if(confirm("") == true) { + if(type == 'usergroup') { + document.location.href = "index.php?a=92&usergroup=" + groupid + "&operation=delete_user_group"; + } + else if(type == 'documentgroup') { + document.location.href = "index.php?a=92&documentgroup=" + groupid + "&operation=delete_document_group"; + } + } + } + -
                              -

                              - - +

                              + + '.$_lang['access_permissions_users_tab'].'

                              '; + echo '

                              ' . $_lang['access_permissions_users_tab'] . '

                              '; -?> - - - - - -
                              -
                              - - -   - -
                              -
                              -
                              -db->select( - 'groupnames.*, users.id AS user_id, users.username user_name ', - $modx->getFullTableName('webgroup_names')." AS groupnames - LEFT JOIN ".$modx->getFullTableName('web_groups')." AS groups ON groups.webgroup = groupnames.id - LEFT JOIN ".$modx->getFullTableName('web_users')." AS users ON users.id = groups.webuser", - '', - 'groupnames.name, user_name' - ); - if ($modx->db->getRecordCount($rs) < 1) { - echo ''.$_lang['no_groups_found'].''; - } else { - echo "
                                \n"; - $pid = ''; - while ($row = $modx->db->getRow($rs)) { - if ($row['id'] !== $pid) { - if ($pid != '') echo "
                              \n"; // close previous one + ?> + + + + + + + + + +
                              +
                              + + +   + +
                              +
                              +
                              + db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames + LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id + LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); + if($modx->db->getRecordCount($rs) < 1) { + echo '' . $_lang['no_groups_found'] . ''; + } else { + echo "
                                \n"; + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] !== $pid) { + if($pid != '') { + echo "
                              \n"; + } // close previous one - // display the current user group with a rename/delete form - echo '
                            • '."\n". - ' '."\n". - ' '."\n". - ' '."\n". - '  '."\n". - '  '."\n". - ' '."\n". - '
                              '; + // display the current user group with a rename/delete form + echo '
                            • ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '  ' . "\n" . '  ' . "\n" . ' ' . "\n" . '
                              '; - echo "
                                \n"; - echo "\t
                              • ".$_lang['web_access_permissions_users_in_group'].' '; - } - if (!$row['user_id']) { - // no users in group - echo ''.$_lang['access_permissions_no_users_in_group'].''; - $pid = $row['id']; - continue; + echo "
                                  \n"; + echo "\t
                                • " . $_lang['web_access_permissions_users_in_group'] . ' '; + } + if(!$row['user_id']) { + // no users in group + echo '' . $_lang['access_permissions_no_users_in_group'] . ''; + $pid = $row['id']; + continue; + } + if($pid == $row['id']) { + echo ', '; + } // comma separation :) + echo '' . $row['user_name'] . ''; + $pid = $row['id']; + } + echo "
                              • \n"; + echo "
                              \n"; } - if ($pid == $row['id']) echo ', '; // comma separation :) - echo ''.$row['user_name'].''; - $pid = $row['id']; - } - echo "
                            • \n"; - echo "\n"; - } -?> -
                              + ?> +
                              -
                              -

                              - - +

                              + + '.$_lang['access_permissions_resources_tab'].'

                              '; + echo '

                              ' . $_lang['access_permissions_resources_tab'] . '

                              '; -?> - - - - - -
                              -
                              - - -   - -
                              -
                              -
                              -db->select( - 'dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', - $modx->getFullTableName('documentgroup_names')." AS dgnames - LEFT JOIN ".$modx->getFullTableName('document_groups')." AS dg ON dg.document_group = dgnames.id - LEFT JOIN ".$modx->getFullTableName('site_content')." AS sc ON sc.id = dg.document", - '', - 'dgnames.name, sc.id' - ); - if ($modx->db->getRecordCount($rs) < 1) { - echo ''.$_lang['no_groups_found'].''; - } else { - echo ''."\n". - ' '."\n". - ' '."\n". - ' '."\n"; - $pid = ''; - while ($row = $modx->db->getRow($rs)) { - if ($row['id'] !== $pid) { - if ($pid != '') echo "\n"; // close previous one + ?> +
                              '.$_lang['access_permissions_resource_groups'].'
                              + + + + + + + + +
                              +
                              + + +   + +
                              +
                              +
                              + db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames + LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id + LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); + if($modx->db->getRecordCount($rs) < 1) { + echo '' . $_lang['no_groups_found'] . ''; + } else { + echo '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] !== $pid) { + if($pid != '') { + echo "\n"; + } // close previous one - echo '
                              ' . $_lang['access_permissions_resource_groups'] . '
                              '."\n". - ' '."\n". - ' '."\n". - ' '."\n". - '  '."\n". - ' '."\n". - ' '."\n". - '
                              '; + echo '
                              ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '  ' . "\n" . ' ' . "\n" . ' ' . "\n" . '
                              '; - echo '
                              '.$_lang['access_permissions_resources_in_group'].' '; - } - if (!$row['doc_id']) { - // no documents in group - echo $_lang['access_permissions_no_resources_in_group']; - $pid = $row['id']; - continue; + echo '
                              ' . $_lang['access_permissions_resources_in_group'] . ' '; + } + if(!$row['doc_id']) { + // no documents in group + echo $_lang['access_permissions_no_resources_in_group']; + $pid = $row['id']; + continue; + } + if($pid == $row['id']) { + echo ", \n"; + } + echo '' . $row['doc_id'] . ''; + $pid = $row['id']; + } + echo "
                              "; } - if ($pid == $row['id']) echo ", \n"; - echo ''.$row['doc_id'].''; - $pid = $row['id']; - } - echo ""; - } -?> -
                              + ?> +
                              -
                              -

                              - - +

                              + + '.$_lang['access_permissions_links_tab'].'

                              '; + echo '

                              ' . $_lang['access_permissions_links_tab'] . '

                              '; - $rs = $modx->db->select( - 'groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', - $modx->getFullTableName('webgroup_names')." AS groupnames - LEFT JOIN ".$modx->getFullTableName('webgroup_access')." AS groupacc ON groupacc.webgroup = groupnames.id - LEFT JOIN ".$modx->getFullTableName('documentgroup_names')." AS dgnames ON dgnames.id = groupacc.documentgroup", - '', - 'name, dg_name' - ); - if ($modx->db->getRecordCount($rs) < 1) { - echo ''.$_lang['no_groups_found'].'
                              '; - } else { - ?> - - - - - - - -
                              -
                              - - - - - - - -
                              -
                              -
                              - \n"; - $pid = ''; - while ($row = $modx->db->getRow($rs)) { - if ($row['id'] != $pid) { - if ($pid != '') echo "\n"; // close previous one - echo '
                            • '.$row['name'].''; + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames + LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id + LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); + if($modx->db->getRecordCount($rs) < 1) { + echo '' . $_lang['no_groups_found'] . '
                              '; + } else { + ?> + + + + + + + + + +
                              +
                              + + + + + + + +
                              +
                              +
                              + \n"; + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] != $pid) { + if($pid != '') { + echo "
                            • \n"; + } // close previous one + echo '
                            • ' . $row['name'] . ''; - if (!$row['dg_id']) { - echo ' » '.$_lang['no_groups_found']."
                            • \n"; - $pid = ''; - continue; - } else { - echo "
                                \n"; + if(!$row['dg_id']) { + echo ' » ' . $_lang['no_groups_found'] . "\n"; + $pid = ''; + continue; + } else { + echo "
                                  \n"; + } + } + if(!$row['dg_id']) { + continue; + } + echo "\t
                                • " . $row['dg_name']; + echo ' ('; + echo $_lang['remove'] . ')'; + echo "
                                • \n"; + + $pid = $row['id']; } + echo "
                                "; } - if (!$row['dg_id']) continue; - echo "\t
                              • ".$row['dg_name']; - echo ' ('; - echo $_lang['remove'].')'; - echo "
                              • \n"; - - $pid = $row['id']; - } - echo "
                              "; - } -?> -
                              + ?> +
                              -