Version zu Ende April 2023
This commit is contained in:
692
static/jeasyui/changelog.txt
Executable file
692
static/jeasyui/changelog.txt
Executable file
@@ -0,0 +1,692 @@
|
||||
Version 1.9.x
|
||||
-------------
|
||||
* Bug
|
||||
* layout: The icon on the collapsed panel is overlaped by title. fixed.
|
||||
* propertygrid: The css style of the row expander will affact that in the detailview. fixed.
|
||||
* combogrid: The 'getValues' method returns incorrect values sometimes. fixed.
|
||||
* Improvement
|
||||
* datagrid: The 'sorter' function on the column accepts the entire row as the sorting parameters.
|
||||
* datagrid: Add 'hformatter' and 'hstyler' properties for the colomns.
|
||||
* datebox: Add 'getDate' and 'setDate' methods.
|
||||
* pagination: Add 'onBeforeSelectPage' event.
|
||||
* combo: Prevent from conflicting with svg.
|
||||
* window: Add 'fixed' property.
|
||||
* timepicker: Add 'hour24' property.
|
||||
* layout: Add 'stopCollapsing' method.
|
||||
|
||||
Version 1.9.0
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: Slow scrolling with mousewheel on frozen columns. fixed.
|
||||
* datagrid: The 'rowStyler' function is called on empty row. fixed.
|
||||
* linkbutton: Calling 'disable' method still can submit the form. fixed.
|
||||
* combotree: The 'onBeforeSelect' event fires twice while selecting a node. fixed.
|
||||
* combotreegrid: The 'onSelect' event fires twice while selecting a row. fixed.
|
||||
* Improvement
|
||||
* checkbox: Add 'readonly' property.
|
||||
* radiobutton: Add 'readonly' property.
|
||||
* Compatible with jQuery 3.x.
|
||||
* New Plugins
|
||||
* timepicker: Allow the user to choose time on a clock.
|
||||
|
||||
Version 1.8.0
|
||||
-------------
|
||||
* Bug
|
||||
* treegrid: The 'pageNumber' can't be initialized with the specified value. fixed.
|
||||
* checkbox: The disabled checkbox has no disabled label. fixed.
|
||||
* Improvement
|
||||
* switchbutton: Add the 'label','labelAlign','labelPosition','labelWidth' properties.
|
||||
* switchbutton: Accept 'tabindex' attribute to get focus when the user press TAB key.
|
||||
* form: The 'onChange' event is available for all the form component.
|
||||
* calendar: The 'Date' property is available to support the hijri date.
|
||||
* textbox: The floating label is available.
|
||||
|
||||
Version 1.7.0
|
||||
-------------
|
||||
* Bug
|
||||
* sidemenu: The tooltip has a wrong position when the 'floatMenuPosition' is set to 'left'. fixed.
|
||||
* datagrid: The horizontal scrollbar has a wrong state when the 'showHeader' is set to true. fixed.
|
||||
* combo: The initialized value will trigger the form's 'onChange' event when the 'multiple' is set to true. fixed.
|
||||
* panel: The horizontal panel doesn't work normally when 'noheader' property is set to true. fixed.
|
||||
* pagination: The extended buttons may lose in IE when rebuild the component. fixed.
|
||||
* Improvement
|
||||
* tree: Add 'findBy' method to find a node by any fields.
|
||||
* tree: The 'find' method is enhanced to find a node easily.
|
||||
* combo: Add 'panelValign' property.
|
||||
* datagrid: The sorting parameters will be ignored when the 'remoteSort' is set to false.
|
||||
* timespinner: Add 'hour12' property to display in 12 hour format.
|
||||
|
||||
Version 1.6.0
|
||||
-------------
|
||||
* Bug
|
||||
* maskedbox: The component does not accept numeric keypad. fixed.
|
||||
* combogrid: When selecting multiple records, the datagrid will scroll to the last checked record. fixed.
|
||||
* Improvement
|
||||
* Compatible with jQuery 3.x.
|
||||
* tabs: The 'toolPosition' property can accept 'top' and 'bottom' values.
|
||||
* textbox: The textbox label has the animating feature when focus or blur on it.
|
||||
* tooltip: Add 'valign' property.
|
||||
* tree: The node class can be initialized by setting the 'nodeCls' in the data.
|
||||
* New Plugins
|
||||
* sidemenu: The sidemenu is created from accordion and tree plugins. It builds a collapsible menu with some categories.
|
||||
* radiobutton: This plugin provides a round interface to select one option from a number of options.
|
||||
* checkbox: This plugin allows a user to select a value from a small set of options.
|
||||
|
||||
Version 1.5.5
|
||||
-------------
|
||||
* Bug
|
||||
* tabs: The selecting history has wrong order when the title contains complex elements. fixed.
|
||||
* combo: The drop-down panel may not be hidden if a bigger 'delay' value is set. fixed.
|
||||
* layout: The expanding panel does not collapse when move mouse quickly away from it. fixed.
|
||||
* tagbox: The tagbox and the label don't stay in the same line. fixed.
|
||||
* Improvement
|
||||
* combo: The 'blur' event handler is attached to the 'inputEvents' property.
|
||||
* numberbox: The 'cloneFrom' method is available.
|
||||
* slider: The 'step' property can be set with a floating number.
|
||||
* menu: The 'findItem' method allows the user to find menu item by any parameters.
|
||||
* menubutton: Add 'showEvent' and 'hideEvent' properties.
|
||||
* New Plugins
|
||||
* maskedbox: The maskedbox enforces its structure as the user types.
|
||||
|
||||
Version 1.5.4
|
||||
-------------
|
||||
* Bug
|
||||
* combotreegrid: The 'onChange' event does not fire when entering values on the inputing box. fixed.
|
||||
* combobox: Clicking on the drop-down panel will jump to the bottom of body on win10 IE11. fixed.
|
||||
* datebox: Clicking on the 'Today' button doesn't trigger the 'onSelect' event. fixed.
|
||||
* propertygrid: The 'getChanges' method doesn't work after editing the only one row. fixed.
|
||||
* Improvement
|
||||
* combo: Add the 'panelEvents' property.
|
||||
* combo: Attach the default 'mousedown' event handler.
|
||||
* combobox: The 'setValues' method can be called to initialize the displaying text.
|
||||
* combotreegrid: Press ENTER key to select the highlighted rows.
|
||||
* panel: Improve the resizing performance.
|
||||
* filebox: The 'files' method allows the user to get the selected file list.
|
||||
* searchbox: Improvent the 'selectName' method.
|
||||
|
||||
Version 1.5.3
|
||||
-------------
|
||||
* Bug
|
||||
* combobox: The 'iconCls' property can not be parsed from the <option> markup. fixed.
|
||||
* combobox: Clicking scrollbar will cause the drop-down panel to be hidden in IE. fixed.
|
||||
* pagination: The pagination height will shrink when the 'displayMsg' property is set to false. fixed.
|
||||
* tabs: The tab panel takes a wrong 'data' parameter in the 'onLoad' event. fixed.
|
||||
* Improvement
|
||||
* draggable: Add 'onEndDrag' event.
|
||||
* resizable: Retrieve more than one resizing directions with different edges.
|
||||
* datagrid: Add 'resizeEdge' property.
|
||||
* datagrid: Avoid the memory leaks.
|
||||
* combo: The 'originalValue' property value is corrected in multiple mode.
|
||||
* form: Add the tagbox to the form fields.
|
||||
* tagbox: Add the 'reset' method.
|
||||
* progress: Increase the response time to open and close the progress message window.
|
||||
|
||||
Version 1.5.2
|
||||
-------------
|
||||
* Bug
|
||||
* form: The initialized value of the inputing box will disappear after calling the 'reset' method. fixed.
|
||||
* textbox: Calling the 'destroy' method does not clean the field label. fixed.
|
||||
* datagrid: Calling the 'selectRow' method on an unexisting row causes undesired record set. fixed.
|
||||
* Improvement
|
||||
* datagrid: The ctrl selection is supported on Mac keyboards.
|
||||
* datagrid: The 'scrollOnSelect' property is available for the user to determine whether to scroll to the specified row when selecting it.
|
||||
* combotree: Add the 'textField' property.
|
||||
* combotreegrid: Add the 'textField' property.
|
||||
* pagination: Add 'showPageInfo' property.
|
||||
* panel: Add 'halign' and 'titleDirection' properties to allow the user to align the panel header to left or right side.
|
||||
* accordion: Add 'halign' property to build the horizontal accordion.
|
||||
* tagbox: The 'required' propery can be applied to validate whether the value is empty.
|
||||
|
||||
Version 1.5.1
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: The selecting and checking flags will lose after calling 'updateRow' method. fixed.
|
||||
* tabs: The trip tools have a wrong position when calling 'update' method. fixed.
|
||||
* window: When the height is set to 'auto', it will disappear after moving the window. fixed.
|
||||
* messager: When display the progress message window and then close it immediately, an exception occurs. fixed.
|
||||
* form: The 'clear' method does not clear the selected drop-down items of the combobox. fixed.
|
||||
* Improvement
|
||||
* textbox: The 'cls' property is available to add a custom style to textbox.
|
||||
* numberbox: Allow the user to format currency in Italian.
|
||||
* combo: Add 'multivalue' property that allows the user to determine how to submit the multiple values.
|
||||
* combobox: Add 'reversed' property.
|
||||
* combobox: Add 'onClick' event.
|
||||
* combogrid: Add 'reversed' property.
|
||||
* treegrid: Enable multiple selection with the shift key.
|
||||
* New Plugins
|
||||
* tagbox: Allows the user to add tags to a form field.
|
||||
|
||||
Version 1.5
|
||||
-------------
|
||||
* Bug
|
||||
* combobox: The 'onSelect' event does not fire when load data that contains the selected item. fixed.
|
||||
* datagrid: The 'updateRow' method sometimes does not work properly when the field is set to a blank value. fixed.
|
||||
* Improvement
|
||||
* A label can be associated to any form fields.
|
||||
* combobox: Enhance the 'select' and 'unselect' rules on the drop-down items.
|
||||
* combobox: Add 'limitToList' property to limit the inputed values to the listed items.
|
||||
* combogrid: Allow the user to clone the component quickly.
|
||||
* form: Add the 'dirty' property that allows the user to submit the only changed fields.
|
||||
* form: Add 'resetDirty' method.
|
||||
* datagrid: Allow the user to display a message when there are no records to be shown.
|
||||
* textbox: Add 'label','labelWidth','labelPosition' and 'labelAlign' properties.
|
||||
* spinner: Add 'spinAlign' property.
|
||||
* calendar: Allow the user to display week number of the year.
|
||||
* window: Add 'constrain' property.
|
||||
* New Plugins
|
||||
* passwordbox: The plugin that allows the user to input passwords with nice feedback.
|
||||
* combotreegrid: Combines combobox with drop-down treegrid component.
|
||||
|
||||
Version 1.4.5
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: The 'getChanges' method does not return the updated rows after calling 'updateRow' method. fixed.
|
||||
* treegrid: The 'onLoadSuccess' event fires when append or insert a row. fixed.
|
||||
* tree: The 'onLoadSuccess' event fires when append or insert a node. fixed.
|
||||
* Improvement
|
||||
* window: The displaying style can be customized.
|
||||
* window: The 'border' property allows the user to set different border style.
|
||||
* navpanel: The 'href' property is enabled to load content from remote server.
|
||||
* combotree: The 'setValue' and 'setValues' methods accept the paremter values in 'id' and 'text' pairs
|
||||
* combobox: Add 'showItemIcon' property.
|
||||
* combobox: Set 'groupPosition' property to 'sticky' to stick the item group to the top of drop-down panel.
|
||||
* messager: Pressing ENTER key on input box will trigger click event of the first button.
|
||||
* validatebox: Add 'editable',disabled' and 'readonly' properties.
|
||||
* validatebox: Add 'enable','disable','readonly' methods.
|
||||
* validatebox: Allow the user to determine how to display the error message.
|
||||
* filebox: Add 'accept' and 'multiple' properties.
|
||||
* form: Add 'iframe' property and 'onProgress' event.
|
||||
* treegrid: Add cascade checkbox selection.
|
||||
* treegrid: Add 'getCheckedNodes','checkNode' and 'uncheckNode' methods.
|
||||
|
||||
Version 1.4.4
|
||||
-------------
|
||||
* Bug
|
||||
* filebox: The 'clear' and 'reset' methods do not work properly in IE9. fixed.
|
||||
* messager: After calling $.messager.progress() with no arguments, the $.messager.progress('close') does not work properly. fixed.
|
||||
* timespinner: The value does not display properly in IE8 while clicking the spin buttons. fixed.
|
||||
* window: The window does not display when calling 'options' method in 'onMove' event. fixed.
|
||||
* treegrid: The 'getLevel' method does not accept the parameter value of 0. fixed.
|
||||
* Improvement
|
||||
* layout: The 'collapsedContent','expandMode' and 'hideExpandTool' properties are supported in region panel.
|
||||
* layout: The 'hideCollapsedContent' property can be set to display the vertical title bar on collapsed panel.
|
||||
* layout: Add 'onCollapse','onExpand','onAdd','onRemove' events.
|
||||
* datagrid: Display the 'up-down' icon on the sortable columns.
|
||||
* datagrid: Add 'gotoPage' method.
|
||||
* propertygrid: Add 'groups' method that allows to get all the data groups.
|
||||
* messager: Auto scroll feature is supported when displaying long messages.
|
||||
* tabs: The 'disabled' property is supported when defining a disabled tab panel.
|
||||
* tabs: The percentange size is supported now.
|
||||
|
||||
Version 1.4.3
|
||||
-------------
|
||||
* Bug
|
||||
* textbox: The 'setText' method does not accept value 0. fixed.
|
||||
* timespinner: When running in IE11, the error occurs when clicking on the empty textbox. fixed.
|
||||
* tabs: The 'update' method can not update only the panel body. fixed.
|
||||
* Improvement
|
||||
* combobox: Improve the performance of displaying the drop-down panel.
|
||||
* combogrid: Remember the displaying text when the drop-down datagrid go to other pages.
|
||||
* combogrid: The 'setValue' and 'setValues' methods accept a key-value object.
|
||||
* window: The inline window's mask can auto-stretch its size to fill parent container.
|
||||
* tabs: The 'showTool' and 'hideTool' methods are available for users to show or hide the tools.
|
||||
* layout: Allow the user to override the 'cls','headerCls' and 'bodyCls' property values.
|
||||
* New Plugins
|
||||
* switchbutton: The switch button with two states:'on' and 'off'.
|
||||
|
||||
Version 1.4.2
|
||||
-------------
|
||||
* Bug
|
||||
* treegrid: The column will restore its size to original size after recreating the treegrid. fixed.
|
||||
* Improvement
|
||||
* draggable: Add 'delay' property that allows the user to delay the drag operation.
|
||||
* tree: Add 'filter' property and 'doFilter' method.
|
||||
* tabs: The 'add' method allows the user to insert a tab panel at a specified index.
|
||||
* tabs: The user can determine what tab panel can be selected.
|
||||
* tabs: Add 'justified' and 'narrow' properties.
|
||||
* layout: Add 'unsplit' and 'split' methods.
|
||||
* messager: Keyboard navigation features are supported now.
|
||||
* form: Add 'onChange' event.
|
||||
* combobox: Add 'queryParams' property.
|
||||
* slider: Add 'range' property.
|
||||
* menu: Add 'itemHeight','inline','noline' properties.
|
||||
* panel: The 'header' property allows the user to customize the panel header.
|
||||
* menubutton: Add 'hasDownArrow' property.
|
||||
* New Plugins
|
||||
* datalist: The plugin to render items in a list.
|
||||
* navpanel: The root component for the mobile page.
|
||||
* mobile: The plugin to provide the mobile page stack management and navigation.
|
||||
|
||||
Version 1.4.1
|
||||
-------------
|
||||
* Bug
|
||||
* combogrid: The combogrid has different height than other combo components. fixed.
|
||||
* datagrid: The row element loses some class style value after calling 'updateRow' method. fixed.
|
||||
* menubutton: Calling 'enable' method on a disabled button can not work well. fixed.
|
||||
* form: The filebox components in the form do not work correctly after calling 'clear' method. fixed.
|
||||
* Improvement
|
||||
* tabs: The 'update' method accepts 'type' option that allows the user to update the header,body,or both.
|
||||
* panel: Add 'openAnimation','openDuration','closeAnimation' and 'closeDuration' properties to set the animation for opening or closing a panel.
|
||||
* panel: Add 'footer' property that allows the user to add a footer bar to the bottom of panel.
|
||||
* datagrid: Calling 'endEdit' method will accept the editing value correctly.
|
||||
* datagrid: Add 'onBeforeSelect','onBeforeCheck','onBeforeUnselect','onBeforeUncheck' events.
|
||||
* propertygrid: The user can edit a row by calling 'beginEdit' method.
|
||||
* datebox: Add 'cloneFrom' method to create the datebox component quickly.
|
||||
* datetimebox: Add 'cloneFrom' method to create the datetimebox component quickly.
|
||||
|
||||
Version 1.4
|
||||
-------------
|
||||
* Bug
|
||||
* menu: The menu should not has a correct height when removed a menu item. fixed.
|
||||
* datagrid: The 'fitColumns' method does not work normally when the datarid width is too small. fixed.
|
||||
* Improvement
|
||||
* The fluid/percentange size is supported now for all easyui components.
|
||||
* menu: Add 'showItem', 'hideItem' and 'resize' methods.
|
||||
* menu: Auto resize the height upon the window size.
|
||||
* menu: Add 'duration' property that allows the user to define duration time in milliseconds to hide menu.
|
||||
* validatebox: Add 'onBeforeValidate' and 'onValidate' events.
|
||||
* combo: Extended from textbox now.
|
||||
* combo: Add 'panelMinWidth','panelMaxWidth','panelMinHeight' and 'panelMaxHeight' properties.
|
||||
* searchbox: Extended from textbox now.
|
||||
* tree: The 'getRoot' method will return the top parent node of a specified node if pass a 'nodeEl' parameter.
|
||||
* tree: Add 'queryParams' property.
|
||||
* datetimebox: Add 'spinnerWidth' property.
|
||||
* panel: Add 'doLayout' method to cause the panel to lay out its components.
|
||||
* panel: Add 'clear' method to clear the panel's content.
|
||||
* datagrid: The user is allowed to assign percent width to columns.
|
||||
* form: Add 'ajax','novalidate' and 'queryParams' properties.
|
||||
* linkbutton: Add 'resize' method.
|
||||
* New Plugins
|
||||
* textbox: A enhanced input field that allows users build their form easily.
|
||||
* datetimespinner: A date and time spinner that allows to pick a specific day.
|
||||
* filebox: The filebox component represents a file field of the forms.
|
||||
|
||||
Version 1.3.6
|
||||
-------------
|
||||
* Bug
|
||||
* treegrid: The 'getChecked' method can not return correct checked rows. fixed.
|
||||
* tree: The checkbox does not display properly on async tree when 'onlyLeafCheck' property is true. fixed.
|
||||
* Improvement
|
||||
* treegrid: All the selecting and checking methods are extended from datagrid component.
|
||||
* linkbutton: The icon alignment is fully supported, possible values are: 'top','bottom','left','right'.
|
||||
* linkbutton: Add 'size' property, possible values are: 'small','large'.
|
||||
* linkbutton: Add 'onClick' event.
|
||||
* menubutton: Add 'menuAlign' property that allows the user set top level menu alignment.
|
||||
* combo: Add 'panelAlign' property, possible values are: 'left','right'.
|
||||
* calendar: The 'formatter','styler' and 'validator' options are available to custom the calendar dates.
|
||||
* calendar: Add 'onChange' event.
|
||||
* panel: Add 'method','queryParams' and 'loader' options.
|
||||
* panel: Add 'onLoadError' event.
|
||||
* datagrid: Add 'onBeginEdit' event that fires when a row goes into edit mode.
|
||||
* datagrid: Add 'onEndEdit' event that fires when finishing editing but before destroying editors.
|
||||
* datagrid: Add 'sort' method and 'onBeforeSortColumn' event.
|
||||
* datagrid: The 'combogrid' editor has been integrated into datagrid.
|
||||
* datagrid: Add 'ctrlSelect' property that only allows multi-selection when ctrl+click is used.
|
||||
* slider: Add 'converter' option that allows users determine how to convert a value to the slider position or the slider position to the value.
|
||||
* searchbox: Add 'disabled' property.
|
||||
* searchbox: Add 'disable','enable','clear','reset' methods.
|
||||
* spinner: Add 'readonly' property, 'readonly' method and 'onChange' event.
|
||||
|
||||
Version 1.3.5
|
||||
-------------
|
||||
* Bug
|
||||
* searchbox: The 'searcher' function can not offer 'name' parameter value correctly. fixed.
|
||||
* combo: The 'isValid' method can not return boolean value. fixed.
|
||||
* combo: Clicking combo will trigger the 'onHidePanel' event of other combo components that have hidden drop-down panels. fixed.
|
||||
* combogrid: Some methods can not inherit from combo. fixed.
|
||||
* Improvement
|
||||
* datagrid: Improve performance on checking rows.
|
||||
* menu: Allows to append a menu separator.
|
||||
* menu: Add 'hideOnUnhover' property to indicate if the menu should be hidden when mouse exits it.
|
||||
* slider: Add 'clear' and 'reset' methods.
|
||||
* tabs: Add 'unselect' method that will trigger 'onUnselect' event.
|
||||
* tabs: Add 'selected' property to specify what tab panel will be opened.
|
||||
* tabs: The 'collapsible' property of tab panel is supported to determine if the tab panel can be collapsed.
|
||||
* tabs: Add 'showHeader' property, 'showHeader' and 'hideHeader' methods.
|
||||
* combobox: The 'disabled' property can be used to disable some items.
|
||||
* tree: Improve loading performance.
|
||||
* pagination: The 'layout' property can be used to customize the pagination layout.
|
||||
* accordion: Add 'unselect' method that will trigger 'onUnselect' event.
|
||||
* accordion: Add 'selected' and 'multiple' properties.
|
||||
* accordion: Add 'getSelections' method.
|
||||
* datebox: Add 'sharedCalendar' property that allows multiple datebox components share one calendar component.
|
||||
|
||||
Version 1.3.4
|
||||
-------------
|
||||
* Bug
|
||||
* combobox: The onLoadSuccess event fires when parsing empty local data. fixed.
|
||||
* form: Calling 'reset' method can not reset datebox field. fixed.
|
||||
* Improvement
|
||||
* mobile: The context menu and double click features are supported on mobile devices.
|
||||
* combobox: The 'groupField' and 'groupFormatter' options are available to display items in groups.
|
||||
* tree: When append or insert nodes, the 'data' parameter accepts one or more nodes data.
|
||||
* tree: The 'getChecked' method accepts a single 'state' or an array of 'state'.
|
||||
* tree: Add 'scrollTo' method.
|
||||
* datagrid: The 'multiSort' property is added to support multiple column sorting.
|
||||
* datagrid: The 'rowStyler' and column 'styler' can return CSS class name or inline styles.
|
||||
* treegrid: Add 'load' method to load data and navigate to the first page.
|
||||
* tabs: Add 'tabWidth' and 'tabHeight' properties.
|
||||
* validatebox: The 'novalidate' property is available to indicate whether to perform the validation.
|
||||
* validatebox: Add 'enableValidation' and 'disableValidation' methods.
|
||||
* form: Add 'enableValidation' and 'disableValidation' methods.
|
||||
* slider: Add 'onComplete' event.
|
||||
* pagination: The 'buttons' property accepts the existing element.
|
||||
|
||||
Version 1.3.3
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: Some style features are not supported by column styler function. fixed.
|
||||
* datagrid: IE 31 stylesheet limit. fixed.
|
||||
* treegrid: Some style features are not supported by column styler function. fixed.
|
||||
* menu: The auto width of menu item displays incorrect in ie6. fixed.
|
||||
* combo: The 'onHidePanel' event can not fire when clicked outside the combo area. fixed.
|
||||
* Improvement
|
||||
* datagrid: Add 'scrollTo' and 'highlightRow' methods.
|
||||
* treegrid: Enable treegrid to parse data from <tbody> element.
|
||||
* combo: Add 'selectOnNavigation' and 'readonly' options.
|
||||
* combobox: Add 'loadFilter' option to allow users to change data format before loading into combobox.
|
||||
* tree: Add 'onBeforeDrop' callback event.
|
||||
* validatebox: Dependent on tooltip plugin now, add 'deltaX' property.
|
||||
* numberbox: The 'filter' options can be used to determine if the key pressed was accepted.
|
||||
* linkbutton: The group button is available.
|
||||
* layout: The 'minWidth','maxWidth','minHeight','maxHeight' and 'collapsible' properties are available for region panel.
|
||||
* New Plugins
|
||||
* tooltip: Display a popup message when moving mouse over an element.
|
||||
|
||||
Version 1.3.2
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: The loading message window can not be centered when changing the width of datagrid. fixed.
|
||||
* treegrid: The 'mergeCells' method can not work normally. fixed.
|
||||
* propertygrid: Calling 'endEdit' method to stop editing a row will cause errors. fixed.
|
||||
* tree: Can not load empty data when 'lines' property set to true. fixed.
|
||||
* Improvement
|
||||
* RTL feature is supported now.
|
||||
* tabs: Add 'scrollBy' method to scroll the tab header by the specified amount of pixels
|
||||
* tabs: Add 'toolPosition' property to set tab tools to left or right.
|
||||
* tabs: Add 'tabPosition' property to define the tab position, possible values are: 'top','bottom','left','right'.
|
||||
* datagrid: Add a column level property 'order' that allows users to define different default sort order per column.
|
||||
* datagrid: Add a column level property 'halign' that allows users to define how to align the column header.
|
||||
* datagrid: Add 'resizeHandle' property to define the resizing column position, by grabbing the left or right edge of the column.
|
||||
* datagrid: Add 'freezeRow' method to freeze some rows that will always be displayed at the top when the datagrid is scrolled down.
|
||||
* datagrid: Add 'clearChecked' method to clear all checked records.
|
||||
* datagrid: Add 'data' property to initialize the datagrid data.
|
||||
* linkbutton: Add 'iconAlgin' property to define the icon position, supported values are: 'left','right'.
|
||||
* menu: Add 'minWidth' property.
|
||||
* menu: The menu width can be automatically calculated.
|
||||
* tree: New events are available including 'onBeforeDrag','onStartDrag','onDragEnter','onDragOver','onDragLeave',etc.
|
||||
* combo: Add 'height' property to allow users to define the height of combo.
|
||||
* combo: Add 'reset' method.
|
||||
* numberbox: Add 'reset' method.
|
||||
* spinner: Add 'reset' method.
|
||||
* spinner: Add 'height' property to allow users to define the height of spinner.
|
||||
* searchbox: Add 'height' property to allow users to define the height of searchbox.
|
||||
* form: Add 'reset' method.
|
||||
* validatebox: Add 'delay' property to delay validating from the last inputting value.
|
||||
* validatebox: Add 'tipPosition' property to define the tip position, supported values are: 'left','right'.
|
||||
* validatebox: Multiple validate rules on a field is supported now.
|
||||
* slider: Add 'reversed' property to determine if the min value and max value will switch their positions.
|
||||
* progressbar: Add 'height' property to allow users to define the height of progressbar.
|
||||
|
||||
Version 1.3.1
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: Setting the 'pageNumber' property is not valid. fixed.
|
||||
* datagrid: The id attribute of rows isn't adjusted properly while calling 'insertRow' or 'deleteRow' method.
|
||||
* dialog: When load content from 'href', the script will run twice. fixed.
|
||||
* propertygrid: The editors that extended from combo can not accept its changed value. fixed.
|
||||
* Improvement
|
||||
* droppable: Add 'disabled' property.
|
||||
* droppable: Add 'options','enable' and 'disable' methods.
|
||||
* tabs: The tab panel tools can be changed by calling 'update' method.
|
||||
* messager: When show a message window, the user can define the window position by applying 'style' property.
|
||||
* window: Prevent script on window body from running twice.
|
||||
* window: Add 'hcenter','vcenter' and 'center' methods.
|
||||
* tree: Add 'onBeforeCheck' callback event.
|
||||
* tree: Extend the 'getChecked' method to allow users to get 'checked','unchecked' or 'indeterminate' nodes.
|
||||
* treegrid: Add 'update' method to update a specified node.
|
||||
* treegrid: Add 'insert' method to insert a new node.
|
||||
* treegrid: Add 'pop' method to remove a node and get the removed node data.
|
||||
|
||||
Version 1.3
|
||||
-----------
|
||||
* Bug
|
||||
* combogrid: When set to 'remote' query mode, the 'queryParams' parameters can't be sent to server. fixed.
|
||||
* combotree: The tree nodes on drop-down panel can not be unchecked while calling 'clear' method. fixed.
|
||||
* datetimebox: Setting 'showSeconds' property to false cannot hide seconds info. fixed.
|
||||
* datagrid: Calling 'mergeCells' method can't auto resize the merged cell while header is hidden. fixed.
|
||||
* dialog: Set cache to false and load data via ajax, the content cannot be refreshed. fixed.
|
||||
* Improvement
|
||||
* The HTML5 'data-options' attribute is available for components to declare all custom options, including properties and events.
|
||||
* More detailed documentation is available.
|
||||
* panel: Prevent script on panel body from running twice.
|
||||
* accordion: Add 'getPanelIndex' method.
|
||||
* accordion: The tools can be added on panel header.
|
||||
* datetimebox: Add 'timeSeparator' option that allows users to define the time separator.
|
||||
* pagination: Add 'refresh' and 'select' methods.
|
||||
* datagrid: Auto resize the column width to fit the contents when the column width is not defined.
|
||||
* datagrid: Double click on the right border of columns to auto resize the columns to the contents in the columns.
|
||||
* datagrid: Add 'autoSizeColumn' method that allows users to adjust the column width to fit the contents.
|
||||
* datagrid: Add 'getChecked' method to get all rows where the checkbox has been checked.
|
||||
* datagrid: Add 'selectOnCheck' and 'checkOnSelect' properties and some checking methods to enhance the row selections.
|
||||
* datagrid: Add 'pagePosition' property to allow users to display pager bar at either top,bottom or both places of the grid.
|
||||
* datagrid: The buffer view and virtual scroll view are supported to display large amounts of records without pagination.
|
||||
* tabs: Add 'disableTab' and 'enableTab' methods to allow users to disable or enable a tab panel.
|
||||
|
||||
Version 1.2.6
|
||||
-------------
|
||||
* Bug
|
||||
* tabs: Call 'add' method with 'selected:false' option, the added tab panel is always selected. fixed.
|
||||
* treegrid: The 'onSelect' and 'onUnselect' events can't be triggered. fixed.
|
||||
* treegrid: Cannot display zero value field. fixed.
|
||||
* Improvement
|
||||
* propertygrid: Add 'expandGroup' and 'collapseGroup' methods.
|
||||
* layout: Allow users to create collapsed layout panels by assigning 'collapsed' property to true.
|
||||
* layout: Add 'add' and 'remove' methods that allow users to dynamically add or remove region panel.
|
||||
* layout: Additional tool icons can be added on region panel header.
|
||||
* calendar: Add 'firstDay' option that allow users to set first day of week. Sunday is 0, Monday is 1, ...
|
||||
* tree: Add 'lines' option, true to display tree lines.
|
||||
* tree: Add 'loadFilter' option that allow users to change data format before loading into the tree.
|
||||
* tree: Add 'loader' option that allow users to define how to load data from remote server.
|
||||
* treegrid: Add 'onClickCell' and 'onDblClickCell' callback function options.
|
||||
* datagrid: Add 'autoRowHeight' property that allow users to determine if set the row height based on the contents of that row.
|
||||
* datagrid: Improve performance to load large data set.
|
||||
* datagrid: Add 'loader' option that allow users to define how to load data from remote server.
|
||||
* treegrid: Add 'loader' option that allow users to define how to load data from remote server.
|
||||
* combobox: Add 'onBeforeLoad' callback event function.
|
||||
* combobox: Add 'loader' option that allow users to define how to load data from remote server.
|
||||
* Add support for other loading mode such as dwr,xml,etc.
|
||||
* New Plugins
|
||||
* slider: Allows the user to choose a numeric value from a finite range.
|
||||
|
||||
Version 1.2.5
|
||||
-------------
|
||||
* Bug
|
||||
* tabs: When add a new tab panel with href property, the content page is loaded twice. fixed.
|
||||
* form: Failed to call 'load' method to load form input with complex name. fixed.
|
||||
* draggable: End drag in ie9, the cursor cannot be restored. fixed.
|
||||
* Improvement
|
||||
* panel: The tools can be defined via html markup.
|
||||
* tabs: Call 'close' method to close specified tab panel, users can pass tab title or index of tab panel. Other methods such 'select','getTab' and 'exists' are similar to 'close' method.
|
||||
* tabs: Add 'getTabIndex' method.
|
||||
* tabs: Users can define mini tools on tabs.
|
||||
* tree: The mouse must move a specified distance to begin drag and drop operation.
|
||||
* resizable: Add 'options','enable' and 'disable' methods.
|
||||
* numberbox: Allow users to change number format.
|
||||
* datagrid: The subgrid is supported now.
|
||||
* searchbox: Add 'selectName' method to select searching type name.
|
||||
|
||||
Version 1.2.4
|
||||
-------------
|
||||
* Bug
|
||||
* menu: The menu position is wrong when scroll bar appears. fixed.
|
||||
* accordion: Cannot display the default selected panel in jQuery 1.6.2. fixed.
|
||||
* tabs: Cannot display the default selected tab panel in jQuery 1.6.2. fixed.
|
||||
* Improvement
|
||||
* menu: Allow users to disable or enable menu item.
|
||||
* combo: Add 'delay' property to set the delay time to do searching from the last key input event.
|
||||
* treegrid: The 'getEditors' and 'getEditor' methods are supported now.
|
||||
* treegrid: The 'loadFilter' option is supported now.
|
||||
* messager: Add 'progress' method to display a message box with a progress bar.
|
||||
* panel: Add 'extractor' option to allow users to extract panel content from ajax response.
|
||||
* New Plugins
|
||||
* searchbox: Allow users to type words into box and do searching operation.
|
||||
* progressbar: To display the progress of a task.
|
||||
|
||||
Version 1.2.3
|
||||
-------------
|
||||
* Bug
|
||||
* window: Cannot resize the window with iframe content. fixed.
|
||||
* tree: The node will be removed when dragging to its child. fixed.
|
||||
* combogrid: The onChange event fires multiple times. fixed.
|
||||
* accordion: Cannot add batch new panels when animate property is set to true. fixed.
|
||||
* Improvement
|
||||
* treegrid: The footer row and row styler features are supported now.
|
||||
* treegrid: Add 'getLevel','reloadFooter','getFooterRows' methods.
|
||||
* treegrid: Support root nodes pagination and editable features.
|
||||
* datagrid: Add 'getFooterRows','reloadFooter','insertRow' methods and improve editing performance.
|
||||
* datagrid: Add 'loadFilter' option that allow users to change original source data to standard data format.
|
||||
* draggable: Add 'onBeforeDrag' callback event function.
|
||||
* validatebox: Add 'remote' validation type.
|
||||
* combobox: Add 'method' option.
|
||||
* New Plugins
|
||||
* propertygrid: Allow users to edit property value in datagrid.
|
||||
|
||||
Version 1.2.2
|
||||
-------------
|
||||
* Bug
|
||||
* datagrid: Apply fitColumns cannot work fine while set checkbox column. fixed.
|
||||
* datagrid: The validateRow method cannot return boolean type value. fixed.
|
||||
* numberbox: Cannot fix value in chrome when min or max property isn't defined. fixed.
|
||||
* Improvement
|
||||
* menu: Add some crud methods.
|
||||
* combo: Add hasDownArrow property to determine whether to display the down arrow button.
|
||||
* tree: Supports inline editing.
|
||||
* calendar: Add some useful methods such as 'resize', 'moveTo' etc.
|
||||
* timespinner: Add some useful methods.
|
||||
* datebox: Refactoring based on combo and calendar plugin now.
|
||||
* datagrid: Allow users to change row style in some conditions.
|
||||
* datagrid: Users can use the footer row to display summary information.
|
||||
* New Plugins
|
||||
* datetimebox: Combines datebox with timespinner component.
|
||||
|
||||
Version 1.2.1
|
||||
-------------
|
||||
* Bug
|
||||
* easyloader: Some dependencies cannot be loaded by their order. fixed.
|
||||
* tree: The checkbox is setted incorrectly when removing a node. fixed.
|
||||
* dialog: The dialog layout incorrectly when 'closed' property is setted to true. fixed.
|
||||
* Improvement
|
||||
* parser: Add onComplete callback function that can indicate whether the parse action is complete.
|
||||
* menu: Add onClick callback function and some other methods.
|
||||
* tree: Add some useful methods.
|
||||
* tree: Drag and Drop feature is supported now.
|
||||
* tree: Add onContextMenu callback function.
|
||||
* tabs: Add onContextMenu callback function.
|
||||
* tabs: Add 'tools' property that can create buttons on right bar.
|
||||
* datagrid: Add onHeaderContextMenu and onRowContextMenu callback functions.
|
||||
* datagrid: Custom view is supported.
|
||||
* treegrid: Add onContextMenu callback function and append,remove methods.
|
||||
|
||||
Version 1.2
|
||||
-------------
|
||||
* Improvement
|
||||
* tree: Add cascadeCheck,onlyLeafCheck properties and select event.
|
||||
* combobox: Enable multiple selection.
|
||||
* combotree: Enable multiple selection.
|
||||
* tabs: Remember the trace of selection, when current tab panel is closed, the previous selected tab will be selected.
|
||||
* datagrid: Extend from panel, so many properties defined in panel can be used for datagrid.
|
||||
* New Plugins
|
||||
* treegrid: Represent tabular data in hierarchical view, combines tree view and datagrid.
|
||||
* combo: The basic component that allow user to extend their combo component such as combobox,combotree,etc.
|
||||
* combogrid: Combines combobox with drop-down datagrid component.
|
||||
* spinner: The basic plugin to create numberspinner,timespinner,etc.
|
||||
* numberspinner: The numberbox that allow user to change value by clicking up and down spin buttons.
|
||||
* timespinner: The time selector that allow user to quickly inc/dec a time.
|
||||
|
||||
Version 1.1.2
|
||||
-------------
|
||||
* Bug
|
||||
* messager: When call show method in layout, the message window will be blocked. fixed.
|
||||
* Improvement
|
||||
* datagrid: Add validateRow method, remember the current editing row status when do editing action.
|
||||
* datagrid: Add the ability to create merged cells.
|
||||
* form: Add callback functions when loading data.
|
||||
* panel,window,dialog: Add maximize,minimize,restore,collapse,expand methods.
|
||||
* panel,tabs,accordion: The lazy loading feature is supported.
|
||||
* tabs: Add getSelected,update,getTab methods.
|
||||
* accordion: Add crud methods.
|
||||
* linkbutton: Accept an id option to set the id attribute.
|
||||
* tree: Enhance tree node operation.
|
||||
|
||||
Version 1.1.1
|
||||
-------------
|
||||
* Bug
|
||||
* form: Cannot clear the value of combobox and combotree component. fixed.
|
||||
* Improvement
|
||||
* tree: Add some useful methods such as 'getRoot','getChildren','update',etc.
|
||||
* datagrid: Add editable feature, improve performance while loading data.
|
||||
* datebox: Add destroy method.
|
||||
* combobox: Add destroy and clear method.
|
||||
* combotree: Add destroy and clear method.
|
||||
|
||||
Version 1.1
|
||||
-------------
|
||||
* Bug
|
||||
* messager: When call show method with timeout property setted, an error occurs while clicking the close button. fixed.
|
||||
* combobox: The editable property of combobox plugin is invalid. fixed.
|
||||
* window: The proxy box will not be removed when dragging or resizing exceed browser border in ie. fixed.
|
||||
* Improvement
|
||||
* menu: The menu item can use <a> markup to display a different page.
|
||||
* tree: The tree node can use <a> markup to act as a tree menu.
|
||||
* pagination: Add some event on refresh button and page list.
|
||||
* datagrid: Add a 'param' parameter for reload method, with which users can pass query parameter when reload data.
|
||||
* numberbox: Add required validation support, the usage is same as validatebox plugin.
|
||||
* combobox: Add required validation support.
|
||||
* combotree: Add required validation support.
|
||||
* layout: Add some method that can get a region panel and attach event handlers.
|
||||
* New Plugins
|
||||
* droppable: A droppable plugin that supports drag drop operation.
|
||||
* calendar: A calendar plugin that can either be embedded within a page or popup.
|
||||
* datebox: Combines a textbox with a calendar that let users to select date.
|
||||
* easyloader: A JavaScript loader that allows you to load plugin and their dependencies into your page.
|
||||
|
||||
Version 1.0.5
|
||||
* Bug
|
||||
* panel: The fit property of panel performs incorrectly. fixed.
|
||||
* Improvement
|
||||
* menu: Add a href attribute for menu item, with which user can display a different page in the current browser window.
|
||||
* form: Add a validate method to do validation for validatebox component.
|
||||
* dialog: The dialog can read collapsible,minimizable,maximizable and resizable attribute from markup.
|
||||
* New Plugins
|
||||
* validatebox: A validation plugin that checks to make sure the user's input value is valid.
|
||||
|
||||
Version 1.0.4
|
||||
-------------
|
||||
* Bug
|
||||
* panel: When panel is invisible, it is abnormal when resized. fixed.
|
||||
* panel: Memory leak in method 'destroy'. fixed.
|
||||
* messager: Memory leak when messager box is closed. fixed.
|
||||
* dialog: No onLoad event occurs when loading remote data. fixed.
|
||||
* Improvement
|
||||
* panel: Add method 'setTitle'.
|
||||
* window: Add method 'setTitle'.
|
||||
* dialog: Add method 'setTitle'.
|
||||
* combotree: Add method 'getValue'.
|
||||
* combobox: Add method 'getValue'.
|
||||
* form: The 'load' method can load data and fill combobox and combotree field correctly.
|
||||
|
||||
Version 1.0.3
|
||||
-------------
|
||||
* Bug
|
||||
* menu: When menu is show in a DIV container, it will be cropped. fixed.
|
||||
* layout: If you collpase a region panel and then expand it immediately, the region panel will not show normally. fixed.
|
||||
* accordion: If no panel selected then the first one will become selected and the first panel's body height will not set correctly. fixed.
|
||||
* Improvement
|
||||
* tree: Add some methods to support CRUD operation.
|
||||
* datagrid: Toolbar can accept a new property named 'disabled' to disable the specified tool button.
|
||||
* New Plugins
|
||||
* combobox: Combines a textbox with a list of options that users are able to choose from.
|
||||
* combotree: Combines combobox with drop-down tree component.
|
||||
* numberbox: Make input element can only enter number char.
|
||||
* dialog: rewrite the dialog plugin, dialog can contains toolbar and buttons.
|
||||
404
static/jeasyui/datagrid-bufferview.js
Normal file
404
static/jeasyui/datagrid-bufferview.js
Normal file
@@ -0,0 +1,404 @@
|
||||
$.extend($.fn.datagrid.defaults, {
|
||||
onBeforeFetch: function(page){},
|
||||
onFetch: function(page, rows){}
|
||||
});
|
||||
|
||||
var bufferview = $.extend({}, $.fn.datagrid.defaults.view, {
|
||||
onAfterRender : function(target){
|
||||
},
|
||||
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;
|
||||
if(index >= state.data.total){
|
||||
return;
|
||||
}
|
||||
|
||||
var table = ['<table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0"><tbody>'];
|
||||
for(var i=0; i<rows.length; i++) {
|
||||
// get the class and style attributes for this row
|
||||
var css = opts.rowStyler ? opts.rowStyler.call(target, index, rows[i]) : '';
|
||||
var classValue = '';
|
||||
var styleValue = '';
|
||||
if (typeof css == 'string'){
|
||||
styleValue = css;
|
||||
} else if (css){
|
||||
classValue = css['class'] || '';
|
||||
styleValue = css['style'] || '';
|
||||
}
|
||||
|
||||
var cls = 'class="datagrid-row ' + (index % 2 && opts.striped ? 'datagrid-row-alt ' : ' ') + classValue + '"';
|
||||
var style = styleValue ? 'style="' + styleValue + '"' : '';
|
||||
var rowId = state.rowIdPrefix + '-' + (frozen?1:2) + '-' + index;
|
||||
table.push('<tr id="' + rowId + '" datagrid-row-index="' + index + '" ' + cls + ' ' + style + '>');
|
||||
table.push(this.renderRow.call(this, target, fields, frozen, index, rows[i]));
|
||||
table.push('</tr>');
|
||||
|
||||
// render the detail row
|
||||
if (opts.detailFormatter){
|
||||
table.push('<tr style="display:none;">');
|
||||
if (frozen){
|
||||
table.push('<td colspan=' + (fields.length+2) + ' style="border-right:0">');
|
||||
} else {
|
||||
table.push('<td colspan=' + (fields.length) + '>');
|
||||
}
|
||||
table.push('<div class="datagrid-row-detail">');
|
||||
if (frozen){
|
||||
table.push(' ');
|
||||
} else {
|
||||
table.push(opts.detailFormatter.call(target, index, rows[i]));
|
||||
}
|
||||
table.push('</div>');
|
||||
table.push('</td>');
|
||||
table.push('</tr>');
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
table.push('</tbody></table>');
|
||||
|
||||
$(container).append(table.join(''));
|
||||
},
|
||||
|
||||
renderRow : function(target, fields, frozen, rowIndex, rowData) { //method backup from the source
|
||||
var opts = $.data(target, "datagrid").options,
|
||||
cc = [],
|
||||
rowSpanField = typeof opts.columns[0]['rowSpanField'] !== 'undefined' ? opts.columns[0]['rowSpanField'] : '',
|
||||
rowSpan = rowSpanField !== '' && typeof rowData[rowSpanField]['numRows'] !== 'undefined' ? rowData[rowSpanField]['numRows'] : 1;
|
||||
|
||||
if (frozen && opts.rownumbers) {
|
||||
var _726 = rowIndex + 1;
|
||||
if (opts.pagination) {
|
||||
_726 += (opts.pageNumber - 1) * opts.pageSize;
|
||||
}
|
||||
cc.push("<td class=\"datagrid-td-rownumber\"><div class=\"datagrid-cell-rownumber\">" + _726 + "</div></td>");
|
||||
}
|
||||
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
var _727 = fields[i];
|
||||
var col = $(target).datagrid("getColumnOption", _727);
|
||||
if (col) {
|
||||
var _728 = rowData[_727];
|
||||
var css = col.styler ? (col.styler(_728, rowData, rowIndex, col) || "") : "";
|
||||
var _729 = "";
|
||||
var _72a = "";
|
||||
if (typeof css == "string") {
|
||||
_72a = css;
|
||||
} else {
|
||||
if (css) {
|
||||
_729 = css["class"] || "";
|
||||
_72a = css["style"] || "";
|
||||
}
|
||||
}
|
||||
var cls = _729 ? "class=\"" + _729 + ( frozen ? 'frozen-td' : '' ) + "\"" : ( frozen ? 'class="frozen-td"' : '' );
|
||||
var _72b = col.hidden ? "style=\"display:none;" + _72a + "\"" : (_72a ? "style=\"" + _72a + "\"" : "");
|
||||
cc.push("<td field=\"" + _727 + "\" " + cls + " " + _72b + ">");
|
||||
var _72b = "";
|
||||
if (!col.checkbox) {
|
||||
if (col.align) {
|
||||
_72b += "text-align:" + col.align + ";";
|
||||
}else if (col.expander){
|
||||
style = "text-align:center;height:16px;";
|
||||
}
|
||||
if (!opts.nowrap) {
|
||||
_72b += "white-space:normal;height:auto;";
|
||||
} else {
|
||||
if (opts.autoRowHeight) {
|
||||
_72b += "height:auto;";
|
||||
}
|
||||
}
|
||||
}
|
||||
cc.push("<div style=\"" + _72b + "\" ");
|
||||
cc.push(col.checkbox ? "class=\"datagrid-cell-check\"" : "class=\"datagrid-cell " + col.cellClass + "\"");
|
||||
cc.push(">");
|
||||
|
||||
if (col.checkbox) {
|
||||
cc.push("<input type=\"checkbox\" " + (rowData.checked ? "checked=\"checked\"" : ""));
|
||||
cc.push(" name=\"" + _727 + "\" value=\"" + (_728 != undefined ? _728 : "") + "\">");
|
||||
}else if (col.expander) {
|
||||
//cc.push('<div style="text-align:center;width:16px;height:16px;">');
|
||||
cc.push('<span class="datagrid-row-expander datagrid-row-expand" style="display:inline-block;width:16px;height:16px;cursor:pointer;" />');
|
||||
//cc.push('</div>');
|
||||
} else if (col.formatter){
|
||||
// console.log('bufferview.renderRow():', col);
|
||||
cc.push(col.formatter(_728, rowData, rowIndex));
|
||||
// cc.push(col.formatter(_728, rowData, rowIndex, col));
|
||||
} else {
|
||||
cc.push(_728);
|
||||
}
|
||||
|
||||
cc.push("</div>");
|
||||
cc.push("</td>");
|
||||
}
|
||||
}
|
||||
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;
|
||||
this.renderedCount = 0;
|
||||
this.rows = [];
|
||||
|
||||
dc.body1.add(dc.body2).empty();
|
||||
init();
|
||||
createHeaderExpander();
|
||||
|
||||
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 * 25;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
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<fields.length; i++){
|
||||
var col = t.datagrid('getColumnOption', fields[i]);
|
||||
if (col.expander){
|
||||
hasExpander = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasExpander){
|
||||
if (opts.frozenColumns && opts.frozenColumns.length){
|
||||
opts.frozenColumns[0].splice(0,0,{field:'_expander',expander:true,width:24,resizable:false,fixed:true});
|
||||
} else {
|
||||
opts.frozenColumns = [[{field:'_expander',expander:true,width:24,resizable:false,fixed:true}]];
|
||||
}
|
||||
|
||||
var t = dc.view1.children('div.datagrid-header').find('table');
|
||||
var td = $('<td rowspan="'+opts.frozenColumns.length+'"><div class="datagrid-header-expander" style="width:24px;"></div></td>');
|
||||
if ($('tr',t).length == 0){
|
||||
td.wrap('<tr></tr>').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);
|
||||
}
|
||||
},
|
||||
|
||||
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 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
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
194
static/jeasyui/easyloader.js
Executable file
194
static/jeasyui/easyloader.js
Executable file
@@ -0,0 +1,194 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(){
|
||||
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"]},radiobutton:{js:"jquery.radiobutton.js",css:"radiobutton.css"},checkbox:{js:"jquery.checkbox.js",css:"checkbox.css"},sidemenu:{js:"jquery.sidemenu.js",css:"sidemenu.css",dependencies:["accordion","tree","tooltip"]},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"]},timepicker:{js:"jquery.timepicker.js",css:"timepicker.css",dependencies:["combo"]},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",css:"flex.css"},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){
|
||||
var _7=false;
|
||||
var _8=document.createElement("script");
|
||||
_8.type="text/javascript";
|
||||
_8.language="javascript";
|
||||
_8.src=_5;
|
||||
_8.onload=_8.onreadystatechange=function(){
|
||||
if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){
|
||||
_7=true;
|
||||
_8.onload=_8.onreadystatechange=null;
|
||||
if(_6){
|
||||
_6.call(_8);
|
||||
}
|
||||
}
|
||||
};
|
||||
document.getElementsByTagName("head")[0].appendChild(_8);
|
||||
};
|
||||
function _9(_a,_b){
|
||||
_4(_a,function(){
|
||||
document.getElementsByTagName("head")[0].removeChild(this);
|
||||
if(_b){
|
||||
_b();
|
||||
}
|
||||
});
|
||||
};
|
||||
function _c(_d,_e){
|
||||
var _f=document.createElement("link");
|
||||
_f.rel="stylesheet";
|
||||
_f.type="text/css";
|
||||
_f.media="screen";
|
||||
_f.href=_d;
|
||||
document.getElementsByTagName("head")[0].appendChild(_f);
|
||||
if(_e){
|
||||
_e.call(_f);
|
||||
}
|
||||
};
|
||||
function _10(_11,_12){
|
||||
_3[_11]="loading";
|
||||
var _13=_1[_11];
|
||||
var _14="loading";
|
||||
var _15=(easyloader.css&&_13["css"])?"loading":"loaded";
|
||||
if(easyloader.css&&_13["css"]){
|
||||
if(/^http/i.test(_13["css"])){
|
||||
var url=_13["css"];
|
||||
}else{
|
||||
var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"];
|
||||
}
|
||||
_c(url,function(){
|
||||
_15="loaded";
|
||||
if(_14=="loaded"&&_15=="loaded"){
|
||||
_16();
|
||||
}
|
||||
});
|
||||
}
|
||||
if(/^http/i.test(_13["js"])){
|
||||
var url=_13["js"];
|
||||
}else{
|
||||
var url=easyloader.base+"plugins/"+_13["js"];
|
||||
}
|
||||
_4(url,function(){
|
||||
_14="loaded";
|
||||
if(_14=="loaded"&&_15=="loaded"){
|
||||
_16();
|
||||
}
|
||||
});
|
||||
function _16(){
|
||||
_3[_11]="loaded";
|
||||
easyloader.onProgress(_11);
|
||||
if(_12){
|
||||
_12();
|
||||
}
|
||||
};
|
||||
};
|
||||
function _17(_18,_19){
|
||||
var mm=[];
|
||||
var _1a=false;
|
||||
if(typeof _18=="string"){
|
||||
add(_18);
|
||||
}else{
|
||||
for(var i=0;i<_18.length;i++){
|
||||
add(_18[i]);
|
||||
}
|
||||
}
|
||||
mm.unshift("parser");
|
||||
function add(_1b){
|
||||
if(!_1[_1b]){
|
||||
return;
|
||||
}
|
||||
var d=_1[_1b]["dependencies"];
|
||||
if(d){
|
||||
for(var i=0;i<d.length;i++){
|
||||
add(d[i]);
|
||||
}
|
||||
}
|
||||
mm.push(_1b);
|
||||
};
|
||||
function _1c(){
|
||||
if(_19){
|
||||
if(window.jQuery){
|
||||
window.jQuery.parser.parseVars();
|
||||
}
|
||||
_19();
|
||||
}
|
||||
easyloader.onLoad(_18);
|
||||
};
|
||||
var _1d=0;
|
||||
function _1e(){
|
||||
if(mm.length){
|
||||
var m=mm[0];
|
||||
if(!_3[m]){
|
||||
_1a=true;
|
||||
_10(m,function(){
|
||||
mm.shift();
|
||||
_1e();
|
||||
});
|
||||
}else{
|
||||
if(_3[m]=="loaded"){
|
||||
mm.shift();
|
||||
_1e();
|
||||
}else{
|
||||
if(_1d<easyloader.timeout){
|
||||
_1d+=10;
|
||||
setTimeout(arguments.callee,10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(easyloader.locale&&_1a==true&&_2[easyloader.locale]){
|
||||
var url=easyloader.base+"locale/"+_2[easyloader.locale];
|
||||
_9(url,function(){
|
||||
_1c();
|
||||
});
|
||||
}else{
|
||||
_1c();
|
||||
}
|
||||
}
|
||||
};
|
||||
_1e();
|
||||
};
|
||||
easyloader={modules:_1,locales:_2,base:".",theme:"default",css:true,locale:null,timeout:2000,load:function(_1f,_20){
|
||||
if(/\.css$/i.test(_1f)){
|
||||
if(/^http/i.test(_1f)){
|
||||
_c(_1f,_20);
|
||||
}else{
|
||||
_c(easyloader.base+_1f,_20);
|
||||
}
|
||||
}else{
|
||||
if(/\.js$/i.test(_1f)){
|
||||
if(/^http/i.test(_1f)){
|
||||
_4(_1f,_20);
|
||||
}else{
|
||||
_4(easyloader.base+_1f,_20);
|
||||
}
|
||||
}else{
|
||||
_17(_1f,_20);
|
||||
}
|
||||
}
|
||||
},onProgress:function(_21){
|
||||
},onLoad:function(_22){
|
||||
}};
|
||||
var _23=document.getElementsByTagName("script");
|
||||
for(var i=0;i<_23.length;i++){
|
||||
var src=_23[i].src;
|
||||
if(!src){
|
||||
continue;
|
||||
}
|
||||
var m=src.match(/easyloader\.js(\W|$)/i);
|
||||
if(m){
|
||||
easyloader.base=src.substring(0,m.index);
|
||||
}
|
||||
}
|
||||
window.using=easyloader.load;
|
||||
if(window.jQuery){
|
||||
jQuery(function(){
|
||||
easyloader.load("parser",function(){
|
||||
jQuery.parser.parse();
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
620
static/jeasyui/jquery.blockUI.js
Normal file
620
static/jeasyui/jquery.blockUI.js
Normal file
@@ -0,0 +1,620 @@
|
||||
/*!
|
||||
* jQuery blockUI plugin
|
||||
* Version 2.70.0-2014.11.23
|
||||
* Requires jQuery v1.7 or later
|
||||
*
|
||||
* Examples at: http://malsup.com/jquery/block/
|
||||
* Copyright (c) 2007-2013 M. Alsup
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
/*jshint eqeqeq:false curly:false latedef:false */
|
||||
"use strict";
|
||||
|
||||
function setup($) {
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
|
||||
var noOp = $.noop || function() {};
|
||||
|
||||
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
|
||||
// confusing userAgent strings on Vista)
|
||||
var msie = /MSIE/.test(navigator.userAgent);
|
||||
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
|
||||
var mode = document.documentMode || 0;
|
||||
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
|
||||
|
||||
// global $ methods for blocking/unblocking the entire page
|
||||
$.blockUI = function(opts) { install(window, opts); };
|
||||
$.unblockUI = function(opts) { remove(window, opts); };
|
||||
|
||||
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
|
||||
$.growlUI = function(title, message, timeout, onClose) {
|
||||
var $m = $('<div class="growlUI"></div>');
|
||||
if (title) $m.append('<h1>'+title+'</h1>');
|
||||
if (message) $m.append('<h2>'+message+'</h2>');
|
||||
if (timeout === undefined) timeout = 3000;
|
||||
|
||||
// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
|
||||
var callBlock = function(opts) {
|
||||
opts = opts || {};
|
||||
|
||||
$.blockUI({
|
||||
message: $m,
|
||||
fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
|
||||
fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
|
||||
timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
|
||||
centerY: false,
|
||||
showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
||||
callBlock();
|
||||
var nonmousedOpacity = $m.css('opacity');
|
||||
$m.mouseover(function() {
|
||||
callBlock({
|
||||
fadeIn: 0,
|
||||
timeout: 30000
|
||||
});
|
||||
|
||||
var displayBlock = $('.blockMsg');
|
||||
displayBlock.stop(); // cancel fadeout if it has started
|
||||
displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
|
||||
}).mouseout(function() {
|
||||
$('.blockMsg').fadeOut(1000);
|
||||
});
|
||||
// End konapun additions
|
||||
};
|
||||
|
||||
// plugin method for blocking element content
|
||||
$.fn.block = function(opts) {
|
||||
if ( this[0] === window ) {
|
||||
$.blockUI( opts );
|
||||
return this;
|
||||
}
|
||||
var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
this.each(function() {
|
||||
var $el = $(this);
|
||||
if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
|
||||
return;
|
||||
$el.unblock({ fadeOut: 0 });
|
||||
});
|
||||
|
||||
return this.each(function() {
|
||||
if ($.css(this,'position') == 'static') {
|
||||
this.style.position = 'relative';
|
||||
$(this).data('blockUI.static', true);
|
||||
}
|
||||
this.style.zoom = 1; // force 'hasLayout' in ie
|
||||
install(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for unblocking element content
|
||||
$.fn.unblock = function(opts) {
|
||||
if ( this[0] === window ) {
|
||||
$.unblockUI( opts );
|
||||
return this;
|
||||
}
|
||||
return this.each(function() {
|
||||
remove(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
$.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!
|
||||
|
||||
// override these in your code to change the default behavior and style
|
||||
$.blockUI.defaults = {
|
||||
// message displayed when blocking (use null for no message)
|
||||
message: '<h1>Please wait...</h1>',
|
||||
|
||||
title: null, // title string; only used when theme == true
|
||||
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
|
||||
|
||||
theme: false, // set to true to use with jQuery UI themes
|
||||
|
||||
// styles for the message when blocking; if you wish to disable
|
||||
// these and use an external stylesheet then do this in your code:
|
||||
// $.blockUI.defaults.css = {};
|
||||
css: {
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%',
|
||||
textAlign: 'center',
|
||||
color: '#000',
|
||||
border: '3px solid #aaa',
|
||||
backgroundColor:'#fff',
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// minimal style set used when themes are used
|
||||
themedCSS: {
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%'
|
||||
},
|
||||
|
||||
// styles for the overlay
|
||||
overlayCSS: {
|
||||
backgroundColor: '#000',
|
||||
opacity: 0.6,
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// style to replace wait cursor before unblocking to correct issue
|
||||
// of lingering wait cursor
|
||||
cursorReset: 'default',
|
||||
|
||||
// styles applied when using $.growlUI
|
||||
growlCSS: {
|
||||
width: '350px',
|
||||
top: '10px',
|
||||
left: '',
|
||||
right: '10px',
|
||||
border: 'none',
|
||||
padding: '5px',
|
||||
opacity: 0.6,
|
||||
cursor: 'default',
|
||||
color: '#fff',
|
||||
backgroundColor: '#000',
|
||||
'-webkit-border-radius':'10px',
|
||||
'-moz-border-radius': '10px',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
|
||||
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
|
||||
// (hat tip to Jorge H. N. de Vasconcelos)
|
||||
/*jshint scripturl:true */
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
|
||||
|
||||
// force usage of iframe in non-IE browsers (handy for blocking applets)
|
||||
forceIframe: false,
|
||||
|
||||
// z-index for the blocking overlay
|
||||
baseZ: 1000,
|
||||
|
||||
// set these to true to have the message automatically centered
|
||||
centerX: true, // <-- only effects element blocking (page block controlled via css above)
|
||||
centerY: true,
|
||||
|
||||
// allow body element to be stetched in ie6; this makes blocking look better
|
||||
// on "short" pages. disable if you wish to prevent changes to the body height
|
||||
allowBodyStretch: true,
|
||||
|
||||
// enable if you want key and mouse events to be disabled for content that is blocked
|
||||
bindEvents: true,
|
||||
|
||||
// be default blockUI will supress tab navigation from leaving blocking content
|
||||
// (if bindEvents is true)
|
||||
constrainTabKey: true,
|
||||
|
||||
// fadeIn time in millis; set to 0 to disable fadeIn on block
|
||||
fadeIn: 200,
|
||||
|
||||
// fadeOut time in millis; set to 0 to disable fadeOut on unblock
|
||||
fadeOut: 400,
|
||||
|
||||
// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
|
||||
timeout: 0,
|
||||
|
||||
// disable if you don't want to show the overlay
|
||||
showOverlay: true,
|
||||
|
||||
// if true, focus will be placed in the first available input field when
|
||||
// page blocking
|
||||
focusInput: true,
|
||||
|
||||
// elements that can receive focus
|
||||
focusableElements: ':input:enabled:visible',
|
||||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
// no longer needed in 2012
|
||||
// applyPlatformOpacityRules: true,
|
||||
|
||||
// callback method invoked when fadeIn has completed and blocking message is visible
|
||||
onBlock: null,
|
||||
|
||||
// callback method invoked when unblocking has completed; the callback is
|
||||
// passed the element that has been unblocked (which is the window object for page
|
||||
// blocks) and the options that were passed to the unblock call:
|
||||
// onUnblock(element, options)
|
||||
onUnblock: null,
|
||||
|
||||
// callback method invoked when the overlay area is clicked.
|
||||
// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
|
||||
onOverlayClick: null,
|
||||
|
||||
// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
|
||||
quirksmodeOffsetHack: 4,
|
||||
|
||||
// class name of the message block
|
||||
blockMsgClass: 'blockMsg',
|
||||
|
||||
// if it is already blocked, then ignore it (don't unblock and reblock)
|
||||
ignoreIfBlocked: false
|
||||
};
|
||||
|
||||
// private data and functions follow...
|
||||
|
||||
var pageBlock = null;
|
||||
var pageBlockEls = [];
|
||||
|
||||
function install(el, opts) {
|
||||
var css, themedCSS;
|
||||
var full = (el == window);
|
||||
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
|
||||
if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
|
||||
return;
|
||||
|
||||
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
|
||||
css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
|
||||
if (opts.onOverlayClick)
|
||||
opts.overlayCSS.cursor = 'pointer';
|
||||
|
||||
themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
|
||||
msg = msg === undefined ? opts.message : msg;
|
||||
|
||||
// remove the current block (if there is one)
|
||||
if (full && pageBlock)
|
||||
remove(window, {fadeOut:0});
|
||||
|
||||
// if an existing element is being used as the blocking content then we capture
|
||||
// its current place in the DOM (and current display style) so we can restore
|
||||
// it when we unblock
|
||||
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
|
||||
var node = msg.jquery ? msg[0] : msg;
|
||||
var data = {};
|
||||
$(el).data('blockUI.history', data);
|
||||
data.el = node;
|
||||
data.parent = node.parentNode;
|
||||
data.display = node.style.display;
|
||||
data.position = node.style.position;
|
||||
if (data.parent)
|
||||
data.parent.removeChild(node);
|
||||
}
|
||||
|
||||
$(el).data('blockUI.onUnblock', opts.onUnblock);
|
||||
var z = opts.baseZ;
|
||||
|
||||
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
|
||||
// layer1 is the iframe layer which is used to supress bleed through of underlying content
|
||||
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
|
||||
// layer3 is the message content that is displayed while blocking
|
||||
var lyr1, lyr2, lyr3, s;
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
|
||||
else
|
||||
lyr1 = $('<div class="blockUI" style="display:none"></div>');
|
||||
|
||||
if (opts.theme)
|
||||
lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
|
||||
else
|
||||
lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
|
||||
|
||||
if (opts.theme && full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (opts.theme) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
else {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
lyr3 = $(s);
|
||||
|
||||
// if we have a message, style it
|
||||
if (msg) {
|
||||
if (opts.theme) {
|
||||
lyr3.css(themedCSS);
|
||||
lyr3.addClass('ui-widget-content');
|
||||
}
|
||||
else
|
||||
lyr3.css(css);
|
||||
}
|
||||
|
||||
// style the overlay
|
||||
if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
|
||||
lyr2.css(opts.overlayCSS);
|
||||
lyr2.css('position', full ? 'fixed' : 'absolute');
|
||||
|
||||
// make iframe layer transparent in IE
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1.css('opacity',0.0);
|
||||
|
||||
//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
|
||||
var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
|
||||
$.each(layers, function() {
|
||||
this.appendTo($par);
|
||||
});
|
||||
|
||||
if (opts.theme && opts.draggable && $.fn.draggable) {
|
||||
lyr3.draggable({
|
||||
handle: '.ui-dialog-titlebar',
|
||||
cancel: 'li'
|
||||
});
|
||||
}
|
||||
|
||||
// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
|
||||
var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
|
||||
if (ie6 || expr) {
|
||||
// give body 100% height
|
||||
if (full && opts.allowBodyStretch && $.support.boxModel)
|
||||
$('html,body').css('height','100%');
|
||||
|
||||
// fix ie6 issue when blocked element has a border width
|
||||
if ((ie6 || !$.support.boxModel) && !full) {
|
||||
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
|
||||
var fixT = t ? '(0 - '+t+')' : 0;
|
||||
var fixL = l ? '(0 - '+l+')' : 0;
|
||||
}
|
||||
|
||||
// simulate fixed position
|
||||
$.each(layers, function(i,o) {
|
||||
var s = o[0].style;
|
||||
s.position = 'absolute';
|
||||
if (i < 2) {
|
||||
if (full)
|
||||
s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
|
||||
else
|
||||
s.setExpression('height','this.parentNode.offsetHeight + "px"');
|
||||
if (full)
|
||||
s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
|
||||
else
|
||||
s.setExpression('width','this.parentNode.offsetWidth + "px"');
|
||||
if (fixL) s.setExpression('left', fixL);
|
||||
if (fixT) s.setExpression('top', fixT);
|
||||
}
|
||||
else if (opts.centerY) {
|
||||
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
|
||||
s.marginTop = 0;
|
||||
}
|
||||
else if (!opts.centerY && full) {
|
||||
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
|
||||
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
|
||||
s.setExpression('top',expression);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// show the message
|
||||
if (msg) {
|
||||
if (opts.theme)
|
||||
lyr3.find('.ui-widget-content').append(msg);
|
||||
else
|
||||
lyr3.append(msg);
|
||||
if (msg.jquery || msg.nodeType)
|
||||
$(msg).show();
|
||||
}
|
||||
|
||||
if ((msie || opts.forceIframe) && opts.showOverlay)
|
||||
lyr1.show(); // opacity is zero
|
||||
if (opts.fadeIn) {
|
||||
var cb = opts.onBlock ? opts.onBlock : noOp;
|
||||
var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
|
||||
var cb2 = msg ? cb : noOp;
|
||||
if (opts.showOverlay)
|
||||
lyr2._fadeIn(opts.fadeIn, cb1);
|
||||
if (msg)
|
||||
lyr3._fadeIn(opts.fadeIn, cb2);
|
||||
}
|
||||
else {
|
||||
if (opts.showOverlay)
|
||||
lyr2.show();
|
||||
if (msg)
|
||||
lyr3.show();
|
||||
if (opts.onBlock)
|
||||
opts.onBlock.bind(lyr3)();
|
||||
}
|
||||
|
||||
// bind key and mouse events
|
||||
bind(1, el, opts);
|
||||
|
||||
if (full) {
|
||||
pageBlock = lyr3[0];
|
||||
pageBlockEls = $(opts.focusableElements,pageBlock);
|
||||
if (opts.focusInput)
|
||||
setTimeout(focus, 20);
|
||||
}
|
||||
else
|
||||
center(lyr3[0], opts.centerX, opts.centerY);
|
||||
|
||||
if (opts.timeout) {
|
||||
// auto-unblock
|
||||
var to = setTimeout(function() {
|
||||
if (full)
|
||||
$.unblockUI(opts);
|
||||
else
|
||||
$(el).unblock(opts);
|
||||
}, opts.timeout);
|
||||
$(el).data('blockUI.timeout', to);
|
||||
}
|
||||
}
|
||||
|
||||
// remove the block
|
||||
function remove(el, opts) {
|
||||
var count;
|
||||
var full = (el == window);
|
||||
var $el = $(el);
|
||||
var data = $el.data('blockUI.history');
|
||||
var to = $el.data('blockUI.timeout');
|
||||
if (to) {
|
||||
clearTimeout(to);
|
||||
$el.removeData('blockUI.timeout');
|
||||
}
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
bind(0, el, opts); // unbind events
|
||||
|
||||
if (opts.onUnblock === null) {
|
||||
opts.onUnblock = $el.data('blockUI.onUnblock');
|
||||
$el.removeData('blockUI.onUnblock');
|
||||
}
|
||||
|
||||
var els;
|
||||
if (full) // crazy selector to handle odd field errors in ie6/7
|
||||
els = $('body').children().filter('.blockUI').add('body > .blockUI');
|
||||
else
|
||||
els = $el.find('>.blockUI');
|
||||
|
||||
// fix cursor issue
|
||||
if ( opts.cursorReset ) {
|
||||
if ( els.length > 1 )
|
||||
els[1].style.cursor = opts.cursorReset;
|
||||
if ( els.length > 2 )
|
||||
els[2].style.cursor = opts.cursorReset;
|
||||
}
|
||||
|
||||
if (full)
|
||||
pageBlock = pageBlockEls = null;
|
||||
|
||||
if (opts.fadeOut) {
|
||||
count = els.length;
|
||||
els.stop().fadeOut(opts.fadeOut, function() {
|
||||
if ( --count === 0)
|
||||
reset(els,data,opts,el);
|
||||
});
|
||||
}
|
||||
else
|
||||
reset(els, data, opts, el);
|
||||
}
|
||||
|
||||
// move blocking element back into the DOM where it started
|
||||
function reset(els,data,opts,el) {
|
||||
var $el = $(el);
|
||||
if ( $el.data('blockUI.isBlocked') )
|
||||
return;
|
||||
|
||||
els.each(function(i,o) {
|
||||
// remove via DOM calls so we don't lose event handlers
|
||||
if (this.parentNode)
|
||||
this.parentNode.removeChild(this);
|
||||
});
|
||||
|
||||
if (data && data.el) {
|
||||
data.el.style.display = data.display;
|
||||
data.el.style.position = data.position;
|
||||
data.el.style.cursor = 'default'; // #59
|
||||
if (data.parent)
|
||||
data.parent.appendChild(data.el);
|
||||
$el.removeData('blockUI.history');
|
||||
}
|
||||
|
||||
if ($el.data('blockUI.static')) {
|
||||
$el.css('position', 'static'); // #22
|
||||
}
|
||||
|
||||
if (typeof opts.onUnblock == 'function')
|
||||
opts.onUnblock(el,opts);
|
||||
|
||||
// fix issue in Safari 6 where block artifacts remain until reflow
|
||||
var body = $(document.body), w = body.width(), cssW = body[0].style.width;
|
||||
body.width(w-1).width(w);
|
||||
body[0].style.width = cssW;
|
||||
}
|
||||
|
||||
// bind/unbind the handler
|
||||
function bind(b, el, opts) {
|
||||
var full = el == window, $el = $(el);
|
||||
|
||||
// don't bother unbinding if there is nothing to unbind
|
||||
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
|
||||
return;
|
||||
|
||||
$el.data('blockUI.isBlocked', b);
|
||||
|
||||
// don't bind events when overlay is not in use or if bindEvents is false
|
||||
if (!full || !opts.bindEvents || (b && !opts.showOverlay))
|
||||
return;
|
||||
|
||||
// bind anchors and inputs for mouse and key events
|
||||
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
|
||||
if (b)
|
||||
$(document).bind(events, opts, handler);
|
||||
else
|
||||
$(document).unbind(events, handler);
|
||||
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
}
|
||||
|
||||
// event handler to suppress keyboard/mouse events when blocking
|
||||
function handler(e) {
|
||||
// allow tab navigation (conditionally)
|
||||
if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
|
||||
if (pageBlock && e.data.constrainTabKey) {
|
||||
var els = pageBlockEls;
|
||||
var fwd = !e.shiftKey && e.target === els[els.length-1];
|
||||
var back = e.shiftKey && e.target === els[0];
|
||||
if (fwd || back) {
|
||||
setTimeout(function(){focus(back);},10);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var opts = e.data;
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
|
||||
opts.onOverlayClick(e);
|
||||
|
||||
// allow events within the message content
|
||||
if (target.parents('div.' + opts.blockMsgClass).length > 0)
|
||||
return true;
|
||||
|
||||
// allow events for content that is not being blocked
|
||||
return target.parents().children().filter('div.blockUI').length === 0;
|
||||
}
|
||||
|
||||
function focus(back) {
|
||||
if (!pageBlockEls)
|
||||
return;
|
||||
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
|
||||
if (e)
|
||||
e.focus();
|
||||
}
|
||||
|
||||
function center(el, x, y) {
|
||||
var p = el.parentNode, s = el.style;
|
||||
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
|
||||
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
|
||||
if (x) s.left = l > 0 ? (l+'px') : '0';
|
||||
if (y) s.top = t > 0 ? (t+'px') : '0';
|
||||
}
|
||||
|
||||
function sz(el, p) {
|
||||
return parseInt($.css(el,p),10)||0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*global define:true */
|
||||
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
||||
define(['jquery'], setup);
|
||||
} else {
|
||||
setup(jQuery);
|
||||
}
|
||||
|
||||
})();
|
||||
17707
static/jeasyui/jquery.easyui.min.js
vendored
Executable file
17707
static/jeasyui/jquery.easyui.min.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
141
static/jeasyui/jquery.easyui.mobile.js
Normal file
141
static/jeasyui/jquery.easyui.mobile.js
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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);
|
||||
|
||||
2
static/jeasyui/jquery.min.js
vendored
Normal file
2
static/jeasyui/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
44
static/jeasyui/locale/easyui-lang-af.js
Executable file
44
static/jeasyui/locale/easyui-lang-af.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Bladsy';
|
||||
$.fn.pagination.defaults.afterPageText = 'Van {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Wys (from) tot (to) van (total) items';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Verwerking, wag asseblief ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Die styl';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Die veld is verpligtend.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = "Gee 'n geldige e-pos adres.";
|
||||
$.fn.validatebox.defaults.rules.url.message = "Gee 'n geldige URL nie.";
|
||||
$.fn.validatebox.defaults.rules.length.message = "Voer 'n waarde tussen {0} en {1}.";
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Vandag';
|
||||
$.fn.datebox.defaults.closeText = 'Sluit';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
46
static/jeasyui/locale/easyui-lang-am.js
Normal file
46
static/jeasyui/locale/easyui-lang-am.js
Normal file
@@ -0,0 +1,46 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Էջ';
|
||||
$.fn.pagination.defaults.afterPageText = 'ից {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Դիտել {from}-ից {to}-ը {total} գրառումից';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Մշակվում է, խնդրում ենք սպասել ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Այո';
|
||||
$.messager.defaults.cancel = 'Փակել';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Այս դաշտը պարտադիր է.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Խնդրում ենք մուտքագրել գործող e-mail հասցե.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Խնդրում ենք մուտքագրել գործող URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Խնդրում ենք մուտքագրել արժեք {0} {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Խնդրում ենք ուղղել այս դաշտը.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.firstDay = 1;
|
||||
$.fn.calendar.defaults.weeks = ['Կ.','Ե.','Ե.','Չ.','Հ.','Ու.','Շ.'];
|
||||
$.fn.calendar.defaults.months = ['Հունվար', 'Փետրվար', 'Մարտ', 'Ապրիլ', 'Մայիս', 'Հունիս', 'Հուլիս', 'Օգոստոս', 'Սեպտեմբեր', 'Հոկտեմբեր', 'Նոյեմբեր', 'Դեկտեմբեր'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Այսօր';
|
||||
$.fn.datebox.defaults.closeText = 'Փակել';
|
||||
$.fn.datebox.defaults.okText = 'Այո';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-ar.js
Executable file
45
static/jeasyui/locale/easyui-lang-ar.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'صفحة';
|
||||
$.fn.pagination.defaults.afterPageText = 'من {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'عرض {from} إلى {to} من {total} عنصر';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'معالجة, الرجاء الإنتظار ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'موافق';
|
||||
$.messager.defaults.cancel = 'إلغاء';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'هذا الحقل مطلوب.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'الرجاء إدخال بريد إلكتروني صحيح.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'الرجاء إدخال رابط صحيح.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'الرجاء إدخال قيمة بين {0} و {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'الرجاء التأكد من الحقل.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'اليوم';
|
||||
$.fn.datebox.defaults.closeText = 'إغلاق';
|
||||
$.fn.datebox.defaults.okText = 'موافق';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
44
static/jeasyui/locale/easyui-lang-bg.js
Executable file
44
static/jeasyui/locale/easyui-lang-bg.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Страница';
|
||||
$.fn.pagination.defaults.afterPageText = 'от {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Показани {from} за {to} от {total} продукти';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Обработка, моля изчакайте ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Добре';
|
||||
$.messager.defaults.cancel = 'Задрасквам';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Това поле е задължително.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Моля, въведете валиден имейл адрес.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Моля въведете валиден URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Моля, въведете стойност между {0} и {1}.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Днес';
|
||||
$.fn.datebox.defaults.closeText = 'Близо';
|
||||
$.fn.datebox.defaults.okText = 'Добре';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
44
static/jeasyui/locale/easyui-lang-ca.js
Executable file
44
static/jeasyui/locale/easyui-lang-ca.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Pàgina';
|
||||
$.fn.pagination.defaults.afterPageText = 'de {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = "Veient {from} a {to} de {total} d'articles";
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Elaboració, si us plau esperi ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Cancel';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Aquest camp és obligatori.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Introduïu una adreça de correu electrònic vàlida.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Si us plau, introduïu un URL vàlida.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Si us plau, introduïu un valor entre {0} i {1}.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Avui';
|
||||
$.fn.datebox.defaults.closeText = 'Tancar';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
44
static/jeasyui/locale/easyui-lang-cs.js
Executable file
44
static/jeasyui/locale/easyui-lang-cs.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Strana';
|
||||
$.fn.pagination.defaults.afterPageText = 'z {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Zobrazuji {from} do {to} z {total} položky';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Zpracování, čekejte prosím ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Zrušit';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Zadejte prosím platnou e-mailovou adresu.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Zadejte prosím platnou adresu URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Prosím, zadejte hodnotu mezi {0} a {1}.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Dnes';
|
||||
$.fn.datebox.defaults.closeText = 'Zavřít';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
44
static/jeasyui/locale/easyui-lang-cz.js
Executable file
44
static/jeasyui/locale/easyui-lang-cz.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Strana';
|
||||
$.fn.pagination.defaults.afterPageText = 'z {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Zobrazuji záznam {from} až {to} z {total}.';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Pracuji, čekejte prosím…';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Zrušit';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Zadejte, prosím, platnou e-mailovou adresu.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Zadejte, prosím, platnou adresu URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Zadejte, prosím, hodnotu mezi {0} a {1}.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['N','P','Ú','S','Č','P','S']; //neděle pondělí úterý středa čtvrtek pátek sobota
|
||||
$.fn.calendar.defaults.months = ['led', 'únr', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro']; //leden únor březen duben květen červen červenec srpen září říjen listopad prosinec
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Dnes';
|
||||
$.fn.datebox.defaults.closeText = 'Zavřít';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
44
static/jeasyui/locale/easyui-lang-da.js
Executable file
44
static/jeasyui/locale/easyui-lang-da.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Page';
|
||||
$.fn.pagination.defaults.afterPageText = 'af {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Viser {from} til {to} af {total} poster';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Behandling, vent venligst ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Annuller';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Dette felt er påkrævet.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Angiv en gyldig e-mail-adresse.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Angiv en gyldig webadresse.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Angiv en værdi mellem {0} og {1}.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'I dag';
|
||||
$.fn.datebox.defaults.closeText = 'Luk';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
63
static/jeasyui/locale/easyui-lang-de.js
Executable file
63
static/jeasyui/locale/easyui-lang-de.js
Executable file
@@ -0,0 +1,63 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Seite';
|
||||
$.fn.pagination.defaults.afterPageText = 'von {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = '{from} bis {to} von {total} Datensätzen';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Verarbeitung läuft, bitte warten ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'OK';
|
||||
$.messager.defaults.cancel = 'Abbruch';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Dieses Feld wird benötigt.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Bitte geben Sie eine gültige E-Mail-Adresse ein.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Bitte geben Sie eine gültige URL ein.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Bitte geben Sie einen Wert zwischen {0} und {1} ein.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.firstDay = 1;
|
||||
$.fn.calendar.defaults.weeks = ['S','M','D','M','D','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Heute';
|
||||
$.fn.datebox.defaults.closeText = 'Schließen';
|
||||
$.fn.datebox.defaults.okText = 'OK';
|
||||
$.fn.datebox.defaults.formatter = function(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return (d<10?('0'+d):d)+'.'+(m<10?('0'+m):m)+'.'+y;
|
||||
};
|
||||
$.fn.datebox.defaults.parser = function(s){
|
||||
if (!s) return new Date();
|
||||
var ss = s.split('.');
|
||||
var m = parseInt(ss[1],10);
|
||||
var d = parseInt(ss[0],10);
|
||||
var y = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new Date(y,m-1,d);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
};
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-el.js
Executable file
45
static/jeasyui/locale/easyui-lang-el.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Σελίδα';
|
||||
$.fn.pagination.defaults.afterPageText = 'από {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Εμφάνιση {from} εώς {to} από {total} αντικείμενα';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Γίνεται Επεξεργασία, Παρακαλώ Περιμένετε ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Εντάξει';
|
||||
$.messager.defaults.cancel = 'Άκυρο';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Το πεδίο είναι υποχρεωτικό.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Παρακαλώ εισάγετε σωστή Ηλ.Διεύθυνση.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Παρακαλώ εισάγετε σωστό σύνδεσμο.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Παρακαλώ εισάγετε τιμή μεταξύ {0} και {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Παρακαλώ διορθώστε αυτό το πεδίο.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'];
|
||||
$.fn.calendar.defaults.months = ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιου', 'Ιου', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Σήμερα';
|
||||
$.fn.datebox.defaults.closeText = 'Κλείσιμο';
|
||||
$.fn.datebox.defaults.okText = 'Εντάξει';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-en.js
Executable file
45
static/jeasyui/locale/easyui-lang-en.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Page';
|
||||
$.fn.pagination.defaults.afterPageText = 'of {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Displaying {from} to {to} of {total} items';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Processing, please wait ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Cancel';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'This field is required.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Please enter a valid email address.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Please enter a valid URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Please enter a value between {0} and {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Please fix this field.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Today';
|
||||
$.fn.datebox.defaults.closeText = 'Close';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-es.js
Executable file
45
static/jeasyui/locale/easyui-lang-es.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Página';
|
||||
$.fn.pagination.defaults.afterPageText = 'de {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Mostrando {from} a {to} de {total} elementos';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Procesando, por favor espere ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Aceptar';
|
||||
$.messager.defaults.cancel = 'Cancelar';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Este campo es obligatorio.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Por favor ingrese una dirección de correo válida.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Por favor ingrese una URL válida.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Por favor ingrese un valor entre {0} y {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Por favor corrija este campo.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['Do','Lu','Ma','Mi','Ju','Vi','Sá'];
|
||||
$.fn.calendar.defaults.months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Hoy';
|
||||
$.fn.datebox.defaults.closeText = 'Cerrar';
|
||||
$.fn.datebox.defaults.okText = 'Aceptar';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-fa.js
Normal file
45
static/jeasyui/locale/easyui-lang-fa.js
Normal file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'صفحه';
|
||||
$.fn.pagination.defaults.afterPageText = 'از {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'نمایش {from} تا {to} از {total} مورد';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'درحال پردازش، لطفا صبر کنید...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'قبول';
|
||||
$.messager.defaults.cancel = 'انصراف';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'این فیلد اجباری می باشد.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'لطفا آدرس ایمیل را صحیح وارد کنید.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'لطفا آدرس سایت را صحیح وارد کنید.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'لطفا مقداری بین {0} و {1} وارد کنید.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'لطفا مقدار این فیلد را تصحیح کنید.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'امروز';
|
||||
$.fn.datebox.defaults.closeText = 'بستن';
|
||||
$.fn.datebox.defaults.okText = 'قبول';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
62
static/jeasyui/locale/easyui-lang-fr.js
Executable file
62
static/jeasyui/locale/easyui-lang-fr.js
Executable file
@@ -0,0 +1,62 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Page';
|
||||
$.fn.pagination.defaults.afterPageText = 'de {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Affichage de {from} et {to} au {total} des articles';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = "Traitement, s'il vous plaît patienter ...";
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Annuler';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Ce champ est obligatoire.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = "S'il vous plaît entrer une adresse email valide.";
|
||||
$.fn.validatebox.defaults.rules.url.message = "S'il vous plaît entrer une URL valide.";
|
||||
$.fn.validatebox.defaults.rules.length.message = "S'il vous plaît entrez une valeur comprise entre {0} et {1}.";
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aôu", "Sep", "Oct", "Nov", "Déc"];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = "Aujourd'hui";
|
||||
$.fn.datebox.defaults.closeText = 'Fermer';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
$.fn.datebox.defaults.formatter = function(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return (d<10?('0'+d):d)+'/'+(m<10?('0'+m):m)+'/'+y;
|
||||
};
|
||||
$.fn.datebox.defaults.parser = function(s){
|
||||
if (!s) return new Date();
|
||||
var ss = s.split('/');
|
||||
var d = parseInt(ss[0],10);
|
||||
var m = parseInt(ss[1],10);
|
||||
var y = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new Date(y,m-1,d);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
};
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
64
static/jeasyui/locale/easyui-lang-it.js
Executable file
64
static/jeasyui/locale/easyui-lang-it.js
Executable file
@@ -0,0 +1,64 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Pagina';
|
||||
$.fn.pagination.defaults.afterPageText = 'di {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Visualizzazione {from} a {to} di {total} elementi';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'In lavorazione, attendere ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Annulla';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Questo campo è richiesto.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Inserisci un indirizzo email valido.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Inserisci un URL valido.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Inserisci un valore tra {0} e {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Correggere questo campo.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.firstDay = 1;
|
||||
$.fn.calendar.defaults.weeks = ['D','L','M','M','G','V','S'];
|
||||
$.fn.calendar.defaults.months = ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Oggi';
|
||||
$.fn.datebox.defaults.closeText = 'Chiudi';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
$.fn.datebox.defaults.formatter = function(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return (d<10?('0'+d):d)+'/'+(m<10?('0'+m):m)+'/'+y;
|
||||
};
|
||||
$.fn.datebox.defaults.parser = function(s){
|
||||
if (!s) return new Date();
|
||||
var ss = s.split('/');
|
||||
var d = parseInt(ss[0],10);
|
||||
var m = parseInt(ss[1],10);
|
||||
var y = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new Date(y,m-1,d);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
};
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-jp.js
Executable file
45
static/jeasyui/locale/easyui-lang-jp.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'ページ';
|
||||
$.fn.pagination.defaults.afterPageText = '{pages} 中';
|
||||
$.fn.pagination.defaults.displayMsg = '全 {total} アイテム中 {from} から {to} を表示中';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = '処理中です。少々お待ちください...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'OK';
|
||||
$.messager.defaults.cancel = 'キャンセル';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = '入力は必須です。';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = '正しいメールアドレスを入力してください。';
|
||||
$.fn.validatebox.defaults.rules.url.message = '正しいURLを入力してください。';
|
||||
$.fn.validatebox.defaults.rules.length.message = '{0} から {1} の範囲の正しい値を入力してください。';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'このフィールドを修正してください。';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['日','月','火','水','木','金','土'];
|
||||
$.fn.calendar.defaults.months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = '今日';
|
||||
$.fn.datebox.defaults.closeText = '閉じる';
|
||||
$.fn.datebox.defaults.okText = 'OK';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-ko.js
Normal file
45
static/jeasyui/locale/easyui-lang-ko.js
Normal file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = '페이지';
|
||||
$.fn.pagination.defaults.afterPageText = '{pages} 중';
|
||||
$.fn.pagination.defaults.displayMsg = '전체 {total} 항목 중 {from}부터 {to}번째';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = '처리 중입니다. 잠시만 기다려 주세요...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = '확인';
|
||||
$.messager.defaults.cancel = '취소';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = '필수 항목입니다.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = '올바른 메일 주소를 입력해 주세요.';
|
||||
$.fn.validatebox.defaults.rules.url.message = '올바른 URL를 입력해 주세요.';
|
||||
$.fn.validatebox.defaults.rules.length.message = '{0}에서 {1} 사이의 값을 입력해 주세요.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = '이 필드를 수정해 주세요.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['일','월','화','수','목','금','토'];
|
||||
$.fn.calendar.defaults.months = ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = '오늘';
|
||||
$.fn.datebox.defaults.closeText = '닫기';
|
||||
$.fn.datebox.defaults.okText = '확인';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
44
static/jeasyui/locale/easyui-lang-nl.js
Executable file
44
static/jeasyui/locale/easyui-lang-nl.js
Executable file
@@ -0,0 +1,44 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Pagina';
|
||||
$.fn.pagination.defaults.afterPageText = 'van {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Tonen van {from} tot {to} van de {total} items';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Verwerking, even geduld ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Annuleren';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Dit veld is verplicht.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Geef een geldig e-mailadres.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Vul een geldige URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Voer een waarde tussen {0} en {1}.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Vandaag';
|
||||
$.fn.datebox.defaults.closeText = 'Dicht';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-pl.js
Executable file
45
static/jeasyui/locale/easyui-lang-pl.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Strona';
|
||||
$.fn.pagination.defaults.afterPageText = 'z {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Wyświetlono elementy od {from} do {to} z {total}';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Przetwarzanie, proszę czekać ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Cancel';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'To pole jest wymagane.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Wprowadź poprawny adres email.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Wprowadź poprawny adres URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Wprowadź wartość z zakresu od {0} do {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Proszę poprawić to pole.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['N','P','W','Ś','C','P','S'];
|
||||
$.fn.calendar.defaults.months = ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Dzisiaj';
|
||||
$.fn.datebox.defaults.closeText = 'Zamknij';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-pt_BR.js
Executable file
45
static/jeasyui/locale/easyui-lang-pt_BR.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Página';
|
||||
$.fn.pagination.defaults.afterPageText = 'de {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Mostrando {from} a {to} de {total} itens';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Processando, aguarde ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Cancelar';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Esse campo é requerido.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Insira um endereço de email válido.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Insira uma URL válida.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Insira uma valor entre {0} e {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Corrija esse campo.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['D','S','T','Q','Q','S','S'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Hoje';
|
||||
$.fn.datebox.defaults.closeText = 'Fechar';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
46
static/jeasyui/locale/easyui-lang-ru.js
Executable file
46
static/jeasyui/locale/easyui-lang-ru.js
Executable file
@@ -0,0 +1,46 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Страница';
|
||||
$.fn.pagination.defaults.afterPageText = 'из {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Просмотр {from} до {to} из {total} записей';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Обрабатывается, пожалуйста ждите ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ок';
|
||||
$.messager.defaults.cancel = 'Закрыть';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Это поле необходимо.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Пожалуйста введите корректный e-mail адрес.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Пожалуйста введите корректный URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Пожалуйста введите зачение между {0} и {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Пожалуйста исправте это поле.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.firstDay = 1;
|
||||
$.fn.calendar.defaults.weeks = ['В','П','В','С','Ч','П','С'];
|
||||
$.fn.calendar.defaults.months = ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Сегодня';
|
||||
$.fn.datebox.defaults.closeText = 'Закрыть';
|
||||
$.fn.datebox.defaults.okText = 'Ок';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
45
static/jeasyui/locale/easyui-lang-sv_SE.js
Executable file
45
static/jeasyui/locale/easyui-lang-sv_SE.js
Executable file
@@ -0,0 +1,45 @@
|
||||
if ($.fn.pagination) {
|
||||
$.fn.pagination.defaults.beforePageText = 'Sida';
|
||||
$.fn.pagination.defaults.afterPageText = 'av {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Visar {from} till {to} av {total} poster';
|
||||
}
|
||||
if ($.fn.datagrid) {
|
||||
$.fn.datagrid.defaults.loadMsg = 'Bearbetar, vänligen vänta ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid) {
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager) {
|
||||
$.messager.defaults.ok = 'Ok';
|
||||
$.messager.defaults.cancel = 'Avbryt';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Detta fält är obligatoriskt.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox) {
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Vänligen ange en korrekt e-post adress.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Vänligen ange en korrekt URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Vänligen ange ett nummer mellan {0} och {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Vänligen åtgärda detta fält.';
|
||||
}
|
||||
if ($.fn.calendar) {
|
||||
$.fn.calendar.defaults.weeks = ['Sön', 'Mån', 'Tis', 'Ons', 'Tors', 'Fre', 'Lör'];
|
||||
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'];
|
||||
}
|
||||
if ($.fn.datebox) {
|
||||
$.fn.datebox.defaults.currentText = 'I dag';
|
||||
$.fn.datebox.defaults.closeText = 'Stäng';
|
||||
$.fn.datebox.defaults.okText = 'Ok';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox) {
|
||||
$.extend($.fn.datetimebox.defaults, {
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
59
static/jeasyui/locale/easyui-lang-tr.js
Executable file
59
static/jeasyui/locale/easyui-lang-tr.js
Executable file
@@ -0,0 +1,59 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Sayfa';
|
||||
$.fn.pagination.defaults.afterPageText = ' / {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = '{from} ile {to} arası gösteriliyor, toplam {total} kayıt';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.panel.defaults.loadingMessage = "Yükleniyor...";
|
||||
}
|
||||
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadingMessage = "Yükleniyor...";
|
||||
$.fn.datagrid.defaults.loadMsg = 'İşleminiz Yapılıyor, lütfen bekleyin ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Tamam';
|
||||
$.messager.defaults.cancel = 'İptal';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Bu alan zorunludur.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Lütfen geçerli bir email adresi giriniz.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Lütfen geçerli bir URL giriniz.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Lütfen {0} ile {1} arasında bir değer giriniz.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Lütfen bu alanı düzeltiniz.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'];
|
||||
$.fn.calendar.defaults.months = ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Bugün';
|
||||
$.fn.datebox.defaults.closeText = 'Kapat';
|
||||
$.fn.datebox.defaults.okText = 'Tamam';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
|
||||
$.fn.datebox.defaults.formatter=function(date){
|
||||
var y=date.getFullYear();
|
||||
var m=date.getMonth()+1;
|
||||
var d=date.getDate();
|
||||
if(m<10){m="0"+m;}
|
||||
if(d<10){d="0"+d;}
|
||||
return d+"."+m+"."+y;
|
||||
};
|
||||
}
|
||||
46
static/jeasyui/locale/easyui-lang-ua.js
Normal file
46
static/jeasyui/locale/easyui-lang-ua.js
Normal file
@@ -0,0 +1,46 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = 'Сторінка';
|
||||
$.fn.pagination.defaults.afterPageText = 'з {pages}';
|
||||
$.fn.pagination.defaults.displayMsg = 'Перегляд {from} до {to} з {total} записів';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = 'Обробляється, зачекайте будь даска ...';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = 'Ок';
|
||||
$.messager.defaults.cancel = 'Закрити';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = 'Це поле необхідно.';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = 'Будь ласка, введіть коректну e-mail адресу.';
|
||||
$.fn.validatebox.defaults.rules.url.message = 'Будь ласка, введіть коректний URL.';
|
||||
$.fn.validatebox.defaults.rules.length.message = 'Будь ласка введіть значення між {0} і {1}.';
|
||||
$.fn.validatebox.defaults.rules.remote.message = 'Будь ласка виправте це поле.';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.firstDay = 1;
|
||||
$.fn.calendar.defaults.weeks = ['В','П','В','С','Ч','П','С'];
|
||||
$.fn.calendar.defaults.months = ['Січ', 'Лют', 'Бер', 'Квіт', 'Трав', 'Черв', 'Лип', 'Серп', 'Вер', 'Жовт', 'Лист', 'Груд'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = 'Сьогодні';
|
||||
$.fn.datebox.defaults.closeText = 'Закрити';
|
||||
$.fn.datebox.defaults.okText = 'Ок';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
66
static/jeasyui/locale/easyui-lang-zh_CN.js
Executable file
66
static/jeasyui/locale/easyui-lang-zh_CN.js
Executable file
@@ -0,0 +1,66 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = '第';
|
||||
$.fn.pagination.defaults.afterPageText = '共{pages}页';
|
||||
$.fn.pagination.defaults.displayMsg = '显示{from}到{to},共{total}记录';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = '正在处理,请稍待。。。';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = '确定';
|
||||
$.messager.defaults.cancel = '取消';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = '该输入项为必输项';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = '请输入有效的电子邮件地址';
|
||||
$.fn.validatebox.defaults.rules.url.message = '请输入有效的URL地址';
|
||||
$.fn.validatebox.defaults.rules.length.message = '输入内容长度必须介于{0}和{1}之间';
|
||||
$.fn.validatebox.defaults.rules.remote.message = '请修正该字段';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六'];
|
||||
$.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = '今天';
|
||||
$.fn.datebox.defaults.closeText = '关闭';
|
||||
$.fn.datebox.defaults.okText = '确定';
|
||||
$.fn.datebox.defaults.formatter = function(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
|
||||
};
|
||||
$.fn.datebox.defaults.parser = function(s){
|
||||
if (!s) return new Date();
|
||||
var ss = s.split('-');
|
||||
var y = parseInt(ss[0],10);
|
||||
var m = parseInt(ss[1],10);
|
||||
var d = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new Date(y,m-1,d);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
};
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
if ($.fn.datetimespinner){
|
||||
$.fn.datetimespinner.defaults.selections = [[0,4],[5,7],[8,10],[11,13],[14,16],[17,19]]
|
||||
}
|
||||
48
static/jeasyui/locale/easyui-lang-zh_TW.js
Executable file
48
static/jeasyui/locale/easyui-lang-zh_TW.js
Executable file
@@ -0,0 +1,48 @@
|
||||
if ($.fn.pagination){
|
||||
$.fn.pagination.defaults.beforePageText = '第';
|
||||
$.fn.pagination.defaults.afterPageText = '共{pages}頁';
|
||||
$.fn.pagination.defaults.displayMsg = '顯示{from}到{to},共{total}記錄';
|
||||
}
|
||||
if ($.fn.datagrid){
|
||||
$.fn.datagrid.defaults.loadMsg = '正在處理,請稍待。。。';
|
||||
}
|
||||
if ($.fn.treegrid && $.fn.datagrid){
|
||||
$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
|
||||
}
|
||||
if ($.messager){
|
||||
$.messager.defaults.ok = '確定';
|
||||
$.messager.defaults.cancel = '取消';
|
||||
}
|
||||
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
|
||||
'combo','combobox','combogrid','combotree',
|
||||
'datebox','datetimebox','numberbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
|
||||
if ($.fn[plugin]){
|
||||
$.fn[plugin].defaults.missingMessage = '該輸入項為必輸項';
|
||||
}
|
||||
});
|
||||
if ($.fn.validatebox){
|
||||
$.fn.validatebox.defaults.rules.email.message = '請輸入有效的電子郵件地址';
|
||||
$.fn.validatebox.defaults.rules.url.message = '請輸入有效的URL地址';
|
||||
$.fn.validatebox.defaults.rules.length.message = '輸入內容長度必須介於{0}和{1}之間';
|
||||
$.fn.validatebox.defaults.rules.remote.message = '請修正此欄位';
|
||||
}
|
||||
if ($.fn.calendar){
|
||||
$.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六'];
|
||||
$.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'];
|
||||
}
|
||||
if ($.fn.datebox){
|
||||
$.fn.datebox.defaults.currentText = '今天';
|
||||
$.fn.datebox.defaults.closeText = '關閉';
|
||||
$.fn.datebox.defaults.okText = '確定';
|
||||
}
|
||||
if ($.fn.datetimebox && $.fn.datebox){
|
||||
$.extend($.fn.datetimebox.defaults,{
|
||||
currentText: $.fn.datebox.defaults.currentText,
|
||||
closeText: $.fn.datebox.defaults.closeText,
|
||||
okText: $.fn.datebox.defaults.okText
|
||||
});
|
||||
}
|
||||
if ($.fn.datetimespinner){
|
||||
$.fn.datetimespinner.defaults.selections = [[0,4],[5,7],[8,10],[11,13],[14,16],[17,19]]
|
||||
}
|
||||
350
static/jeasyui/plugins/jquery.accordion.js
Executable file
350
static/jeasyui/plugins/jquery.accordion.js
Executable file
@@ -0,0 +1,350 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,_3){
|
||||
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 _8=0;
|
||||
var _9="auto";
|
||||
var _a=cc.find(">.panel>.accordion-header");
|
||||
if(_a.length){
|
||||
if(_7){
|
||||
$(_a[0]).next().panel("resize",{width:cc.width(),height:cc.height()});
|
||||
_8=$(_a[0])._outerWidth();
|
||||
}else{
|
||||
_8=$(_a[0]).css("height","")._outerHeight();
|
||||
}
|
||||
}
|
||||
if(!isNaN(parseInt(_5.height))){
|
||||
if(_7){
|
||||
_9=cc.width()-_8*_a.length;
|
||||
}else{
|
||||
_9=cc.height()-_8*_a.length;
|
||||
}
|
||||
}
|
||||
_b(true,_9-_b(false));
|
||||
function _b(_c,_d){
|
||||
var _e=0;
|
||||
for(var i=0;i<_6.length;i++){
|
||||
var p=_6[i];
|
||||
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 _e;
|
||||
};
|
||||
};
|
||||
function _10(_11,_12,_13,all){
|
||||
var _14=$.data(_11,"accordion").panels;
|
||||
var pp=[];
|
||||
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]==$(_13)[0]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_12){
|
||||
return all?pp:(pp.length?pp[0]:null);
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
function _15(_16){
|
||||
return _10(_16,"collapsed",false,true);
|
||||
};
|
||||
function _17(_18){
|
||||
var pp=_15(_18);
|
||||
return pp.length?pp[0]:null;
|
||||
};
|
||||
function _19(_1a,_1b){
|
||||
return _10(_1a,null,_1b);
|
||||
};
|
||||
function _1c(_1d,_1e){
|
||||
var _1f=$.data(_1d,"accordion").panels;
|
||||
if(typeof _1e=="number"){
|
||||
if(_1e<0||_1e>=_1f.length){
|
||||
return null;
|
||||
}else{
|
||||
return _1f[_1e];
|
||||
}
|
||||
}
|
||||
return _10(_1d,"title",_1e);
|
||||
};
|
||||
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 _23(_24){
|
||||
var _25=$.data(_24,"accordion");
|
||||
var cc=$(_24);
|
||||
cc.addClass("accordion");
|
||||
_25.panels=[];
|
||||
cc.children("div").each(function(){
|
||||
var _26=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)});
|
||||
var pp=$(this);
|
||||
_25.panels.push(pp);
|
||||
_28(_24,pp,_26);
|
||||
});
|
||||
cc._bind("_resize",function(e,_27){
|
||||
if($(this).hasClass("easyui-fluid")||_27){
|
||||
_1(_24);
|
||||
}
|
||||
return 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(!_2b.multiple){
|
||||
var all=$.grep(_15(_29),function(p){
|
||||
return p.panel("options").collapsible;
|
||||
});
|
||||
for(var i=0;i<all.length;i++){
|
||||
_34(_29,_19(_29,all[i]));
|
||||
}
|
||||
}
|
||||
var _2c=$(this).panel("header");
|
||||
_2c.addClass("accordion-header-selected");
|
||||
_2c.find(".accordion-collapse").removeClass("accordion-expand");
|
||||
},onExpand:function(){
|
||||
$(_29).find(">.panel-last>.accordion-header").removeClass("accordion-header-border");
|
||||
if(_2a.onExpand){
|
||||
_2a.onExpand.call(this);
|
||||
}
|
||||
_2b.onSelect.call(_29,$(this).panel("options").title,_19(_29,this));
|
||||
},onBeforeCollapse:function(){
|
||||
if(_2a.onBeforeCollapse){
|
||||
if(_2a.onBeforeCollapse.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$(_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(isNaN(parseInt(_2b.height))){
|
||||
$(_29).find(">.panel-last>.accordion-header").removeClass("accordion-header-border");
|
||||
}
|
||||
if(_2a.onCollapse){
|
||||
_2a.onCollapse.call(this);
|
||||
}
|
||||
_2b.onUnselect.call(_29,$(this).panel("options").title,_19(_29,this));
|
||||
}}));
|
||||
var _2e=pp.panel("header");
|
||||
var _2f=_2e.children("div.panel-tool");
|
||||
_2f.children("a.panel-tool-collapse").hide();
|
||||
var t=$("<a href=\"javascript:;\"></a>").addClass("accordion-collapse accordion-expand").appendTo(_2f);
|
||||
t._bind("click",function(){
|
||||
_30(pp);
|
||||
return false;
|
||||
});
|
||||
pp.panel("options").collapsible?t.show():t.hide();
|
||||
if(_2b.halign=="left"||_2b.halign=="right"){
|
||||
t.hide();
|
||||
}
|
||||
_2e._bind("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 _33(_35,_36){
|
||||
var p=_1c(_35,_36);
|
||||
if(!p){
|
||||
return;
|
||||
}
|
||||
_37(_35);
|
||||
var _38=$.data(_35,"accordion").options;
|
||||
p.panel("expand",_38.animate);
|
||||
};
|
||||
function _34(_39,_3a){
|
||||
var p=_1c(_39,_3a);
|
||||
if(!p){
|
||||
return;
|
||||
}
|
||||
_37(_39);
|
||||
var _3b=$.data(_39,"accordion").options;
|
||||
p.panel("collapse",_3b.animate);
|
||||
};
|
||||
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){
|
||||
_3f(_19(_3d,p));
|
||||
}else{
|
||||
_3f(_3e.selected);
|
||||
}
|
||||
function _3f(_40){
|
||||
var _41=_3e.animate;
|
||||
_3e.animate=false;
|
||||
_33(_3d,_40);
|
||||
_3e.animate=_41;
|
||||
};
|
||||
};
|
||||
function _37(_42){
|
||||
var _43=$.data(_42,"accordion").panels;
|
||||
for(var i=0;i<_43.length;i++){
|
||||
_43[i].stop(true,true);
|
||||
}
|
||||
};
|
||||
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=$("<div></div>").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 _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(_4d.onBeforeRemove.call(_4a,_50,_51)==false){
|
||||
return;
|
||||
}
|
||||
_4e.splice(_51,1);
|
||||
_4f.panel("destroy");
|
||||
if(_4e.length){
|
||||
_1(_4a);
|
||||
var _52=_17(_4a);
|
||||
if(!_52){
|
||||
_33(_4a,0);
|
||||
}
|
||||
}
|
||||
_4d.onRemove.call(_4a,_50,_51);
|
||||
};
|
||||
$.fn.accordion=function(_53,_54){
|
||||
if(typeof _53=="string"){
|
||||
return $.fn.accordion.methods[_53](this,_54);
|
||||
}
|
||||
_53=_53||{};
|
||||
return this.each(function(){
|
||||
var _55=$.data(this,"accordion");
|
||||
if(_55){
|
||||
$.extend(_55.options,_53);
|
||||
}else{
|
||||
$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_53),accordion:$(this).addClass("accordion"),panels:[]});
|
||||
_23(this);
|
||||
}
|
||||
_20(this);
|
||||
_1(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,_56){
|
||||
return jq.each(function(){
|
||||
_1(this,_56);
|
||||
});
|
||||
},getSelections:function(jq){
|
||||
return _15(jq[0]);
|
||||
},getSelected:function(jq){
|
||||
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(){
|
||||
_33(this,_59);
|
||||
});
|
||||
},unselect:function(jq,_5a){
|
||||
return jq.each(function(){
|
||||
_34(this,_5a);
|
||||
});
|
||||
},add:function(jq,_5b){
|
||||
return jq.each(function(){
|
||||
add(this,_5b);
|
||||
});
|
||||
},remove:function(jq,_5c){
|
||||
return jq.each(function(){
|
||||
_49(this,_5c);
|
||||
});
|
||||
}};
|
||||
$.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,halign:"top",onSelect:function(_5e,_5f){
|
||||
},onUnselect:function(_60,_61){
|
||||
},onAdd:function(_62,_63){
|
||||
},onBeforeRemove:function(_64,_65){
|
||||
},onRemove:function(_66,_67){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
403
static/jeasyui/plugins/jquery.calendar.js
Executable file
403
static/jeasyui/plugins/jquery.calendar.js
Executable file
@@ -0,0 +1,403 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,_3){
|
||||
var _4=$.data(_2,"calendar").options;
|
||||
var t=$(_2);
|
||||
if(_3){
|
||||
$.extend(_4,{width:_3.width,height:_3.height});
|
||||
}
|
||||
t._size(_4,t.parent());
|
||||
t.find(".calendar-body")._outerHeight(t.height()-t.find(".calendar-header")._outerHeight());
|
||||
if(t.find(".calendar-menu").is(":visible")){
|
||||
_5(_2);
|
||||
}
|
||||
};
|
||||
function _6(_7){
|
||||
$(_7).addClass("calendar").html("<div class=\"calendar-header\">"+"<div class=\"calendar-nav calendar-prevmonth\"></div>"+"<div class=\"calendar-nav calendar-nextmonth\"></div>"+"<div class=\"calendar-nav calendar-prevyear\"></div>"+"<div class=\"calendar-nav calendar-nextyear\"></div>"+"<div class=\"calendar-title\">"+"<span class=\"calendar-text\"></span>"+"</div>"+"</div>"+"<div class=\"calendar-body\">"+"<div class=\"calendar-menu\">"+"<div class=\"calendar-menu-year-inner\">"+"<span class=\"calendar-nav calendar-menu-prev\"></span>"+"<span><input class=\"calendar-menu-year\" type=\"text\"></span>"+"<span class=\"calendar-nav calendar-menu-next\"></span>"+"</div>"+"<div class=\"calendar-menu-month-inner\">"+"</div>"+"</div>"+"</div>");
|
||||
$(_7)._bind("_resize",function(e,_8){
|
||||
if($(this).hasClass("easyui-fluid")||_8){
|
||||
_1(_7);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _9(_a){
|
||||
var _b=$.data(_a,"calendar").options;
|
||||
var _c=$(_a).find(".calendar-menu");
|
||||
_c.find(".calendar-menu-year")._unbind(".calendar")._bind("keypress.calendar",function(e){
|
||||
if(e.keyCode==13){
|
||||
_d(true);
|
||||
}
|
||||
});
|
||||
$(_a)._unbind(".calendar")._bind("mouseover.calendar",function(e){
|
||||
var t=_e(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=_e(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=_e(e.target);
|
||||
if(t.hasClass("calendar-menu-next")||t.hasClass("calendar-nextyear")){
|
||||
_f(1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-menu-prev")||t.hasClass("calendar-prevyear")){
|
||||
_f(-1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-menu-month")){
|
||||
_c.find(".calendar-selected").removeClass("calendar-selected");
|
||||
t.addClass("calendar-selected");
|
||||
_d(true);
|
||||
}else{
|
||||
if(t.hasClass("calendar-prevmonth")){
|
||||
_10(-1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-nextmonth")){
|
||||
_10(1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-text")){
|
||||
if(_c.is(":visible")){
|
||||
_c.hide();
|
||||
}else{
|
||||
_5(_a);
|
||||
}
|
||||
}else{
|
||||
if(t.hasClass("calendar-day")){
|
||||
if(t.hasClass("calendar-disabled")){
|
||||
return;
|
||||
}
|
||||
var _11=_b.current;
|
||||
t.closest("div.calendar-body").find(".calendar-selected").removeClass("calendar-selected");
|
||||
t.addClass("calendar-selected");
|
||||
var _12=t.attr("abbr").split(",");
|
||||
var y=parseInt(_12[0]);
|
||||
var m=parseInt(_12[1]);
|
||||
var d=parseInt(_12[2]);
|
||||
_b.current=new _b.Date(y,m-1,d);
|
||||
_b.onSelect.call(_a,_b.current);
|
||||
if(!_11||_11.getTime()!=_b.current.getTime()){
|
||||
_b.onChange.call(_a,_b.current,_11);
|
||||
}
|
||||
if(_b.year!=y||_b.month!=m){
|
||||
_b.year=y;
|
||||
_b.month=m;
|
||||
_19(_a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
function _e(t){
|
||||
var day=$(t).closest(".calendar-day");
|
||||
if(day.length){
|
||||
return day;
|
||||
}else{
|
||||
return $(t);
|
||||
}
|
||||
};
|
||||
function _d(_13){
|
||||
var _14=$(_a).find(".calendar-menu");
|
||||
var _15=_14.find(".calendar-menu-year").val();
|
||||
var _16=_14.find(".calendar-selected").attr("abbr");
|
||||
if(!isNaN(_15)){
|
||||
_b.year=parseInt(_15);
|
||||
_b.month=parseInt(_16);
|
||||
_19(_a);
|
||||
}
|
||||
if(_13){
|
||||
_14.hide();
|
||||
}
|
||||
};
|
||||
function _f(_17){
|
||||
_b.year+=_17;
|
||||
_19(_a);
|
||||
_c.find(".calendar-menu-year").val(_b.year);
|
||||
};
|
||||
function _10(_18){
|
||||
_b.month+=_18;
|
||||
if(_b.month>12){
|
||||
_b.year++;
|
||||
_b.month=1;
|
||||
}else{
|
||||
if(_b.month<1){
|
||||
_b.year--;
|
||||
_b.month=12;
|
||||
}
|
||||
}
|
||||
_19(_a);
|
||||
_c.find("td.calendar-selected").removeClass("calendar-selected");
|
||||
_c.find("td:eq("+(_b.month-1)+")").addClass("calendar-selected");
|
||||
};
|
||||
};
|
||||
function _5(_1a){
|
||||
var _1b=$.data(_1a,"calendar").options;
|
||||
$(_1a).find(".calendar-menu").show();
|
||||
if($(_1a).find(".calendar-menu-month-inner").is(":empty")){
|
||||
$(_1a).find(".calendar-menu-month-inner").empty();
|
||||
var t=$("<table class=\"calendar-mtable\"></table>").appendTo($(_1a).find(".calendar-menu-month-inner"));
|
||||
var idx=0;
|
||||
for(var i=0;i<3;i++){
|
||||
var tr=$("<tr></tr>").appendTo(t);
|
||||
for(var j=0;j<4;j++){
|
||||
$("<td class=\"calendar-nav calendar-menu-month\"></td>").html(_1b.months[idx++]).attr("abbr",idx).appendTo(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _1c=$(_1a).find(".calendar-body");
|
||||
var _1d=$(_1a).find(".calendar-menu");
|
||||
var _1e=_1d.find(".calendar-menu-year-inner");
|
||||
var _1f=_1d.find(".calendar-menu-month-inner");
|
||||
_1e.find("input").val(_1b.year).focus();
|
||||
_1f.find("td.calendar-selected").removeClass("calendar-selected");
|
||||
_1f.find("td:eq("+(_1b.month-1)+")").addClass("calendar-selected");
|
||||
_1d._outerWidth(_1c._outerWidth());
|
||||
_1d._outerHeight(_1c._outerHeight());
|
||||
_1f._outerHeight(_1d.height()-_1e._outerHeight());
|
||||
};
|
||||
function _20(_21,_22,_23){
|
||||
var _24=$.data(_21,"calendar").options;
|
||||
var _25=[];
|
||||
var _26=new _24.Date(_22,_23,0).getDate();
|
||||
for(var i=1;i<=_26;i++){
|
||||
_25.push([_22,_23,i]);
|
||||
}
|
||||
var _27=[],_28=[];
|
||||
var _29=-1;
|
||||
while(_25.length>0){
|
||||
var _2a=_25.shift();
|
||||
_28.push(_2a);
|
||||
var day=new _24.Date(_2a[0],_2a[1]-1,_2a[2]).getDay();
|
||||
if(_29==day){
|
||||
day=0;
|
||||
}else{
|
||||
if(day==(_24.firstDay==0?7:_24.firstDay)-1){
|
||||
_27.push(_28);
|
||||
_28=[];
|
||||
}
|
||||
}
|
||||
_29=day;
|
||||
}
|
||||
if(_28.length){
|
||||
_27.push(_28);
|
||||
}
|
||||
var _2b=_27[0];
|
||||
if(_2b.length<7){
|
||||
while(_2b.length<7){
|
||||
var _2c=_2b[0];
|
||||
var _2a=new _24.Date(_2c[0],_2c[1]-1,_2c[2]-1);
|
||||
_2b.unshift([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
}else{
|
||||
var _2c=_2b[0];
|
||||
var _28=[];
|
||||
for(var i=1;i<=7;i++){
|
||||
var _2a=new _24.Date(_2c[0],_2c[1]-1,_2c[2]-i);
|
||||
_28.unshift([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
_27.unshift(_28);
|
||||
}
|
||||
var _2d=_27[_27.length-1];
|
||||
while(_2d.length<7){
|
||||
var _2e=_2d[_2d.length-1];
|
||||
var _2a=new _24.Date(_2e[0],_2e[1]-1,_2e[2]+1);
|
||||
_2d.push([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
if(_27.length<6){
|
||||
var _2e=_2d[_2d.length-1];
|
||||
var _28=[];
|
||||
for(var i=1;i<=7;i++){
|
||||
var _2a=new _24.Date(_2e[0],_2e[1]-1,_2e[2]+i);
|
||||
_28.push([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
_27.push(_28);
|
||||
}
|
||||
return _27;
|
||||
};
|
||||
function _19(_2f){
|
||||
var _30=$.data(_2f,"calendar").options;
|
||||
if(_30.current&&!_30.validator.call(_2f,_30.current)){
|
||||
_30.current=null;
|
||||
}
|
||||
var now=new _30.Date();
|
||||
var _31=now.getFullYear()+","+(now.getMonth()+1)+","+now.getDate();
|
||||
var _32=_30.current?(_30.current.getFullYear()+","+(_30.current.getMonth()+1)+","+_30.current.getDate()):"";
|
||||
var _33=6-_30.firstDay;
|
||||
var _34=_33+1;
|
||||
if(_33>=7){
|
||||
_33-=7;
|
||||
}
|
||||
if(_34>=7){
|
||||
_34-=7;
|
||||
}
|
||||
$(_2f).find(".calendar-title span").html(_30.months[_30.month-1]+" "+_30.year);
|
||||
var _35=$(_2f).find("div.calendar-body");
|
||||
_35.children("table").remove();
|
||||
var _36=["<table class=\"calendar-dtable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"];
|
||||
_36.push("<thead><tr>");
|
||||
if(_30.showWeek){
|
||||
_36.push("<th class=\"calendar-week\">"+_30.weekNumberHeader+"</th>");
|
||||
}
|
||||
for(var i=_30.firstDay;i<_30.weeks.length;i++){
|
||||
_36.push("<th>"+_30.weeks[i]+"</th>");
|
||||
}
|
||||
for(var i=0;i<_30.firstDay;i++){
|
||||
_36.push("<th>"+_30.weeks[i]+"</th>");
|
||||
}
|
||||
_36.push("</tr></thead>");
|
||||
_36.push("<tbody>");
|
||||
var _37=_20(_2f,_30.year,_30.month);
|
||||
for(var i=0;i<_37.length;i++){
|
||||
var _38=_37[i];
|
||||
var cls="";
|
||||
if(i==0){
|
||||
cls="calendar-first";
|
||||
}else{
|
||||
if(i==_37.length-1){
|
||||
cls="calendar-last";
|
||||
}
|
||||
}
|
||||
_36.push("<tr class=\""+cls+"\">");
|
||||
if(_30.showWeek){
|
||||
var _39=_30.getWeekNumber(new _30.Date(_38[0][0],parseInt(_38[0][1])-1,_38[0][2]));
|
||||
_36.push("<td class=\"calendar-week\">"+_39+"</td>");
|
||||
}
|
||||
for(var j=0;j<_38.length;j++){
|
||||
var day=_38[j];
|
||||
var s=day[0]+","+day[1]+","+day[2];
|
||||
var _3a=new _30.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"){
|
||||
_3c=css;
|
||||
}else{
|
||||
if(css){
|
||||
_3b=css["class"]||"";
|
||||
_3c=css["style"]||"";
|
||||
}
|
||||
}
|
||||
var cls="calendar-day";
|
||||
if(!(_30.year==day[0]&&_30.month==day[1])){
|
||||
cls+=" calendar-other-month";
|
||||
}
|
||||
if(s==_31){
|
||||
cls+=" calendar-today";
|
||||
}
|
||||
if(s==_32){
|
||||
cls+=" calendar-selected";
|
||||
}
|
||||
if(j==_33){
|
||||
cls+=" calendar-saturday";
|
||||
}else{
|
||||
if(j==_34){
|
||||
cls+=" calendar-sunday";
|
||||
}
|
||||
}
|
||||
if(j==0){
|
||||
cls+=" calendar-first";
|
||||
}else{
|
||||
if(j==_38.length-1){
|
||||
cls+=" calendar-last";
|
||||
}
|
||||
}
|
||||
cls+=" "+_3b;
|
||||
if(!_30.validator.call(_2f,_3a)){
|
||||
cls+=" calendar-disabled";
|
||||
}
|
||||
_36.push("<td class=\""+cls+"\" abbr=\""+s+"\" style=\""+_3c+"\">"+d+"</td>");
|
||||
}
|
||||
_36.push("</tr>");
|
||||
}
|
||||
_36.push("</tbody>");
|
||||
_36.push("</table>");
|
||||
_35.append(_36.join(""));
|
||||
_35.children("table.calendar-dtable").prependTo(_35);
|
||||
_30.onNavigate.call(_2f,_30.year,_30.month);
|
||||
};
|
||||
$.fn.calendar=function(_3d,_3e){
|
||||
if(typeof _3d=="string"){
|
||||
return $.fn.calendar.methods[_3d](this,_3e);
|
||||
}
|
||||
_3d=_3d||{};
|
||||
return this.each(function(){
|
||||
var _3f=$.data(this,"calendar");
|
||||
if(_3f){
|
||||
$.extend(_3f.options,_3d);
|
||||
}else{
|
||||
_3f=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_3d)});
|
||||
_6(this);
|
||||
}
|
||||
if(_3f.options.border==false){
|
||||
$(this).addClass("calendar-noborder");
|
||||
}
|
||||
_1(this);
|
||||
_9(this);
|
||||
_19(this);
|
||||
$(this).find("div.calendar-menu").hide();
|
||||
});
|
||||
};
|
||||
$.fn.calendar.methods={options:function(jq){
|
||||
return $.data(jq[0],"calendar").options;
|
||||
},resize:function(jq,_40){
|
||||
return jq.each(function(){
|
||||
_1(this,_40);
|
||||
});
|
||||
},moveTo:function(jq,_41){
|
||||
return jq.each(function(){
|
||||
var _42=$(this).calendar("options");
|
||||
if(!_41){
|
||||
var now=new _42.Date();
|
||||
$(this).calendar({year:now.getFullYear(),month:now.getMonth()+1,current:_41});
|
||||
return;
|
||||
}
|
||||
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(_44){
|
||||
var t=$(_44);
|
||||
return $.extend({},$.parser.parseOptions(_44,["weekNumberHeader",{firstDay:"number",fit:"boolean",border:"boolean",showWeek:"boolean"}]));
|
||||
};
|
||||
$.fn.calendar.defaults={Date:Date,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());
|
||||
})(),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(_4a){
|
||||
return true;
|
||||
},onSelect:function(_4b){
|
||||
},onChange:function(_4c,_4d){
|
||||
},onNavigate:function(_4e,_4f){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
190
static/jeasyui/plugins/jquery.checkbox.js
Normal file
190
static/jeasyui/plugins/jquery.checkbox.js
Normal file
@@ -0,0 +1,190 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
var _4=$("<span class=\"checkbox inputbox\">"+"<span class=\"checkbox-inner\">"+"<svg xml:space=\"preserve\" focusable=\"false\" version=\"1.1\" viewBox=\"0 0 24 24\"><path d=\"M4.1,12.7 9,17.6 20.3,6.3\" fill=\"none\" stroke=\"white\"></path></svg>"+"</span>"+"<input type=\"checkbox\" class=\"checkbox-value\">"+"</span>").insertAfter(_3);
|
||||
var t=$(_3);
|
||||
t.addClass("checkbox-f").hide();
|
||||
var _5=t.attr("name");
|
||||
if(_5){
|
||||
t.removeAttr("name").attr("checkboxName",_5);
|
||||
_4.find(".checkbox-value").attr("name",_5);
|
||||
}
|
||||
return _4;
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"checkbox");
|
||||
var _9=_8.options;
|
||||
var _a=_8.checkbox;
|
||||
var _b="_easyui_checkbox_"+(++_1);
|
||||
var _c=_a.find(".checkbox-value").attr("id",_b);
|
||||
_c._unbind(".checkbox")._bind("change.checkbox",function(e){
|
||||
return false;
|
||||
});
|
||||
if(_9.label){
|
||||
if(typeof _9.label=="object"){
|
||||
_8.label=$(_9.label);
|
||||
_8.label.attr("for",_b);
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
_8.label=$("<label class=\"textbox-label\"></label>").html(_9.label);
|
||||
_8.label.css("textAlign",_9.labelAlign).attr("for",_b);
|
||||
if(_9.labelPosition=="after"){
|
||||
_8.label.insertAfter(_a);
|
||||
}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();
|
||||
}
|
||||
$(_7).checkbox("setValue",_9.value);
|
||||
_d(_7,_9.checked);
|
||||
_e(_7,_9.readonly);
|
||||
_f(_7,_9.disabled);
|
||||
};
|
||||
function _10(_11){
|
||||
var _12=$.data(_11,"checkbox");
|
||||
var _13=_12.options;
|
||||
var _14=_12.checkbox;
|
||||
_14._unbind(".checkbox")._bind("click.checkbox",function(){
|
||||
if(!_13.disabled&&!_13.readonly){
|
||||
_d(_11,!_13.checked);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _15(_16){
|
||||
var _17=$.data(_16,"checkbox");
|
||||
var _18=_17.options;
|
||||
var _19=_17.checkbox;
|
||||
_19._size(_18,_19.parent());
|
||||
if(_18.label&&_18.labelPosition){
|
||||
if(_18.labelPosition=="top"){
|
||||
_17.label._size({width:_18.labelWidth},_19);
|
||||
}else{
|
||||
_17.label._size({width:_18.labelWidth,height:_19.outerHeight()},_19);
|
||||
_17.label.css("lineHeight",_19.outerHeight()+"px");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _d(_1a,_1b){
|
||||
var _1c=$.data(_1a,"checkbox");
|
||||
var _1d=_1c.options;
|
||||
var _1e=_1c.checkbox;
|
||||
_1e.find(".checkbox-value")._propAttr("checked",_1b);
|
||||
var _1f=_1e.find(".checkbox-inner").css("display",_1b?"":"none");
|
||||
if(_1b){
|
||||
_1e.addClass("checkbox-checked");
|
||||
$(_1c.label).addClass("textbox-label-checked");
|
||||
}else{
|
||||
_1e.removeClass("checkbox-checked");
|
||||
$(_1c.label).removeClass("textbox-label-checked");
|
||||
}
|
||||
if(_1d.checked!=_1b){
|
||||
_1d.checked=_1b;
|
||||
_1d.onChange.call(_1a,_1b);
|
||||
$(_1a).closest("form").trigger("_change",[_1a]);
|
||||
}
|
||||
};
|
||||
function _e(_20,_21){
|
||||
var _22=$.data(_20,"checkbox");
|
||||
var _23=_22.options;
|
||||
_23.readonly=_21==undefined?true:_21;
|
||||
if(_23.readonly){
|
||||
_22.checkbox.addClass("checkbox-readonly");
|
||||
$(_22.label).addClass("textbox-label-readonly");
|
||||
}else{
|
||||
_22.checkbox.removeClass("checkbox-readonly");
|
||||
$(_22.label).removeClass("textbox-label-readonly");
|
||||
}
|
||||
};
|
||||
function _f(_24,_25){
|
||||
var _26=$.data(_24,"checkbox");
|
||||
var _27=_26.options;
|
||||
var _28=_26.checkbox;
|
||||
var rv=_28.find(".checkbox-value");
|
||||
_27.disabled=_25;
|
||||
if(_25){
|
||||
$(_24).add(rv)._propAttr("disabled",true);
|
||||
_28.addClass("checkbox-disabled");
|
||||
$(_26.label).addClass("textbox-label-disabled");
|
||||
}else{
|
||||
$(_24).add(rv)._propAttr("disabled",false);
|
||||
_28.removeClass("checkbox-disabled");
|
||||
$(_26.label).removeClass("textbox-label-disabled");
|
||||
}
|
||||
};
|
||||
$.fn.checkbox=function(_29,_2a){
|
||||
if(typeof _29=="string"){
|
||||
return $.fn.checkbox.methods[_29](this,_2a);
|
||||
}
|
||||
_29=_29||{};
|
||||
return this.each(function(){
|
||||
var _2b=$.data(this,"checkbox");
|
||||
if(_2b){
|
||||
$.extend(_2b.options,_29);
|
||||
}else{
|
||||
_2b=$.data(this,"checkbox",{options:$.extend({},$.fn.checkbox.defaults,$.fn.checkbox.parseOptions(this),_29),checkbox:_2(this)});
|
||||
}
|
||||
_2b.options.originalChecked=_2b.options.checked;
|
||||
_6(this);
|
||||
_10(this);
|
||||
_15(this);
|
||||
});
|
||||
};
|
||||
$.fn.checkbox.methods={options:function(jq){
|
||||
var _2c=jq.data("checkbox");
|
||||
return $.extend(_2c.options,{value:_2c.checkbox.find(".checkbox-value").val()});
|
||||
},setValue:function(jq,_2d){
|
||||
return jq.each(function(){
|
||||
$(this).val(_2d);
|
||||
$.data(this,"checkbox").checkbox.find(".checkbox-value").val(_2d);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,true);
|
||||
});
|
||||
},readonly:function(jq,_2e){
|
||||
return jq.each(function(){
|
||||
_e(this,_2e);
|
||||
});
|
||||
},check:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,true);
|
||||
});
|
||||
},uncheck:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _2f=$(this).checkbox("options");
|
||||
_d(this,_2f.originalChecked);
|
||||
});
|
||||
}};
|
||||
$.fn.checkbox.parseOptions=function(_30){
|
||||
var t=$(_30);
|
||||
return $.extend({},$.parser.parseOptions(_30,["label","labelPosition","labelAlign",{labelWidth:"number"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
|
||||
};
|
||||
$.fn.checkbox.defaults={width:20,height:20,value:null,disabled:false,readonly:false,checked:false,label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",onChange:function(_31){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
414
static/jeasyui/plugins/jquery.combo.js
Executable file
414
static/jeasyui/plugins/jquery.combo.js
Executable file
@@ -0,0 +1,414 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(){
|
||||
$(document)._unbind(".combo")._bind("mousedown.combo mousewheel.combo",function(e){
|
||||
var p=$(e.target).closest("span.combo,div.combo-p,div.menu");
|
||||
if(p.length){
|
||||
_1(p);
|
||||
return;
|
||||
}
|
||||
$("body>div.combo-p>div.combo-panel:visible").panel("close");
|
||||
});
|
||||
});
|
||||
function _2(_3){
|
||||
var _4=$.data(_3,"combo");
|
||||
var _5=_4.options;
|
||||
if(!_4.panel){
|
||||
_4.panel=$("<div class=\"combo-panel\"></div>").appendTo("html>body");
|
||||
_4.panel.panel({minWidth:_5.panelMinWidth,maxWidth:_5.panelMaxWidth,minHeight:_5.panelMinHeight,maxHeight:_5.panelMaxHeight,doSize:false,closed:true,cls:"combo-p",style:{position:"absolute",zIndex:10},onOpen:function(){
|
||||
var _6=$(this).panel("options").comboTarget;
|
||||
var _7=$.data(_6,"combo");
|
||||
if(_7){
|
||||
_7.options.onShowPanel.call(_6);
|
||||
}
|
||||
},onBeforeClose:function(){
|
||||
_1($(this).parent());
|
||||
},onClose:function(){
|
||||
var _8=$(this).panel("options").comboTarget;
|
||||
var _9=$(_8).data("combo");
|
||||
if(_9){
|
||||
_9.options.onHidePanel.call(_8);
|
||||
}
|
||||
}});
|
||||
}
|
||||
var _a=$.extend(true,[],_5.icons);
|
||||
if(_5.hasDownArrow){
|
||||
_a.push({iconCls:"combo-arrow",handler:function(e){
|
||||
_10(e.data.target);
|
||||
}});
|
||||
}
|
||||
$(_3).addClass("combo-f").textbox($.extend({},_5,{icons:_a,onChange:function(){
|
||||
}}));
|
||||
$(_3).attr("comboName",$(_3).attr("textboxName"));
|
||||
_4.combo=$(_3).next();
|
||||
_4.combo.addClass("combo");
|
||||
_4.panel._unbind(".combo");
|
||||
for(var _b in _5.panelEvents){
|
||||
_4.panel._bind(_b+".combo",{target:_3},_5.panelEvents[_b]);
|
||||
}
|
||||
};
|
||||
function _c(_d){
|
||||
var _e=$.data(_d,"combo");
|
||||
var _f=_e.options;
|
||||
var p=_e.panel;
|
||||
if(p.is(":visible")){
|
||||
p.panel("close");
|
||||
}
|
||||
if(!_f.cloned){
|
||||
p.panel("destroy");
|
||||
}
|
||||
$(_d).textbox("destroy");
|
||||
};
|
||||
function _10(_11){
|
||||
var _12=$.data(_11,"combo").panel;
|
||||
if(_12.is(":visible")){
|
||||
var _13=_12.combo("combo");
|
||||
_14(_13);
|
||||
if(_13!=_11){
|
||||
$(_11).combo("showPanel");
|
||||
}
|
||||
}else{
|
||||
var p=$(_11).closest("div.combo-p").children(".combo-panel");
|
||||
$("div.combo-panel:visible").not(_12).not(p).panel("close");
|
||||
$(_11).combo("showPanel");
|
||||
}
|
||||
$(_11).combo("textbox").focus();
|
||||
};
|
||||
function _1(_15){
|
||||
$(_15).find(".combo-f").each(function(){
|
||||
var p=$(this).combo("panel");
|
||||
if(p.is(":visible")){
|
||||
p.panel("close");
|
||||
}
|
||||
});
|
||||
};
|
||||
function _16(e){
|
||||
var _17=e.data.target;
|
||||
var _18=$.data(_17,"combo");
|
||||
var _19=_18.options;
|
||||
if(!_19.editable){
|
||||
_10(_17);
|
||||
}else{
|
||||
var p=$(_17).closest("div.combo-p").children(".combo-panel");
|
||||
$("div.combo-panel:visible").not(p).each(function(){
|
||||
var _1a=$(this).combo("combo");
|
||||
if(_1a!=_17){
|
||||
_14(_1a);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function _1b(e){
|
||||
var _1c=e.data.target;
|
||||
var t=$(_1c);
|
||||
var _1d=t.data("combo");
|
||||
var _1e=t.combo("options");
|
||||
_1d.panel.panel("options").comboTarget=_1c;
|
||||
switch(e.keyCode){
|
||||
case 38:
|
||||
_1e.keyHandler.up.call(_1c,e);
|
||||
break;
|
||||
case 40:
|
||||
_1e.keyHandler.down.call(_1c,e);
|
||||
break;
|
||||
case 37:
|
||||
_1e.keyHandler.left.call(_1c,e);
|
||||
break;
|
||||
case 39:
|
||||
_1e.keyHandler.right.call(_1c,e);
|
||||
break;
|
||||
case 13:
|
||||
e.preventDefault();
|
||||
_1e.keyHandler.enter.call(_1c,e);
|
||||
return false;
|
||||
case 9:
|
||||
case 27:
|
||||
_14(_1c);
|
||||
break;
|
||||
default:
|
||||
if(_1e.editable){
|
||||
if(_1d.timer){
|
||||
clearTimeout(_1d.timer);
|
||||
}
|
||||
_1d.timer=setTimeout(function(){
|
||||
var q=t.combo("getText");
|
||||
if(_1d.previousText!=q){
|
||||
_1d.previousText=q;
|
||||
t.combo("showPanel");
|
||||
_1e.keyHandler.query.call(_1c,q,e);
|
||||
t.combo("validate");
|
||||
}
|
||||
},_1e.delay);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _1f(e){
|
||||
var _20=e.data.target;
|
||||
var _21=$(_20).data("combo");
|
||||
if(_21.timer){
|
||||
clearTimeout(_21.timer);
|
||||
}
|
||||
};
|
||||
function _22(_23){
|
||||
var _24=$.data(_23,"combo");
|
||||
var _25=_24.combo;
|
||||
var _26=_24.panel;
|
||||
var _27=$(_23).combo("options");
|
||||
var _28=_26.panel("options");
|
||||
_28.comboTarget=_23;
|
||||
if(_28.closed){
|
||||
_26.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999});
|
||||
_26.panel("resize",{width:(_27.panelWidth?_27.panelWidth:_25._outerWidth()),height:_27.panelHeight});
|
||||
_26.panel("panel").hide();
|
||||
_26.panel("open");
|
||||
}
|
||||
(function(){
|
||||
if(_28.comboTarget==_23&&_26.is(":visible")){
|
||||
_26.panel("move",{left:_29(),top:_2a()});
|
||||
setTimeout(arguments.callee,200);
|
||||
}
|
||||
})();
|
||||
function _29(){
|
||||
var _2b=_25.offset().left;
|
||||
if(_27.panelAlign=="right"){
|
||||
_2b+=_25._outerWidth()-_26._outerWidth();
|
||||
}
|
||||
if(_2b+_26._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){
|
||||
_2b=$(window)._outerWidth()+$(document).scrollLeft()-_26._outerWidth();
|
||||
}
|
||||
if(_2b<0){
|
||||
_2b=0;
|
||||
}
|
||||
return _2b;
|
||||
};
|
||||
function _2a(){
|
||||
if(_27.panelValign=="top"){
|
||||
var top=_25.offset().top-_26._outerHeight();
|
||||
}else{
|
||||
if(_27.panelValign=="bottom"){
|
||||
var top=_25.offset().top+_25._outerHeight();
|
||||
}else{
|
||||
var top=_25.offset().top+_25._outerHeight();
|
||||
if(top+_26._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
|
||||
top=_25.offset().top-_26._outerHeight();
|
||||
}
|
||||
if(top<$(document).scrollTop()){
|
||||
top=_25.offset().top+_25._outerHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
};
|
||||
};
|
||||
function _14(_2c){
|
||||
var _2d=$.data(_2c,"combo").panel;
|
||||
_2d.panel("close");
|
||||
};
|
||||
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 _33(_34){
|
||||
var _35=$.data(_34,"combo");
|
||||
var _36=_35.options;
|
||||
var _37=$(_34).next();
|
||||
var _38=[];
|
||||
_37.find(".textbox-value").each(function(){
|
||||
_38.push($(this).val());
|
||||
});
|
||||
if(_36.multivalue){
|
||||
return _38;
|
||||
}else{
|
||||
return _38.length?_38[0].split(_36.separator):_38;
|
||||
}
|
||||
};
|
||||
function _39(_3a,_3b){
|
||||
var _3c=$.data(_3a,"combo");
|
||||
var _3d=_3c.combo;
|
||||
var _3e=$(_3a).combo("options");
|
||||
if(!$.isArray(_3b)){
|
||||
_3b=_3b.split(_3e.separator);
|
||||
}
|
||||
var _3f=_33(_3a);
|
||||
_3d.find(".textbox-value").remove();
|
||||
if(_3b.length){
|
||||
if(_3e.multivalue){
|
||||
for(var i=0;i<_3b.length;i++){
|
||||
_40(_3b[i]);
|
||||
}
|
||||
}else{
|
||||
_40(_3b.join(_3e.separator));
|
||||
}
|
||||
}
|
||||
function _40(_41){
|
||||
var _42=$(_3a).attr("textboxName")||"";
|
||||
var _43=$("<input type=\"hidden\" class=\"textbox-value\">").appendTo(_3d);
|
||||
_43.attr("name",_42);
|
||||
if(_3e.disabled){
|
||||
_43.attr("disabled","disabled");
|
||||
}
|
||||
_43.val(_41);
|
||||
};
|
||||
var _44=(function(){
|
||||
if(_3e.onChange==$.parser.emptyFn){
|
||||
return false;
|
||||
}
|
||||
if(_3f.length!=_3b.length){
|
||||
return true;
|
||||
}
|
||||
for(var i=0;i<_3b.length;i++){
|
||||
if(_3b[i]!=_3f[i]){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
if(_44){
|
||||
$(_3a).val(_3b.join(_3e.separator));
|
||||
if(_3e.multiple){
|
||||
_3e.onChange.call(_3a,_3b,_3f);
|
||||
}else{
|
||||
_3e.onChange.call(_3a,_3b[0],_3f[0]);
|
||||
}
|
||||
$(_3a).closest("form").trigger("_change",[_3a]);
|
||||
}
|
||||
};
|
||||
function _45(_46){
|
||||
var _47=_33(_46);
|
||||
return _47[0];
|
||||
};
|
||||
function _48(_49,_4a){
|
||||
_39(_49,[_4a]);
|
||||
};
|
||||
function _4b(_4c){
|
||||
var _4d=$.data(_4c,"combo").options;
|
||||
var _4e=_4d.onChange;
|
||||
_4d.onChange=$.parser.emptyFn;
|
||||
if(_4d.multiple){
|
||||
_39(_4c,_4d.value?_4d.value:[]);
|
||||
}else{
|
||||
_48(_4c,_4d.value);
|
||||
}
|
||||
_4d.onChange=_4e;
|
||||
};
|
||||
$.fn.combo=function(_4f,_50){
|
||||
if(typeof _4f=="string"){
|
||||
var _51=$.fn.combo.methods[_4f];
|
||||
if(_51){
|
||||
return _51(this,_50);
|
||||
}else{
|
||||
return this.textbox(_4f,_50);
|
||||
}
|
||||
}
|
||||
_4f=_4f||{};
|
||||
return this.each(function(){
|
||||
var _52=$.data(this,"combo");
|
||||
if(_52){
|
||||
$.extend(_52.options,_4f);
|
||||
if(_4f.value!=undefined){
|
||||
_52.options.originalValue=_4f.value;
|
||||
}
|
||||
}else{
|
||||
_52=$.data(this,"combo",{options:$.extend({},$.fn.combo.defaults,$.fn.combo.parseOptions(this),_4f),previousText:""});
|
||||
if(_52.options.multiple&&_52.options.value==""){
|
||||
_52.options.originalValue=[];
|
||||
}else{
|
||||
_52.options.originalValue=_52.options.value;
|
||||
}
|
||||
}
|
||||
_2(this);
|
||||
_4b(this);
|
||||
});
|
||||
};
|
||||
$.fn.combo.methods={options:function(jq){
|
||||
var _53=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"combo").options,{width:_53.width,height:_53.height,disabled:_53.disabled,readonly:_53.readonly});
|
||||
},cloneFrom:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("cloneFrom",_54);
|
||||
$.data(this,"combo",{options:$.extend(true,{cloned:true},$(_54).combo("options")),combo:$(this).next(),panel:$(_54).combo("panel")});
|
||||
$(this).addClass("combo-f").attr("comboName",$(this).attr("textboxName"));
|
||||
});
|
||||
},combo:function(jq){
|
||||
return jq.closest(".combo-panel").panel("options").comboTarget;
|
||||
},panel:function(jq){
|
||||
return $.data(jq[0],"combo").panel;
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_c(this);
|
||||
});
|
||||
},showPanel:function(jq){
|
||||
return jq.each(function(){
|
||||
_22(this);
|
||||
});
|
||||
},hidePanel:function(jq){
|
||||
return jq.each(function(){
|
||||
_14(this);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("setText","");
|
||||
var _55=$.data(this,"combo").options;
|
||||
if(_55.multiple){
|
||||
$(this).combo("setValues",[]);
|
||||
}else{
|
||||
$(this).combo("setValue","");
|
||||
}
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _56=$.data(this,"combo").options;
|
||||
if(_56.multiple){
|
||||
$(this).combo("setValues",_56.originalValue);
|
||||
}else{
|
||||
$(this).combo("setValue",_56.originalValue);
|
||||
}
|
||||
});
|
||||
},setText:function(jq,_57){
|
||||
return jq.each(function(){
|
||||
_2e(this,_57);
|
||||
});
|
||||
},getValues:function(jq){
|
||||
return _33(jq[0]);
|
||||
},setValues:function(jq,_58){
|
||||
return jq.each(function(){
|
||||
_39(this,_58);
|
||||
});
|
||||
},getValue:function(jq){
|
||||
return _45(jq[0]);
|
||||
},setValue:function(jq,_59){
|
||||
return jq.each(function(){
|
||||
_48(this,_59);
|
||||
});
|
||||
}};
|
||||
$.fn.combo.parseOptions=function(_5a){
|
||||
var t=$(_5a);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_5a),$.parser.parseOptions(_5a,["separator","panelAlign",{panelWidth:"number",hasDownArrow:"boolean",delay:"number",reversed:"boolean",multivalue:"boolean",selectOnNavigation:"boolean"},{panelMinWidth:"number",panelMaxWidth:"number",panelMinHeight:"number",panelMaxHeight:"number"}]),{panelHeight:(t.attr("panelHeight")=="auto"?"auto":parseInt(t.attr("panelHeight"))||undefined),multiple:(t.attr("multiple")?true:undefined)});
|
||||
};
|
||||
$.fn.combo.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{click:_16,keydown:_1b,paste:_1b,drop:_1b,blur:_1f},panelEvents:{mousedown:function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}},panelWidth:null,panelHeight:300,panelMinWidth:null,panelMaxWidth:null,panelMinHeight:null,panelMaxHeight:null,panelAlign:"left",panelValign:"auto",reversed:false,multiple:false,multivalue:true,selectOnNavigation:true,separator:",",hasDownArrow:true,delay:200,keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
},query:function(q,e){
|
||||
}},onShowPanel:function(){
|
||||
},onHidePanel:function(){
|
||||
},onChange:function(_5b,_5c){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
612
static/jeasyui/plugins/jquery.combobox.js
Executable file
612
static/jeasyui/plugins/jquery.combobox.js
Executable file
@@ -0,0 +1,612 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,_3){
|
||||
var _4=$.data(_2,"combobox");
|
||||
return $.easyui.indexOfArray(_4.data,_4.options.valueField,_3);
|
||||
};
|
||||
function _5(_6,_7){
|
||||
var _8=$.data(_6,"combobox").options;
|
||||
var _9=$(_6).combo("panel");
|
||||
var _a=_8.finder.getEl(_6,_7);
|
||||
if(_a.length){
|
||||
if(_a.position().top<=0){
|
||||
var h=_9.scrollTop()+_a.position().top;
|
||||
_9.scrollTop(h);
|
||||
}else{
|
||||
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 _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(_d=="next"){
|
||||
_10=_10.nextAll(_11);
|
||||
if(!_10.length){
|
||||
_10=_f.children(_11);
|
||||
}
|
||||
}else{
|
||||
_10=_10.prevAll(_11);
|
||||
if(!_10.length){
|
||||
_10=_f.children(_12);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_10.length){
|
||||
_10.addClass("combobox-item-hover");
|
||||
var row=_e.finder.getRow(_c,_10);
|
||||
if(row){
|
||||
$(_c).combobox("scrollTo",row[_e.valueField]);
|
||||
if(_e.selectOnNavigation){
|
||||
_13(_c,row[_e.valueField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
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{
|
||||
_18=[_15];
|
||||
}
|
||||
_19(_14,_18,_16);
|
||||
}
|
||||
};
|
||||
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 _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");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$.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<_21.length;i++){
|
||||
var v=_21[i];
|
||||
var s=v;
|
||||
var row=_23.finder.getRow(_20,v);
|
||||
if(row){
|
||||
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);
|
||||
}
|
||||
}else{
|
||||
s=_27(v,_23.mappingRows)||v;
|
||||
}
|
||||
vv.push(v);
|
||||
ss.push(s);
|
||||
}
|
||||
if(!_22){
|
||||
$(_20).combo("setText",ss.join(_23.separator));
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
$(_20).combo("setValues",vv);
|
||||
_24.triggerHandler("scroll");
|
||||
function _27(_28,a){
|
||||
var _29=$.easyui.getArrayItem(a,_23.valueField,_28);
|
||||
return _29?_29[_23.textField]:undefined;
|
||||
};
|
||||
};
|
||||
function _2a(_2b,_2c,_2d){
|
||||
var _2e=$.data(_2b,"combobox");
|
||||
var _2f=_2e.options;
|
||||
_2e.data=_2f.loadFilter.call(_2b,_2c);
|
||||
_2f.view.render.call(_2f.view,_2b,$(_2b).combo("panel"),_2e.data);
|
||||
var vv=$(_2b).combobox("getValues");
|
||||
$.easyui.forEach(_2e.data,false,function(row){
|
||||
if(row["selected"]){
|
||||
$.easyui.addArrayItem(vv,row[_2f.valueField]+"");
|
||||
}
|
||||
});
|
||||
if(_2f.multiple){
|
||||
_19(_2b,vv,_2d);
|
||||
}else{
|
||||
_19(_2b,vv.length?[vv[vv.length-1]]:[],_2d);
|
||||
}
|
||||
_2f.onLoadSuccess.call(_2b,_2c);
|
||||
};
|
||||
function _30(_31,url,_32,_33){
|
||||
var _34=$.data(_31,"combobox").options;
|
||||
if(url){
|
||||
_34.url=url;
|
||||
}
|
||||
_32=$.extend({},_34.queryParams,_32||{});
|
||||
if(_34.onBeforeLoad.call(_31,_32)==false){
|
||||
return;
|
||||
}
|
||||
_34.loader.call(_31,_32,function(_35){
|
||||
_2a(_31,_35,_33);
|
||||
},function(){
|
||||
_34.onLoadError.apply(this,arguments);
|
||||
});
|
||||
};
|
||||
function _36(_37,q){
|
||||
var _38=$.data(_37,"combobox");
|
||||
var _39=_38.options;
|
||||
var _3a=$();
|
||||
var qq=_39.multiple?q.split(_39.separator):[q];
|
||||
if(_39.mode=="remote"){
|
||||
_3b(qq);
|
||||
_30(_37,null,{q:q},true);
|
||||
}else{
|
||||
var _3c=$(_37).combo("panel");
|
||||
_3c.find(".combobox-item-hover").removeClass("combobox-item-hover");
|
||||
_3c.find(".combobox-item,.combobox-group").hide();
|
||||
var _3d=_38.data;
|
||||
var vv=[];
|
||||
$.map(qq,function(q){
|
||||
q=$.trim(q);
|
||||
var _3e=q;
|
||||
var _3f=undefined;
|
||||
_3a=$();
|
||||
for(var i=0;i<_3d.length;i++){
|
||||
var row=_3d[i];
|
||||
if(_39.filter.call(_37,q,row)){
|
||||
var v=row[_39.valueField];
|
||||
var s=row[_39.textField];
|
||||
var g=row[_39.groupField];
|
||||
var _40=_39.finder.getEl(_37,v).show();
|
||||
if(s.toLowerCase()==q.toLowerCase()){
|
||||
_3e=v;
|
||||
if(_39.reversed){
|
||||
_3a=_40;
|
||||
}else{
|
||||
_13(_37,v,true);
|
||||
}
|
||||
}
|
||||
if(_39.groupField&&_3f!=g){
|
||||
_39.finder.getGroupEl(_37,g).show();
|
||||
_3f=g;
|
||||
}
|
||||
}
|
||||
}
|
||||
vv.push(_3e);
|
||||
});
|
||||
_3b(vv);
|
||||
}
|
||||
function _3b(vv){
|
||||
if(_39.reversed){
|
||||
_3a.addClass("combobox-item-hover");
|
||||
}else{
|
||||
_19(_37,_39.multiple?(q?vv:[]):vv,true);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _41(_42){
|
||||
var t=$(_42);
|
||||
var _43=t.combobox("options");
|
||||
var _44=t.combobox("panel");
|
||||
var _45=_44.children("div.combobox-item-hover");
|
||||
if(_45.length){
|
||||
_45.removeClass("combobox-item-hover");
|
||||
var row=_43.finder.getRow(_42,_45);
|
||||
var _46=row[_43.valueField];
|
||||
if(_43.multiple){
|
||||
if(_45.hasClass("combobox-item-selected")){
|
||||
t.combobox("unselect",_46);
|
||||
}else{
|
||||
t.combobox("select",_46);
|
||||
}
|
||||
}else{
|
||||
t.combobox("select",_46);
|
||||
}
|
||||
}
|
||||
var vv=[];
|
||||
$.map(t.combobox("getValues"),function(v){
|
||||
if(_1(_42,v)>=0){
|
||||
vv.push(v);
|
||||
}
|
||||
});
|
||||
t.combobox("setValues",vv);
|
||||
if(!_43.multiple){
|
||||
t.combobox("hidePanel");
|
||||
}
|
||||
};
|
||||
function _47(_48){
|
||||
var _49=$.data(_48,"combobox");
|
||||
var _4a=_49.options;
|
||||
$(_48).addClass("combobox-f");
|
||||
$(_48).combo($.extend({},_4a,{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"));
|
||||
_4a.onShowPanel.call(this);
|
||||
}}));
|
||||
};
|
||||
function _4b(e){
|
||||
$(this).children("div.combobox-item-hover").removeClass("combobox-item-hover");
|
||||
var _4c=$(e.target).closest("div.combobox-item");
|
||||
if(!_4c.hasClass("combobox-item-disabled")){
|
||||
_4c.addClass("combobox-item-hover");
|
||||
}
|
||||
e.stopPropagation();
|
||||
};
|
||||
function _4d(e){
|
||||
$(e.target).closest("div.combobox-item").removeClass("combobox-item-hover");
|
||||
e.stopPropagation();
|
||||
};
|
||||
function _4e(e){
|
||||
var _4f=$(this).panel("options").comboTarget;
|
||||
if(!_4f){
|
||||
return;
|
||||
}
|
||||
var _50=$(_4f).combobox("options");
|
||||
var _51=$(e.target).closest("div.combobox-item");
|
||||
if(!_51.length||_51.hasClass("combobox-item-disabled")){
|
||||
return;
|
||||
}
|
||||
var row=_50.finder.getRow(_4f,_51);
|
||||
if(!row){
|
||||
return;
|
||||
}
|
||||
if(_50.blurTimer){
|
||||
clearTimeout(_50.blurTimer);
|
||||
_50.blurTimer=null;
|
||||
}
|
||||
_50.onClick.call(_4f,row);
|
||||
var _52=row[_50.valueField];
|
||||
if(_50.multiple){
|
||||
if(_51.hasClass("combobox-item-selected")){
|
||||
_1a(_4f,_52);
|
||||
}else{
|
||||
_13(_4f,_52);
|
||||
}
|
||||
}else{
|
||||
$(_4f).combobox("setValue",_52).combobox("hidePanel");
|
||||
}
|
||||
e.stopPropagation();
|
||||
};
|
||||
function _53(e){
|
||||
var _54=$(this).panel("options").comboTarget;
|
||||
if(!_54){
|
||||
return;
|
||||
}
|
||||
var _55=$(_54).combobox("options");
|
||||
if(_55.groupPosition=="sticky"){
|
||||
var _56=$(this).children(".combobox-stick");
|
||||
if(!_56.length){
|
||||
_56=$("<div class=\"combobox-stick\"></div>").appendTo(this);
|
||||
}
|
||||
_56.hide();
|
||||
var _57=$(_54).data("combobox");
|
||||
$(this).children(".combobox-group:visible").each(function(){
|
||||
var g=$(this);
|
||||
var _58=_55.finder.getGroup(_54,g);
|
||||
var _59=_57.data[_58.startIndex+_58.count-1];
|
||||
var _5a=_55.finder.getEl(_54,_59[_55.valueField]);
|
||||
if(g.position().top<0&&_5a.position().top>0){
|
||||
_56.show().html(g.html());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn.combobox=function(_5b,_5c){
|
||||
if(typeof _5b=="string"){
|
||||
var _5d=$.fn.combobox.methods[_5b];
|
||||
if(_5d){
|
||||
return _5d(this,_5c);
|
||||
}else{
|
||||
return this.combo(_5b,_5c);
|
||||
}
|
||||
}
|
||||
_5b=_5b||{};
|
||||
return this.each(function(){
|
||||
var _5e=$.data(this,"combobox");
|
||||
if(_5e){
|
||||
$.extend(_5e.options,_5b);
|
||||
}else{
|
||||
_5e=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_5b),data:[]});
|
||||
}
|
||||
_47(this);
|
||||
if(_5e.options.data){
|
||||
_2a(this,_5e.options.data);
|
||||
}else{
|
||||
var _5f=$.fn.combobox.parseData(this);
|
||||
if(_5f.length){
|
||||
_2a(this,_5f);
|
||||
}
|
||||
}
|
||||
_30(this);
|
||||
});
|
||||
};
|
||||
$.fn.combobox.methods={options:function(jq){
|
||||
var _60=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combobox").options,{width:_60.width,height:_60.height,originalValue:_60.originalValue,disabled:_60.disabled,readonly:_60.readonly});
|
||||
},cloneFrom:function(jq,_61){
|
||||
return jq.each(function(){
|
||||
$(this).combo("cloneFrom",_61);
|
||||
$.data(this,"combobox",$(_61).data("combobox"));
|
||||
$(this).addClass("combobox-f").attr("comboboxName",$(this).attr("textboxName"));
|
||||
});
|
||||
},getData:function(jq){
|
||||
return $.data(jq[0],"combobox").data;
|
||||
},setValues:function(jq,_62){
|
||||
return jq.each(function(){
|
||||
var _63=$(this).combobox("options");
|
||||
if($.isArray(_62)){
|
||||
_62=$.map(_62,function(_64){
|
||||
if(_64&&typeof _64=="object"){
|
||||
$.easyui.addArrayItem(_63.mappingRows,_63.valueField,_64);
|
||||
return _64[_63.valueField];
|
||||
}else{
|
||||
return _64;
|
||||
}
|
||||
});
|
||||
}
|
||||
_19(this,_62);
|
||||
});
|
||||
},setValue:function(jq,_65){
|
||||
return jq.each(function(){
|
||||
$(this).combobox("setValues",$.isArray(_65)?_65:[_65]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_19(this,[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _66=$(this).combobox("options");
|
||||
if(_66.multiple){
|
||||
$(this).combobox("setValues",_66.originalValue);
|
||||
}else{
|
||||
$(this).combobox("setValue",_66.originalValue);
|
||||
}
|
||||
});
|
||||
},loadData:function(jq,_67){
|
||||
return jq.each(function(){
|
||||
_2a(this,_67);
|
||||
});
|
||||
},reload:function(jq,url){
|
||||
return jq.each(function(){
|
||||
if(typeof url=="string"){
|
||||
_30(this,url);
|
||||
}else{
|
||||
if(url){
|
||||
var _68=$(this).combobox("options");
|
||||
_68.queryParams=url;
|
||||
}
|
||||
_30(this);
|
||||
}
|
||||
});
|
||||
},select:function(jq,_69){
|
||||
return jq.each(function(){
|
||||
_13(this,_69);
|
||||
});
|
||||
},unselect:function(jq,_6a){
|
||||
return jq.each(function(){
|
||||
_1a(this,_6a);
|
||||
});
|
||||
},scrollTo:function(jq,_6b){
|
||||
return jq.each(function(){
|
||||
_5(this,_6b);
|
||||
});
|
||||
}};
|
||||
$.fn.combobox.parseOptions=function(_6c){
|
||||
var t=$(_6c);
|
||||
return $.extend({},$.fn.combo.parseOptions(_6c),$.parser.parseOptions(_6c,["valueField","textField","groupField","groupPosition","mode","method","url",{showItemIcon:"boolean",limitToList:"boolean"}]));
|
||||
};
|
||||
$.fn.combobox.parseData=function(_6d){
|
||||
var _6e=[];
|
||||
var _6f=$(_6d).combobox("options");
|
||||
$(_6d).children().each(function(){
|
||||
if(this.tagName.toLowerCase()=="optgroup"){
|
||||
var _70=$(this).attr("label");
|
||||
$(this).children().each(function(){
|
||||
_71(this,_70);
|
||||
});
|
||||
}else{
|
||||
_71(this);
|
||||
}
|
||||
});
|
||||
return _6e;
|
||||
function _71(el,_72){
|
||||
var t=$(el);
|
||||
var row={};
|
||||
row[_6f.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text();
|
||||
row[_6f.textField]=t.text();
|
||||
row["iconCls"]=$.parser.parseOptions(el,["iconCls"]).iconCls;
|
||||
row["selected"]=t.is(":selected");
|
||||
row["disabled"]=t.is(":disabled");
|
||||
if(_72){
|
||||
_6f.groupField=_6f.groupField||"group";
|
||||
row[_6f.groupField]=_72;
|
||||
}
|
||||
_6e.push(row);
|
||||
};
|
||||
};
|
||||
var _73=0;
|
||||
var _74={render:function(_75,_76,_77){
|
||||
var _78=$.data(_75,"combobox");
|
||||
var _79=_78.options;
|
||||
var _7a=$(_75).attr("id")||"";
|
||||
_73++;
|
||||
_78.itemIdPrefix=_7a+"_easyui_combobox_i"+_73;
|
||||
_78.groupIdPrefix=_7a+"_easyui_combobox_g"+_73;
|
||||
_78.groups=[];
|
||||
var dd=[];
|
||||
var _7b=undefined;
|
||||
for(var i=0;i<_77.length;i++){
|
||||
var row=_77[i];
|
||||
var v=row[_79.valueField]+"";
|
||||
var s=row[_79.textField];
|
||||
var g=row[_79.groupField];
|
||||
if(g){
|
||||
if(_7b!=g){
|
||||
_7b=g;
|
||||
_78.groups.push({value:g,startIndex:i,count:1});
|
||||
dd.push("<div id=\""+(_78.groupIdPrefix+"_"+(_78.groups.length-1))+"\" class=\"combobox-group\">");
|
||||
dd.push(_79.groupFormatter?_79.groupFormatter.call(_75,g):g);
|
||||
dd.push("</div>");
|
||||
}else{
|
||||
_78.groups[_78.groups.length-1].count++;
|
||||
}
|
||||
}else{
|
||||
_7b=undefined;
|
||||
}
|
||||
var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":"");
|
||||
dd.push("<div id=\""+(_78.itemIdPrefix+"_"+i)+"\" class=\""+cls+"\">");
|
||||
if(_79.showItemIcon&&row.iconCls){
|
||||
dd.push("<span class=\"combobox-icon "+row.iconCls+"\"></span>");
|
||||
}
|
||||
dd.push(_79.formatter?_79.formatter.call(_75,row):s);
|
||||
dd.push("</div>");
|
||||
}
|
||||
$(_76).html(dd.join(""));
|
||||
}};
|
||||
$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupPosition:"static",groupField:null,groupFormatter:function(_7c){
|
||||
return _7c;
|
||||
},mode:"local",method:"post",url:null,data:null,queryParams:{},showItemIcon:false,limitToList:false,unselectedValues:[],mappingRows:[],view:_74,keyHandler:{up:function(e){
|
||||
_b(this,"prev");
|
||||
e.preventDefault();
|
||||
},down:function(e){
|
||||
_b(this,"next");
|
||||
e.preventDefault();
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_41(this);
|
||||
},query:function(q,e){
|
||||
_36(this,q);
|
||||
}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var _7d=e.data.target;
|
||||
var _7e=$(_7d).combobox("options");
|
||||
if(_7e.reversed||_7e.limitToList){
|
||||
if(_7e.blurTimer){
|
||||
clearTimeout(_7e.blurTimer);
|
||||
}
|
||||
_7e.blurTimer=setTimeout(function(){
|
||||
var _7f=$(_7d).parent().length;
|
||||
if(_7f){
|
||||
if(_7e.reversed){
|
||||
$(_7d).combobox("setValues",$(_7d).combobox("getValues"));
|
||||
}else{
|
||||
if(_7e.limitToList){
|
||||
var vv=[];
|
||||
$.map($(_7d).combobox("getValues"),function(v){
|
||||
var _80=$.easyui.indexOfArray($(_7d).combobox("getData"),_7e.valueField,v);
|
||||
if(_80>=0){
|
||||
vv.push(v);
|
||||
}
|
||||
});
|
||||
$(_7d).combobox("setValues",vv);
|
||||
}
|
||||
}
|
||||
_7e.blurTimer=null;
|
||||
}
|
||||
},50);
|
||||
}
|
||||
}}),panelEvents:{mouseover:_4b,mouseout:_4d,mousedown:function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
},click:_4e,scroll:_53},filter:function(q,row){
|
||||
var _81=$(this).combobox("options");
|
||||
return row[_81.textField].toLowerCase().indexOf(q.toLowerCase())>=0;
|
||||
},formatter:function(row){
|
||||
var _82=$(this).combobox("options");
|
||||
return row[_82.textField];
|
||||
},loader:function(_83,_84,_85){
|
||||
var _86=$(this).combobox("options");
|
||||
if(!_86.url){
|
||||
return false;
|
||||
}
|
||||
$.ajax({type:_86.method,url:_86.url,data:_83,dataType:"json",success:function(_87){
|
||||
_84(_87);
|
||||
},error:function(){
|
||||
_85.apply(this,arguments);
|
||||
}});
|
||||
},loadFilter:function(_88){
|
||||
return _88;
|
||||
},finder:{getEl:function(_89,_8a){
|
||||
var _8b=_1(_89,_8a);
|
||||
var id=$.data(_89,"combobox").itemIdPrefix+"_"+_8b;
|
||||
return $("#"+id);
|
||||
},getGroupEl:function(_8c,_8d){
|
||||
var _8e=$.data(_8c,"combobox");
|
||||
var _8f=$.easyui.indexOfArray(_8e.groups,"value",_8d);
|
||||
var id=_8e.groupIdPrefix+"_"+_8f;
|
||||
return $("#"+id);
|
||||
},getGroup:function(_90,p){
|
||||
var _91=$.data(_90,"combobox");
|
||||
var _92=p.attr("id").substr(_91.groupIdPrefix.length+1);
|
||||
return _91.groups[parseInt(_92)];
|
||||
},getRow:function(_93,p){
|
||||
var _94=$.data(_93,"combobox");
|
||||
var _95=(p instanceof $)?p.attr("id").substr(_94.itemIdPrefix.length+1):_1(_93,p);
|
||||
return _94.data[parseInt(_95)];
|
||||
}},onBeforeLoad:function(_96){
|
||||
},onLoadSuccess:function(_97){
|
||||
},onLoadError:function(){
|
||||
},onSelect:function(_98){
|
||||
},onUnselect:function(_99){
|
||||
},onClick:function(_9a){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
353
static/jeasyui/plugins/jquery.combogrid.js
Executable file
353
static/jeasyui/plugins/jquery.combogrid.js
Executable file
@@ -0,0 +1,353 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"combogrid");
|
||||
var _4=_3.options;
|
||||
var _5=_3.grid;
|
||||
$(_2).addClass("combogrid-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
_22(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");
|
||||
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 _a=$(_2).combo("panel");
|
||||
if(!_5){
|
||||
_5=$("<table></table>").appendTo(_a);
|
||||
_3.grid=_5;
|
||||
}
|
||||
_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;
|
||||
};
|
||||
function _b(_f){
|
||||
var _10=_e(this);
|
||||
var _11=$(_10).data("combogrid");
|
||||
var _12=_11.options;
|
||||
var _13=$(_10).combo("getValues");
|
||||
_22(_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");
|
||||
}
|
||||
_17.onClickRow.call(this,_14,row);
|
||||
};
|
||||
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);
|
||||
}
|
||||
}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);
|
||||
var _20=dg.data("datagrid").dc.body2;
|
||||
var _21=_20.scrollTop();
|
||||
_22(_1d,vv,_1e.remainText);
|
||||
_20.scrollTop(_21);
|
||||
};
|
||||
};
|
||||
function nav(_23,dir){
|
||||
var _24=$.data(_23,"combogrid");
|
||||
var _25=_24.options;
|
||||
var _26=_24.grid;
|
||||
var _27=_26.datagrid("getRows").length;
|
||||
if(!_27){
|
||||
return;
|
||||
}
|
||||
var tr=_25.finder.getTr(_26[0],null,"highlight");
|
||||
if(!tr.length){
|
||||
tr=_25.finder.getTr(_26[0],null,"selected");
|
||||
}
|
||||
var _28;
|
||||
if(!tr.length){
|
||||
_28=(dir=="next"?0:_27-1);
|
||||
}else{
|
||||
var _28=parseInt(tr.attr("datagrid-row-index"));
|
||||
_28+=(dir=="next"?1:-1);
|
||||
if(_28<0){
|
||||
_28=_27-1;
|
||||
}
|
||||
if(_28>=_27){
|
||||
_28=0;
|
||||
}
|
||||
}
|
||||
_26.datagrid("highlightRow",_28);
|
||||
if(_25.selectOnNavigation){
|
||||
_24.remainText=false;
|
||||
_26.datagrid("selectRow",_28);
|
||||
}
|
||||
};
|
||||
function _22(_29,_2a,_2b){
|
||||
var _2c=$.data(_29,"combogrid");
|
||||
var _2d=_2c.options;
|
||||
var _2e=_2c.grid;
|
||||
var _2f=$(_29).combo("getValues");
|
||||
var _30=$(_29).combo("options");
|
||||
var _31=_30.onChange;
|
||||
_30.onChange=function(){
|
||||
};
|
||||
var _32=_2e.datagrid("options");
|
||||
var _33=_32.onSelect;
|
||||
var _34=_32.onUnselectAll;
|
||||
_32.onSelect=_32.onUnselectAll=function(){
|
||||
};
|
||||
if(!$.isArray(_2a)){
|
||||
_2a=_2a.split(_2d.separator);
|
||||
}
|
||||
if(!_2d.multiple){
|
||||
_2a=_2a.length?[_2a[0]]:[""];
|
||||
}
|
||||
var vv=$.map(_2a,function(_35){
|
||||
return String(_35);
|
||||
});
|
||||
vv=$.grep(vv,function(v,_36){
|
||||
return _36===$.inArray(v,vv);
|
||||
});
|
||||
var _37=$.grep(_2e.datagrid("getSelections"),function(row,_38){
|
||||
return $.inArray(String(row[_2d.idField]),vv)>=0;
|
||||
});
|
||||
_2e.datagrid("clearSelections");
|
||||
_2e.data("datagrid").selectedRows=_37;
|
||||
var ss=[];
|
||||
_2d.unselectedValues=[];
|
||||
$.map(vv,function(v){
|
||||
var _39=_2e.datagrid("getRowIndex",v);
|
||||
if(_39>=0){
|
||||
_2e.datagrid("selectRow",_39);
|
||||
}else{
|
||||
if($.easyui.indexOfArray(_37,_2d.idField,v)==-1){
|
||||
_2d.unselectedValues.push(v);
|
||||
}
|
||||
}
|
||||
ss.push(_3a(v,_2e.datagrid("getRows"))||_3a(v,_37)||_3a(v,_2d.mappingRows)||v);
|
||||
});
|
||||
$(_29).combo("setValues",_2f);
|
||||
_30.onChange=_31;
|
||||
_32.onSelect=_33;
|
||||
_32.onUnselectAll=_34;
|
||||
if(!_2b){
|
||||
var s=ss.join(_2d.separator);
|
||||
if($(_29).combo("getText")!=s){
|
||||
$(_29).combo("setText",s);
|
||||
}
|
||||
}
|
||||
$(_29).combo("setValues",_2a);
|
||||
function _3a(_3b,a){
|
||||
var _3c=$.easyui.getArrayItem(a,_2d.idField,_3b);
|
||||
return _3c?_3c[_2d.textField]:undefined;
|
||||
};
|
||||
};
|
||||
function _3d(_3e,q){
|
||||
var _3f=$.data(_3e,"combogrid");
|
||||
var _40=_3f.options;
|
||||
var _41=_3f.grid;
|
||||
_3f.remainText=true;
|
||||
var qq=_40.multiple?q.split(_40.separator):[q];
|
||||
qq=$.grep(qq,function(q){
|
||||
return $.trim(q)!="";
|
||||
});
|
||||
if(_40.mode=="remote"){
|
||||
_42(qq);
|
||||
_41.datagrid("load",$.extend({},_40.queryParams,{q:q}));
|
||||
}else{
|
||||
_41.datagrid("highlightRow",-1);
|
||||
var _43=_41.datagrid("getRows");
|
||||
var vv=[];
|
||||
$.map(qq,function(q){
|
||||
q=$.trim(q);
|
||||
var _44=q;
|
||||
_45(_40.mappingRows,q);
|
||||
_45(_41.datagrid("getSelections"),q);
|
||||
var _46=_45(_43,q);
|
||||
if(_46>=0){
|
||||
if(_40.reversed){
|
||||
_41.datagrid("highlightRow",_46);
|
||||
}
|
||||
}else{
|
||||
$.map(_43,function(row,i){
|
||||
if(_40.filter.call(_3e,q,row)){
|
||||
_41.datagrid("highlightRow",i);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
_42(vv);
|
||||
}
|
||||
function _45(_47,q){
|
||||
for(var i=0;i<_47.length;i++){
|
||||
var row=_47[i];
|
||||
if((row[_40.textField]||"").toLowerCase()==q.toLowerCase()){
|
||||
vv.push(row[_40.idField]);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
function _42(vv){
|
||||
if(!_40.reversed){
|
||||
_22(_3e,vv,true);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _48(_49){
|
||||
var _4a=$.data(_49,"combogrid");
|
||||
var _4b=_4a.options;
|
||||
var _4c=_4a.grid;
|
||||
var tr=_4b.finder.getTr(_4c[0],null,"highlight");
|
||||
_4a.remainText=false;
|
||||
if(tr.length){
|
||||
var _4d=parseInt(tr.attr("datagrid-row-index"));
|
||||
if(_4b.multiple){
|
||||
if(tr.hasClass("datagrid-row-selected")){
|
||||
_4c.datagrid("unselectRow",_4d);
|
||||
}else{
|
||||
_4c.datagrid("selectRow",_4d);
|
||||
}
|
||||
}else{
|
||||
_4c.datagrid("selectRow",_4d);
|
||||
}
|
||||
}
|
||||
var vv=[];
|
||||
$.map(_4c.datagrid("getSelections"),function(row){
|
||||
vv.push(row[_4b.idField]);
|
||||
});
|
||||
$.map(_4b.unselectedValues,function(v){
|
||||
if($.easyui.indexOfArray(_4b.mappingRows,_4b.idField,v)>=0){
|
||||
$.easyui.addArrayItem(vv,v);
|
||||
}
|
||||
});
|
||||
$(_49).combogrid("setValues",vv);
|
||||
if(!_4b.multiple){
|
||||
$(_49).combogrid("hidePanel");
|
||||
}
|
||||
};
|
||||
$.fn.combogrid=function(_4e,_4f){
|
||||
if(typeof _4e=="string"){
|
||||
var _50=$.fn.combogrid.methods[_4e];
|
||||
if(_50){
|
||||
return _50(this,_4f);
|
||||
}else{
|
||||
return this.combo(_4e,_4f);
|
||||
}
|
||||
}
|
||||
_4e=_4e||{};
|
||||
return this.each(function(){
|
||||
var _51=$.data(this,"combogrid");
|
||||
if(_51){
|
||||
$.extend(_51.options,_4e);
|
||||
}else{
|
||||
_51=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_4e)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.combogrid.methods={options:function(jq){
|
||||
var _52=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combogrid").options,{width:_52.width,height:_52.height,originalValue:_52.originalValue,disabled:_52.disabled,readonly:_52.readonly});
|
||||
},cloneFrom:function(jq,_53){
|
||||
return jq.each(function(){
|
||||
$(this).combo("cloneFrom",_53);
|
||||
$.data(this,"combogrid",{options:$.extend(true,{cloned:true},$(_53).combogrid("options")),combo:$(this).next(),panel:$(_53).combo("panel"),grid:$(_53).combogrid("grid")});
|
||||
});
|
||||
},grid:function(jq){
|
||||
return $.data(jq[0],"combogrid").grid;
|
||||
},setValues:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
var _55=$(this).combogrid("options");
|
||||
if($.isArray(_54)){
|
||||
_54=$.map(_54,function(_56){
|
||||
if(_56&&typeof _56=="object"){
|
||||
$.easyui.addArrayItem(_55.mappingRows,_55.idField,_56);
|
||||
return _56[_55.idField];
|
||||
}else{
|
||||
return _56;
|
||||
}
|
||||
});
|
||||
}
|
||||
_22(this,_54);
|
||||
});
|
||||
},setValue:function(jq,_57){
|
||||
return jq.each(function(){
|
||||
$(this).combogrid("setValues",$.isArray(_57)?_57:[_57]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combogrid("setValues",[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _58=$(this).combogrid("options");
|
||||
if(_58.multiple){
|
||||
$(this).combogrid("setValues",_58.originalValue);
|
||||
}else{
|
||||
$(this).combogrid("setValue",_58.originalValue);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.combogrid.parseOptions=function(_59){
|
||||
var t=$(_59);
|
||||
return $.extend({},$.fn.combo.parseOptions(_59),$.fn.datagrid.parseOptions(_59),$.parser.parseOptions(_59,["idField","textField","mode"]));
|
||||
};
|
||||
$.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){
|
||||
nav(this,"next");
|
||||
e.preventDefault();
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_48(this);
|
||||
},query:function(q,e){
|
||||
_3d(this,q);
|
||||
}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var _5a=e.data.target;
|
||||
var _5b=$(_5a).combogrid("options");
|
||||
if(_5b.reversed){
|
||||
$(_5a).combogrid("setValues",$(_5a).combogrid("getValues"));
|
||||
}
|
||||
}}),panelEvents:{mousedown:function(e){
|
||||
}},filter:function(q,row){
|
||||
var _5c=$(this).combogrid("options");
|
||||
return (row[_5c.textField]||"").toLowerCase().indexOf(q.toLowerCase())>=0;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
239
static/jeasyui/plugins/jquery.combotree.js
Executable file
239
static/jeasyui/plugins/jquery.combotree.js
Executable file
@@ -0,0 +1,239 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"combotree");
|
||||
var _4=_3.options;
|
||||
var _5=_3.tree;
|
||||
$(_2).addClass("combotree-f");
|
||||
$(_2).combo($.extend({},_4,{onShowPanel:function(){
|
||||
if(_4.editable){
|
||||
_5.tree("doFilter","");
|
||||
}
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
var _6=$(_2).combo("panel");
|
||||
if(!_5){
|
||||
_5=$("<ul></ul>").appendTo(_6);
|
||||
_3.tree=_5;
|
||||
}
|
||||
_5.tree($.extend({},_4,{checkbox:_4.multiple,onLoadSuccess:function(_7,_8){
|
||||
var _9=$(_2).combotree("getValues");
|
||||
if(_4.multiple){
|
||||
$.map(_5.tree("getChecked"),function(_a){
|
||||
$.easyui.addArrayItem(_9,_a.id);
|
||||
});
|
||||
}
|
||||
_15(_2,_9,_3.remainText);
|
||||
_4.onLoadSuccess.call(this,_7,_8);
|
||||
},onClick:function(_b){
|
||||
if(_4.multiple){
|
||||
$(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);
|
||||
}}));
|
||||
};
|
||||
function _e(_f){
|
||||
var _10=$.data(_f,"combotree");
|
||||
var _11=_10.options;
|
||||
var _12=_10.tree;
|
||||
var vv=[];
|
||||
if(_11.multiple){
|
||||
vv=$.map(_12.tree("getChecked"),function(_13){
|
||||
return _13.id;
|
||||
});
|
||||
}else{
|
||||
var _14=_12.tree("getSelected");
|
||||
if(_14){
|
||||
vv.push(_14.id);
|
||||
}
|
||||
}
|
||||
vv=vv.concat(_11.unselectedValues);
|
||||
_15(_f,vv,_10.remainText);
|
||||
};
|
||||
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.onBeforeSelect;
|
||||
var _20=_1c.onSelect;
|
||||
_1c.onBeforeCheck=_1c.onCheck=_1c.onBeforeSelect=_1c.onSelect=function(){
|
||||
};
|
||||
if(!$.isArray(_17)){
|
||||
_17=_17.split(_1a.separator);
|
||||
}
|
||||
if(!_1a.multiple){
|
||||
_17=_17.length?[_17[0]]:[""];
|
||||
}
|
||||
var vv=$.map(_17,function(_21){
|
||||
return String(_21);
|
||||
});
|
||||
_1b.find("div.tree-node-selected").removeClass("tree-node-selected");
|
||||
$.map(_1b.tree("getChecked"),function(_22){
|
||||
if($.inArray(String(_22.id),vv)==-1){
|
||||
_1b.tree("uncheck",_22.target);
|
||||
}
|
||||
});
|
||||
var ss=[];
|
||||
_1a.unselectedValues=[];
|
||||
$.map(vv,function(v){
|
||||
var _23=_1b.tree("find",v);
|
||||
if(_23){
|
||||
_1b.tree("check",_23.target).tree("select",_23.target);
|
||||
ss.push(_24(_23));
|
||||
}else{
|
||||
ss.push(_25(v,_1a.mappingRows)||v);
|
||||
_1a.unselectedValues.push(v);
|
||||
}
|
||||
});
|
||||
if(_1a.multiple){
|
||||
$.map(_1b.tree("getChecked"),function(_26){
|
||||
var id=String(_26.id);
|
||||
if($.inArray(id,vv)==-1){
|
||||
vv.push(id);
|
||||
ss.push(_24(_26));
|
||||
}
|
||||
});
|
||||
}
|
||||
_1c.onBeforeCheck=_1d;
|
||||
_1c.onCheck=_1e;
|
||||
_1c.onBeforeSelect=_1f;
|
||||
_1c.onSelect=_20;
|
||||
if(!_18){
|
||||
var s=ss.join(_1a.separator);
|
||||
if($(_16).combo("getText")!=s){
|
||||
$(_16).combo("setText",s);
|
||||
}
|
||||
}
|
||||
$(_16).combo("setValues",vv);
|
||||
function _25(_27,a){
|
||||
var _28=$.easyui.getArrayItem(a,"id",_27);
|
||||
return _28?_24(_28):undefined;
|
||||
};
|
||||
function _24(_29){
|
||||
return _29[_1a.textField||""]||_29.text;
|
||||
};
|
||||
};
|
||||
function _2a(_2b,q){
|
||||
var _2c=$.data(_2b,"combotree");
|
||||
var _2d=_2c.options;
|
||||
var _2e=_2c.tree;
|
||||
_2c.remainText=true;
|
||||
_2e.tree("doFilter",_2d.multiple?q.split(_2d.separator):q);
|
||||
};
|
||||
function _2f(_30){
|
||||
var _31=$.data(_30,"combotree");
|
||||
_31.remainText=false;
|
||||
$(_30).combotree("setValues",$(_30).combotree("getValues"));
|
||||
$(_30).combotree("hidePanel");
|
||||
};
|
||||
$.fn.combotree=function(_32,_33){
|
||||
if(typeof _32=="string"){
|
||||
var _34=$.fn.combotree.methods[_32];
|
||||
if(_34){
|
||||
return _34(this,_33);
|
||||
}else{
|
||||
return this.combo(_32,_33);
|
||||
}
|
||||
}
|
||||
_32=_32||{};
|
||||
return this.each(function(){
|
||||
var _35=$.data(this,"combotree");
|
||||
if(_35){
|
||||
$.extend(_35.options,_32);
|
||||
}else{
|
||||
$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_32)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.combotree.methods={options:function(jq){
|
||||
var _36=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combotree").options,{width:_36.width,height:_36.height,originalValue:_36.originalValue,disabled:_36.disabled,readonly:_36.readonly});
|
||||
},clone:function(jq,_37){
|
||||
var t=jq.combo("clone",_37);
|
||||
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,_38){
|
||||
return jq.each(function(){
|
||||
var _39=$.data(this,"combotree").options;
|
||||
_39.data=_38;
|
||||
var _3a=$.data(this,"combotree").tree;
|
||||
_3a.tree("loadData",_38);
|
||||
});
|
||||
},reload:function(jq,url){
|
||||
return jq.each(function(){
|
||||
var _3b=$.data(this,"combotree").options;
|
||||
var _3c=$.data(this,"combotree").tree;
|
||||
if(url){
|
||||
_3b.url=url;
|
||||
}
|
||||
_3c.tree({url:_3b.url});
|
||||
});
|
||||
},setValues:function(jq,_3d){
|
||||
return jq.each(function(){
|
||||
var _3e=$(this).combotree("options");
|
||||
if($.isArray(_3d)){
|
||||
_3d=$.map(_3d,function(_3f){
|
||||
if(_3f&&typeof _3f=="object"){
|
||||
$.easyui.addArrayItem(_3e.mappingRows,"id",_3f);
|
||||
return _3f.id;
|
||||
}else{
|
||||
return _3f;
|
||||
}
|
||||
});
|
||||
}
|
||||
_15(this,_3d);
|
||||
});
|
||||
},setValue:function(jq,_40){
|
||||
return jq.each(function(){
|
||||
$(this).combotree("setValues",$.isArray(_40)?_40:[_40]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combotree("setValues",[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _41=$(this).combotree("options");
|
||||
if(_41.multiple){
|
||||
$(this).combotree("setValues",_41.originalValue);
|
||||
}else{
|
||||
$(this).combotree("setValue",_41.originalValue);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.combotree.parseOptions=function(_42){
|
||||
return $.extend({},$.fn.combo.parseOptions(_42),$.fn.tree.parseOptions(_42));
|
||||
};
|
||||
$.fn.combotree.defaults=$.extend({},$.fn.combo.defaults,$.fn.tree.defaults,{editable:false,textField:null,unselectedValues:[],mappingRows:[],keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_2f(this);
|
||||
},query:function(q,e){
|
||||
_2a(this,q);
|
||||
}}});
|
||||
})(jQuery);
|
||||
|
||||
328
static/jeasyui/plugins/jquery.combotreegrid.js
Normal file
328
static/jeasyui/plugins/jquery.combotreegrid.js
Normal file
@@ -0,0 +1,328 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"combotreegrid");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("combotreegrid-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
var p=$(this).combotreegrid("panel");
|
||||
var _5=p.outerHeight()-p.height();
|
||||
var _6=p._size("minHeight");
|
||||
var _7=p._size("maxHeight");
|
||||
var dg=$(this).combotreegrid("grid");
|
||||
dg.treegrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_6?_6-_5:""),maxHeight:(_7?_7-_5:"")});
|
||||
var _8=dg.treegrid("getSelected");
|
||||
if(_8){
|
||||
dg.treegrid("scrollTo",_8[_4.idField]);
|
||||
}
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
if(!_3.grid){
|
||||
var _9=$(_2).combo("panel");
|
||||
_3.grid=$("<table></table>").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;
|
||||
var _1c=_1b.datagrid("options");
|
||||
var _1d=_1c.onBeforeCheck;
|
||||
var _1e=_1c.onCheck;
|
||||
var _1f=_1c.onBeforeSelect;
|
||||
var _20=_1c.onSelect;
|
||||
_1c.onBeforeCheck=_1c.onCheck=_1c.onBeforeSelect=_1c.onSelect=function(){
|
||||
};
|
||||
if(!$.isArray(_18)){
|
||||
_18=_18.split(_1a.separator);
|
||||
}
|
||||
if(!_1a.multiple){
|
||||
_18=_18.length?[_18[0]]:[""];
|
||||
}
|
||||
var vv=$.map(_18,function(_21){
|
||||
return String(_21);
|
||||
});
|
||||
vv=$.grep(vv,function(v,_22){
|
||||
return _22===$.inArray(v,vv);
|
||||
});
|
||||
var _23=_1b.treegrid("getSelected");
|
||||
if(_23){
|
||||
_1b.treegrid("unselect",_23[_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(_24(row));
|
||||
}else{
|
||||
ss.push(_25(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(_24(row));
|
||||
}
|
||||
});
|
||||
}
|
||||
_1c.onBeforeCheck=_1d;
|
||||
_1c.onCheck=_1e;
|
||||
_1c.onBeforeSelect=_1f;
|
||||
_1c.onSelect=_20;
|
||||
if(!_19.remainText){
|
||||
var s=ss.join(_1a.separator);
|
||||
if($(_17).combo("getText")!=s){
|
||||
$(_17).combo("setText",s);
|
||||
}
|
||||
}
|
||||
$(_17).combo("setValues",vv);
|
||||
function _25(_26,a){
|
||||
var _27=$.easyui.getArrayItem(a,_1a.idField,_26);
|
||||
return _27?_24(_27):undefined;
|
||||
};
|
||||
function _24(row){
|
||||
return row[_1a.textField||""]||row[_1a.treeField];
|
||||
};
|
||||
};
|
||||
function _28(_29,q){
|
||||
var _2a=$.data(_29,"combotreegrid");
|
||||
var _2b=_2a.options;
|
||||
var _2c=_2a.grid;
|
||||
_2a.remainText=true;
|
||||
var qq=_2b.multiple?q.split(_2b.separator):[q];
|
||||
qq=$.grep(qq,function(q){
|
||||
return $.trim(q)!="";
|
||||
});
|
||||
_2c.treegrid("clearSelections").treegrid("clearChecked").treegrid("highlightRow",-1);
|
||||
if(_2b.mode=="remote"){
|
||||
_2d(qq);
|
||||
_2c.treegrid("load",$.extend({},_2b.queryParams,{q:q}));
|
||||
}else{
|
||||
if(q){
|
||||
var _2e=_2c.treegrid("getData");
|
||||
var vv=[];
|
||||
$.map(qq,function(q){
|
||||
q=$.trim(q);
|
||||
if(q){
|
||||
var v=undefined;
|
||||
$.easyui.forEach(_2e,true,function(row){
|
||||
if(q.toLowerCase()==String(row[_2b.treeField]).toLowerCase()){
|
||||
v=row[_2b.idField];
|
||||
return false;
|
||||
}else{
|
||||
if(_2b.filter.call(_29,q,row)){
|
||||
_2c.treegrid("expandTo",row[_2b.idField]);
|
||||
_2c.treegrid("highlightRow",row[_2b.idField]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(v==undefined){
|
||||
$.easyui.forEach(_2b.mappingRows,false,function(row){
|
||||
if(q.toLowerCase()==String(row[_2b.treeField])){
|
||||
v=row[_2b.idField];
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(v!=undefined){
|
||||
vv.push(v);
|
||||
}else{
|
||||
vv.push(q);
|
||||
}
|
||||
}
|
||||
});
|
||||
_2d(vv);
|
||||
_2a.remainText=false;
|
||||
}
|
||||
}
|
||||
function _2d(vv){
|
||||
if(!_2b.reversed){
|
||||
$(_29).combotreegrid("setValues",vv);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _2f(_30){
|
||||
var _31=$.data(_30,"combotreegrid");
|
||||
var _32=_31.options;
|
||||
var _33=_31.grid;
|
||||
var tr=_32.finder.getTr(_33[0],null,"highlight");
|
||||
_31.remainText=false;
|
||||
if(tr.length){
|
||||
var id=tr.attr("node-id");
|
||||
if(_32.multiple){
|
||||
if(tr.hasClass("datagrid-row-selected")){
|
||||
_33.treegrid("uncheckNode",id);
|
||||
}else{
|
||||
_33.treegrid("checkNode",id);
|
||||
}
|
||||
}else{
|
||||
_33.treegrid("selectRow",id);
|
||||
}
|
||||
}
|
||||
var vv=[];
|
||||
if(_32.multiple){
|
||||
$.map(_33.treegrid("getCheckedNodes"),function(row){
|
||||
vv.push(row[_32.idField]);
|
||||
});
|
||||
}else{
|
||||
var row=_33.treegrid("getSelected");
|
||||
if(row){
|
||||
vv.push(row[_32.idField]);
|
||||
}
|
||||
}
|
||||
$.map(_32.unselectedValues,function(v){
|
||||
if($.easyui.indexOfArray(_32.mappingRows,_32.idField,v)>=0){
|
||||
$.easyui.addArrayItem(vv,v);
|
||||
}
|
||||
});
|
||||
$(_30).combotreegrid("setValues",vv);
|
||||
if(!_32.multiple){
|
||||
$(_30).combotreegrid("hidePanel");
|
||||
}
|
||||
};
|
||||
$.fn.combotreegrid=function(_34,_35){
|
||||
if(typeof _34=="string"){
|
||||
var _36=$.fn.combotreegrid.methods[_34];
|
||||
if(_36){
|
||||
return _36(this,_35);
|
||||
}else{
|
||||
return this.combo(_34,_35);
|
||||
}
|
||||
}
|
||||
_34=_34||{};
|
||||
return this.each(function(){
|
||||
var _37=$.data(this,"combotreegrid");
|
||||
if(_37){
|
||||
$.extend(_37.options,_34);
|
||||
}else{
|
||||
_37=$.data(this,"combotreegrid",{options:$.extend({},$.fn.combotreegrid.defaults,$.fn.combotreegrid.parseOptions(this),_34)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.combotreegrid.methods={options:function(jq){
|
||||
var _38=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combotreegrid").options,{width:_38.width,height:_38.height,originalValue:_38.originalValue,disabled:_38.disabled,readonly:_38.readonly});
|
||||
},grid:function(jq){
|
||||
return $.data(jq[0],"combotreegrid").grid;
|
||||
},setValues:function(jq,_39){
|
||||
return jq.each(function(){
|
||||
var _3a=$(this).combotreegrid("options");
|
||||
if($.isArray(_39)){
|
||||
_39=$.map(_39,function(_3b){
|
||||
if(_3b&&typeof _3b=="object"){
|
||||
$.easyui.addArrayItem(_3a.mappingRows,_3a.idField,_3b);
|
||||
return _3b[_3a.idField];
|
||||
}else{
|
||||
return _3b;
|
||||
}
|
||||
});
|
||||
}
|
||||
_16(this,_39);
|
||||
});
|
||||
},setValue:function(jq,_3c){
|
||||
return jq.each(function(){
|
||||
$(this).combotreegrid("setValues",$.isArray(_3c)?_3c:[_3c]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combotreegrid("setValues",[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _3d=$(this).combotreegrid("options");
|
||||
if(_3d.multiple){
|
||||
$(this).combotreegrid("setValues",_3d.originalValue);
|
||||
}else{
|
||||
$(this).combotreegrid("setValue",_3d.originalValue);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.combotreegrid.parseOptions=function(_3e){
|
||||
var t=$(_3e);
|
||||
return $.extend({},$.fn.combo.parseOptions(_3e),$.fn.treegrid.parseOptions(_3e),$.parser.parseOptions(_3e,["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){
|
||||
_2f(this);
|
||||
},query:function(q,e){
|
||||
_28(this,q);
|
||||
}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var _3f=e.data.target;
|
||||
var _40=$(_3f).combotreegrid("options");
|
||||
if(_40.limitToGrid){
|
||||
_2f(_3f);
|
||||
}
|
||||
}}),filter:function(q,row){
|
||||
var _41=$(this).combotreegrid("options");
|
||||
return (row[_41.treeField]||"").toLowerCase().indexOf(q.toLowerCase())>=0;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
2614
static/jeasyui/plugins/jquery.datagrid.js
Executable file
2614
static/jeasyui/plugins/jquery.datagrid.js
Executable file
File diff suppressed because it is too large
Load Diff
136
static/jeasyui/plugins/jquery.datalist.js
Normal file
136
static/jeasyui/plugins/jquery.datalist.js
Normal file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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<g.groups.length;i++){
|
||||
_d.push(this.renderGroup.call(this,_8,i,g.groups[i],_a));
|
||||
}
|
||||
$(_9).html(_d.join(""));
|
||||
}else{
|
||||
$(_9).html(this.renderTable(_8,0,_b.data.rows,_a));
|
||||
}
|
||||
},renderGroup:function(_e,_f,_10,_11){
|
||||
var _12=$.data(_e,"datagrid");
|
||||
var _13=_12.options;
|
||||
var _14=$(_e).datagrid("getColumnFields",_11);
|
||||
var _15=[];
|
||||
_15.push("<div class=\"datagrid-group\" group-index="+_f+">");
|
||||
if(!_11){
|
||||
_15.push("<span class=\"datagrid-group-title\">");
|
||||
_15.push(_13.groupFormatter.call(_e,_10.value,_10.rows));
|
||||
_15.push("</span>");
|
||||
}
|
||||
_15.push("</div>");
|
||||
_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);
|
||||
|
||||
233
static/jeasyui/plugins/jquery.datebox.js
Executable file
233
static/jeasyui/plugins/jquery.datebox.js
Executable file
@@ -0,0 +1,233 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"datebox");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("datebox-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
_5(this);
|
||||
_6(this);
|
||||
_7(this);
|
||||
_18(this,$(this).datebox("getText"),true);
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
if(!_3.calendar){
|
||||
var _8=$(_2).combo("panel").css("overflow","hidden");
|
||||
_8.panel("options").onBeforeDestroy=function(){
|
||||
var c=$(this).find(".calendar-shared");
|
||||
if(c.length){
|
||||
c.insertBefore(c[0].pholder);
|
||||
}
|
||||
};
|
||||
var cc=$("<div class=\"datebox-calendar-inner\"></div>").prependTo(_8);
|
||||
if(_4.sharedCalendar){
|
||||
var c=$(_4.sharedCalendar);
|
||||
if(!c[0].pholder){
|
||||
c[0].pholder=$("<div class=\"calendar-pholder\" style=\"display:none\"></div>").insertAfter(c);
|
||||
}
|
||||
c.addClass("calendar-shared").appendTo(cc);
|
||||
if(!c.hasClass("calendar")){
|
||||
c.calendar();
|
||||
}
|
||||
_3.calendar=c;
|
||||
}else{
|
||||
_3.calendar=$("<div></div>").appendTo(cc).calendar();
|
||||
}
|
||||
$.extend(_3.calendar.calendar("options"),{fit:true,border:false,onSelect:function(_9){
|
||||
var _a=this.target;
|
||||
var _b=$(_a).datebox("options");
|
||||
_b.onSelect.call(_a,_9);
|
||||
_18(_a,_b.formatter.call(_a,_9));
|
||||
$(_a).combo("hidePanel");
|
||||
}});
|
||||
}
|
||||
$(_2).combo("textbox").parent().addClass("datebox");
|
||||
$(_2).datebox("initValue",_4.value);
|
||||
function _5(_c){
|
||||
var _d=$(_c).datebox("options");
|
||||
var _e=$(_c).combo("panel");
|
||||
_e._unbind(".datebox")._bind("click.datebox",function(e){
|
||||
if($(e.target).hasClass("datebox-button-a")){
|
||||
var _f=parseInt($(e.target).attr("datebox-button-index"));
|
||||
_d.buttons[_f].handler.call(e.target,_c);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _6(_10){
|
||||
var _11=$(_10).combo("panel");
|
||||
if(_11.children("div.datebox-button").length){
|
||||
return;
|
||||
}
|
||||
var _12=$("<div class=\"datebox-button\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%\"><tr></tr></table></div>").appendTo(_11);
|
||||
var tr=_12.find("tr");
|
||||
for(var i=0;i<_4.buttons.length;i++){
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var btn=_4.buttons[i];
|
||||
var t=$("<a class=\"datebox-button-a\" href=\"javascript:;\"></a>").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)+"%");
|
||||
};
|
||||
function _7(_13){
|
||||
var _14=$(_13).combo("panel");
|
||||
var cc=_14.children("div.datebox-calendar-inner");
|
||||
_14.children()._outerWidth(_14.width());
|
||||
_3.calendar.appendTo(cc);
|
||||
_3.calendar[0].target=_13;
|
||||
if(_4.panelHeight!="auto"){
|
||||
var _15=_14.height();
|
||||
_14.children().not(cc).each(function(){
|
||||
_15-=$(this).outerHeight();
|
||||
});
|
||||
cc._outerHeight(_15);
|
||||
}
|
||||
_3.calendar.calendar("resize");
|
||||
};
|
||||
};
|
||||
function _16(_17,q){
|
||||
_18(_17,q,true);
|
||||
};
|
||||
function _19(_1a){
|
||||
var _1b=$.data(_1a,"datebox");
|
||||
var _1c=_1b.options;
|
||||
var _1d=_1b.calendar.calendar("options").current;
|
||||
if(_1d){
|
||||
_18(_1a,_1c.formatter.call(_1a,_1d));
|
||||
$(_1a).combo("hidePanel");
|
||||
}
|
||||
};
|
||||
function _18(_1e,_1f,_20){
|
||||
var _21=$.data(_1e,"datebox");
|
||||
var _22=_21.options;
|
||||
var _23=_21.calendar;
|
||||
_23.calendar("moveTo",_22.parser.call(_1e,_1f));
|
||||
if(_20){
|
||||
$(_1e).combo("setValue",_1f);
|
||||
}else{
|
||||
if(_1f){
|
||||
_1f=_22.formatter.call(_1e,_23.calendar("options").current);
|
||||
}
|
||||
$(_1e).combo("setText",_1f).combo("setValue",_1f);
|
||||
}
|
||||
};
|
||||
$.fn.datebox=function(_24,_25){
|
||||
if(typeof _24=="string"){
|
||||
var _26=$.fn.datebox.methods[_24];
|
||||
if(_26){
|
||||
return _26(this,_25);
|
||||
}else{
|
||||
return this.combo(_24,_25);
|
||||
}
|
||||
}
|
||||
_24=_24||{};
|
||||
return this.each(function(){
|
||||
var _27=$.data(this,"datebox");
|
||||
if(_27){
|
||||
$.extend(_27.options,_24);
|
||||
}else{
|
||||
$.data(this,"datebox",{options:$.extend({},$.fn.datebox.defaults,$.fn.datebox.parseOptions(this),_24)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.datebox.methods={options:function(jq){
|
||||
var _28=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"datebox").options,{width:_28.width,height:_28.height,originalValue:_28.originalValue,disabled:_28.disabled,readonly:_28.readonly});
|
||||
},cloneFrom:function(jq,_29){
|
||||
return jq.each(function(){
|
||||
$(this).combo("cloneFrom",_29);
|
||||
$.data(this,"datebox",{options:$.extend(true,{},$(_29).datebox("options")),calendar:$(_29).datebox("calendar")});
|
||||
$(this).addClass("datebox-f");
|
||||
});
|
||||
},calendar:function(jq){
|
||||
return $.data(jq[0],"datebox").calendar;
|
||||
},initValue:function(jq,_2a){
|
||||
return jq.each(function(){
|
||||
var _2b=$(this).datebox("options");
|
||||
var _2c=_2b.value;
|
||||
if(_2c){
|
||||
var _2d=_2b.parser.call(this,_2c);
|
||||
_2c=_2b.formatter.call(this,_2d);
|
||||
$(this).datebox("calendar").calendar("moveTo",_2d);
|
||||
}
|
||||
$(this).combo("initValue",_2c).combo("setText",_2c);
|
||||
});
|
||||
},setValue:function(jq,_2e){
|
||||
return jq.each(function(){
|
||||
_18(this,_2e);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _2f=$(this).datebox("options");
|
||||
$(this).datebox("setValue",_2f.originalValue);
|
||||
});
|
||||
},setDate:function(jq,_30){
|
||||
return jq.each(function(){
|
||||
var _31=$(this).datebox("options");
|
||||
$(this).datebox("calendar").calendar("moveTo",_30);
|
||||
_18(this,_30?_31.formatter.call(this,_30):"");
|
||||
});
|
||||
},getDate:function(jq){
|
||||
if(jq.datebox("getValue")){
|
||||
return jq.datebox("calendar").calendar("options").current;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}};
|
||||
$.fn.datebox.parseOptions=function(_32){
|
||||
return $.extend({},$.fn.combo.parseOptions(_32),$.parser.parseOptions(_32,["sharedCalendar"]));
|
||||
};
|
||||
$.fn.datebox.defaults=$.extend({},$.fn.combo.defaults,{panelWidth:250,panelHeight:"auto",sharedCalendar:null,keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_19(this);
|
||||
},query:function(q,e){
|
||||
_16(this,q);
|
||||
}},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_33){
|
||||
return $(_33).datebox("options").currentText;
|
||||
},handler:function(_34){
|
||||
var _35=$(_34).datebox("options");
|
||||
var now=new Date();
|
||||
var _36=new Date(now.getFullYear(),now.getMonth(),now.getDate());
|
||||
$(_34).datebox("calendar").calendar({year:_36.getFullYear(),month:_36.getMonth()+1,current:_36});
|
||||
_35.onSelect.call(_34,_36);
|
||||
_19(_34);
|
||||
}},{text:function(_37){
|
||||
return $(_37).datebox("options").closeText;
|
||||
},handler:function(_38){
|
||||
$(this).closest("div.combo-panel").panel("close");
|
||||
}}],formatter:function(_39){
|
||||
var y=_39.getFullYear();
|
||||
var m=_39.getMonth()+1;
|
||||
var d=_39.getDate();
|
||||
return (m<10?("0"+m):m)+"/"+(d<10?("0"+d):d)+"/"+y;
|
||||
},parser:function(s){
|
||||
var _3a=$.fn.calendar.defaults.Date;
|
||||
if($(this).data("datebox")){
|
||||
_3a=$(this).datebox("calendar").calendar("options").Date;
|
||||
}
|
||||
if(!s){
|
||||
return new _3a();
|
||||
}
|
||||
var ss=s.split("/");
|
||||
var m=parseInt(ss[0],10);
|
||||
var d=parseInt(ss[1],10);
|
||||
var y=parseInt(ss[2],10);
|
||||
if(!isNaN(y)&&!isNaN(m)&&!isNaN(d)){
|
||||
return new _3a(y,m-1,d);
|
||||
}else{
|
||||
return new _3a();
|
||||
}
|
||||
},onSelect:function(_3b){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
182
static/jeasyui/plugins/jquery.datetimebox.js
Executable file
182
static/jeasyui/plugins/jquery.datetimebox.js
Executable file
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"datetimebox");
|
||||
var _4=_3.options;
|
||||
$(_2).datebox($.extend({},_4,{onShowPanel:function(){
|
||||
var _5=$(this).datetimebox("getValue");
|
||||
_d(this,_5,true);
|
||||
_4.onShowPanel.call(this);
|
||||
},formatter:$.fn.datebox.defaults.formatter,parser:$.fn.datebox.defaults.parser}));
|
||||
$(_2).removeClass("datebox-f").addClass("datetimebox-f");
|
||||
$(_2).datebox("calendar").calendar({onSelect:function(_6){
|
||||
_4.onSelect.call(this.target,_6);
|
||||
}});
|
||||
if(!_3.spinner){
|
||||
var _7=$(_2).datebox("panel");
|
||||
var p=$("<div style=\"padding:2px\"><input></div>").insertAfter(_7.children("div.datebox-calendar-inner"));
|
||||
_3.spinner=p.children("input");
|
||||
}
|
||||
_3.spinner.timespinner({width:_4.spinnerWidth,showSeconds:_4.showSeconds,separator:_4.timeSeparator,hour12:_4.hour12});
|
||||
$(_2).datetimebox("initValue",_4.value);
|
||||
};
|
||||
function _8(_9){
|
||||
var c=$(_9).datetimebox("calendar");
|
||||
var t=$(_9).datetimebox("spinner");
|
||||
var _a=c.calendar("options").current;
|
||||
return new Date(_a.getFullYear(),_a.getMonth(),_a.getDate(),t.timespinner("getHours"),t.timespinner("getMinutes"),t.timespinner("getSeconds"));
|
||||
};
|
||||
function _b(_c,q){
|
||||
_d(_c,q,true);
|
||||
};
|
||||
function _e(_f){
|
||||
var _10=$.data(_f,"datetimebox").options;
|
||||
var _11=_8(_f);
|
||||
_d(_f,_10.formatter.call(_f,_11));
|
||||
$(_f).combo("hidePanel");
|
||||
};
|
||||
function _d(_12,_13,_14){
|
||||
var _15=$.data(_12,"datetimebox").options;
|
||||
$(_12).combo("setValue",_13);
|
||||
if(!_14){
|
||||
if(_13){
|
||||
var _16=_15.parser.call(_12,_13);
|
||||
$(_12).combo("setText",_15.formatter.call(_12,_16));
|
||||
$(_12).combo("setValue",_15.formatter.call(_12,_16));
|
||||
}else{
|
||||
$(_12).combo("setText",_13);
|
||||
}
|
||||
}
|
||||
var _16=_15.parser.call(_12,_13);
|
||||
$(_12).datetimebox("calendar").calendar("moveTo",_16);
|
||||
$(_12).datetimebox("spinner").timespinner("setValue",_17(_16));
|
||||
function _17(_18){
|
||||
function _19(_1a){
|
||||
return (_1a<10?"0":"")+_1a;
|
||||
};
|
||||
var tt=[_19(_18.getHours()),_19(_18.getMinutes())];
|
||||
if(_15.showSeconds){
|
||||
tt.push(_19(_18.getSeconds()));
|
||||
}
|
||||
return tt.join($(_12).datetimebox("spinner").timespinner("options").separator);
|
||||
};
|
||||
};
|
||||
$.fn.datetimebox=function(_1b,_1c){
|
||||
if(typeof _1b=="string"){
|
||||
var _1d=$.fn.datetimebox.methods[_1b];
|
||||
if(_1d){
|
||||
return _1d(this,_1c);
|
||||
}else{
|
||||
return this.datebox(_1b,_1c);
|
||||
}
|
||||
}
|
||||
_1b=_1b||{};
|
||||
return this.each(function(){
|
||||
var _1e=$.data(this,"datetimebox");
|
||||
if(_1e){
|
||||
$.extend(_1e.options,_1b);
|
||||
}else{
|
||||
$.data(this,"datetimebox",{options:$.extend({},$.fn.datetimebox.defaults,$.fn.datetimebox.parseOptions(this),_1b)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.datetimebox.methods={options:function(jq){
|
||||
var _1f=jq.datebox("options");
|
||||
return $.extend($.data(jq[0],"datetimebox").options,{originalValue:_1f.originalValue,disabled:_1f.disabled,readonly:_1f.readonly});
|
||||
},cloneFrom:function(jq,_20){
|
||||
return jq.each(function(){
|
||||
$(this).datebox("cloneFrom",_20);
|
||||
$.data(this,"datetimebox",{options:$.extend(true,{},$(_20).datetimebox("options")),spinner:$(_20).datetimebox("spinner")});
|
||||
$(this).removeClass("datebox-f").addClass("datetimebox-f");
|
||||
});
|
||||
},spinner:function(jq){
|
||||
return $.data(jq[0],"datetimebox").spinner;
|
||||
},initValue:function(jq,_21){
|
||||
return jq.each(function(){
|
||||
var _22=$(this).datetimebox("options");
|
||||
var _23=_22.value;
|
||||
if(_23){
|
||||
var _24=_22.parser.call(this,_23);
|
||||
_23=_22.formatter.call(this,_24);
|
||||
$(this).datetimebox("calendar").calendar("moveTo",_24);
|
||||
}
|
||||
$(this).combo("initValue",_23).combo("setText",_23);
|
||||
});
|
||||
},setValue:function(jq,_25){
|
||||
return jq.each(function(){
|
||||
_d(this,_25);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _26=$(this).datetimebox("options");
|
||||
$(this).datetimebox("setValue",_26.originalValue);
|
||||
});
|
||||
},setDate:function(jq,_27){
|
||||
return jq.each(function(){
|
||||
var _28=$(this).datetimebox("options");
|
||||
$(this).datetimebox("calendar").calendar("moveTo",_27);
|
||||
_d(this,_27?_28.formatter.call(this,_27):"");
|
||||
});
|
||||
},getDate:function(jq){
|
||||
if(jq.datetimebox("getValue")){
|
||||
return jq.datetimebox("calendar").calendar("options").current;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}};
|
||||
$.fn.datetimebox.parseOptions=function(_29){
|
||||
var t=$(_29);
|
||||
return $.extend({},$.fn.datebox.parseOptions(_29),$.parser.parseOptions(_29,["timeSeparator","spinnerWidth",{showSeconds:"boolean"}]));
|
||||
};
|
||||
$.fn.datetimebox.defaults=$.extend({},$.fn.datebox.defaults,{spinnerWidth:"100%",showSeconds:true,timeSeparator:":",hour12:false,panelEvents:{mousedown:function(e){
|
||||
}},keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_e(this);
|
||||
},query:function(q,e){
|
||||
_b(this,q);
|
||||
}},buttons:[{text:function(_2a){
|
||||
return $(_2a).datetimebox("options").currentText;
|
||||
},handler:function(_2b){
|
||||
var _2c=$(_2b).datetimebox("options");
|
||||
_d(_2b,_2c.formatter.call(_2b,new Date()));
|
||||
$(_2b).datetimebox("hidePanel");
|
||||
}},{text:function(_2d){
|
||||
return $(_2d).datetimebox("options").okText;
|
||||
},handler:function(_2e){
|
||||
_e(_2e);
|
||||
}},{text:function(_2f){
|
||||
return $(_2f).datetimebox("options").closeText;
|
||||
},handler:function(_30){
|
||||
$(_30).datetimebox("hidePanel");
|
||||
}}],formatter:function(_31){
|
||||
if(!_31){
|
||||
return "";
|
||||
}
|
||||
return $.fn.datebox.defaults.formatter.call(this,_31)+" "+$.fn.timespinner.defaults.formatter.call($(this).datetimebox("spinner")[0],_31);
|
||||
},parser:function(s){
|
||||
s=$.trim(s);
|
||||
if(!s){
|
||||
return new Date();
|
||||
}
|
||||
var dt=s.split(" ");
|
||||
var _32=$.fn.datebox.defaults.parser.call(this,dt[0]);
|
||||
if(dt.length<2){
|
||||
return _32;
|
||||
}
|
||||
var _33=$.fn.timespinner.defaults.parser.call($(this).datetimebox("spinner")[0],dt[1]+(dt[2]?" "+dt[2]:""));
|
||||
return new Date(_32.getFullYear(),_32.getMonth(),_32.getDate(),_33.getHours(),_33.getMinutes(),_33.getSeconds());
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
61
static/jeasyui/plugins/jquery.datetimespinner.js
Normal file
61
static/jeasyui/plugins/jquery.datetimespinner.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"datetimespinner").options;
|
||||
$(_2).addClass("datetimespinner-f").timespinner(_3);
|
||||
};
|
||||
$.fn.datetimespinner=function(_4,_5){
|
||||
if(typeof _4=="string"){
|
||||
var _6=$.fn.datetimespinner.methods[_4];
|
||||
if(_6){
|
||||
return _6(this,_5);
|
||||
}else{
|
||||
return this.timespinner(_4,_5);
|
||||
}
|
||||
}
|
||||
_4=_4||{};
|
||||
return this.each(function(){
|
||||
var _7=$.data(this,"datetimespinner");
|
||||
if(_7){
|
||||
$.extend(_7.options,_4);
|
||||
}else{
|
||||
$.data(this,"datetimespinner",{options:$.extend({},$.fn.datetimespinner.defaults,$.fn.datetimespinner.parseOptions(this),_4)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.datetimespinner.methods={options:function(jq){
|
||||
var _8=jq.timespinner("options");
|
||||
return $.extend($.data(jq[0],"datetimespinner").options,{width:_8.width,value:_8.value,originalValue:_8.originalValue,disabled:_8.disabled,readonly:_8.readonly});
|
||||
}};
|
||||
$.fn.datetimespinner.parseOptions=function(_9){
|
||||
return $.extend({},$.fn.timespinner.parseOptions(_9),$.parser.parseOptions(_9,[]));
|
||||
};
|
||||
$.fn.datetimespinner.defaults=$.extend({},$.fn.timespinner.defaults,{formatter:function(_a){
|
||||
if(!_a){
|
||||
return "";
|
||||
}
|
||||
return $.fn.datebox.defaults.formatter.call(this,_a)+" "+$.fn.timespinner.defaults.formatter.call(this,_a);
|
||||
},parser:function(s){
|
||||
s=$.trim(s);
|
||||
if(!s){
|
||||
return null;
|
||||
}
|
||||
var dt=s.split(" ");
|
||||
var _b=$.fn.datebox.defaults.parser.call(this,dt[0]);
|
||||
if(dt.length<2){
|
||||
return _b;
|
||||
}
|
||||
var _c=$.fn.timespinner.defaults.parser.call(this,dt[1]+(dt[2]?" "+dt[2]:""));
|
||||
return new Date(_b.getFullYear(),_b.getMonth(),_b.getDate(),_c.getHours(),_c.getMinutes(),_c.getSeconds());
|
||||
},selections:[[0,2],[3,5],[6,10],[11,13],[14,16],[17,19],[20,22]]});
|
||||
})(jQuery);
|
||||
|
||||
136
static/jeasyui/plugins/jquery.dialog.js
Executable file
136
static/jeasyui/plugins/jquery.dialog.js
Executable file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"dialog").options;
|
||||
_3.inited=false;
|
||||
$(_2).window($.extend({},_3,{onResize:function(w,h){
|
||||
if(_3.inited){
|
||||
_b(this);
|
||||
_3.onResize.call(this,w,h);
|
||||
}
|
||||
}}));
|
||||
var _4=$(_2).window("window");
|
||||
if(_3.toolbar){
|
||||
if($.isArray(_3.toolbar)){
|
||||
$(_2).siblings("div.dialog-toolbar").remove();
|
||||
var _5=$("<div class=\"dialog-toolbar\"><table cellspacing=\"0\" cellpadding=\"0\"><tr></tr></table></div>").appendTo(_4);
|
||||
var tr=_5.find("tr");
|
||||
for(var i=0;i<_3.toolbar.length;i++){
|
||||
var _6=_3.toolbar[i];
|
||||
if(_6=="-"){
|
||||
$("<td><div class=\"dialog-tool-separator\"></div></td>").appendTo(tr);
|
||||
}else{
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var _7=$("<a href=\"javascript:;\"></a>").appendTo(td);
|
||||
_7[0].onclick=eval(_6.handler||function(){
|
||||
});
|
||||
_7.linkbutton($.extend({},_6,{plain:true}));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(_3.toolbar).addClass("dialog-toolbar").appendTo(_4);
|
||||
$(_3.toolbar).show();
|
||||
}
|
||||
}else{
|
||||
$(_2).siblings("div.dialog-toolbar").remove();
|
||||
}
|
||||
if(_3.buttons){
|
||||
if($.isArray(_3.buttons)){
|
||||
$(_2).siblings("div.dialog-button").remove();
|
||||
var _8=$("<div class=\"dialog-button\"></div>").appendTo(_4);
|
||||
for(var i=0;i<_3.buttons.length;i++){
|
||||
var p=_3.buttons[i];
|
||||
var _9=$("<a href=\"javascript:;\"></a>").appendTo(_8);
|
||||
if(p.handler){
|
||||
_9[0].onclick=p.handler;
|
||||
}
|
||||
_9.linkbutton(p);
|
||||
}
|
||||
}else{
|
||||
$(_3.buttons).addClass("dialog-button").appendTo(_4);
|
||||
$(_3.buttons).show();
|
||||
}
|
||||
}else{
|
||||
$(_2).siblings("div.dialog-button").remove();
|
||||
}
|
||||
_3.inited=true;
|
||||
var _a=_3.closed;
|
||||
_4.show();
|
||||
$(_2).window("resize",{});
|
||||
if(_a){
|
||||
_4.hide();
|
||||
}
|
||||
};
|
||||
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(_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");
|
||||
_13.css({width:cc._outerWidth(),height:cc._outerHeight()});
|
||||
}
|
||||
};
|
||||
$.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(_14,_15);
|
||||
}
|
||||
}
|
||||
_14=_14||{};
|
||||
return this.each(function(){
|
||||
var _17=$.data(this,"dialog");
|
||||
if(_17){
|
||||
$.extend(_17.options,_14);
|
||||
}else{
|
||||
$.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_14)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.dialog.methods={options:function(jq){
|
||||
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(_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);
|
||||
|
||||
306
static/jeasyui/plugins/jquery.draggable.js
Executable file
306
static/jeasyui/plugins/jquery.draggable.js
Executable file
@@ -0,0 +1,306 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(e){
|
||||
var _2=$.data(e.data.target,"draggable");
|
||||
var _3=_2.options;
|
||||
var _4=_2.proxy;
|
||||
var _5=e.data;
|
||||
var _6=_5.startLeft+e.pageX-_5.startX;
|
||||
var _7=_5.startTop+e.pageY-_5.startY;
|
||||
if(_4){
|
||||
if(_4.parent()[0]==document.body){
|
||||
if(_3.deltaX!=null&&_3.deltaX!=undefined){
|
||||
_6=e.pageX+_3.deltaX;
|
||||
}else{
|
||||
_6=e.pageX-e.data.offsetWidth;
|
||||
}
|
||||
if(_3.deltaY!=null&&_3.deltaY!=undefined){
|
||||
_7=e.pageY+_3.deltaY;
|
||||
}else{
|
||||
_7=e.pageY-e.data.offsetHeight;
|
||||
}
|
||||
}else{
|
||||
if(_3.deltaX!=null&&_3.deltaX!=undefined){
|
||||
_6+=e.data.offsetWidth+_3.deltaX;
|
||||
}
|
||||
if(_3.deltaY!=null&&_3.deltaY!=undefined){
|
||||
_7+=e.data.offsetHeight+_3.deltaY;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(e.data.parent!=document.body){
|
||||
_6+=$(e.data.parent).scrollLeft();
|
||||
_7+=$(e.data.parent).scrollTop();
|
||||
}
|
||||
if(_3.axis=="h"){
|
||||
_5.left=_6;
|
||||
}else{
|
||||
if(_3.axis=="v"){
|
||||
_5.top=_7;
|
||||
}else{
|
||||
_5.left=_6;
|
||||
_5.top=_7;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _8(e){
|
||||
var _9=$.data(e.data.target,"draggable");
|
||||
var _a=_9.options;
|
||||
var _b=_9.proxy;
|
||||
if(!_b){
|
||||
_b=$(e.data.target);
|
||||
}
|
||||
_b.css({left:e.data.left,top:e.data.top});
|
||||
$("body").css("cursor",_a.cursor);
|
||||
};
|
||||
function _c(e){
|
||||
if(!$.fn.draggable.isDragging){
|
||||
return false;
|
||||
}
|
||||
var _d=$.data(e.data.target,"draggable");
|
||||
var _e=_d.options;
|
||||
var _f=$(".droppable:visible").filter(function(){
|
||||
return e.data.target!=this;
|
||||
}).filter(function(){
|
||||
var _10=$.data(this,"droppable").options.accept;
|
||||
if(_10){
|
||||
return $(_10).filter(function(){
|
||||
return this==e.data.target;
|
||||
}).length>0;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
});
|
||||
_d.droppables=_f;
|
||||
var _11=_d.proxy;
|
||||
if(!_11){
|
||||
if(_e.proxy){
|
||||
if(_e.proxy=="clone"){
|
||||
_11=$(e.data.target).clone().insertAfter(e.data.target);
|
||||
}else{
|
||||
_11=_e.proxy.call(e.data.target,e.data.target);
|
||||
}
|
||||
_d.proxy=_11;
|
||||
}else{
|
||||
_11=$(e.data.target);
|
||||
}
|
||||
}
|
||||
_11.css("position","absolute");
|
||||
_1(e);
|
||||
_8(e);
|
||||
_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){
|
||||
_8(e);
|
||||
}
|
||||
var _14=e.data.target;
|
||||
_13.droppables.each(function(){
|
||||
var _15=$(this);
|
||||
if(_15.droppable("options").disabled){
|
||||
return;
|
||||
}
|
||||
var p2=_15.offset();
|
||||
if(e.pageX>p2.left&&e.pageX<p2.left+_15.outerWidth()&&e.pageY>p2.top&&e.pageY<p2.top+_15.outerHeight()){
|
||||
if(!this.entered){
|
||||
$(this).trigger("_dragenter",[_14]);
|
||||
this.entered=true;
|
||||
}
|
||||
$(this).trigger("_dragover",[_14]);
|
||||
}else{
|
||||
if(this.entered){
|
||||
$(this).trigger("_dragleave",[_14]);
|
||||
this.entered=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
function _16(e){
|
||||
if(!$.fn.draggable.isDragging){
|
||||
_17();
|
||||
return false;
|
||||
}
|
||||
_12(e);
|
||||
var _18=$.data(e.data.target,"draggable");
|
||||
var _19=_18.proxy;
|
||||
var _1a=_18.options;
|
||||
_1a.onEndDrag.call(e.data.target,e);
|
||||
if(_1a.revert){
|
||||
if(_1b()==true){
|
||||
$(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop});
|
||||
}else{
|
||||
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{
|
||||
_1c=e.data.startLeft;
|
||||
top=e.data.startTop;
|
||||
}
|
||||
_19.animate({left:_1c,top:top},function(){
|
||||
_1d();
|
||||
});
|
||||
}else{
|
||||
$(e.data.target).animate({left:e.data.startLeft,top:e.data.startTop},function(){
|
||||
$(e.data.target).css("position",e.data.startPosition);
|
||||
});
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(e.data.target).css({position:"absolute",left:e.data.left,top:e.data.top});
|
||||
_1b();
|
||||
}
|
||||
_1a.onStopDrag.call(e.data.target,e);
|
||||
_17();
|
||||
function _1d(){
|
||||
if(_19){
|
||||
_19.remove();
|
||||
}
|
||||
_18.proxy=null;
|
||||
};
|
||||
function _1b(){
|
||||
var _1e=false;
|
||||
_18.droppables.each(function(){
|
||||
var _1f=$(this);
|
||||
if(_1f.droppable("options").disabled){
|
||||
return;
|
||||
}
|
||||
var p2=_1f.offset();
|
||||
if(e.pageX>p2.left&&e.pageX<p2.left+_1f.outerWidth()&&e.pageY>p2.top&&e.pageY<p2.top+_1f.outerHeight()){
|
||||
if(_1a.revert){
|
||||
$(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop});
|
||||
}
|
||||
$(this).triggerHandler("_drop",[e.data.target]);
|
||||
_1d();
|
||||
_1e=true;
|
||||
this.entered=false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(!_1e&&!_1a.revert){
|
||||
_1d();
|
||||
}
|
||||
return _1e;
|
||||
};
|
||||
return false;
|
||||
};
|
||||
function _17(){
|
||||
if($.fn.draggable.timer){
|
||||
clearTimeout($.fn.draggable.timer);
|
||||
$.fn.draggable.timer=undefined;
|
||||
}
|
||||
$(document)._unbind(".draggable");
|
||||
$.fn.draggable.isDragging=false;
|
||||
setTimeout(function(){
|
||||
$("body").css("cursor","");
|
||||
},100);
|
||||
};
|
||||
$.fn.draggable=function(_20,_21){
|
||||
if(typeof _20=="string"){
|
||||
return $.fn.draggable.methods[_20](this,_21);
|
||||
}
|
||||
return this.each(function(){
|
||||
var _22;
|
||||
var _23=$.data(this,"draggable");
|
||||
if(_23){
|
||||
_23.handle._unbind(".draggable");
|
||||
_22=$.extend(_23.options,_20);
|
||||
}else{
|
||||
_22=$.extend({},$.fn.draggable.defaults,$.fn.draggable.parseOptions(this),_20||{});
|
||||
}
|
||||
var _24=_22.handle?(typeof _22.handle=="string"?$(_22.handle,this):_22.handle):$(this);
|
||||
$.data(this,"draggable",{options:_22,handle:_24});
|
||||
if(_22.disabled){
|
||||
$(this).css("cursor","");
|
||||
return;
|
||||
}
|
||||
_24._unbind(".draggable")._bind("mousemove.draggable",{target:this},function(e){
|
||||
if($.fn.draggable.isDragging){
|
||||
return;
|
||||
}
|
||||
var _25=$.data(e.data.target,"draggable").options;
|
||||
if(_26(e)){
|
||||
$(this).css("cursor",_25.cursor);
|
||||
}else{
|
||||
$(this).css("cursor","");
|
||||
}
|
||||
})._bind("mouseleave.draggable",{target:this},function(e){
|
||||
$(this).css("cursor","");
|
||||
})._bind("mousedown.draggable",{target:this},function(e){
|
||||
if(_26(e)==false){
|
||||
return;
|
||||
}
|
||||
$(this).css("cursor","");
|
||||
var _27=$(e.data.target).position();
|
||||
var _28=$(e.data.target).offset();
|
||||
var _29={startPosition:$(e.data.target).css("position"),startLeft:_27.left,startTop:_27.top,left:_27.left,top:_27.top,startX:e.pageX,startY:e.pageY,width:$(e.data.target).outerWidth(),height:$(e.data.target).outerHeight(),offsetWidth:(e.pageX-_28.left),offsetHeight:(e.pageY-_28.top),target:e.data.target,parent:$(e.data.target).parent()[0]};
|
||||
$.extend(e.data,_29);
|
||||
var _2a=$.data(e.data.target,"draggable").options;
|
||||
if(_2a.onBeforeDrag.call(e.data.target,e)==false){
|
||||
return;
|
||||
}
|
||||
$(document)._bind("mousedown.draggable",e.data,_c);
|
||||
$(document)._bind("mousemove.draggable",e.data,_12);
|
||||
$(document)._bind("mouseup.draggable",e.data,_16);
|
||||
$.fn.draggable.timer=setTimeout(function(){
|
||||
$.fn.draggable.isDragging=true;
|
||||
_c(e);
|
||||
},_2a.delay);
|
||||
return false;
|
||||
});
|
||||
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;
|
||||
};
|
||||
});
|
||||
};
|
||||
$.fn.draggable.methods={options:function(jq){
|
||||
return $.data(jq[0],"draggable").options;
|
||||
},proxy:function(jq){
|
||||
return $.data(jq[0],"draggable").proxy;
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).draggable({disabled:false});
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).draggable({disabled:true});
|
||||
});
|
||||
}};
|
||||
$.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,delay:100,onBeforeDrag:function(e){
|
||||
},onStartDrag:function(e){
|
||||
},onDrag:function(e){
|
||||
},onEndDrag:function(e){
|
||||
},onStopDrag:function(e){
|
||||
}};
|
||||
$.fn.draggable.isDragging=false;
|
||||
})(jQuery);
|
||||
|
||||
62
static/jeasyui/plugins/jquery.droppable.js
Executable file
62
static/jeasyui/plugins/jquery.droppable.js
Executable file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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){
|
||||
$(_2).addClass("droppable");
|
||||
$(_2)._bind("_dragenter",function(e,_3){
|
||||
$.data(_2,"droppable").options.onDragEnter.apply(_2,[e,_3]);
|
||||
});
|
||||
$(_2)._bind("_dragleave",function(e,_4){
|
||||
$.data(_2,"droppable").options.onDragLeave.apply(_2,[e,_4]);
|
||||
});
|
||||
$(_2)._bind("_dragover",function(e,_5){
|
||||
$.data(_2,"droppable").options.onDragOver.apply(_2,[e,_5]);
|
||||
});
|
||||
$(_2)._bind("_drop",function(e,_6){
|
||||
$.data(_2,"droppable").options.onDrop.apply(_2,[e,_6]);
|
||||
});
|
||||
};
|
||||
$.fn.droppable=function(_7,_8){
|
||||
if(typeof _7=="string"){
|
||||
return $.fn.droppable.methods[_7](this,_8);
|
||||
}
|
||||
_7=_7||{};
|
||||
return this.each(function(){
|
||||
var _9=$.data(this,"droppable");
|
||||
if(_9){
|
||||
$.extend(_9.options,_7);
|
||||
}else{
|
||||
_1(this);
|
||||
$.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,$.fn.droppable.parseOptions(this),_7)});
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.droppable.methods={options:function(jq){
|
||||
return $.data(jq[0],"droppable").options;
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).droppable({disabled:false});
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).droppable({disabled:true});
|
||||
});
|
||||
}};
|
||||
$.fn.droppable.parseOptions=function(_a){
|
||||
var t=$(_a);
|
||||
return $.extend({},$.parser.parseOptions(_a,["accept"]),{disabled:(t.attr("disabled")?true:undefined)});
|
||||
};
|
||||
$.fn.droppable.defaults={accept:null,disabled:false,onDragEnter:function(e,_b){
|
||||
},onDragOver:function(e,_c){
|
||||
},onDragLeave:function(e,_d){
|
||||
},onDrop:function(e,_e){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
100
static/jeasyui/plugins/jquery.filebox.js
Normal file
100
static/jeasyui/plugins/jquery.filebox.js
Normal file
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=0;
|
||||
function _2(_3){
|
||||
var _4=$.data(_3,"filebox");
|
||||
var _5=_4.options;
|
||||
_5.fileboxId="filebox_file_id_"+(++_1);
|
||||
$(_3).addClass("filebox-f").textbox(_5);
|
||||
$(_3).textbox("textbox").attr("readonly","readonly");
|
||||
_4.filebox=$(_3).next().addClass("filebox");
|
||||
var _6=_7(_3);
|
||||
var _8=$(_3).filebox("button");
|
||||
if(_8.length){
|
||||
$("<label class=\"filebox-label\" for=\""+_5.fileboxId+"\"></label>").appendTo(_8);
|
||||
if(_8.linkbutton("options").disabled){
|
||||
_6._propAttr("disabled",true);
|
||||
}else{
|
||||
_6._propAttr("disabled",false);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _7(_9){
|
||||
var _a=$.data(_9,"filebox");
|
||||
var _b=_a.options;
|
||||
_a.filebox.find(".textbox-value").remove();
|
||||
_b.oldValue="";
|
||||
var _c=$("<input type=\"file\" class=\"textbox-value\">").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(_f,_10);
|
||||
}
|
||||
}
|
||||
_f=_f||{};
|
||||
return this.each(function(){
|
||||
var _12=$.data(this,"filebox");
|
||||
if(_12){
|
||||
$.extend(_12.options,_f);
|
||||
}else{
|
||||
$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_f)});
|
||||
}
|
||||
_2(this);
|
||||
});
|
||||
};
|
||||
$.fn.filebox.methods={options:function(jq){
|
||||
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;
|
||||
},files:function(jq){
|
||||
return jq.next().find(".textbox-value")[0].files;
|
||||
}};
|
||||
$.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:{},accept:"",capture:"",separator:",",multiple:false});
|
||||
})(jQuery);
|
||||
|
||||
414
static/jeasyui/plugins/jquery.form.js
Executable file
414
static/jeasyui/plugins/jquery.form.js
Executable file
@@ -0,0 +1,414 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,_3){
|
||||
var _4=$.data(_2,"form").options;
|
||||
$.extend(_4,_3||{});
|
||||
var _5=$.extend({},_4.queryParams);
|
||||
if(_4.onSubmit.call(_2,_5)==false){
|
||||
return;
|
||||
}
|
||||
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._propAttr("disabled",true);
|
||||
}
|
||||
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._propAttr("disabled",false);
|
||||
}
|
||||
};
|
||||
function _8(_a,_b){
|
||||
var _c=$.data(_a,"form").options;
|
||||
var _d="easyui_frame_"+(new Date().getTime());
|
||||
var _e=$("<iframe id="+_d+" name="+_d+"></iframe>").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 _10){
|
||||
var _13=$("<input type=\"hidden\" name=\""+n+"\">").val(_10[n]).appendTo(_11);
|
||||
_12=_12.add(_13);
|
||||
}
|
||||
_14();
|
||||
_11[0].submit();
|
||||
}
|
||||
finally{
|
||||
_11.attr("action",a);
|
||||
t?_11.attr("target",t):_11.removeAttr("target");
|
||||
_12.remove();
|
||||
}
|
||||
};
|
||||
function _14(){
|
||||
var f=$("#"+_d);
|
||||
if(!f.length){
|
||||
return;
|
||||
}
|
||||
try{
|
||||
var s=f.contents()[0].readyState;
|
||||
if(s&&s.toLowerCase()=="uninitialized"){
|
||||
setTimeout(_14,100);
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
cb();
|
||||
}
|
||||
};
|
||||
var _15=10;
|
||||
function cb(){
|
||||
var f=$("#"+_d);
|
||||
if(!f.length){
|
||||
return;
|
||||
}
|
||||
f.unbind();
|
||||
var _16="";
|
||||
try{
|
||||
var _17=f.contents().find("body");
|
||||
_16=_17.html();
|
||||
if(_16==""){
|
||||
if(--_15){
|
||||
setTimeout(cb,100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var ta=_17.find(">textarea");
|
||||
if(ta.length){
|
||||
_16=ta.val();
|
||||
}else{
|
||||
var pre=_17.find(">pre");
|
||||
if(pre.length){
|
||||
_16=pre.html();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
_c.success.call(_a,_16);
|
||||
setTimeout(function(){
|
||||
f.unbind();
|
||||
f.remove();
|
||||
},100);
|
||||
};
|
||||
};
|
||||
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:_22,data:_24,dataType:"json",success:function(_25){
|
||||
_26(_25);
|
||||
},error:function(){
|
||||
_23.onLoadError.apply(_21,arguments);
|
||||
}});
|
||||
}else{
|
||||
_26(_22);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
_23.onLoadSuccess.call(_21,_27);
|
||||
_28.form("validate");
|
||||
};
|
||||
function _2a(_2c,val){
|
||||
var _2d=["switchbutton","radiobutton","checkbox"];
|
||||
for(var i=0;i<_2d.length;i++){
|
||||
var _2e=_2d[i];
|
||||
var cc=$(_21).find("["+_2e+"Name=\""+_2c+"\"]");
|
||||
if(cc.length){
|
||||
cc[_2e]("uncheck");
|
||||
cc.each(function(){
|
||||
if(_2f($(this)[_2e]("options").value,val)){
|
||||
$(this)[_2e]("check");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var cc=$(_21).find("input[name=\""+_2c+"\"][type=radio], input[name=\""+_2c+"\"][type=checkbox]");
|
||||
if(cc.length){
|
||||
cc._propAttr("checked",false);
|
||||
cc.each(function(){
|
||||
if(_2f($(this).val(),val)){
|
||||
$(this)._propAttr("checked",true);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
function _2f(v,val){
|
||||
if(v==String(val)||$.inArray(v,$.isArray(val)?val:[val])>=0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function _2b(_30,val){
|
||||
var _31=$(_21).find("[textboxName=\""+_30+"\"],[sliderName=\""+_30+"\"]");
|
||||
if(_31.length){
|
||||
for(var i=0;i<_23.fieldTypes.length;i++){
|
||||
var _32=_23.fieldTypes[i];
|
||||
var _33=_31.data(_32);
|
||||
if(_33){
|
||||
if(_33.options.multiple||_33.options.range){
|
||||
_31[_32]("setValues",val);
|
||||
}else{
|
||||
_31[_32]("setValue",val);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
};
|
||||
function _34(_35){
|
||||
$("input,select,textarea",_35).each(function(){
|
||||
if($(this).hasClass("textbox-value")){
|
||||
return;
|
||||
}
|
||||
var t=this.type,tag=this.tagName.toLowerCase();
|
||||
if(t=="text"||t=="hidden"||t=="password"||tag=="textarea"){
|
||||
this.value="";
|
||||
}else{
|
||||
if(t=="file"){
|
||||
var _36=$(this);
|
||||
if(!_36.hasClass("textbox-value")){
|
||||
var _37=_36.clone().val("");
|
||||
_37.insertAfter(_36);
|
||||
if(_36.data("validatebox")){
|
||||
_36.validatebox("destroy");
|
||||
_37.validatebox();
|
||||
}else{
|
||||
_36.remove();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(t=="checkbox"||t=="radio"){
|
||||
this.checked=false;
|
||||
}else{
|
||||
if(tag=="select"){
|
||||
this.selectedIndex=-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var tmp=$();
|
||||
var _38=$(_35);
|
||||
var _39=$.data(_35,"form").options;
|
||||
for(var i=0;i<_39.fieldTypes.length;i++){
|
||||
var _3a=_39.fieldTypes[i];
|
||||
var _3b=_38.find("."+_3a+"-f").not(tmp);
|
||||
if(_3b.length&&_3b[_3a]){
|
||||
_3b[_3a]("clear");
|
||||
tmp=tmp.add(_3b);
|
||||
}
|
||||
}
|
||||
_38.form("validate");
|
||||
};
|
||||
function _3c(_3d){
|
||||
_3d.reset();
|
||||
var _3e=$(_3d);
|
||||
var _3f=$.data(_3d,"form").options;
|
||||
for(var i=_3f.fieldTypes.length-1;i>=0;i--){
|
||||
var _40=_3f.fieldTypes[i];
|
||||
var _41=_3e.find("."+_40+"-f");
|
||||
if(_41.length&&_41[_40]){
|
||||
_41[_40]("reset");
|
||||
}
|
||||
}
|
||||
_3e.form("validate");
|
||||
};
|
||||
function _42(_43){
|
||||
var _44=$.data(_43,"form").options;
|
||||
$(_43).unbind(".form");
|
||||
if(_44.ajax){
|
||||
$(_43).bind("submit.form",function(){
|
||||
setTimeout(function(){
|
||||
_1(_43,_44);
|
||||
},0);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$(_43).bind("_change.form",function(e,t){
|
||||
if($.inArray(t,_44.dirtyFields)==-1){
|
||||
_44.dirtyFields.push(t);
|
||||
}
|
||||
_44.onChange.call(this,t);
|
||||
}).bind("change.form",function(e){
|
||||
var t=e.target;
|
||||
if(!$(t).hasClass("textbox-text")){
|
||||
if($.inArray(t,_44.dirtyFields)==-1){
|
||||
_44.dirtyFields.push(t);
|
||||
}
|
||||
_44.onChange.call(this,t);
|
||||
}
|
||||
});
|
||||
_45(_43,_44.novalidate);
|
||||
};
|
||||
function _46(_47,_48){
|
||||
_48=_48||{};
|
||||
var _49=$.data(_47,"form");
|
||||
if(_49){
|
||||
$.extend(_49.options,_48);
|
||||
}else{
|
||||
$.data(_47,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_47),_48)});
|
||||
}
|
||||
};
|
||||
function _4a(_4b){
|
||||
if($.fn.validatebox){
|
||||
var t=$(_4b);
|
||||
t.find(".validatebox-text:not(:disabled)").validatebox("validate");
|
||||
var _4c=t.find(".validatebox-invalid");
|
||||
_4c.filter(":not(:disabled):first").focus();
|
||||
return _4c.length==0;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _45(_4d,_4e){
|
||||
var _4f=$.data(_4d,"form").options;
|
||||
_4f.novalidate=_4e;
|
||||
$(_4d).find(".validatebox-text:not(:disabled)").validatebox(_4e?"disableValidation":"enableValidation");
|
||||
};
|
||||
$.fn.form=function(_50,_51){
|
||||
if(typeof _50=="string"){
|
||||
this.each(function(){
|
||||
_46(this);
|
||||
});
|
||||
return $.fn.form.methods[_50](this,_51);
|
||||
}
|
||||
return this.each(function(){
|
||||
_46(this,_50);
|
||||
_42(this);
|
||||
});
|
||||
};
|
||||
$.fn.form.methods={options:function(jq){
|
||||
return $.data(jq[0],"form").options;
|
||||
},submit:function(jq,_52){
|
||||
return jq.each(function(){
|
||||
_1(this,_52);
|
||||
});
|
||||
},load:function(jq,_53){
|
||||
return jq.each(function(){
|
||||
_20(this,_53);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_34(this);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
_3c(this);
|
||||
});
|
||||
},validate:function(jq){
|
||||
return _4a(jq[0]);
|
||||
},disableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
_45(this,true);
|
||||
});
|
||||
},enableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
_45(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(_54){
|
||||
var t=$(_54);
|
||||
return $.extend({},$.parser.parseOptions(_54,[{ajax:"boolean",dirty:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)});
|
||||
};
|
||||
$.fn.form.defaults={fieldTypes:["tagbox","combobox","combotree","combogrid","combotreegrid","datetimebox","datebox","timepicker","combo","datetimespinner","timespinner","numberspinner","spinner","slider","searchbox","numberbox","passwordbox","filebox","textbox","switchbutton","radiobutton","checkbox"],novalidate:false,ajax:true,iframe:true,dirty:false,dirtyFields:[],url:null,queryParams:{},onSubmit:function(_55){
|
||||
return $(this).form("validate");
|
||||
},onProgress:function(_56){
|
||||
},success:function(_57){
|
||||
},onBeforeLoad:function(_58){
|
||||
},onLoadSuccess:function(_59){
|
||||
},onLoadError:function(){
|
||||
},onChange:function(_5a){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
530
static/jeasyui/plugins/jquery.layout.js
Executable file
530
static/jeasyui/plugins/jquery.layout.js
Executable file
@@ -0,0 +1,530 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=false;
|
||||
function _2(_3,_4){
|
||||
var _5=$.data(_3,"layout");
|
||||
var _6=_5.options;
|
||||
var _7=_5.panels;
|
||||
var cc=$(_3);
|
||||
if(_4){
|
||||
$.extend(_6,{width:_4.width,height:_4.height});
|
||||
}
|
||||
if(_3.tagName.toLowerCase()=="body"){
|
||||
cc._size("fit");
|
||||
}else{
|
||||
cc._size(_6);
|
||||
}
|
||||
var _8={top:0,left:0,width:cc.width(),height:cc.height()};
|
||||
_9(_a(_7.expandNorth)?_7.expandNorth:_7.north,"n");
|
||||
_9(_a(_7.expandSouth)?_7.expandSouth:_7.south,"s");
|
||||
_b(_a(_7.expandEast)?_7.expandEast:_7.east,"e");
|
||||
_b(_a(_7.expandWest)?_7.expandWest:_7.west,"w");
|
||||
_7.center.panel("resize",_8);
|
||||
function _9(pp,_c){
|
||||
if(!pp.length||!_a(pp)){
|
||||
return;
|
||||
}
|
||||
var _d=pp.panel("options");
|
||||
pp.panel("resize",{width:cc.width(),height:_d.height});
|
||||
var _e=pp.panel("panel").outerHeight();
|
||||
pp.panel("move",{left:0,top:(_c=="n"?0:cc.height()-_e)});
|
||||
_8.height-=_e;
|
||||
if(_c=="n"){
|
||||
_8.top+=_e;
|
||||
if(!_d.split&&_d.border){
|
||||
_8.top--;
|
||||
}
|
||||
}
|
||||
if(!_d.split&&_d.border){
|
||||
_8.height++;
|
||||
}
|
||||
};
|
||||
function _b(pp,_f){
|
||||
if(!pp.length||!_a(pp)){
|
||||
return;
|
||||
}
|
||||
var _10=pp.panel("options");
|
||||
pp.panel("resize",{width:_10.width,height:_8.height});
|
||||
var _11=pp.panel("panel").outerWidth();
|
||||
pp.panel("move",{left:(_f=="e"?cc.width()-_11:0),top:_8.top});
|
||||
_8.width-=_11;
|
||||
if(_f=="w"){
|
||||
_8.left+=_11;
|
||||
if(!_10.split&&_10.border){
|
||||
_8.left--;
|
||||
}
|
||||
}
|
||||
if(!_10.split&&_10.border){
|
||||
_8.width++;
|
||||
}
|
||||
};
|
||||
};
|
||||
function _12(_13){
|
||||
var cc=$(_13);
|
||||
cc.addClass("layout");
|
||||
function _14(el){
|
||||
var _15=$.fn.layout.parsePanelOptions(el);
|
||||
if("north,south,east,west,center".indexOf(_15.region)>=0){
|
||||
_19(_13,_15,el);
|
||||
}
|
||||
};
|
||||
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("<div class=\"layout-split-proxy-h\"></div><div class=\"layout-split-proxy-v\"></div>");
|
||||
cc._bind("_resize",function(e,_18){
|
||||
if($(this).hasClass("easyui-fluid")||_18){
|
||||
_2(_13);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
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=$("<div></div>").appendTo(cc);
|
||||
}
|
||||
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 _20="layout-button-"+_1f[dir];
|
||||
var t=_1e.children("a."+_20);
|
||||
if(!t.length){
|
||||
t=$("<a href=\"javascript:;\"></a>").addClass(_20).appendTo(_1e);
|
||||
t._bind("click",{dir:dir},function(e){
|
||||
_39(_1a,e.data.dir);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$(this).panel("options").collapsible?t.show():t.hide();
|
||||
}},_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){
|
||||
_22.addClass("layout-split-"+dir);
|
||||
}
|
||||
_22.resizable($.extend({},{handles:(_21[dir]||""),disabled:(!pp.panel("options").split),onStartResize:function(e){
|
||||
_1=true;
|
||||
if(dir=="north"||dir=="south"){
|
||||
var _23=$(">div.layout-split-proxy-v",_1a);
|
||||
}else{
|
||||
var _23=$(">div.layout-split-proxy-h",_1a);
|
||||
}
|
||||
var top=0,_24=0,_25=0,_26=0;
|
||||
var pos={display:"block"};
|
||||
if(dir=="north"){
|
||||
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(_22.css("top"));
|
||||
pos.left=parseInt(_22.css("left"));
|
||||
pos.width=_22.outerWidth();
|
||||
pos.height=_23.height();
|
||||
}else{
|
||||
if(dir=="east"){
|
||||
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(_22.css("top"))||0;
|
||||
pos.left=_22.outerWidth()-_23.width();
|
||||
pos.width=_23.width();
|
||||
pos.height=_22.outerHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_23.css(pos);
|
||||
$("<div class=\"layout-mask\"></div>").css({left:0,top:0,width:cc.width(),height:cc.height()}).appendTo(cc);
|
||||
},onResize:function(e){
|
||||
if(dir=="north"||dir=="south"){
|
||||
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 _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(_1a);
|
||||
_1=false;
|
||||
cc.find(">div.layout-mask").remove();
|
||||
}},_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]();
|
||||
}
|
||||
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 _39(_3a,_3b,_3c){
|
||||
if(_3c==undefined){
|
||||
_3c="normal";
|
||||
}
|
||||
var _3d=$.data(_3a,"layout");
|
||||
var _3e=_3d.panels;
|
||||
var p=_3e[_3b];
|
||||
var _3f=p.panel("options");
|
||||
if(_3f.onBeforeCollapse.call(p)==false){
|
||||
return;
|
||||
}
|
||||
var _40="expand"+_3b.substring(0,1).toUpperCase()+_3b.substring(1);
|
||||
if(!_3e[_40]){
|
||||
_3e[_40]=_41(_3b);
|
||||
var ep=_3e[_40].panel("panel");
|
||||
if(!_3f.expandMode){
|
||||
ep.css("cursor","default");
|
||||
}else{
|
||||
ep._bind("click",function(){
|
||||
if(_3f.expandMode=="dock"){
|
||||
_53(_3a,_3b);
|
||||
}else{
|
||||
p.panel("expand",false).panel("open");
|
||||
var _42=_43();
|
||||
p.panel("resize",_42.collapse);
|
||||
p.panel("panel")._unbind(".layout")._bind("mouseleave.layout",{region:_3b},function(e){
|
||||
var _44=this;
|
||||
_3d.collapseTimer=setTimeout(function(){
|
||||
$(_44).stop(true,true);
|
||||
if(_1==true){
|
||||
return;
|
||||
}
|
||||
if($("body>div.combo-p>div.combo-panel:visible").length){
|
||||
return;
|
||||
}
|
||||
_39(_3a,e.data.region);
|
||||
},_3d.options.collapseDelay);
|
||||
});
|
||||
p.panel("panel").animate(_42.expand,function(){
|
||||
$(_3a).layout("options").onExpand.call(_3a,_3b);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
var _45=_43();
|
||||
if(!_a(_3e[_40])){
|
||||
_3e.center.panel("resize",_45.resizeC);
|
||||
}
|
||||
p.panel("panel").animate(_45.collapse,_3c,function(){
|
||||
p.panel("collapse",false).panel("close");
|
||||
_3e[_40].panel("open").panel("resize",_45.expandP);
|
||||
$(this)._unbind(".layout");
|
||||
$(_3a).layout("options").onCollapse.call(_3a,_3b);
|
||||
});
|
||||
function _41(dir){
|
||||
var _46={"east":"left","west":"right","north":"down","south":"up"};
|
||||
var _47=(_3f.region=="north"||_3f.region=="south");
|
||||
var _48="layout-button-"+_46[dir];
|
||||
var p=$("<div></div>").appendTo(_3a);
|
||||
p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",titleDirection:_3f.titleDirection,iconCls:(_3f.hideCollapsedContent?null:_3f.iconCls),closed:true,minWidth:0,minHeight:0,doSize:false,region:_3f.region,collapsedSize:_3f.collapsedSize,noheader:(!_47&&_3f.hideExpandTool),tools:((_47&&_3f.hideExpandTool)?null:[{iconCls:_48,handler:function(){
|
||||
_53(_3a,_3b);
|
||||
return false;
|
||||
}}]),onResize:function(){
|
||||
var _49=$(this).children(".layout-expand-title");
|
||||
if(_49.length){
|
||||
var _4a=$(this).children(".panel-icon");
|
||||
var _4b=_4a.length>0?(_4a._outerHeight()+2):0;
|
||||
_49._outerWidth($(this).height()-_4b);
|
||||
var _4c=($(this).width()-Math.min(_49._outerWidth(),_49._outerHeight()))/2;
|
||||
var top=Math.max(_49._outerWidth(),_49._outerHeight());
|
||||
if(_49.hasClass("layout-expand-title-down")){
|
||||
_4c+=Math.min(_49._outerWidth(),_49._outerHeight());
|
||||
top=0;
|
||||
}
|
||||
top+=_4b;
|
||||
_49.css({left:(_4c+"px"),top:(top+"px")});
|
||||
}
|
||||
}}));
|
||||
if(!_3f.hideCollapsedContent){
|
||||
var _4d=typeof _3f.collapsedContent=="function"?_3f.collapsedContent.call(p[0],_3f.title):_3f.collapsedContent;
|
||||
_47?p.panel("setTitle",_4d):p.html(_4d);
|
||||
}
|
||||
p.panel("panel").hover(function(){
|
||||
$(this).addClass("layout-expand-over");
|
||||
},function(){
|
||||
$(this).removeClass("layout-expand-over");
|
||||
});
|
||||
return p;
|
||||
};
|
||||
function _43(){
|
||||
var cc=$(_3a);
|
||||
var _4e=_3e.center.panel("options");
|
||||
var _4f=_3f.collapsedSize;
|
||||
if(_3b=="east"){
|
||||
var _50=p.panel("panel")._outerWidth();
|
||||
var _51=_4e.width+_50-_4f;
|
||||
if(_3f.split||!_3f.border){
|
||||
_51++;
|
||||
}
|
||||
return {resizeC:{width:_51},expand:{left:cc.width()-_50},expandP:{top:_4e.top,left:cc.width()-_4f,width:_4f,height:_4e.height},collapse:{left:cc.width(),top:_4e.top,height:_4e.height}};
|
||||
}else{
|
||||
if(_3b=="west"){
|
||||
var _50=p.panel("panel")._outerWidth();
|
||||
var _51=_4e.width+_50-_4f;
|
||||
if(_3f.split||!_3f.border){
|
||||
_51++;
|
||||
}
|
||||
return {resizeC:{width:_51,left:_4f-1},expand:{left:0},expandP:{left:0,top:_4e.top,width:_4f,height:_4e.height},collapse:{left:-_50,top:_4e.top,height:_4e.height}};
|
||||
}else{
|
||||
if(_3b=="north"){
|
||||
var _52=p.panel("panel")._outerHeight();
|
||||
var hh=_4e.height;
|
||||
if(!_a(_3e.expandNorth)){
|
||||
hh+=_52-_4f+((_3f.split||!_3f.border)?1:0);
|
||||
}
|
||||
_3e.east.add(_3e.west).add(_3e.expandEast).add(_3e.expandWest).panel("resize",{top:_4f-1,height:hh});
|
||||
return {resizeC:{top:_4f-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_4f},collapse:{top:-_52,width:cc.width()}};
|
||||
}else{
|
||||
if(_3b=="south"){
|
||||
var _52=p.panel("panel")._outerHeight();
|
||||
var hh=_4e.height;
|
||||
if(!_a(_3e.expandSouth)){
|
||||
hh+=_52-_4f+((_3f.split||!_3f.border)?1:0);
|
||||
}
|
||||
_3e.east.add(_3e.west).add(_3e.expandEast).add(_3e.expandWest).panel("resize",{height:hh});
|
||||
return {resizeC:{height:hh},expand:{top:cc.height()-_52},expandP:{top:cc.height()-_4f,left:0,width:cc.width(),height:_4f},collapse:{top:cc.height(),width:cc.width()}};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _53(_54,_55){
|
||||
var _56=$.data(_54,"layout").panels;
|
||||
var p=_56[_55];
|
||||
var _57=p.panel("options");
|
||||
if(_57.onBeforeExpand.call(p)==false){
|
||||
return;
|
||||
}
|
||||
var _58="expand"+_55.substring(0,1).toUpperCase()+_55.substring(1);
|
||||
if(_56[_58]){
|
||||
_56[_58].panel("close");
|
||||
p.panel("panel").stop(true,true);
|
||||
p.panel("expand",false).panel("open");
|
||||
var _59=_5a();
|
||||
p.panel("resize",_59.collapse);
|
||||
p.panel("panel").animate(_59.expand,function(){
|
||||
_2(_54);
|
||||
$(_54).layout("options").onExpand.call(_54,_55);
|
||||
});
|
||||
}
|
||||
function _5a(){
|
||||
var cc=$(_54);
|
||||
var _5b=_56.center.panel("options");
|
||||
if(_55=="east"&&_56.expandEast){
|
||||
return {collapse:{left:cc.width(),top:_5b.top,height:_5b.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}};
|
||||
}else{
|
||||
if(_55=="west"&&_56.expandWest){
|
||||
return {collapse:{left:-p.panel("panel")._outerWidth(),top:_5b.top,height:_5b.height},expand:{left:0}};
|
||||
}else{
|
||||
if(_55=="north"&&_56.expandNorth){
|
||||
return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}};
|
||||
}else{
|
||||
if(_55=="south"&&_56.expandSouth){
|
||||
return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.panel("panel")._outerHeight()}};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _a(pp){
|
||||
if(!pp){
|
||||
return false;
|
||||
}
|
||||
if(pp.length){
|
||||
return pp.panel("panel").is(":visible");
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function _5c(_5d){
|
||||
var _5e=$.data(_5d,"layout");
|
||||
var _5f=_5e.options;
|
||||
var _60=_5e.panels;
|
||||
var _61=_5f.onCollapse;
|
||||
_5f.onCollapse=function(){
|
||||
};
|
||||
_62("east");
|
||||
_62("west");
|
||||
_62("north");
|
||||
_62("south");
|
||||
_5f.onCollapse=_61;
|
||||
function _62(_63){
|
||||
var p=_60[_63];
|
||||
if(p.length&&p.panel("options").collapsed){
|
||||
_39(_5d,_63,0);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _64(_65,_66,_67){
|
||||
var p=$(_65).layout("panel",_66);
|
||||
p.panel("options").split=_67;
|
||||
var cls="layout-split-"+_66;
|
||||
var _68=p.panel("panel").removeClass(cls);
|
||||
if(_67){
|
||||
_68.addClass(cls);
|
||||
}
|
||||
_68.resizable({disabled:(!_67)});
|
||||
_2(_65);
|
||||
};
|
||||
$.fn.layout=function(_69,_6a){
|
||||
if(typeof _69=="string"){
|
||||
return $.fn.layout.methods[_69](this,_6a);
|
||||
}
|
||||
_69=_69||{};
|
||||
return this.each(function(){
|
||||
var _6b=$.data(this,"layout");
|
||||
if(_6b){
|
||||
$.extend(_6b.options,_69);
|
||||
}else{
|
||||
var _6c=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_69);
|
||||
$.data(this,"layout",{options:_6c,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}});
|
||||
_12(this);
|
||||
}
|
||||
_2(this);
|
||||
_5c(this);
|
||||
});
|
||||
};
|
||||
$.fn.layout.methods={options:function(jq){
|
||||
return $.data(jq[0],"layout").options;
|
||||
},resize:function(jq,_6d){
|
||||
return jq.each(function(){
|
||||
_2(this,_6d);
|
||||
});
|
||||
},panel:function(jq,_6e){
|
||||
return $.data(jq[0],"layout").panels[_6e];
|
||||
},collapse:function(jq,_6f){
|
||||
return jq.each(function(){
|
||||
_39(this,_6f);
|
||||
});
|
||||
},expand:function(jq,_70){
|
||||
return jq.each(function(){
|
||||
_53(this,_70);
|
||||
});
|
||||
},add:function(jq,_71){
|
||||
return jq.each(function(){
|
||||
_19(this,_71);
|
||||
_2(this);
|
||||
if($(this).layout("panel",_71.region).panel("options").collapsed){
|
||||
_39(this,_71.region,0);
|
||||
}
|
||||
});
|
||||
},remove:function(jq,_72){
|
||||
return jq.each(function(){
|
||||
_34(this,_72);
|
||||
_2(this);
|
||||
});
|
||||
},split:function(jq,_73){
|
||||
return jq.each(function(){
|
||||
_64(this,_73,true);
|
||||
});
|
||||
},unsplit:function(jq,_74){
|
||||
return jq.each(function(){
|
||||
_64(this,_74,false);
|
||||
});
|
||||
},stopCollapsing:function(jq){
|
||||
return jq.each(function(){
|
||||
clearTimeout($(this).data("layout").collapseTimer);
|
||||
});
|
||||
}};
|
||||
$.fn.layout.parseOptions=function(_75){
|
||||
return $.extend({},$.parser.parseOptions(_75,[{fit:"boolean"}]));
|
||||
};
|
||||
$.fn.layout.defaults={fit:false,onExpand:function(_76){
|
||||
},onCollapse:function(_77){
|
||||
},onAdd:function(_78){
|
||||
},onRemove:function(_79){
|
||||
}};
|
||||
$.fn.layout.parsePanelOptions=function(_7a){
|
||||
var t=$(_7a);
|
||||
return $.extend({},$.fn.panel.parseOptions(_7a),$.parser.parseOptions(_7a,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}]));
|
||||
};
|
||||
$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapseDelay:100,collapsedSize:32,expandMode:"float",hideExpandTool:false,hideCollapsedContent:true,collapsedContent:function(_7b){
|
||||
var p=$(this);
|
||||
var _7c=p.panel("options");
|
||||
if(_7c.region=="north"||_7c.region=="south"){
|
||||
return _7b;
|
||||
}
|
||||
var cc=[];
|
||||
if(_7c.iconCls){
|
||||
cc.push("<div class=\"panel-icon "+_7c.iconCls+"\"></div>");
|
||||
}
|
||||
cc.push("<div class=\"panel-title layout-expand-title");
|
||||
cc.push(" layout-expand-title-"+_7c.titleDirection);
|
||||
cc.push(_7c.iconCls?" layout-expand-with-icon":"");
|
||||
cc.push("\">");
|
||||
cc.push(_7b);
|
||||
cc.push("</div>");
|
||||
return cc.join("");
|
||||
},minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000});
|
||||
})(jQuery);
|
||||
|
||||
185
static/jeasyui/plugins/jquery.linkbutton.js
Executable file
185
static/jeasyui/plugins/jquery.linkbutton.js
Executable file
@@ -0,0 +1,185 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,_3){
|
||||
var _4=$.data(_2,"linkbutton").options;
|
||||
if(_3){
|
||||
$.extend(_4,_3);
|
||||
}
|
||||
if(_4.width||_4.height||_4.fit){
|
||||
var _5=$(_2);
|
||||
var _6=_5.parent();
|
||||
var _7=_5.is(":visible");
|
||||
if(!_7){
|
||||
var _8=$("<div style=\"display:none\"></div>").insertBefore(_2);
|
||||
var _9={position:_5.css("position"),display:_5.css("display"),left:_5.css("left")};
|
||||
_5.appendTo("body");
|
||||
_5.css({position:"absolute",display:"inline-block",left:-20000});
|
||||
}
|
||||
_5._size(_4,_6);
|
||||
var _a=_5.find(".l-btn-left");
|
||||
_a.css("margin-top",0);
|
||||
_a.css("margin-top",parseInt((_5.height()-_a.height())/2)+"px");
|
||||
if(!_7){
|
||||
_5.insertAfter(_8);
|
||||
_5.css(_9);
|
||||
_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 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");
|
||||
}
|
||||
t.attr("group",_d.group||"");
|
||||
t.attr("id",_d.id||"");
|
||||
var _e=$("<span class=\"l-btn-left\"></span>").appendTo(t);
|
||||
if(_d.text){
|
||||
$("<span class=\"l-btn-text\"></span>").html(_d.text).appendTo(_e);
|
||||
}else{
|
||||
$("<span class=\"l-btn-text l-btn-empty\"> </span>").appendTo(_e);
|
||||
}
|
||||
if(_d.iconCls){
|
||||
$("<span class=\"l-btn-icon\"> </span>").addClass(_d.iconCls).appendTo(_e);
|
||||
_e.addClass("l-btn-icon-"+_d.iconAlign);
|
||||
}
|
||||
t._unbind(".linkbutton")._bind("focus.linkbutton",function(){
|
||||
if(!_d.disabled){
|
||||
$(this).addClass("l-btn-focus");
|
||||
}
|
||||
})._bind("blur.linkbutton",function(){
|
||||
$(this).removeClass("l-btn-focus");
|
||||
})._bind("click.linkbutton",function(){
|
||||
if(!_d.disabled){
|
||||
if(_d.toggle){
|
||||
if(_d.selected){
|
||||
$(this).linkbutton("unselect");
|
||||
}else{
|
||||
$(this).linkbutton("select");
|
||||
}
|
||||
}
|
||||
_d.onClick.call(this);
|
||||
}
|
||||
});
|
||||
_f(_c,_d.selected);
|
||||
_10(_c,_d.disabled);
|
||||
};
|
||||
function _f(_11,_12){
|
||||
var _13=$.data(_11,"linkbutton").options;
|
||||
if(_12){
|
||||
if(_13.group){
|
||||
$("a.l-btn[group=\""+_13.group+"\"]").each(function(){
|
||||
var o=$(this).linkbutton("options");
|
||||
if(o.toggle){
|
||||
$(this).removeClass("l-btn-selected l-btn-plain-selected");
|
||||
o.selected=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
$(_11).addClass(_13.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected");
|
||||
_13.selected=true;
|
||||
}else{
|
||||
if(!_13.group){
|
||||
$(_11).removeClass("l-btn-selected l-btn-plain-selected");
|
||||
_13.selected=false;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _10(_14,_15){
|
||||
var _16=$.data(_14,"linkbutton");
|
||||
var _17=_16.options;
|
||||
$(_14).removeClass("l-btn-disabled l-btn-plain-disabled");
|
||||
if(_15){
|
||||
_17.disabled=true;
|
||||
var _18=$(_14).attr("href");
|
||||
if(_18){
|
||||
_16.href=_18;
|
||||
$(_14).attr("href","javascript:;");
|
||||
}
|
||||
if(_14.onclick){
|
||||
_16.onclick=_14.onclick;
|
||||
_14.onclick=null;
|
||||
}
|
||||
_17.plain?$(_14).addClass("l-btn-disabled l-btn-plain-disabled"):$(_14).addClass("l-btn-disabled");
|
||||
}else{
|
||||
_17.disabled=false;
|
||||
if(_16.href){
|
||||
$(_14).attr("href",_16.href);
|
||||
}
|
||||
if(_16.onclick){
|
||||
_14.onclick=_16.onclick;
|
||||
}
|
||||
}
|
||||
$(_14)._propAttr("disabled",_15);
|
||||
};
|
||||
$.fn.linkbutton=function(_19,_1a){
|
||||
if(typeof _19=="string"){
|
||||
return $.fn.linkbutton.methods[_19](this,_1a);
|
||||
}
|
||||
_19=_19||{};
|
||||
return this.each(function(){
|
||||
var _1b=$.data(this,"linkbutton");
|
||||
if(_1b){
|
||||
$.extend(_1b.options,_19);
|
||||
}else{
|
||||
$.data(this,"linkbutton",{options:$.extend({},$.fn.linkbutton.defaults,$.fn.linkbutton.parseOptions(this),_19)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
$(this)._bind("_resize",function(e,_1c){
|
||||
if($(this).hasClass("easyui-fluid")||_1c){
|
||||
_1(this);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
_b(this);
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.linkbutton.methods={options:function(jq){
|
||||
return $.data(jq[0],"linkbutton").options;
|
||||
},resize:function(jq,_1d){
|
||||
return jq.each(function(){
|
||||
_1(this,_1d);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,true);
|
||||
});
|
||||
},select:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,true);
|
||||
});
|
||||
},unselect:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,false);
|
||||
});
|
||||
}};
|
||||
$.fn.linkbutton.parseOptions=function(_1e){
|
||||
var t=$(_1e);
|
||||
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,outline:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
221
static/jeasyui/plugins/jquery.maskedbox.js
Normal file
221
static/jeasyui/plugins/jquery.maskedbox.js
Normal file
@@ -0,0 +1,221 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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=$(_2).data("maskedbox");
|
||||
var _4=_3.options;
|
||||
$(_2).textbox(_4);
|
||||
$(_2).maskedbox("initValue",_4.value);
|
||||
};
|
||||
function _5(_6,_7){
|
||||
var _8=$(_6).maskedbox("options");
|
||||
var tt=(_7||$(_6).maskedbox("getText")||"").split("");
|
||||
var vv=[];
|
||||
for(var i=0;i<_8.mask.length;i++){
|
||||
if(_8.masks[_8.mask[i]]){
|
||||
var t=tt[i];
|
||||
vv.push(t!=_8.promptChar?t:" ");
|
||||
}
|
||||
}
|
||||
return vv.join("");
|
||||
};
|
||||
function _9(_a,_b){
|
||||
var _c=$(_a).maskedbox("options");
|
||||
var cc=_b.split("");
|
||||
var tt=[];
|
||||
for(var i=0;i<_c.mask.length;i++){
|
||||
var m=_c.mask[i];
|
||||
var r=_c.masks[m];
|
||||
if(r){
|
||||
var c=cc.shift();
|
||||
if(c!=undefined){
|
||||
var d=new RegExp(r,"i");
|
||||
if(d.test(c)){
|
||||
tt.push(c);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
tt.push(_c.promptChar);
|
||||
}else{
|
||||
tt.push(m);
|
||||
}
|
||||
}
|
||||
return tt.join("");
|
||||
};
|
||||
function _d(_e,c){
|
||||
var _f=$(_e).maskedbox("options");
|
||||
var _10=$(_e).maskedbox("getSelectionRange");
|
||||
var _11=_12(_e,_10.start);
|
||||
var end=_12(_e,_10.end);
|
||||
if(_11!=-1){
|
||||
var r=new RegExp(_f.masks[_f.mask[_11]],"i");
|
||||
if(r.test(c)){
|
||||
var vv=_5(_e).split("");
|
||||
var _13=_11-_14(_e,_11);
|
||||
var _15=end-_14(_e,end);
|
||||
vv.splice(_13,_15-_13,c);
|
||||
$(_e).maskedbox("setValue",_9(_e,vv.join("")));
|
||||
_11=_12(_e,++_11);
|
||||
$(_e).maskedbox("setSelectionRange",{start:_11,end:_11});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _16(_17,_18){
|
||||
var _19=$(_17).maskedbox("options");
|
||||
var vv=_5(_17).split("");
|
||||
var _1a=$(_17).maskedbox("getSelectionRange");
|
||||
if(_1a.start==_1a.end){
|
||||
if(_18){
|
||||
var _1b=_1c(_17,_1a.start);
|
||||
}else{
|
||||
var _1b=_12(_17,_1a.start);
|
||||
}
|
||||
var _1d=_1b-_14(_17,_1b);
|
||||
if(_1d>=0){
|
||||
vv.splice(_1d,1);
|
||||
}
|
||||
}else{
|
||||
var _1b=_12(_17,_1a.start);
|
||||
var end=_1c(_17,_1a.end);
|
||||
var _1d=_1b-_14(_17,_1b);
|
||||
var _1e=end-_14(_17,end);
|
||||
vv.splice(_1d,_1e-_1d+1);
|
||||
}
|
||||
$(_17).maskedbox("setValue",_9(_17,vv.join("")));
|
||||
$(_17).maskedbox("setSelectionRange",{start:_1b,end:_1b});
|
||||
};
|
||||
function _14(_1f,pos){
|
||||
var _20=$(_1f).maskedbox("options");
|
||||
var _21=0;
|
||||
if(pos>=_20.mask.length){
|
||||
pos--;
|
||||
}
|
||||
for(var i=pos;i>=0;i--){
|
||||
if(_20.masks[_20.mask[i]]==undefined){
|
||||
_21++;
|
||||
}
|
||||
}
|
||||
return _21;
|
||||
};
|
||||
function _12(_22,pos){
|
||||
var _23=$(_22).maskedbox("options");
|
||||
var m=_23.mask[pos];
|
||||
var r=_23.masks[m];
|
||||
while(pos<_23.mask.length&&!r){
|
||||
pos++;
|
||||
m=_23.mask[pos];
|
||||
r=_23.masks[m];
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
function _1c(_24,pos){
|
||||
var _25=$(_24).maskedbox("options");
|
||||
var m=_25.mask[--pos];
|
||||
var r=_25.masks[m];
|
||||
while(pos>=0&&!r){
|
||||
pos--;
|
||||
m=_25.mask[pos];
|
||||
r=_25.masks[m];
|
||||
}
|
||||
return pos<0?0:pos;
|
||||
};
|
||||
function _26(e){
|
||||
if(e.metaKey||e.ctrlKey){
|
||||
return;
|
||||
}
|
||||
var _27=e.data.target;
|
||||
var _28=$(_27).maskedbox("options");
|
||||
var _29=[9,13,35,36,37,39];
|
||||
if($.inArray(e.keyCode,_29)!=-1){
|
||||
return true;
|
||||
}
|
||||
if(e.keyCode>=96&&e.keyCode<=105){
|
||||
e.keyCode-=48;
|
||||
}
|
||||
var c=String.fromCharCode(e.keyCode);
|
||||
if(e.keyCode>=65&&e.keyCode<=90&&!e.shiftKey){
|
||||
c=c.toLowerCase();
|
||||
}else{
|
||||
if(e.keyCode==189){
|
||||
c="-";
|
||||
}else{
|
||||
if(e.keyCode==187){
|
||||
c="+";
|
||||
}else{
|
||||
if(e.keyCode==190){
|
||||
c=".";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(e.keyCode==8){
|
||||
_16(_27,true);
|
||||
}else{
|
||||
if(e.keyCode==46){
|
||||
_16(_27,false);
|
||||
}else{
|
||||
_d(_27,c);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
$.extend($.fn.textbox.methods,{inputMask:function(jq,_2a){
|
||||
return jq.each(function(){
|
||||
var _2b=this;
|
||||
var _2c=$.extend({},$.fn.maskedbox.defaults,_2a);
|
||||
$.data(_2b,"maskedbox",{options:_2c});
|
||||
var _2d=$(_2b).textbox("textbox");
|
||||
_2d._unbind(".maskedbox");
|
||||
for(var _2e in _2c.inputEvents){
|
||||
_2d._bind(_2e+".maskedbox",{target:_2b},_2c.inputEvents[_2e]);
|
||||
}
|
||||
});
|
||||
}});
|
||||
$.fn.maskedbox=function(_2f,_30){
|
||||
if(typeof _2f=="string"){
|
||||
var _31=$.fn.maskedbox.methods[_2f];
|
||||
if(_31){
|
||||
return _31(this,_30);
|
||||
}else{
|
||||
return this.textbox(_2f,_30);
|
||||
}
|
||||
}
|
||||
_2f=_2f||{};
|
||||
return this.each(function(){
|
||||
var _32=$.data(this,"maskedbox");
|
||||
if(_32){
|
||||
$.extend(_32.options,_2f);
|
||||
}else{
|
||||
$.data(this,"maskedbox",{options:$.extend({},$.fn.maskedbox.defaults,$.fn.maskedbox.parseOptions(this),_2f)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.maskedbox.methods={options:function(jq){
|
||||
var _33=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"maskedbox").options,{width:_33.width,value:_33.value,originalValue:_33.originalValue,disabled:_33.disabled,readonly:_33.readonly});
|
||||
},initValue:function(jq,_34){
|
||||
return jq.each(function(){
|
||||
_34=_9(this,_5(this,_34));
|
||||
$(this).textbox("initValue",_34);
|
||||
});
|
||||
},setValue:function(jq,_35){
|
||||
return jq.each(function(){
|
||||
_35=_9(this,_5(this,_35));
|
||||
$(this).textbox("setValue",_35);
|
||||
});
|
||||
}};
|
||||
$.fn.maskedbox.parseOptions=function(_36){
|
||||
var t=$(_36);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_36),$.parser.parseOptions(_36,["mask","promptChar"]),{});
|
||||
};
|
||||
$.fn.maskedbox.defaults=$.extend({},$.fn.textbox.defaults,{mask:"",promptChar:"_",masks:{"9":"[0-9]","a":"[a-zA-Z]","*":"[0-9a-zA-Z]"},inputEvents:{keydown:_26}});
|
||||
})(jQuery);
|
||||
|
||||
502
static/jeasyui/plugins/jquery.menu.js
Executable file
502
static/jeasyui/plugins/jquery.menu.js
Executable file
@@ -0,0 +1,502 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(){
|
||||
$(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").not(".menu-inline").menu("hide");
|
||||
_1($("body>div.menu:visible").not(".menu-inline"));
|
||||
});
|
||||
});
|
||||
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 _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);
|
||||
});
|
||||
$("<div class=\"menu-line\"></div>").prependTo(_e);
|
||||
}
|
||||
_10(_c,_e);
|
||||
if(!_e.hasClass("menu-inline")){
|
||||
_e.hide();
|
||||
}
|
||||
_11(_c,_e);
|
||||
};
|
||||
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($("<div class=\"menu-text\"></div>").html(_15.text));
|
||||
if(_15.iconCls){
|
||||
$("<div class=\"menu-icon\"></div>").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{
|
||||
_14[0].onclick=eval(_15.onclick);
|
||||
}
|
||||
}
|
||||
if(_15.disabled){
|
||||
_16(_12,_14[0],true);
|
||||
}
|
||||
if(_14[0].submenu){
|
||||
$("<div class=\"menu-rightarrow\"></div>").appendTo(_14);
|
||||
}
|
||||
}
|
||||
};
|
||||
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"});
|
||||
});
|
||||
_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();
|
||||
}
|
||||
});
|
||||
_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();
|
||||
_1e=Math.min(_1e,Math.max(h1,h2));
|
||||
}else{
|
||||
if(_1e>$(window)._outerHeight()){
|
||||
_1e=$(window).height();
|
||||
}
|
||||
}
|
||||
}
|
||||
_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 _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]);
|
||||
}
|
||||
};
|
||||
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);
|
||||
}
|
||||
};
|
||||
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){
|
||||
_1(this.submenu);
|
||||
}
|
||||
$(this).removeClass("menu-active");
|
||||
});
|
||||
_2e.addClass("menu-active");
|
||||
if(_2e.hasClass("menu-item-disabled")){
|
||||
_2e.addClass("menu-active-disabled");
|
||||
return;
|
||||
}
|
||||
var _2f=_2e[0].submenu;
|
||||
if(_2f){
|
||||
$(_2d).menu("show",{menu:_2f,parent:_2e});
|
||||
}
|
||||
}
|
||||
};
|
||||
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{
|
||||
_1(_32);
|
||||
}
|
||||
}else{
|
||||
_31.removeClass("menu-active");
|
||||
}
|
||||
}
|
||||
};
|
||||
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 _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(_3f.align=="right"){
|
||||
_3e+=at.outerWidth()-_40.outerWidth();
|
||||
}
|
||||
}
|
||||
if(_3e+_40.outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){
|
||||
_3e=$(window)._outerWidth()+$(document).scrollLeft()-_40.outerWidth()-5;
|
||||
}
|
||||
if(_3e<0){
|
||||
_3e=0;
|
||||
}
|
||||
top=_41(top,_3f.alignTo);
|
||||
}else{
|
||||
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=_41(_42.offset().top-3);
|
||||
}
|
||||
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()-_40.outerHeight();
|
||||
}
|
||||
}
|
||||
if(top<0){
|
||||
top=0;
|
||||
}
|
||||
return top;
|
||||
};
|
||||
_40.css(_3f.position.call(_3c,_40[0],_3e,top));
|
||||
_40.show(0,function(){
|
||||
if(!_40[0].shadow){
|
||||
_40[0].shadow=$("<div class=\"menu-shadow\"></div>").insertAfter(_40);
|
||||
}
|
||||
_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 _1(_44){
|
||||
if(_44&&_44.length){
|
||||
_45(_44);
|
||||
_44.find("div.menu-item").each(function(){
|
||||
if(this.submenu){
|
||||
_1(this.submenu);
|
||||
}
|
||||
$(this).removeClass("menu-active");
|
||||
});
|
||||
}
|
||||
function _45(m){
|
||||
m.stop(true,true);
|
||||
if(m[0].shadow){
|
||||
m[0].shadow.hide();
|
||||
}
|
||||
m.hide();
|
||||
};
|
||||
};
|
||||
function _46(_47,_48){
|
||||
var _49=null;
|
||||
var fn=$.isFunction(_48)?_48:function(_4a){
|
||||
for(var p in _48){
|
||||
if(_4a[p]!=_48[p]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _4b(_4c){
|
||||
_4c.children("div.menu-item").each(function(){
|
||||
var _4d=$(this).data("menuitem").options;
|
||||
if(fn.call(_47,_4d)==true){
|
||||
_49=$(_47).menu("getItem",this);
|
||||
}else{
|
||||
if(this.submenu&&!_49){
|
||||
_4b(this.submenu);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
_4b($(_47));
|
||||
return _49;
|
||||
};
|
||||
function _16(_4e,_4f,_50){
|
||||
var t=$(_4f);
|
||||
if(t.hasClass("menu-item")){
|
||||
var _51=t.data("menuitem").options;
|
||||
_51.disabled=_50;
|
||||
if(_50){
|
||||
t.addClass("menu-item-disabled");
|
||||
t[0].onclick=null;
|
||||
}else{
|
||||
t.removeClass("menu-item-disabled");
|
||||
t[0].onclick=_51.onclick;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _52(_53,_54){
|
||||
var _55=$.data(_53,"menu").options;
|
||||
var _56=$(_53);
|
||||
if(_54.parent){
|
||||
if(!_54.parent.submenu){
|
||||
var _57=$("<div></div>").appendTo("body");
|
||||
_54.parent.submenu=_57;
|
||||
$("<div class=\"menu-rightarrow\"></div>").appendTo(_54.parent);
|
||||
_b(_53,_57);
|
||||
}
|
||||
_56=_54.parent.submenu;
|
||||
}
|
||||
var div=$("<div></div>").appendTo(_56);
|
||||
_f(_53,div,_54);
|
||||
};
|
||||
function _58(_59,_5a){
|
||||
function _5b(el){
|
||||
if(el.submenu){
|
||||
el.submenu.children("div.menu-item").each(function(){
|
||||
_5b(this);
|
||||
});
|
||||
var _5c=el.submenu[0].shadow;
|
||||
if(_5c){
|
||||
_5c.remove();
|
||||
}
|
||||
el.submenu.remove();
|
||||
}
|
||||
$(el).remove();
|
||||
};
|
||||
_5b(_5a);
|
||||
};
|
||||
function _5d(_5e,_5f,_60){
|
||||
var _61=$(_5f).parent();
|
||||
if(_60){
|
||||
$(_5f).show();
|
||||
}else{
|
||||
$(_5f).hide();
|
||||
}
|
||||
_10(_5e,_61);
|
||||
};
|
||||
function _62(_63){
|
||||
$(_63).children("div.menu-item").each(function(){
|
||||
_58(_63,this);
|
||||
});
|
||||
if(_63.shadow){
|
||||
_63.shadow.remove();
|
||||
}
|
||||
$(_63).remove();
|
||||
};
|
||||
$.fn.menu=function(_64,_65){
|
||||
if(typeof _64=="string"){
|
||||
return $.fn.menu.methods[_64](this,_65);
|
||||
}
|
||||
_64=_64||{};
|
||||
return this.each(function(){
|
||||
var _66=$.data(this,"menu");
|
||||
if(_66){
|
||||
$.extend(_66.options,_64);
|
||||
}else{
|
||||
_66=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_64)});
|
||||
_2(this);
|
||||
}
|
||||
$(this).css({left:_66.options.left,top:_66.options.top});
|
||||
});
|
||||
};
|
||||
$.fn.menu.methods={options:function(jq){
|
||||
return $.data(jq[0],"menu").options;
|
||||
},show:function(jq,pos){
|
||||
return jq.each(function(){
|
||||
_3b(this,pos);
|
||||
});
|
||||
},hide:function(jq){
|
||||
return jq.each(function(){
|
||||
_2b(this);
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_62(this);
|
||||
});
|
||||
},setText:function(jq,_67){
|
||||
return jq.each(function(){
|
||||
var _68=$(_67.target).data("menuitem").options;
|
||||
_68.text=_67.text;
|
||||
$(_67.target).children("div.menu-text").html(_67.text);
|
||||
});
|
||||
},setIcon:function(jq,_69){
|
||||
return jq.each(function(){
|
||||
var _6a=$(_69.target).data("menuitem").options;
|
||||
_6a.iconCls=_69.iconCls;
|
||||
$(_69.target).children("div.menu-icon").remove();
|
||||
if(_69.iconCls){
|
||||
$("<div class=\"menu-icon\"></div>").addClass(_69.iconCls).appendTo(_69.target);
|
||||
}
|
||||
});
|
||||
},getItem:function(jq,_6b){
|
||||
var _6c=$(_6b).data("menuitem").options;
|
||||
return $.extend({},_6c,{target:$(_6b)[0]});
|
||||
},findItem:function(jq,_6d){
|
||||
if(typeof _6d=="string"){
|
||||
return _46(jq[0],function(_6e){
|
||||
return $("<div>"+_6e.text+"</div>").text()==_6d;
|
||||
});
|
||||
}else{
|
||||
return _46(jq[0],_6d);
|
||||
}
|
||||
},appendItem:function(jq,_6f){
|
||||
return jq.each(function(){
|
||||
_52(this,_6f);
|
||||
});
|
||||
},removeItem:function(jq,_70){
|
||||
return jq.each(function(){
|
||||
_58(this,_70);
|
||||
});
|
||||
},enableItem:function(jq,_71){
|
||||
return jq.each(function(){
|
||||
_16(this,_71,false);
|
||||
});
|
||||
},disableItem:function(jq,_72){
|
||||
return jq.each(function(){
|
||||
_16(this,_72,true);
|
||||
});
|
||||
},showItem:function(jq,_73){
|
||||
return jq.each(function(){
|
||||
_5d(this,_73,true);
|
||||
});
|
||||
},hideItem:function(jq,_74){
|
||||
return jq.each(function(){
|
||||
_5d(this,_74,false);
|
||||
});
|
||||
},resize:function(jq,_75){
|
||||
return jq.each(function(){
|
||||
_10(this,_75?$(_75):$(this));
|
||||
});
|
||||
}};
|
||||
$.fn.menu.parseOptions=function(_76){
|
||||
return $.extend({},$.parser.parseOptions(_76,[{minWidth:"number",itemHeight:"number",duration:"number",hideOnUnhover:"boolean"},{fit:"boolean",inline:"boolean",noline:"boolean"}]));
|
||||
};
|
||||
$.fn.menu.defaults={zIndex:110000,left:0,top:0,alignTo:null,align:"left",minWidth:150,itemHeight:32,duration:100,hideOnUnhover:true,inline:false,fit:false,noline:false,events:{mouseenter:_25,mouseleave:_28,mouseover:_2c,mouseout:_30,click:_33},position:function(_77,_78,top){
|
||||
return {left:_78,top:top};
|
||||
},onShow:function(){
|
||||
},onHide:function(){
|
||||
},onClick:function(_79){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
123
static/jeasyui/plugins/jquery.menubutton.js
Executable file
123
static/jeasyui/plugins/jquery.menubutton.js
Executable file
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"menubutton").options;
|
||||
var _4=$(_2);
|
||||
_4.linkbutton(_3);
|
||||
if(_3.hasDownArrow){
|
||||
_4.removeClass(_3.cls.btn1+" "+_3.cls.btn2).addClass("m-btn");
|
||||
_4.removeClass("m-btn-small m-btn-medium m-btn-large").addClass("m-btn-"+_3.size);
|
||||
var _5=_4.find(".l-btn-left");
|
||||
$("<span></span>").addClass(_3.cls.arrow).appendTo(_5);
|
||||
$("<span></span>").addClass("m-btn-line").appendTo(_5);
|
||||
}
|
||||
$(_2).menubutton("resize");
|
||||
if(_3.menu){
|
||||
$(_3.menu).menu({duration:_3.duration});
|
||||
var _6=$(_3.menu).menu("options");
|
||||
var _7=_6.onShow;
|
||||
var _8=_6.onHide;
|
||||
$.extend(_6,{onShow:function(){
|
||||
var _9=$(this).menu("options");
|
||||
var _a=$(_9.alignTo);
|
||||
var _b=_a.menubutton("options");
|
||||
_a.addClass((_b.plain==true)?_b.cls.btn2:_b.cls.btn1);
|
||||
_7.call(this);
|
||||
},onHide:function(){
|
||||
var _c=$(this).menu("options");
|
||||
var _d=$(_c.alignTo);
|
||||
var _e=_d.menubutton("options");
|
||||
_d.removeClass((_e.plain==true)?_e.cls.btn2:_e.cls.btn1);
|
||||
_8.call(this);
|
||||
}});
|
||||
}
|
||||
};
|
||||
function _f(_10){
|
||||
var _11=$.data(_10,"menubutton").options;
|
||||
var btn=$(_10);
|
||||
var t=btn.find("."+_11.cls.trigger);
|
||||
if(!t.length){
|
||||
t=btn;
|
||||
}
|
||||
t._unbind(".menubutton");
|
||||
var _12=null;
|
||||
t._bind(_11.showEvent+".menubutton",function(){
|
||||
if(!_13()){
|
||||
_12=setTimeout(function(){
|
||||
_14(_10);
|
||||
},_11.duration);
|
||||
return false;
|
||||
}
|
||||
})._bind(_11.hideEvent+".menubutton",function(){
|
||||
if(_12){
|
||||
clearTimeout(_12);
|
||||
}
|
||||
$(_11.menu).triggerHandler("mouseleave");
|
||||
});
|
||||
function _13(){
|
||||
return $(_10).linkbutton("options").disabled;
|
||||
};
|
||||
};
|
||||
function _14(_15){
|
||||
var _16=$(_15).menubutton("options");
|
||||
if(_16.disabled||!_16.menu){
|
||||
return;
|
||||
}
|
||||
$("body>div.menu-top").menu("hide");
|
||||
var btn=$(_15);
|
||||
var mm=$(_16.menu);
|
||||
if(mm.length){
|
||||
mm.menu("options").alignTo=btn;
|
||||
mm.menu("show",{alignTo:btn,align:_16.menuAlign});
|
||||
}
|
||||
btn.blur();
|
||||
};
|
||||
$.fn.menubutton=function(_17,_18){
|
||||
if(typeof _17=="string"){
|
||||
var _19=$.fn.menubutton.methods[_17];
|
||||
if(_19){
|
||||
return _19(this,_18);
|
||||
}else{
|
||||
return this.linkbutton(_17,_18);
|
||||
}
|
||||
}
|
||||
_17=_17||{};
|
||||
return this.each(function(){
|
||||
var _1a=$.data(this,"menubutton");
|
||||
if(_1a){
|
||||
$.extend(_1a.options,_17);
|
||||
}else{
|
||||
$.data(this,"menubutton",{options:$.extend({},$.fn.menubutton.defaults,$.fn.menubutton.parseOptions(this),_17)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
}
|
||||
_1(this);
|
||||
_f(this);
|
||||
});
|
||||
};
|
||||
$.fn.menubutton.methods={options:function(jq){
|
||||
var _1b=jq.linkbutton("options");
|
||||
return $.extend($.data(jq[0],"menubutton").options,{toggle:_1b.toggle,selected:_1b.selected,disabled:_1b.disabled});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
var _1c=$(this).menubutton("options");
|
||||
if(_1c.menu){
|
||||
$(_1c.menu).menu("destroy");
|
||||
}
|
||||
$(this).remove();
|
||||
});
|
||||
}};
|
||||
$.fn.menubutton.parseOptions=function(_1d){
|
||||
var t=$(_1d);
|
||||
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,hasDownArrow:true,menu:null,menuAlign:"left",duration:100,showEvent:"mouseenter",hideEvent:"mouseleave",cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}});
|
||||
})(jQuery);
|
||||
|
||||
186
static/jeasyui/plugins/jquery.messager.js
Executable file
186
static/jeasyui/plugins/jquery.messager.js
Executable file
@@ -0,0 +1,186 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(){
|
||||
$(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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
function _7(){
|
||||
$(document)._unbind(".messager");
|
||||
};
|
||||
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:300,height:150,minHeight:0,showType:"slide",showSpeed:600,content:_9.msg,timeout:4000},_9);
|
||||
var _b=$("<div class=\"messager-body\"></div>").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");
|
||||
}
|
||||
},_a.timeout);
|
||||
}
|
||||
};
|
||||
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;
|
||||
};
|
||||
function _d(_e){
|
||||
_1();
|
||||
var _f=$("<div class=\"messager-body\"></div>").appendTo("body");
|
||||
_f.dialog($.extend({},_e,{noheader:(_e.title?false:true),onClose:function(){
|
||||
_7();
|
||||
if(_e.onClose){
|
||||
_e.onClose.call(this);
|
||||
}
|
||||
_f.dialog("destroy");
|
||||
}}));
|
||||
var win=_f.dialog("dialog").addClass("messager-window");
|
||||
win.find(".dialog-button").addClass("messager-button").find("a:first").focus();
|
||||
return _f;
|
||||
};
|
||||
function _6(dlg,_10){
|
||||
var _11=dlg.dialog("options");
|
||||
dlg.dialog("close");
|
||||
_11.fn(_10);
|
||||
};
|
||||
$.messager={show:function(_12){
|
||||
return _8(_12);
|
||||
},alert:function(_13,msg,_14,fn){
|
||||
var _15=typeof _13=="object"?_13:{title:_13,msg:msg,icon:_14,fn:fn};
|
||||
var cls=_15.icon?"messager-icon messager-"+_15.icon:"";
|
||||
_15=$.extend({},$.messager.defaults,{content:"<div class=\""+cls+"\"></div>"+"<div>"+_15.msg+"</div>"+"<div style=\"clear:both;\"></div>"},_15);
|
||||
if(!_15.buttons){
|
||||
_15.buttons=[{text:_15.ok,onClick:function(){
|
||||
_6(dlg);
|
||||
}}];
|
||||
}
|
||||
var dlg=_d(_15);
|
||||
return dlg;
|
||||
},confirm:function(_16,msg,fn){
|
||||
var _17=typeof _16=="object"?_16:{title:_16,msg:msg,fn:fn};
|
||||
_17=$.extend({},$.messager.defaults,{content:"<div class=\"messager-icon messager-question\"></div>"+"<div>"+_17.msg+"</div>"+"<div style=\"clear:both;\"></div>"},_17);
|
||||
if(!_17.buttons){
|
||||
_17.buttons=[{text:_17.ok,onClick:function(){
|
||||
_6(dlg,true);
|
||||
}},{text:_17.cancel,onClick:function(){
|
||||
_6(dlg,false);
|
||||
}}];
|
||||
}
|
||||
var dlg=_d(_17);
|
||||
return dlg;
|
||||
},prompt:function(_18,msg,fn){
|
||||
var _19=typeof _18=="object"?_18:{title:_18,msg:msg,fn:fn};
|
||||
_19=$.extend({},$.messager.defaults,{content:"<div class=\"messager-icon messager-question\"></div>"+"<div>"+_19.msg+"</div>"+"<br>"+"<div style=\"clear:both;\"></div>"+"<div><input class=\"messager-input\" type=\"text\"></div>"},_19);
|
||||
if(!_19.buttons){
|
||||
_19.buttons=[{text:_19.ok,onClick:function(){
|
||||
_6(dlg,dlg.find(".messager-input").val());
|
||||
}},{text:_19.cancel,onClick:function(){
|
||||
_6(dlg);
|
||||
}}];
|
||||
}
|
||||
var dlg=_d(_19);
|
||||
dlg.find(".messager-input").focus();
|
||||
return dlg;
|
||||
},progress:function(_1a){
|
||||
var _1b={bar:function(){
|
||||
return $("body>div.messager-window").find("div.messager-p-bar");
|
||||
},close:function(){
|
||||
var dlg=$("body>div.messager-window>div.messager-body:has(div.messager-progress)");
|
||||
if(dlg.length){
|
||||
dlg.dialog("close");
|
||||
}
|
||||
}};
|
||||
if(typeof _1a=="string"){
|
||||
var _1c=_1b[_1a];
|
||||
return _1c();
|
||||
}
|
||||
_1a=_1a||{};
|
||||
var _1d=$.extend({},{title:"",minHeight:0,content:undefined,msg:"",text:undefined,interval:300},_1a);
|
||||
var dlg=_d($.extend({},$.messager.defaults,{content:"<div class=\"messager-progress\"><div class=\"messager-p-msg\">"+_1d.msg+"</div><div class=\"messager-p-bar\"></div></div>",closable:false,doSize:false},_1d,{onClose:function(){
|
||||
if(this.timer){
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
if(_1a.onClose){
|
||||
_1a.onClose.call(this);
|
||||
}else{
|
||||
$.messager.defaults.onClose.call(this);
|
||||
}
|
||||
}}));
|
||||
var bar=dlg.find("div.messager-p-bar");
|
||||
bar.progressbar({text:_1d.text});
|
||||
dlg.dialog("resize");
|
||||
if(_1d.interval){
|
||||
dlg[0].timer=setInterval(function(){
|
||||
var v=bar.progressbar("getValue");
|
||||
v+=10;
|
||||
if(v>100){
|
||||
v=0;
|
||||
}
|
||||
bar.progressbar("setValue",v);
|
||||
},_1d.interval);
|
||||
}
|
||||
return dlg;
|
||||
}};
|
||||
$.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);
|
||||
|
||||
141
static/jeasyui/plugins/jquery.mobile.js
Normal file
141
static/jeasyui/plugins/jquery.mobile.js
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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);
|
||||
|
||||
187
static/jeasyui/plugins/jquery.numberbox.js
Executable file
187
static/jeasyui/plugins/jquery.numberbox.js
Executable file
@@ -0,0 +1,187 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"numberbox");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("numberbox-f").textbox(_4);
|
||||
$(_2).textbox("textbox").css({imeMode:"disabled"});
|
||||
$(_2).attr("numberboxName",$(_2).attr("textboxName"));
|
||||
_3.numberbox=$(_2).next();
|
||||
_3.numberbox.addClass("numberbox");
|
||||
var _5=_4.parser.call(_2,_4.value);
|
||||
var _6=_4.formatter.call(_2,_5);
|
||||
$(_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("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"){
|
||||
var _f=$.fn.numberbox.methods[_d];
|
||||
if(_f){
|
||||
return _f(this,_e);
|
||||
}else{
|
||||
return this.textbox(_d,_e);
|
||||
}
|
||||
}
|
||||
_d=_d||{};
|
||||
return this.each(function(){
|
||||
var _10=$.data(this,"numberbox");
|
||||
if(_10){
|
||||
$.extend(_10.options,_d);
|
||||
}else{
|
||||
_10=$.data(this,"numberbox",{options:$.extend({},$.fn.numberbox.defaults,$.fn.numberbox.parseOptions(this),_d)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.numberbox.methods={options:function(jq){
|
||||
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});
|
||||
},cloneFrom:function(jq,_12){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("cloneFrom",_12);
|
||||
$.data(this,"numberbox",{options:$.extend(true,{},$(_12).numberbox("options"))});
|
||||
$(this).addClass("numberbox-f");
|
||||
});
|
||||
},fix:function(jq){
|
||||
return jq.each(function(){
|
||||
var _13=$(this).numberbox("options");
|
||||
_13.value=null;
|
||||
var _14=_13.parser.call(this,$(this).numberbox("getText"));
|
||||
$(this).numberbox("setValue",_14);
|
||||
});
|
||||
},setValue:function(jq,_15){
|
||||
return jq.each(function(){
|
||||
_7(this,_15);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("clear");
|
||||
$(this).numberbox("options").value="";
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("reset");
|
||||
$(this).numberbox("setValue",$(this).numberbox("getValue"));
|
||||
});
|
||||
}};
|
||||
$.fn.numberbox.parseOptions=function(_16){
|
||||
var t=$(_16);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_16),$.parser.parseOptions(_16,["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 _17=e.data.target;
|
||||
var _18=$(_17).numberbox("options");
|
||||
return _18.filter.call(_17,e);
|
||||
},blur:function(e){
|
||||
$(e.data.target).numberbox("fix");
|
||||
},keydown:function(e){
|
||||
if(e.keyCode==13){
|
||||
$(e.data.target).numberbox("fix");
|
||||
}
|
||||
}},min:null,max:null,precision:0,decimalSeparator:".",groupSeparator:"",prefix:"",suffix:"",filter:function(e){
|
||||
var _19=$(this).numberbox("options");
|
||||
var s=$(this).numberbox("getText");
|
||||
if(e.metaKey||e.ctrlKey){
|
||||
return true;
|
||||
}
|
||||
if($.inArray(String(e.which),["46","8","13","0"])>=0){
|
||||
return true;
|
||||
}
|
||||
var tmp=$("<span></span>");
|
||||
tmp.html(String.fromCharCode(e.which));
|
||||
var c=tmp.text();
|
||||
tmp.remove();
|
||||
if(!c){
|
||||
return true;
|
||||
}
|
||||
if(c=="-"&&_19.min!=null&&_19.min>=0){
|
||||
return false;
|
||||
}
|
||||
if(c=="-"||c==_19.decimalSeparator){
|
||||
return (s.indexOf(c)==-1)?true:false;
|
||||
}else{
|
||||
if(c==_19.groupSeparator){
|
||||
return true;
|
||||
}else{
|
||||
if("0123456789".indexOf(c)>=0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},formatter:function(_1a){
|
||||
if(!_1a){
|
||||
return _1a;
|
||||
}
|
||||
_1a=_1a+"";
|
||||
var _1b=$(this).numberbox("options");
|
||||
var s1=_1a,s2="";
|
||||
var _1c=_1a.indexOf(".");
|
||||
if(_1c>=0){
|
||||
s1=_1a.substring(0,_1c);
|
||||
s2=_1a.substring(_1c+1,_1a.length);
|
||||
}
|
||||
if(_1b.groupSeparator){
|
||||
var p=/(\d+)(\d{3})/;
|
||||
while(p.test(s1)){
|
||||
s1=s1.replace(p,"$1"+_1b.groupSeparator+"$2");
|
||||
}
|
||||
}
|
||||
if(s2){
|
||||
return _1b.prefix+s1+_1b.decimalSeparator+s2+_1b.suffix;
|
||||
}else{
|
||||
return _1b.prefix+s1+_1b.suffix;
|
||||
}
|
||||
},parser:function(s){
|
||||
s=s+"";
|
||||
var _1d=$(this).numberbox("options");
|
||||
if(_1d.prefix){
|
||||
s=$.trim(s.replace(new RegExp("\\"+$.trim(_1d.prefix),"g"),""));
|
||||
}
|
||||
if(_1d.suffix){
|
||||
s=$.trim(s.replace(new RegExp("\\"+$.trim(_1d.suffix),"g"),""));
|
||||
}
|
||||
if(parseFloat(s)!=_1d.value){
|
||||
if(_1d.groupSeparator){
|
||||
s=$.trim(s.replace(new RegExp("\\"+_1d.groupSeparator,"g"),""));
|
||||
}
|
||||
if(_1d.decimalSeparator){
|
||||
s=$.trim(s.replace(new RegExp("\\"+_1d.decimalSeparator,"g"),"."));
|
||||
}
|
||||
s=s.replace(/\s/g,"");
|
||||
}
|
||||
var val=parseFloat(s).toFixed(_1d.precision);
|
||||
if(isNaN(val)){
|
||||
val="";
|
||||
}else{
|
||||
if(typeof (_1d.min)=="number"&&val<_1d.min){
|
||||
val=_1d.min.toFixed(_1d.precision);
|
||||
}else{
|
||||
if(typeof (_1d.max)=="number"&&val>_1d.max){
|
||||
val=_1d.max.toFixed(_1d.precision);
|
||||
}
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
58
static/jeasyui/plugins/jquery.numberspinner.js
Executable file
58
static/jeasyui/plugins/jquery.numberspinner.js
Executable file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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){
|
||||
$(_2).addClass("numberspinner-f");
|
||||
var _3=$.data(_2,"numberspinner").options;
|
||||
$(_2).numberbox($.extend({},_3,{doSize:false})).spinner(_3);
|
||||
$(_2).numberbox("setValue",_3.value);
|
||||
};
|
||||
function _4(_5,_6){
|
||||
var _7=$.data(_5,"numberspinner").options;
|
||||
var v=parseFloat($(_5).numberbox("getValue")||_7.value)||0;
|
||||
if(_6){
|
||||
v-=_7.increment;
|
||||
}else{
|
||||
v+=_7.increment;
|
||||
}
|
||||
$(_5).numberbox("setValue",v);
|
||||
};
|
||||
$.fn.numberspinner=function(_8,_9){
|
||||
if(typeof _8=="string"){
|
||||
var _a=$.fn.numberspinner.methods[_8];
|
||||
if(_a){
|
||||
return _a(this,_9);
|
||||
}else{
|
||||
return this.numberbox(_8,_9);
|
||||
}
|
||||
}
|
||||
_8=_8||{};
|
||||
return this.each(function(){
|
||||
var _b=$.data(this,"numberspinner");
|
||||
if(_b){
|
||||
$.extend(_b.options,_8);
|
||||
}else{
|
||||
$.data(this,"numberspinner",{options:$.extend({},$.fn.numberspinner.defaults,$.fn.numberspinner.parseOptions(this),_8)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.numberspinner.methods={options:function(jq){
|
||||
var _c=jq.numberbox("options");
|
||||
return $.extend($.data(jq[0],"numberspinner").options,{width:_c.width,value:_c.value,originalValue:_c.originalValue,disabled:_c.disabled,readonly:_c.readonly});
|
||||
}};
|
||||
$.fn.numberspinner.parseOptions=function(_d){
|
||||
return $.extend({},$.fn.spinner.parseOptions(_d),$.fn.numberbox.parseOptions(_d),{});
|
||||
};
|
||||
$.fn.numberspinner.defaults=$.extend({},$.fn.spinner.defaults,$.fn.numberbox.defaults,{spin:function(_e){
|
||||
_4(this,_e);
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
304
static/jeasyui/plugins/jquery.pagination.js
Executable file
304
static/jeasyui/plugins/jquery.pagination.js
Executable file
@@ -0,0 +1,304 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"pagination");
|
||||
var _4=_3.options;
|
||||
var bb=_3.bb={};
|
||||
if(_4.buttons&&!$.isArray(_4.buttons)){
|
||||
$(_4.buttons).insertAfter(_2);
|
||||
}
|
||||
var _5=$(_2).addClass("pagination").html("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr></tr></table>");
|
||||
var tr=_5.find("tr");
|
||||
var aa=$.extend([],_4.layout);
|
||||
if(!_4.showPageList){
|
||||
_6(aa,"list");
|
||||
}
|
||||
if(!_4.showPageInfo){
|
||||
_6(aa,"info");
|
||||
}
|
||||
if(!_4.showRefresh){
|
||||
_6(aa,"refresh");
|
||||
}
|
||||
if(aa[0]=="sep"){
|
||||
aa.shift();
|
||||
}
|
||||
if(aa[aa.length-1]=="sep"){
|
||||
aa.pop();
|
||||
}
|
||||
for(var _7=0;_7<aa.length;_7++){
|
||||
var _8=aa[_7];
|
||||
if(_8=="list"){
|
||||
var ps=$("<select class=\"pagination-page-list\"></select>");
|
||||
ps._bind("change",function(){
|
||||
_4.pageSize=parseInt($(this).val());
|
||||
_4.onChangePageSize.call(_2,_4.pageSize);
|
||||
_10(_2,_4.pageNumber);
|
||||
});
|
||||
for(var i=0;i<_4.pageList.length;i++){
|
||||
$("<option></option>").text(_4.pageList[i]).appendTo(ps);
|
||||
}
|
||||
$("<td></td>").append(ps).appendTo(tr);
|
||||
}else{
|
||||
if(_8=="sep"){
|
||||
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
|
||||
}else{
|
||||
if(_8=="first"){
|
||||
bb.first=_9("first");
|
||||
}else{
|
||||
if(_8=="prev"){
|
||||
bb.prev=_9("prev");
|
||||
}else{
|
||||
if(_8=="next"){
|
||||
bb.next=_9("next");
|
||||
}else{
|
||||
if(_8=="last"){
|
||||
bb.last=_9("last");
|
||||
}else{
|
||||
if(_8=="manual"){
|
||||
$("<span style=\"padding-left:6px;\"></span>").html(_4.beforePageText).appendTo(tr).wrap("<td></td>");
|
||||
bb.num=$("<input class=\"pagination-num\" type=\"text\" value=\"1\" size=\"2\">").appendTo(tr).wrap("<td></td>");
|
||||
bb.num._unbind(".pagination")._bind("keydown.pagination",function(e){
|
||||
if(e.keyCode==13){
|
||||
var _a=parseInt($(this).val())||1;
|
||||
_10(_2,_a);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
bb.after=$("<span style=\"padding-right:6px;\"></span>").appendTo(tr).wrap("<td></td>");
|
||||
}else{
|
||||
if(_8=="refresh"){
|
||||
bb.refresh=_9("refresh");
|
||||
}else{
|
||||
if(_8=="links"){
|
||||
$("<td class=\"pagination-links\"></td>").appendTo(tr);
|
||||
}else{
|
||||
if(_8=="info"){
|
||||
if(_7==aa.length-1){
|
||||
$("<div class=\"pagination-info\"></div>").appendTo(_5);
|
||||
}else{
|
||||
$("<td><div class=\"pagination-info\"></div></td>").appendTo(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_4.buttons){
|
||||
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
|
||||
if($.isArray(_4.buttons)){
|
||||
for(var i=0;i<_4.buttons.length;i++){
|
||||
var _b=_4.buttons[i];
|
||||
if(_b=="-"){
|
||||
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
|
||||
}else{
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var a=$("<a href=\"javascript:;\"></a>").appendTo(td);
|
||||
a[0].onclick=eval(_b.handler||function(){
|
||||
});
|
||||
a.linkbutton($.extend({},_b,{plain:true}));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
$(_4.buttons).appendTo(td).show();
|
||||
}
|
||||
}
|
||||
$("<div style=\"clear:both;\"></div>").appendTo(_5);
|
||||
function _9(_c){
|
||||
var _d=_4.nav[_c];
|
||||
var a=$("<a href=\"javascript:;\"></a>").appendTo(tr);
|
||||
a.wrap("<td></td>");
|
||||
a.linkbutton({iconCls:_d.iconCls,plain:true})._unbind(".pagination")._bind("click.pagination",function(){
|
||||
_d.handler.call(_2);
|
||||
});
|
||||
return a;
|
||||
};
|
||||
function _6(aa,_e){
|
||||
var _f=$.inArray(_e,aa);
|
||||
if(_f>=0){
|
||||
aa.splice(_f,1);
|
||||
}
|
||||
return aa;
|
||||
};
|
||||
};
|
||||
function _10(_11,_12){
|
||||
var _13=$.data(_11,"pagination").options;
|
||||
if(_13.onBeforeSelectPage.call(_11,_12,_13.pageSize)==false){
|
||||
_14(_11);
|
||||
return;
|
||||
}
|
||||
_14(_11,{pageNumber:_12});
|
||||
_13.onSelectPage.call(_11,_13.pageNumber,_13.pageSize);
|
||||
};
|
||||
function _14(_15,_16){
|
||||
var _17=$.data(_15,"pagination");
|
||||
var _18=_17.options;
|
||||
var bb=_17.bb;
|
||||
$.extend(_18,_16||{});
|
||||
var ps=$(_15).find("select.pagination-page-list");
|
||||
if(ps.length){
|
||||
ps.val(_18.pageSize+"");
|
||||
_18.pageSize=parseInt(ps.val());
|
||||
}
|
||||
var _19=Math.ceil(_18.total/_18.pageSize)||1;
|
||||
if(_18.pageNumber<1){
|
||||
_18.pageNumber=1;
|
||||
}
|
||||
if(_18.pageNumber>_19){
|
||||
_18.pageNumber=_19;
|
||||
}
|
||||
if(_18.total==0){
|
||||
_18.pageNumber=0;
|
||||
_19=0;
|
||||
}
|
||||
if(bb.num){
|
||||
bb.num.val(_18.pageNumber);
|
||||
}
|
||||
if(bb.after){
|
||||
bb.after.html(_18.afterPageText.replace(/{pages}/,_19));
|
||||
}
|
||||
var td=$(_15).find("td.pagination-links");
|
||||
if(td.length){
|
||||
td.empty();
|
||||
var _1a=_18.pageNumber-Math.floor(_18.links/2);
|
||||
if(_1a<1){
|
||||
_1a=1;
|
||||
}
|
||||
var _1b=_1a+_18.links-1;
|
||||
if(_1b>_19){
|
||||
_1b=_19;
|
||||
}
|
||||
_1a=_1b-_18.links+1;
|
||||
if(_1a<1){
|
||||
_1a=1;
|
||||
}
|
||||
for(var i=_1a;i<=_1b;i++){
|
||||
var a=$("<a class=\"pagination-link\" href=\"javascript:;\"></a>").appendTo(td);
|
||||
a.linkbutton({plain:true,text:i});
|
||||
if(i==_18.pageNumber){
|
||||
a.linkbutton("select");
|
||||
}else{
|
||||
a._unbind(".pagination")._bind("click.pagination",{pageNumber:i},function(e){
|
||||
_10(_15,e.data.pageNumber);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
var _1c=_18.displayMsg;
|
||||
_1c=_1c.replace(/{from}/,_18.total==0?0:_18.pageSize*(_18.pageNumber-1)+1);
|
||||
_1c=_1c.replace(/{to}/,Math.min(_18.pageSize*(_18.pageNumber),_18.total));
|
||||
_1c=_1c.replace(/{total}/,_18.total);
|
||||
$(_15).find("div.pagination-info").html(_1c);
|
||||
if(bb.first){
|
||||
bb.first.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)});
|
||||
}
|
||||
if(bb.prev){
|
||||
bb.prev.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)});
|
||||
}
|
||||
if(bb.next){
|
||||
bb.next.linkbutton({disabled:(_18.pageNumber==_19)});
|
||||
}
|
||||
if(bb.last){
|
||||
bb.last.linkbutton({disabled:(_18.pageNumber==_19)});
|
||||
}
|
||||
_1d(_15,_18.loading);
|
||||
};
|
||||
function _1d(_1e,_1f){
|
||||
var _20=$.data(_1e,"pagination");
|
||||
var _21=_20.options;
|
||||
_21.loading=_1f;
|
||||
if(_21.showRefresh&&_20.bb.refresh){
|
||||
_20.bb.refresh.linkbutton({iconCls:(_21.loading?"pagination-loading":"pagination-load")});
|
||||
}
|
||||
};
|
||||
$.fn.pagination=function(_22,_23){
|
||||
if(typeof _22=="string"){
|
||||
return $.fn.pagination.methods[_22](this,_23);
|
||||
}
|
||||
_22=_22||{};
|
||||
return this.each(function(){
|
||||
var _24;
|
||||
var _25=$.data(this,"pagination");
|
||||
if(_25){
|
||||
_24=$.extend(_25.options,_22);
|
||||
}else{
|
||||
_24=$.extend({},$.fn.pagination.defaults,$.fn.pagination.parseOptions(this),_22);
|
||||
$.data(this,"pagination",{options:_24});
|
||||
}
|
||||
_1(this);
|
||||
_14(this);
|
||||
});
|
||||
};
|
||||
$.fn.pagination.methods={options:function(jq){
|
||||
return $.data(jq[0],"pagination").options;
|
||||
},loading:function(jq){
|
||||
return jq.each(function(){
|
||||
_1d(this,true);
|
||||
});
|
||||
},loaded:function(jq){
|
||||
return jq.each(function(){
|
||||
_1d(this,false);
|
||||
});
|
||||
},refresh:function(jq,_26){
|
||||
return jq.each(function(){
|
||||
_14(this,_26);
|
||||
});
|
||||
},select:function(jq,_27){
|
||||
return jq.each(function(){
|
||||
_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",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"],onBeforeSelectPage:function(_29,_2a){
|
||||
},onSelectPage:function(_2b,_2c){
|
||||
},onBeforeRefresh:function(_2d,_2e){
|
||||
},onRefresh:function(_2f,_30){
|
||||
},onChangePageSize:function(_31){
|
||||
},beforePageText:"Page",afterPageText:"of {pages}",displayMsg:"Displaying {from} to {to} of {total} items",nav:{first:{iconCls:"pagination-first",handler:function(){
|
||||
var _32=$(this).pagination("options");
|
||||
if(_32.pageNumber>1){
|
||||
$(this).pagination("select",1);
|
||||
}
|
||||
}},prev:{iconCls:"pagination-prev",handler:function(){
|
||||
var _33=$(this).pagination("options");
|
||||
if(_33.pageNumber>1){
|
||||
$(this).pagination("select",_33.pageNumber-1);
|
||||
}
|
||||
}},next:{iconCls:"pagination-next",handler:function(){
|
||||
var _34=$(this).pagination("options");
|
||||
var _35=Math.ceil(_34.total/_34.pageSize);
|
||||
if(_34.pageNumber<_35){
|
||||
$(this).pagination("select",_34.pageNumber+1);
|
||||
}
|
||||
}},last:{iconCls:"pagination-last",handler:function(){
|
||||
var _36=$(this).pagination("options");
|
||||
var _37=Math.ceil(_36.total/_36.pageSize);
|
||||
if(_36.pageNumber<_37){
|
||||
$(this).pagination("select",_37);
|
||||
}
|
||||
}},refresh:{iconCls:"pagination-refresh",handler:function(){
|
||||
var _38=$(this).pagination("options");
|
||||
if(_38.onBeforeRefresh.call(this,_38.pageNumber,_38.pageSize)!=false){
|
||||
$(this).pagination("select",_38.pageNumber);
|
||||
_38.onRefresh.call(this,_38.pageNumber,_38.pageSize);
|
||||
}
|
||||
}}}};
|
||||
})(jQuery);
|
||||
|
||||
694
static/jeasyui/plugins/jquery.panel.js
Executable file
694
static/jeasyui/plugins/jquery.panel.js
Executable file
@@ -0,0 +1,694 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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._remove=function(){
|
||||
return this.each(function(){
|
||||
$(this).remove();
|
||||
try{
|
||||
this.outerHTML="";
|
||||
}
|
||||
catch(err){
|
||||
}
|
||||
});
|
||||
};
|
||||
function _1(_2){
|
||||
_2._remove();
|
||||
};
|
||||
function _3(_4,_5){
|
||||
var _6=$.data(_4,"panel");
|
||||
var _7=_6.options;
|
||||
var _8=_6.panel;
|
||||
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});
|
||||
_7.hasResized=false;
|
||||
}
|
||||
var _d=_8.outerWidth();
|
||||
var _e=_8.outerHeight();
|
||||
_8._size(_7);
|
||||
var _f=_8.outerWidth();
|
||||
var _10=_8.outerHeight();
|
||||
if(_7.hasResized&&(_d==_f&&_e==_10)){
|
||||
return;
|
||||
}
|
||||
_7.hasResized=true;
|
||||
if(!_c){
|
||||
_9._outerWidth(_8.width());
|
||||
}
|
||||
_a._outerWidth(_8.width());
|
||||
if(!isNaN(parseInt(_7.height))){
|
||||
if(_c){
|
||||
if(_7.header){
|
||||
var _11=$(_7.header)._outerWidth();
|
||||
}else{
|
||||
_9.css("width","");
|
||||
var _11=_9._outerWidth();
|
||||
}
|
||||
var _12=_9.find(".panel-title");
|
||||
_11+=Math.min(_12._outerWidth(),_12._outerHeight());
|
||||
var _13=_8.height();
|
||||
_9._outerWidth(_11)._outerHeight(_13);
|
||||
_12._outerWidth(_9.height());
|
||||
_a._outerWidth(_8.width()-_11-_b._outerWidth())._outerHeight(_13);
|
||||
_b._outerHeight(_13);
|
||||
_a.css({left:"",right:""});
|
||||
if(_9.length){
|
||||
_a.css(_7.halign,(_9.position()[_7.halign]+_11)+"px");
|
||||
}
|
||||
_7.panelCssWidth=_8.css("width");
|
||||
if(_7.collapsed){
|
||||
_8._outerWidth(_11+_b._outerWidth());
|
||||
}
|
||||
}else{
|
||||
_a._outerHeight(_8.height()-_9._outerHeight()-_b._outerHeight());
|
||||
}
|
||||
}else{
|
||||
_a.css("height","");
|
||||
var min=$.parser.parseValue("minHeight",_7.minHeight,_8.parent());
|
||||
var max=$.parser.parseValue("maxHeight",_7.maxHeight,_8.parent());
|
||||
var _14=_9._outerHeight()+_b._outerHeight()+_8._outerHeight()-_8.height();
|
||||
_a._size("minHeight",min?(min-_14):"");
|
||||
_a._size("maxHeight",max?(max-_14):"");
|
||||
}
|
||||
_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 _15(_16,_17){
|
||||
var _18=$.data(_16,"panel");
|
||||
var _19=_18.options;
|
||||
var _1a=_18.panel;
|
||||
if(_17){
|
||||
if(_17.left!=null){
|
||||
_19.left=_17.left;
|
||||
}
|
||||
if(_17.top!=null){
|
||||
_19.top=_17.top;
|
||||
}
|
||||
}
|
||||
_1a.css({left:_19.left,top:_19.top});
|
||||
_1a.find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("reposition");
|
||||
});
|
||||
_19.onMove.apply(_16,[_19.left,_19.top]);
|
||||
};
|
||||
function _1b(_1c){
|
||||
$(_1c).addClass("panel-body")._size("clear");
|
||||
var _1d=$("<div class=\"panel\"></div>").insertBefore(_1c);
|
||||
_1d[0].appendChild(_1c);
|
||||
_1d._bind("_resize",function(e,_1e){
|
||||
if($(this).hasClass("easyui-fluid")||_1e){
|
||||
_3(_1c,{});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return _1d;
|
||||
};
|
||||
function _1f(_20){
|
||||
var _21=$.data(_20,"panel");
|
||||
var _22=_21.options;
|
||||
var _23=_21.panel;
|
||||
_23.css(_22.style);
|
||||
_23.addClass(_22.cls);
|
||||
_23.removeClass("panel-hleft panel-hright").addClass("panel-h"+_22.halign);
|
||||
_24();
|
||||
_25();
|
||||
var _26=$(_20).panel("header");
|
||||
var _27=$(_20).panel("body");
|
||||
var _28=$(_20).siblings(".panel-footer");
|
||||
if(_22.border){
|
||||
_26.removeClass("panel-header-noborder");
|
||||
_27.removeClass("panel-body-noborder");
|
||||
_28.removeClass("panel-footer-noborder");
|
||||
}else{
|
||||
_26.addClass("panel-header-noborder");
|
||||
_27.addClass("panel-body-noborder");
|
||||
_28.addClass("panel-footer-noborder");
|
||||
}
|
||||
_26.addClass(_22.headerCls);
|
||||
_27.addClass(_22.bodyCls);
|
||||
$(_20).attr("id",_22.id||"");
|
||||
if(_22.content){
|
||||
$(_20).panel("clear");
|
||||
$(_20).html(_22.content);
|
||||
$.parser.parse($(_20));
|
||||
}
|
||||
function _24(){
|
||||
if(_22.noheader||(!_22.title&&!_22.header)){
|
||||
_1(_23.children(".panel-header"));
|
||||
_23.children(".panel-body").addClass("panel-body-noheader");
|
||||
}else{
|
||||
if(_22.header){
|
||||
$(_22.header).addClass("panel-header").prependTo(_23);
|
||||
}else{
|
||||
var _29=_23.children(".panel-header");
|
||||
if(!_29.length){
|
||||
_29=$("<div class=\"panel-header\"></div>").prependTo(_23);
|
||||
}
|
||||
if(!$.isArray(_22.tools)){
|
||||
_29.find("div.panel-tool .panel-tool-a").appendTo(_22.tools);
|
||||
}
|
||||
_29.empty();
|
||||
var _2a=$("<div class=\"panel-title\"></div>").html(_22.title).appendTo(_29);
|
||||
if(_22.iconCls){
|
||||
_2a.addClass("panel-with-icon");
|
||||
$("<div class=\"panel-icon\"></div>").addClass(_22.iconCls).appendTo(_29);
|
||||
}
|
||||
if(_22.halign=="left"||_22.halign=="right"){
|
||||
_2a.addClass("panel-title-"+_22.titleDirection);
|
||||
}
|
||||
var _2b=$("<div class=\"panel-tool\"></div>").appendTo(_29);
|
||||
_2b._bind("click",function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
if(_22.tools){
|
||||
if($.isArray(_22.tools)){
|
||||
$.map(_22.tools,function(t){
|
||||
_2c(_2b,t.iconCls,eval(t.handler));
|
||||
});
|
||||
}else{
|
||||
$(_22.tools).children().each(function(){
|
||||
$(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(_2b);
|
||||
});
|
||||
}
|
||||
}
|
||||
if(_22.collapsible){
|
||||
_2c(_2b,"panel-tool-collapse",function(){
|
||||
if(_22.collapsed==true){
|
||||
_57(_20,true);
|
||||
}else{
|
||||
_43(_20,true);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(_22.minimizable){
|
||||
_2c(_2b,"panel-tool-min",function(){
|
||||
_62(_20);
|
||||
});
|
||||
}
|
||||
if(_22.maximizable){
|
||||
_2c(_2b,"panel-tool-max",function(){
|
||||
if(_22.maximized==true){
|
||||
_66(_20);
|
||||
}else{
|
||||
_42(_20);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(_22.closable){
|
||||
_2c(_2b,"panel-tool-close",function(){
|
||||
_44(_20);
|
||||
});
|
||||
}
|
||||
}
|
||||
_23.children("div.panel-body").removeClass("panel-body-noheader");
|
||||
}
|
||||
};
|
||||
function _2c(c,_2d,_2e){
|
||||
var a=$("<a href=\"javascript:;\"></a>").addClass(_2d).appendTo(c);
|
||||
a._bind("click",_2e);
|
||||
};
|
||||
function _25(){
|
||||
if(_22.footer){
|
||||
$(_22.footer).addClass("panel-footer").appendTo(_23);
|
||||
$(_20).addClass("panel-body-nobottom");
|
||||
}else{
|
||||
_23.children(".panel-footer").remove();
|
||||
$(_20).removeClass("panel-body-nobottom");
|
||||
}
|
||||
};
|
||||
};
|
||||
function _2f(_30,_31){
|
||||
var _32=$.data(_30,"panel");
|
||||
var _33=_32.options;
|
||||
if(_34){
|
||||
_33.queryParams=_31;
|
||||
}
|
||||
if(!_33.href){
|
||||
return;
|
||||
}
|
||||
if(!_32.isLoaded||!_33.cache){
|
||||
var _34=$.extend({},_33.queryParams);
|
||||
if(_33.onBeforeLoad.call(_30,_34)==false){
|
||||
return;
|
||||
}
|
||||
_32.isLoaded=false;
|
||||
if(_33.loadingMessage){
|
||||
$(_30).panel("clear");
|
||||
$(_30).html($("<div class=\"panel-loading\"></div>").html(_33.loadingMessage));
|
||||
}
|
||||
_33.loader.call(_30,_34,function(_35){
|
||||
var _36=_33.extractor.call(_30,_35);
|
||||
$(_30).panel("clear");
|
||||
$(_30).html(_36);
|
||||
$.parser.parse($(_30));
|
||||
_33.onLoad.apply(_30,arguments);
|
||||
_32.isLoaded=true;
|
||||
},function(){
|
||||
_33.onLoadError.apply(_30,arguments);
|
||||
});
|
||||
}
|
||||
};
|
||||
function _37(_38){
|
||||
var t=$(_38);
|
||||
t.find(".combo-f").each(function(){
|
||||
$(this).combo("destroy");
|
||||
});
|
||||
t.find(".m-btn").each(function(){
|
||||
$(this).menubutton("destroy");
|
||||
});
|
||||
t.find(".s-btn").each(function(){
|
||||
$(this).splitbutton("destroy");
|
||||
});
|
||||
t.find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("destroy");
|
||||
});
|
||||
t.children("div").each(function(){
|
||||
$(this)._size("unfit");
|
||||
});
|
||||
t.empty();
|
||||
};
|
||||
function _39(_3a){
|
||||
$(_3a).panel("doLayout",true);
|
||||
};
|
||||
function _3b(_3c,_3d){
|
||||
var _3e=$.data(_3c,"panel");
|
||||
var _3f=_3e.options;
|
||||
var _40=_3e.panel;
|
||||
if(_3d!=true){
|
||||
if(_3f.onBeforeOpen.call(_3c)==false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
_40.stop(true,true);
|
||||
if($.isFunction(_3f.openAnimation)){
|
||||
_3f.openAnimation.call(_3c,cb);
|
||||
}else{
|
||||
switch(_3f.openAnimation){
|
||||
case "slide":
|
||||
_40.slideDown(_3f.openDuration,cb);
|
||||
break;
|
||||
case "fade":
|
||||
_40.fadeIn(_3f.openDuration,cb);
|
||||
break;
|
||||
case "show":
|
||||
_40.show(_3f.openDuration,cb);
|
||||
break;
|
||||
default:
|
||||
_40.show();
|
||||
cb();
|
||||
}
|
||||
}
|
||||
function cb(){
|
||||
_3f.closed=false;
|
||||
_3f.minimized=false;
|
||||
var _41=_40.children(".panel-header").find("a.panel-tool-restore");
|
||||
if(_41.length){
|
||||
_3f.maximized=true;
|
||||
}
|
||||
_3f.onOpen.call(_3c);
|
||||
if(_3f.maximized==true){
|
||||
_3f.maximized=false;
|
||||
_42(_3c);
|
||||
}
|
||||
if(_3f.collapsed==true){
|
||||
_3f.collapsed=false;
|
||||
_43(_3c);
|
||||
}
|
||||
if(!_3f.collapsed){
|
||||
if(_3f.href&&(!_3e.isLoaded||!_3f.cache)){
|
||||
_2f(_3c);
|
||||
_39(_3c);
|
||||
_3f.doneLayout=true;
|
||||
}
|
||||
}
|
||||
if(!_3f.doneLayout){
|
||||
_3f.doneLayout=true;
|
||||
_39(_3c);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _44(_45,_46){
|
||||
var _47=$.data(_45,"panel");
|
||||
var _48=_47.options;
|
||||
var _49=_47.panel;
|
||||
if(_46!=true){
|
||||
if(_48.onBeforeClose.call(_45)==false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
_49.find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("hide");
|
||||
});
|
||||
_49.stop(true,true);
|
||||
_49._size("unfit");
|
||||
if($.isFunction(_48.closeAnimation)){
|
||||
_48.closeAnimation.call(_45,cb);
|
||||
}else{
|
||||
switch(_48.closeAnimation){
|
||||
case "slide":
|
||||
_49.slideUp(_48.closeDuration,cb);
|
||||
break;
|
||||
case "fade":
|
||||
_49.fadeOut(_48.closeDuration,cb);
|
||||
break;
|
||||
case "hide":
|
||||
_49.hide(_48.closeDuration,cb);
|
||||
break;
|
||||
default:
|
||||
_49.hide();
|
||||
cb();
|
||||
}
|
||||
}
|
||||
function cb(){
|
||||
_48.closed=true;
|
||||
_48.onClose.call(_45);
|
||||
};
|
||||
};
|
||||
function _4a(_4b,_4c){
|
||||
var _4d=$.data(_4b,"panel");
|
||||
var _4e=_4d.options;
|
||||
var _4f=_4d.panel;
|
||||
if(_4c!=true){
|
||||
if(_4e.onBeforeDestroy.call(_4b)==false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
$(_4b).panel("clear").panel("clear","footer");
|
||||
_1(_4f);
|
||||
_4e.onDestroy.call(_4b);
|
||||
};
|
||||
function _43(_50,_51){
|
||||
var _52=$.data(_50,"panel").options;
|
||||
var _53=$.data(_50,"panel").panel;
|
||||
var _54=_53.children(".panel-body");
|
||||
var _55=_53.children(".panel-header");
|
||||
var _56=_55.find("a.panel-tool-collapse");
|
||||
if(_52.collapsed==true){
|
||||
return;
|
||||
}
|
||||
_54.stop(true,true);
|
||||
if(_52.onBeforeCollapse.call(_50)==false){
|
||||
return;
|
||||
}
|
||||
_56.addClass("panel-tool-expand");
|
||||
if(_51==true){
|
||||
if(_52.halign=="left"||_52.halign=="right"){
|
||||
_53.animate({width:_55._outerWidth()+_53.children(".panel-footer")._outerWidth()},function(){
|
||||
cb();
|
||||
});
|
||||
}else{
|
||||
_54.slideUp("normal",function(){
|
||||
cb();
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(_52.halign=="left"||_52.halign=="right"){
|
||||
_53._outerWidth(_55._outerWidth()+_53.children(".panel-footer")._outerWidth());
|
||||
}
|
||||
cb();
|
||||
}
|
||||
function cb(){
|
||||
_54.hide();
|
||||
_52.collapsed=true;
|
||||
_52.onCollapse.call(_50);
|
||||
};
|
||||
};
|
||||
function _57(_58,_59){
|
||||
var _5a=$.data(_58,"panel").options;
|
||||
var _5b=$.data(_58,"panel").panel;
|
||||
var _5c=_5b.children(".panel-body");
|
||||
var _5d=_5b.children(".panel-header").find("a.panel-tool-collapse");
|
||||
if(_5a.collapsed==false){
|
||||
return;
|
||||
}
|
||||
_5c.stop(true,true);
|
||||
if(_5a.onBeforeExpand.call(_58)==false){
|
||||
return;
|
||||
}
|
||||
_5d.removeClass("panel-tool-expand");
|
||||
if(_59==true){
|
||||
if(_5a.halign=="left"||_5a.halign=="right"){
|
||||
_5c.show();
|
||||
_5b.animate({width:_5a.panelCssWidth},function(){
|
||||
cb();
|
||||
});
|
||||
}else{
|
||||
_5c.slideDown("normal",function(){
|
||||
cb();
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(_5a.halign=="left"||_5a.halign=="right"){
|
||||
_5b.css("width",_5a.panelCssWidth);
|
||||
}
|
||||
cb();
|
||||
}
|
||||
function cb(){
|
||||
_5c.show();
|
||||
_5a.collapsed=false;
|
||||
_5a.onExpand.call(_58);
|
||||
_2f(_58);
|
||||
_39(_58);
|
||||
};
|
||||
};
|
||||
function _42(_5e){
|
||||
var _5f=$.data(_5e,"panel").options;
|
||||
var _60=$.data(_5e,"panel").panel;
|
||||
var _61=_60.children(".panel-header").find("a.panel-tool-max");
|
||||
if(_5f.maximized==true){
|
||||
return;
|
||||
}
|
||||
_61.addClass("panel-tool-restore");
|
||||
if(!$.data(_5e,"panel").original){
|
||||
$.data(_5e,"panel").original={width:_5f.width,height:_5f.height,left:_5f.left,top:_5f.top,fit:_5f.fit};
|
||||
}
|
||||
_5f.left=0;
|
||||
_5f.top=0;
|
||||
_5f.fit=true;
|
||||
_3(_5e);
|
||||
_5f.minimized=false;
|
||||
_5f.maximized=true;
|
||||
_5f.onMaximize.call(_5e);
|
||||
};
|
||||
function _62(_63){
|
||||
var _64=$.data(_63,"panel").options;
|
||||
var _65=$.data(_63,"panel").panel;
|
||||
_65._size("unfit");
|
||||
_65.hide();
|
||||
_64.minimized=true;
|
||||
_64.maximized=false;
|
||||
_64.onMinimize.call(_63);
|
||||
};
|
||||
function _66(_67){
|
||||
var _68=$.data(_67,"panel").options;
|
||||
var _69=$.data(_67,"panel").panel;
|
||||
var _6a=_69.children(".panel-header").find("a.panel-tool-max");
|
||||
if(_68.maximized==false){
|
||||
return;
|
||||
}
|
||||
_69.show();
|
||||
_6a.removeClass("panel-tool-restore");
|
||||
$.extend(_68,$.data(_67,"panel").original);
|
||||
_3(_67);
|
||||
_68.minimized=false;
|
||||
_68.maximized=false;
|
||||
$.data(_67,"panel").original=null;
|
||||
_68.onRestore.call(_67);
|
||||
};
|
||||
function _6b(_6c,_6d){
|
||||
$.data(_6c,"panel").options.title=_6d;
|
||||
$(_6c).panel("header").find("div.panel-title").html(_6d);
|
||||
};
|
||||
var _6e=null;
|
||||
$(window)._unbind(".panel")._bind("resize.panel",function(){
|
||||
if(_6e){
|
||||
clearTimeout(_6e);
|
||||
}
|
||||
_6e=setTimeout(function(){
|
||||
var _6f=$("body.layout");
|
||||
if(_6f.length){
|
||||
_6f.layout("resize");
|
||||
$("body").children(".easyui-fluid:visible").each(function(){
|
||||
$(this).triggerHandler("_resize");
|
||||
});
|
||||
}else{
|
||||
$("body").panel("doLayout");
|
||||
}
|
||||
_6e=null;
|
||||
},100);
|
||||
});
|
||||
$.fn.panel=function(_70,_71){
|
||||
if(typeof _70=="string"){
|
||||
return $.fn.panel.methods[_70](this,_71);
|
||||
}
|
||||
_70=_70||{};
|
||||
return this.each(function(){
|
||||
var _72=$.data(this,"panel");
|
||||
var _73;
|
||||
if(_72){
|
||||
_73=$.extend(_72.options,_70);
|
||||
_72.isLoaded=false;
|
||||
}else{
|
||||
_73=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_70);
|
||||
$(this).attr("title","");
|
||||
_72=$.data(this,"panel",{options:_73,panel:_1b(this),isLoaded:false});
|
||||
}
|
||||
_1f(this);
|
||||
$(this).show();
|
||||
if(_73.doSize==true){
|
||||
_72.panel.css("display","block");
|
||||
_3(this);
|
||||
}
|
||||
if(_73.closed==true||_73.minimized==true){
|
||||
_72.panel.hide();
|
||||
}else{
|
||||
_3b(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.panel.methods={options:function(jq){
|
||||
return $.data(jq[0],"panel").options;
|
||||
},panel:function(jq){
|
||||
return $.data(jq[0],"panel").panel;
|
||||
},header:function(jq){
|
||||
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.children(".panel-body");
|
||||
},setTitle:function(jq,_74){
|
||||
return jq.each(function(){
|
||||
_6b(this,_74);
|
||||
});
|
||||
},open:function(jq,_75){
|
||||
return jq.each(function(){
|
||||
_3b(this,_75);
|
||||
});
|
||||
},close:function(jq,_76){
|
||||
return jq.each(function(){
|
||||
_44(this,_76);
|
||||
});
|
||||
},destroy:function(jq,_77){
|
||||
return jq.each(function(){
|
||||
_4a(this,_77);
|
||||
});
|
||||
},clear:function(jq,_78){
|
||||
return jq.each(function(){
|
||||
_37(_78=="footer"?$(this).panel("footer"):this);
|
||||
});
|
||||
},refresh:function(jq,_79){
|
||||
return jq.each(function(){
|
||||
var _7a=$.data(this,"panel");
|
||||
_7a.isLoaded=false;
|
||||
if(_79){
|
||||
if(typeof _79=="string"){
|
||||
_7a.options.href=_79;
|
||||
}else{
|
||||
_7a.options.queryParams=_79;
|
||||
}
|
||||
}
|
||||
_2f(this);
|
||||
});
|
||||
},resize:function(jq,_7b){
|
||||
return jq.each(function(){
|
||||
_3(this,_7b||{});
|
||||
});
|
||||
},doLayout:function(jq,all){
|
||||
return jq.each(function(){
|
||||
_7c(this,"body");
|
||||
_7c($(this).siblings(".panel-footer")[0],"footer");
|
||||
function _7c(_7d,_7e){
|
||||
if(!_7d){
|
||||
return;
|
||||
}
|
||||
var _7f=_7d==$("body")[0];
|
||||
var s=$(_7d).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_80,el){
|
||||
var p=$(el).parents(".panel-"+_7e+":first");
|
||||
return _7f?p.length==0:p[0]==_7d;
|
||||
});
|
||||
s.each(function(){
|
||||
$(this).triggerHandler("_resize",[all||false]);
|
||||
});
|
||||
};
|
||||
});
|
||||
},move:function(jq,_81){
|
||||
return jq.each(function(){
|
||||
_15(this,_81);
|
||||
});
|
||||
},maximize:function(jq){
|
||||
return jq.each(function(){
|
||||
_42(this);
|
||||
});
|
||||
},minimize:function(jq){
|
||||
return jq.each(function(){
|
||||
_62(this);
|
||||
});
|
||||
},restore:function(jq){
|
||||
return jq.each(function(){
|
||||
_66(this);
|
||||
});
|
||||
},collapse:function(jq,_82){
|
||||
return jq.each(function(){
|
||||
_43(this,_82);
|
||||
});
|
||||
},expand:function(jq,_83){
|
||||
return jq.each(function(){
|
||||
_57(this,_83);
|
||||
});
|
||||
}};
|
||||
$.fn.panel.parseOptions=function(_84){
|
||||
var t=$(_84);
|
||||
var hh=t.children(".panel-header,header");
|
||||
var ff=t.children(".panel-footer,footer");
|
||||
return $.extend({},$.parser.parseOptions(_84,["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,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(_85,_86,_87){
|
||||
var _88=$(this).panel("options");
|
||||
if(!_88.href){
|
||||
return false;
|
||||
}
|
||||
$.ajax({type:_88.method,url:_88.href,cache:false,data:_85,dataType:"html",success:function(_89){
|
||||
_86(_89);
|
||||
},error:function(){
|
||||
_87.apply(this,arguments);
|
||||
}});
|
||||
},extractor:function(_8a){
|
||||
var _8b=/<body[^>]*>((.|[\n\r])*)<\/body>/im;
|
||||
var _8c=_8b.exec(_8a);
|
||||
if(_8c){
|
||||
return _8c[1];
|
||||
}else{
|
||||
return _8a;
|
||||
}
|
||||
},onBeforeLoad:function(_8d){
|
||||
},onLoad:function(){
|
||||
},onLoadError:function(){
|
||||
},onBeforeOpen:function(){
|
||||
},onOpen:function(){
|
||||
},onBeforeClose:function(){
|
||||
},onClose:function(){
|
||||
},onBeforeDestroy:function(){
|
||||
},onDestroy:function(){
|
||||
},onResize:function(_8e,_8f){
|
||||
},onMove:function(_90,top){
|
||||
},onMaximize:function(){
|
||||
},onRestore:function(){
|
||||
},onMinimize:function(){
|
||||
},onBeforeCollapse:function(){
|
||||
},onBeforeExpand:function(){
|
||||
},onCollapse:function(){
|
||||
},onExpand:function(){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
393
static/jeasyui/plugins/jquery.parser.js
Executable file
393
static/jeasyui/plugins/jquery.parser.js
Executable file
@@ -0,0 +1,393 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
$.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,emptyFn:function(){
|
||||
},onComplete:function(_b){
|
||||
},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","sidemenu","menubutton","splitbutton","switchbutton","progressbar","radiobutton","checkbox","tree","textbox","passwordbox","maskedbox","filebox","combo","combobox","combotree","combogrid","combotreegrid","tagbox","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","timepicker","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 _d=$.parser.plugins[i];
|
||||
var r=$(".easyui-"+_d,_c);
|
||||
if(r.length){
|
||||
if(r[_d]){
|
||||
r.each(function(){
|
||||
$(this)[_d]($.data(this,"options")||{});
|
||||
});
|
||||
}else{
|
||||
aa.push({name:_d,jq:r});
|
||||
}
|
||||
}
|
||||
}
|
||||
if(aa.length&&window.easyloader){
|
||||
var _e=[];
|
||||
for(var i=0;i<aa.length;i++){
|
||||
_e.push(aa[i].name);
|
||||
}
|
||||
easyloader.load(_e,function(){
|
||||
for(var i=0;i<aa.length;i++){
|
||||
var _f=aa[i].name;
|
||||
var jq=aa[i].jq;
|
||||
jq.each(function(){
|
||||
$(this)[_f]($.data(this,"options")||{});
|
||||
});
|
||||
}
|
||||
$.parser.onComplete.call($.parser,_c);
|
||||
});
|
||||
}else{
|
||||
$.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){
|
||||
_13+=_12[0].offsetWidth-_12[0].clientWidth;
|
||||
v=Math.floor((_12.width()-_13)*v/100);
|
||||
}else{
|
||||
_13+=_12[0].offsetHeight-_12[0].clientHeight;
|
||||
v=Math.floor((_12.height()-_13)*v/100);
|
||||
}
|
||||
}else{
|
||||
v=parseInt(v)||undefined;
|
||||
}
|
||||
return v;
|
||||
},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+"}";
|
||||
}
|
||||
_17=(new Function("return "+s))();
|
||||
}
|
||||
$.map(["width","height","left","top","minWidth","maxWidth","minHeight","maxHeight"],function(p){
|
||||
var pv=$.trim(_15.style[p]||"");
|
||||
if(pv){
|
||||
if(pv.indexOf("%")==-1){
|
||||
pv=parseInt(pv);
|
||||
if(isNaN(pv)){
|
||||
pv=undefined;
|
||||
}
|
||||
}
|
||||
_17[p]=pv;
|
||||
}
|
||||
});
|
||||
if(_16){
|
||||
var _18={};
|
||||
for(var i=0;i<_16.length;i++){
|
||||
var pp=_16[i];
|
||||
if(typeof pp=="string"){
|
||||
_18[pp]=t.attr(pp);
|
||||
}else{
|
||||
for(var _19 in pp){
|
||||
var _1a=pp[_19];
|
||||
if(_1a=="boolean"){
|
||||
_18[_19]=t.attr(_19)?(t.attr(_19)=="true"):undefined;
|
||||
}else{
|
||||
if(_1a=="number"){
|
||||
_18[_19]=t.attr(_19)=="0"?0:parseFloat(t.attr(_19))||undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$.extend(_17,_18);
|
||||
}
|
||||
return _17;
|
||||
},parseVars:function(){
|
||||
var d=$("<div style=\"position:absolute;top:-1000px;width:100px;height:100px;padding:5px\"></div>").appendTo("body");
|
||||
$._boxModel=d.outerWidth()!=100;
|
||||
d.remove();
|
||||
d=$("<div style=\"position:fixed\"></div>").appendTo("body");
|
||||
$._positionFixed=(d.css("position")=="fixed");
|
||||
d.remove();
|
||||
}};
|
||||
$(function(){
|
||||
$.parser.parseVars();
|
||||
if(!window.easyloader&&$.parser.auto){
|
||||
$.parser.parse();
|
||||
}
|
||||
});
|
||||
$.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",_1b);
|
||||
};
|
||||
$.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",_1c);
|
||||
};
|
||||
$.fn._scrollLeft=function(_1d){
|
||||
if(_1d==undefined){
|
||||
return this.scrollLeft();
|
||||
}else{
|
||||
return this.each(function(){
|
||||
$(this).scrollLeft(_1d);
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn._propAttr=$.fn.prop||$.fn.attr;
|
||||
$.fn._bind=$.fn.on;
|
||||
$.fn._unbind=$.fn.off;
|
||||
$.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(_1e=="fit"){
|
||||
return this.each(function(){
|
||||
_20(this,this.tagName=="BODY"?$("body"):$(this).parent(),true);
|
||||
});
|
||||
}else{
|
||||
if(_1e=="unfit"){
|
||||
return this.each(function(){
|
||||
_20(this,$(this).parent(),false);
|
||||
});
|
||||
}else{
|
||||
if(_1f==undefined){
|
||||
return _21(this[0],_1e);
|
||||
}else{
|
||||
return this.each(function(){
|
||||
_21(this,_1e,_1f);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return this.each(function(){
|
||||
_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{
|
||||
$(this).removeClass("easyui-fluid");
|
||||
}
|
||||
});
|
||||
}
|
||||
function _20(_23,_24,fit){
|
||||
if(!_24.length){
|
||||
return false;
|
||||
}
|
||||
var t=$(_23)[0];
|
||||
var p=_24[0];
|
||||
var _25=p.fcount||0;
|
||||
if(fit){
|
||||
if(!t.fitted){
|
||||
t.fitted=true;
|
||||
p.fcount=_25+1;
|
||||
$(p).addClass("panel-noscroll");
|
||||
if(p.tagName=="BODY"){
|
||||
$("html").addClass("panel-fit");
|
||||
}
|
||||
}
|
||||
return {width:($(p).width()||1),height:($(p).height()||1)};
|
||||
}else{
|
||||
if(t.fitted){
|
||||
t.fitted=false;
|
||||
p.fcount=_25-1;
|
||||
if(p.fcount==0){
|
||||
$(p).removeClass("panel-noscroll");
|
||||
if(p.tagName=="BODY"){
|
||||
$("html").removeClass("panel-fit");
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
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,_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(!_2a){
|
||||
_29[p]=v;
|
||||
}
|
||||
t._size("min"+p1,"");
|
||||
t._size("max"+p1,"");
|
||||
t._size(p,v);
|
||||
}else{
|
||||
t._size(p,"");
|
||||
t._size("min"+p1,min);
|
||||
t._size("max"+p1,max);
|
||||
}
|
||||
return _2a||_29.fit;
|
||||
};
|
||||
function _21(_2b,_2c,_2d){
|
||||
var t=$(_2b);
|
||||
if(_2d==undefined){
|
||||
_2d=parseInt(_2b.style[_2c]);
|
||||
if(isNaN(_2d)){
|
||||
return undefined;
|
||||
}
|
||||
if($._boxModel){
|
||||
_2d+=_2e();
|
||||
}
|
||||
return _2d;
|
||||
}else{
|
||||
if(_2d===""){
|
||||
t.css(_2c,"");
|
||||
}else{
|
||||
if($._boxModel){
|
||||
_2d-=_2e();
|
||||
if(_2d<0){
|
||||
_2d=0;
|
||||
}
|
||||
}
|
||||
t.css(_2c,_2d+"px");
|
||||
}
|
||||
}
|
||||
function _2e(){
|
||||
if(_2c.toLowerCase().indexOf("width")>=0){
|
||||
return t.outerWidth()-t.width();
|
||||
}else{
|
||||
return t.outerHeight()-t.height();
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
})(jQuery);
|
||||
(function($){
|
||||
var _2f=null;
|
||||
var _30=null;
|
||||
var _31=false;
|
||||
function _32(e){
|
||||
if(e.touches.length!=1){
|
||||
return;
|
||||
}
|
||||
if(!_31){
|
||||
_31=true;
|
||||
dblClickTimer=setTimeout(function(){
|
||||
_31=false;
|
||||
},500);
|
||||
}else{
|
||||
clearTimeout(dblClickTimer);
|
||||
_31=false;
|
||||
_33(e,"dblclick");
|
||||
}
|
||||
_2f=setTimeout(function(){
|
||||
_33(e,"contextmenu",3);
|
||||
},1000);
|
||||
_33(e,"mousedown");
|
||||
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
function _34(e){
|
||||
if(e.touches.length!=1){
|
||||
return;
|
||||
}
|
||||
if(_2f){
|
||||
clearTimeout(_2f);
|
||||
}
|
||||
_33(e,"mousemove");
|
||||
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
function _35(e){
|
||||
if(_2f){
|
||||
clearTimeout(_2f);
|
||||
}
|
||||
_33(e,"mouseup");
|
||||
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
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",_32,true);
|
||||
document.addEventListener("touchmove",_34,true);
|
||||
document.addEventListener("touchend",_35,true);
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
164
static/jeasyui/plugins/jquery.passwordbox.js
Normal file
164
static/jeasyui/plugins/jquery.passwordbox.js
Normal file
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _b=$(_8).data("passwordbox");
|
||||
var t=$(_8);
|
||||
var _c=t.passwordbox("options");
|
||||
if(_c.revealed){
|
||||
t.textbox("setValue",_9);
|
||||
return;
|
||||
}
|
||||
_b.converting=true;
|
||||
var _d=unescape(_c.passwordChar);
|
||||
var cc=_9.split("");
|
||||
var vv=t.passwordbox("getValue").split("");
|
||||
for(var i=0;i<cc.length;i++){
|
||||
var c=cc[i];
|
||||
if(c!=vv[i]){
|
||||
if(c!=_d){
|
||||
vv.splice(i,0,c);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _e=t.passwordbox("getSelectionStart");
|
||||
if(cc.length<vv.length){
|
||||
vv.splice(_e,vv.length-cc.length,"");
|
||||
}
|
||||
for(var i=0;i<cc.length;i++){
|
||||
if(_a||i!=_e-1){
|
||||
cc[i]=_d;
|
||||
}
|
||||
}
|
||||
t.textbox("setValue",vv.join(""));
|
||||
t.textbox("setText",cc.join(""));
|
||||
t.textbox("setSelectionRange",{start:_e,end:_e});
|
||||
setTimeout(function(){
|
||||
_b.converting=false;
|
||||
},0);
|
||||
};
|
||||
function _6(_f,_10){
|
||||
var t=$(_f);
|
||||
var _11=t.passwordbox("options");
|
||||
var _12=t.next().find(".passwordbox-open");
|
||||
var _13=unescape(_11.passwordChar);
|
||||
_10=_10==undefined?t.textbox("getValue"):_10;
|
||||
t.textbox("setValue",_10);
|
||||
t.textbox("setText",_11.revealed?_10:_10.replace(/./ig,_13));
|
||||
_11.revealed?_12.addClass("passwordbox-close"):_12.removeClass("passwordbox-close");
|
||||
};
|
||||
function _14(e){
|
||||
var _15=e.data.target;
|
||||
var t=$(e.data.target);
|
||||
var _16=t.data("passwordbox");
|
||||
var _17=t.data("passwordbox").options;
|
||||
_16.checking=true;
|
||||
_16.value=t.passwordbox("getText");
|
||||
(function(){
|
||||
if(_16.checking){
|
||||
var _18=t.passwordbox("getText");
|
||||
if(_16.value!=_18){
|
||||
_16.value=_18;
|
||||
if(_16.lastTimer){
|
||||
clearTimeout(_16.lastTimer);
|
||||
_16.lastTimer=undefined;
|
||||
}
|
||||
_7(_15,_18);
|
||||
_16.lastTimer=setTimeout(function(){
|
||||
_7(_15,t.passwordbox("getText"),true);
|
||||
_16.lastTimer=undefined;
|
||||
},_17.lastDelay);
|
||||
}
|
||||
setTimeout(arguments.callee,_17.checkInterval);
|
||||
}
|
||||
})();
|
||||
};
|
||||
function _19(e){
|
||||
var _1a=e.data.target;
|
||||
var _1b=$(_1a).data("passwordbox");
|
||||
_1b.checking=false;
|
||||
if(_1b.lastTimer){
|
||||
clearTimeout(_1b.lastTimer);
|
||||
_1b.lastTimer=undefined;
|
||||
}
|
||||
_6(_1a);
|
||||
};
|
||||
$.fn.passwordbox=function(_1c,_1d){
|
||||
if(typeof _1c=="string"){
|
||||
var _1e=$.fn.passwordbox.methods[_1c];
|
||||
if(_1e){
|
||||
return _1e(this,_1d);
|
||||
}else{
|
||||
return this.textbox(_1c,_1d);
|
||||
}
|
||||
}
|
||||
_1c=_1c||{};
|
||||
return this.each(function(){
|
||||
var _1f=$.data(this,"passwordbox");
|
||||
if(_1f){
|
||||
$.extend(_1f.options,_1c);
|
||||
}else{
|
||||
_1f=$.data(this,"passwordbox",{options:$.extend({},$.fn.passwordbox.defaults,$.fn.passwordbox.parseOptions(this),_1c)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.passwordbox.methods={options:function(jq){
|
||||
return $.data(jq[0],"passwordbox").options;
|
||||
},setValue:function(jq,_20){
|
||||
return jq.each(function(){
|
||||
_6(this,_20);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_6(this,"");
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("reset");
|
||||
_6(this);
|
||||
});
|
||||
},showPassword:function(jq){
|
||||
return jq.each(function(){
|
||||
var _21=$(this).passwordbox("options");
|
||||
_21.revealed=true;
|
||||
_6(this);
|
||||
});
|
||||
},hidePassword:function(jq){
|
||||
return jq.each(function(){
|
||||
var _22=$(this).passwordbox("options");
|
||||
_22.revealed=false;
|
||||
_6(this);
|
||||
});
|
||||
}};
|
||||
$.fn.passwordbox.parseOptions=function(_23){
|
||||
return $.extend({},$.fn.textbox.parseOptions(_23),$.parser.parseOptions(_23,["passwordChar",{checkInterval:"number",lastDelay:"number",revealed:"boolean",showEye:"boolean"}]));
|
||||
};
|
||||
$.fn.passwordbox.defaults=$.extend({},$.fn.textbox.defaults,{passwordChar:"%u25CF",checkInterval:200,lastDelay:500,revealed:false,showEye:true,inputEvents:{focus:_14,blur:_19,keydown:function(e){
|
||||
var _24=$(e.data.target).data("passwordbox");
|
||||
return !_24.converting;
|
||||
}},val:function(_25){
|
||||
return $(_25).parent().prev().passwordbox("getValue");
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
84
static/jeasyui/plugins/jquery.progressbar.js
Executable file
84
static/jeasyui/plugins/jquery.progressbar.js
Executable file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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){
|
||||
$(_2).addClass("progressbar");
|
||||
$(_2).html("<div class=\"progressbar-text\"></div><div class=\"progressbar-value\"><div class=\"progressbar-text\"></div></div>");
|
||||
$(_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);
|
||||
|
||||
427
static/jeasyui/plugins/jquery.propertygrid.js
Executable file
427
static/jeasyui/plugins/jquery.propertygrid.js
Executable file
@@ -0,0 +1,427 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1;
|
||||
$(document)._unbind(".propertygrid")._bind("mousedown.propertygrid",function(e){
|
||||
var p=$(e.target).closest("div.datagrid-view,div.combo-panel");
|
||||
if(p.length){
|
||||
return;
|
||||
}
|
||||
_2(_1);
|
||||
_1=undefined;
|
||||
});
|
||||
function _3(_4){
|
||||
var _5=$.data(_4,"propertygrid");
|
||||
var _6=$.data(_4,"propertygrid").options;
|
||||
$(_4).datagrid($.extend({},_6,{cls:"propertygrid",view:(_6.showGroup?_6.groupView:_6.view),onBeforeEdit:function(_7,_8){
|
||||
if(_6.onBeforeEdit.call(_4,_7,_8)==false){
|
||||
return false;
|
||||
}
|
||||
var dg=$(this);
|
||||
var _8=dg.datagrid("getRows")[_7];
|
||||
var _9=dg.datagrid("getColumnOption","value");
|
||||
_9.editor=_8.editor;
|
||||
},onClickCell:function(_a,_b,_c){
|
||||
if(_1!=this){
|
||||
_2(_1);
|
||||
_1=this;
|
||||
}
|
||||
if(_6.editIndex!=_a){
|
||||
_2(_1);
|
||||
$(this).datagrid("beginEdit",_a);
|
||||
var ed=$(this).datagrid("getEditor",{index:_a,field:_b});
|
||||
if(!ed){
|
||||
ed=$(this).datagrid("getEditor",{index:_a,field:"value"});
|
||||
}
|
||||
if(ed){
|
||||
var t=$(ed.target);
|
||||
var _d=t.data("textbox")?t.textbox("textbox"):t;
|
||||
_d.focus();
|
||||
_6.editIndex=_a;
|
||||
}
|
||||
}
|
||||
_6.onClickCell.call(_4,_a,_b,_c);
|
||||
},loadFilter:function(_e){
|
||||
_2(this);
|
||||
return _6.loadFilter.call(this,_e);
|
||||
}}));
|
||||
};
|
||||
function _2(_f){
|
||||
var t=$(_f);
|
||||
if(!t.length){
|
||||
return;
|
||||
}
|
||||
var _10=$.data(_f,"propertygrid").options;
|
||||
_10.finder.getTr(_f,null,"editing").each(function(){
|
||||
var _11=parseInt($(this).attr("datagrid-row-index"));
|
||||
if(t.datagrid("validateRow",_11)){
|
||||
t.datagrid("endEdit",_11);
|
||||
}else{
|
||||
t.datagrid("cancelEdit",_11);
|
||||
}
|
||||
});
|
||||
_10.editIndex=undefined;
|
||||
};
|
||||
$.fn.propertygrid=function(_12,_13){
|
||||
if(typeof _12=="string"){
|
||||
var _14=$.fn.propertygrid.methods[_12];
|
||||
if(_14){
|
||||
return _14(this,_13);
|
||||
}else{
|
||||
return this.datagrid(_12,_13);
|
||||
}
|
||||
}
|
||||
_12=_12||{};
|
||||
return this.each(function(){
|
||||
var _15=$.data(this,"propertygrid");
|
||||
if(_15){
|
||||
$.extend(_15.options,_12);
|
||||
}else{
|
||||
var _16=$.extend({},$.fn.propertygrid.defaults,$.fn.propertygrid.parseOptions(this),_12);
|
||||
_16.frozenColumns=$.extend(true,[],_16.frozenColumns);
|
||||
_16.columns=$.extend(true,[],_16.columns);
|
||||
$.data(this,"propertygrid",{options:_16});
|
||||
}
|
||||
_3(this);
|
||||
});
|
||||
};
|
||||
$.fn.propertygrid.methods={options:function(jq){
|
||||
return $.data(jq[0],"propertygrid").options;
|
||||
}};
|
||||
$.fn.propertygrid.parseOptions=function(_17){
|
||||
return $.extend({},$.fn.datagrid.parseOptions(_17),$.parser.parseOptions(_17,[{showGroup:"boolean"}]));
|
||||
};
|
||||
var _18=$.extend({},$.fn.datagrid.defaults.view,{render:function(_19,_1a,_1b){
|
||||
var _1c=[];
|
||||
var _1d=this.groups;
|
||||
for(var i=0;i<_1d.length;i++){
|
||||
_1c.push(this.renderGroup.call(this,_19,i,_1d[i],_1b));
|
||||
}
|
||||
$(_1a).html(_1c.join(""));
|
||||
},renderGroup:function(_1e,_1f,_20,_21){
|
||||
var _22=$.data(_1e,"datagrid");
|
||||
var _23=_22.options;
|
||||
var _24=$(_1e).datagrid("getColumnFields",_21);
|
||||
var _25=_23.frozenColumns&&_23.frozenColumns.length;
|
||||
if(_21){
|
||||
if(!(_23.rownumbers||_25)){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var _26=[];
|
||||
var css=_23.groupStyler.call(_1e,_20.value,_20.rows);
|
||||
var cs=_27(css,"datagrid-group");
|
||||
_26.push("<div group-index="+_1f+" "+cs+">");
|
||||
if((_21&&(_23.rownumbers||_23.frozenColumns.length))||(!_21&&!(_23.rownumbers||_23.frozenColumns.length))){
|
||||
_26.push("<span class=\"datagrid-group-expander\">");
|
||||
_26.push("<span class=\"datagrid-row-expander datagrid-row-collapse\"> </span>");
|
||||
_26.push("</span>");
|
||||
}
|
||||
if((_21&&_25)||(!_21)){
|
||||
_26.push("<span class=\"datagrid-group-title\">");
|
||||
_26.push(_23.groupFormatter.call(_1e,_20.value,_20.rows));
|
||||
_26.push("</span>");
|
||||
}
|
||||
_26.push("</div>");
|
||||
_26.push("<table class=\"datagrid-btable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody>");
|
||||
var _28=_20.startIndex;
|
||||
for(var j=0;j<_20.rows.length;j++){
|
||||
var css=_23.rowStyler?_23.rowStyler.call(_1e,_28,_20.rows[j]):"";
|
||||
var _29="";
|
||||
var _2a="";
|
||||
if(typeof css=="string"){
|
||||
_2a=css;
|
||||
}else{
|
||||
if(css){
|
||||
_29=css["class"]||"";
|
||||
_2a=css["style"]||"";
|
||||
}
|
||||
}
|
||||
var cls="class=\"datagrid-row "+(_28%2&&_23.striped?"datagrid-row-alt ":" ")+_29+"\"";
|
||||
var _2b=_2a?"style=\""+_2a+"\"":"";
|
||||
var _2c=_22.rowIdPrefix+"-"+(_21?1:2)+"-"+_28;
|
||||
_26.push("<tr id=\""+_2c+"\" datagrid-row-index=\""+_28+"\" "+cls+" "+_2b+">");
|
||||
_26.push(this.renderRow.call(this,_1e,_24,_21,_28,_20.rows[j]));
|
||||
_26.push("</tr>");
|
||||
_28++;
|
||||
}
|
||||
_26.push("</tbody></table>");
|
||||
return _26.join("");
|
||||
function _27(css,cls){
|
||||
var _2d="";
|
||||
var _2e="";
|
||||
if(typeof css=="string"){
|
||||
_2e=css;
|
||||
}else{
|
||||
if(css){
|
||||
_2d=css["class"]||"";
|
||||
_2e=css["style"]||"";
|
||||
}
|
||||
}
|
||||
return "class=\""+cls+(_2d?" "+_2d:"")+"\" "+"style=\""+_2e+"\"";
|
||||
};
|
||||
},bindEvents:function(_2f){
|
||||
var _30=$.data(_2f,"datagrid");
|
||||
var dc=_30.dc;
|
||||
var _31=dc.body1.add(dc.body2);
|
||||
var _32=($.data(_31[0],"events")||$._data(_31[0],"events")).click[0].handler;
|
||||
_31._unbind("click")._bind("click",function(e){
|
||||
var tt=$(e.target);
|
||||
var _33=tt.closest("span.datagrid-row-expander");
|
||||
if(_33.length){
|
||||
var _34=_33.closest("div.datagrid-group").attr("group-index");
|
||||
if(_33.hasClass("datagrid-row-collapse")){
|
||||
$(_2f).datagrid("collapseGroup",_34);
|
||||
}else{
|
||||
$(_2f).datagrid("expandGroup",_34);
|
||||
}
|
||||
}else{
|
||||
_32(e);
|
||||
}
|
||||
e.stopPropagation();
|
||||
});
|
||||
},onBeforeRender:function(_35,_36){
|
||||
var _37=$.data(_35,"datagrid");
|
||||
var _38=_37.options;
|
||||
_39();
|
||||
var _3a=[];
|
||||
for(var i=0;i<_36.length;i++){
|
||||
var row=_36[i];
|
||||
var _3b=_3c(row[_38.groupField]);
|
||||
if(!_3b){
|
||||
_3b={value:row[_38.groupField],rows:[row]};
|
||||
_3a.push(_3b);
|
||||
}else{
|
||||
_3b.rows.push(row);
|
||||
}
|
||||
}
|
||||
var _3d=0;
|
||||
var _3e=[];
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _3b=_3a[i];
|
||||
_3b.startIndex=_3d;
|
||||
_3d+=_3b.rows.length;
|
||||
_3e=_3e.concat(_3b.rows);
|
||||
}
|
||||
_37.data.rows=_3e;
|
||||
this.groups=_3a;
|
||||
var _3f=this;
|
||||
setTimeout(function(){
|
||||
_3f.bindEvents(_35);
|
||||
},0);
|
||||
function _3c(_40){
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _41=_3a[i];
|
||||
if(_41.value==_40){
|
||||
return _41;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
function _39(){
|
||||
if(!$("#datagrid-group-style").length){
|
||||
$("head").append("<style id=\"datagrid-group-style\">"+".datagrid-group{height:"+_38.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:"+_38.groupHeight+"px;padding:0 4px;}"+".datagrid-group-title{position:relative;}"+".datagrid-group-expander{width:"+_38.expanderWidth+"px;text-align:center;padding:0}"+".datagrid-group-expander .datagrid-row-expander{margin:"+Math.floor((_38.groupHeight-16)/2)+"px 0;display:inline-block;width:16px;height:16px;cursor:pointer}"+"</style>");
|
||||
}
|
||||
};
|
||||
},onAfterRender:function(_42){
|
||||
$.fn.datagrid.defaults.view.onAfterRender.call(this,_42);
|
||||
var _43=this;
|
||||
var _44=$.data(_42,"datagrid");
|
||||
var _45=_44.options;
|
||||
if(!_44.onResizeColumn){
|
||||
_44.onResizeColumn=_45.onResizeColumn;
|
||||
}
|
||||
if(!_44.onResize){
|
||||
_44.onResize=_45.onResize;
|
||||
}
|
||||
_45.onResizeColumn=function(_46,_47){
|
||||
_43.resizeGroup(_42);
|
||||
_44.onResizeColumn.call(_42,_46,_47);
|
||||
};
|
||||
_45.onResize=function(_48,_49){
|
||||
_43.resizeGroup(_42);
|
||||
_44.onResize.call($(_42).datagrid("getPanel")[0],_48,_49);
|
||||
};
|
||||
_43.resizeGroup(_42);
|
||||
}});
|
||||
$.extend($.fn.datagrid.methods,{groups:function(jq){
|
||||
return jq.datagrid("options").view.groups;
|
||||
},expandGroup:function(jq,_4a){
|
||||
return jq.each(function(){
|
||||
var _4b=$(this).datagrid("options");
|
||||
var _4c=$.data(this,"datagrid").dc.view;
|
||||
var _4d=_4c.find(_4a!=undefined?"div.datagrid-group[group-index=\""+_4a+"\"]":"div.datagrid-group");
|
||||
var _4e=_4d.find("span.datagrid-row-expander");
|
||||
if(_4e.hasClass("datagrid-row-expand")){
|
||||
_4e.removeClass("datagrid-row-expand").addClass("datagrid-row-collapse");
|
||||
_4d.next("table").show();
|
||||
}
|
||||
$(this).datagrid("fixRowHeight");
|
||||
if(_4b.onExpandGroup){
|
||||
_4b.onExpandGroup.call(this,_4a);
|
||||
}
|
||||
});
|
||||
},collapseGroup:function(jq,_4f){
|
||||
return jq.each(function(){
|
||||
var _50=$(this).datagrid("options");
|
||||
var _51=$.data(this,"datagrid").dc.view;
|
||||
var _52=_51.find(_4f!=undefined?"div.datagrid-group[group-index=\""+_4f+"\"]":"div.datagrid-group");
|
||||
var _53=_52.find("span.datagrid-row-expander");
|
||||
if(_53.hasClass("datagrid-row-collapse")){
|
||||
_53.removeClass("datagrid-row-collapse").addClass("datagrid-row-expand");
|
||||
_52.next("table").hide();
|
||||
}
|
||||
$(this).datagrid("fixRowHeight");
|
||||
if(_50.onCollapseGroup){
|
||||
_50.onCollapseGroup.call(this,_4f);
|
||||
}
|
||||
});
|
||||
},scrollToGroup:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
var _55=$.data(this,"datagrid");
|
||||
var dc=_55.dc;
|
||||
var _56=dc.body2.children("div.datagrid-group[group-index=\""+_54+"\"]");
|
||||
if(_56.length){
|
||||
var _57=_56.outerHeight();
|
||||
var _58=dc.view2.children("div.datagrid-header")._outerHeight();
|
||||
var _59=dc.body2.outerHeight(true)-dc.body2.outerHeight();
|
||||
var top=_56.position().top-_58-_59;
|
||||
if(top<0){
|
||||
dc.body2.scrollTop(dc.body2.scrollTop()+top);
|
||||
}else{
|
||||
if(top+_57>dc.body2.height()-18){
|
||||
dc.body2.scrollTop(dc.body2.scrollTop()+top+_57-dc.body2.height()+18);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}});
|
||||
$.extend(_18,{refreshGroupTitle:function(_5a,_5b){
|
||||
var _5c=$.data(_5a,"datagrid");
|
||||
var _5d=_5c.options;
|
||||
var dc=_5c.dc;
|
||||
var _5e=this.groups[_5b];
|
||||
var _5f=dc.body1.add(dc.body2).children("div.datagrid-group[group-index="+_5b+"]").find("span.datagrid-group-title");
|
||||
_5f.html(_5d.groupFormatter.call(_5a,_5e.value,_5e.rows));
|
||||
},resizeGroup:function(_60,_61){
|
||||
var _62=$.data(_60,"datagrid");
|
||||
var dc=_62.dc;
|
||||
var ht=dc.header2.find("table");
|
||||
var fr=ht.find("tr.datagrid-filter-row").hide();
|
||||
var ww=dc.body2.children("table.datagrid-btable:first").width();
|
||||
if(_61==undefined){
|
||||
var _63=dc.body2.children("div.datagrid-group");
|
||||
}else{
|
||||
var _63=dc.body2.children("div.datagrid-group[group-index="+_61+"]");
|
||||
}
|
||||
_63._outerWidth(ww);
|
||||
var _64=_62.options;
|
||||
if(_64.frozenColumns&&_64.frozenColumns.length){
|
||||
var _65=dc.view1.width()-_64.expanderWidth;
|
||||
var _66=dc.view1.css("direction").toLowerCase()=="rtl";
|
||||
_63.find(".datagrid-group-title").css(_66?"right":"left",-_65+"px");
|
||||
}
|
||||
if(fr.length){
|
||||
if(_64.showFilterBar){
|
||||
fr.show();
|
||||
}
|
||||
}
|
||||
},insertRow:function(_67,_68,row){
|
||||
var _69=$.data(_67,"datagrid");
|
||||
var _6a=_69.options;
|
||||
var dc=_69.dc;
|
||||
var _6b=null;
|
||||
var _6c;
|
||||
if(!_69.data.rows.length){
|
||||
$(_67).datagrid("loadData",[row]);
|
||||
return;
|
||||
}
|
||||
for(var i=0;i<this.groups.length;i++){
|
||||
if(this.groups[i].value==row[_6a.groupField]){
|
||||
_6b=this.groups[i];
|
||||
_6c=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_6b){
|
||||
if(_68==undefined||_68==null){
|
||||
_68=_69.data.rows.length;
|
||||
}
|
||||
if(_68<_6b.startIndex){
|
||||
_68=_6b.startIndex;
|
||||
}else{
|
||||
if(_68>_6b.startIndex+_6b.rows.length){
|
||||
_68=_6b.startIndex+_6b.rows.length;
|
||||
}
|
||||
}
|
||||
$.fn.datagrid.defaults.view.insertRow.call(this,_67,_68,row);
|
||||
if(_68>=_6b.startIndex+_6b.rows.length){
|
||||
_6d(_68,true);
|
||||
_6d(_68,false);
|
||||
}
|
||||
_6b.rows.splice(_68-_6b.startIndex,0,row);
|
||||
}else{
|
||||
_6b={value:row[_6a.groupField],rows:[row],startIndex:_69.data.rows.length};
|
||||
_6c=this.groups.length;
|
||||
dc.body1.append(this.renderGroup.call(this,_67,_6c,_6b,true));
|
||||
dc.body2.append(this.renderGroup.call(this,_67,_6c,_6b,false));
|
||||
this.groups.push(_6b);
|
||||
_69.data.rows.push(row);
|
||||
}
|
||||
this.setGroupIndex(_67);
|
||||
this.refreshGroupTitle(_67,_6c);
|
||||
this.resizeGroup(_67);
|
||||
function _6d(_6e,_6f){
|
||||
var _70=_6f?1:2;
|
||||
var _71=_6a.finder.getTr(_67,_6e-1,"body",_70);
|
||||
var tr=_6a.finder.getTr(_67,_6e,"body",_70);
|
||||
tr.insertAfter(_71);
|
||||
};
|
||||
},updateRow:function(_72,_73,row){
|
||||
var _74=$.data(_72,"datagrid").options;
|
||||
$.fn.datagrid.defaults.view.updateRow.call(this,_72,_73,row);
|
||||
var tb=_74.finder.getTr(_72,_73,"body",2).closest("table.datagrid-btable");
|
||||
var _75=parseInt(tb.prev().attr("group-index"));
|
||||
this.refreshGroupTitle(_72,_75);
|
||||
},deleteRow:function(_76,_77){
|
||||
var _78=$.data(_76,"datagrid");
|
||||
var _79=_78.options;
|
||||
var dc=_78.dc;
|
||||
var _7a=dc.body1.add(dc.body2);
|
||||
var tb=_79.finder.getTr(_76,_77,"body",2).closest("table.datagrid-btable");
|
||||
var _7b=parseInt(tb.prev().attr("group-index"));
|
||||
$.fn.datagrid.defaults.view.deleteRow.call(this,_76,_77);
|
||||
var _7c=this.groups[_7b];
|
||||
if(_7c.rows.length>1){
|
||||
_7c.rows.splice(_77-_7c.startIndex,1);
|
||||
this.refreshGroupTitle(_76,_7b);
|
||||
}else{
|
||||
_7a.children("div.datagrid-group[group-index="+_7b+"]").remove();
|
||||
for(var i=_7b+1;i<this.groups.length;i++){
|
||||
_7a.children("div.datagrid-group[group-index="+i+"]").attr("group-index",i-1);
|
||||
}
|
||||
this.groups.splice(_7b,1);
|
||||
}
|
||||
this.setGroupIndex(_76);
|
||||
},setGroupIndex:function(_7d){
|
||||
var _7e=0;
|
||||
for(var i=0;i<this.groups.length;i++){
|
||||
var _7f=this.groups[i];
|
||||
_7f.startIndex=_7e;
|
||||
_7e+=_7f.rows.length;
|
||||
}
|
||||
}});
|
||||
$.fn.propertygrid.defaults=$.extend({},$.fn.datagrid.defaults,{groupHeight:28,expanderWidth:20,singleSelect:true,remoteSort:false,fitColumns:true,loadMsg:"",frozenColumns:[[{field:"f",width:20,resizable:false}]],columns:[[{field:"name",title:"Name",width:100,sortable:true},{field:"value",title:"Value",width:100,resizable:false}]],showGroup:false,groupView:_18,groupField:"group",groupStyler:function(_80,_81){
|
||||
return "";
|
||||
},groupFormatter:function(_82,_83){
|
||||
return _82;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
204
static/jeasyui/plugins/jquery.radiobutton.js
Normal file
204
static/jeasyui/plugins/jquery.radiobutton.js
Normal file
@@ -0,0 +1,204 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
var _4=$("<span class=\"radiobutton inputbox\">"+"<span class=\"radiobutton-inner\" style=\"display:none\"></span>"+"<input type=\"radio\" class=\"radiobutton-value\">"+"</span>").insertAfter(_3);
|
||||
var t=$(_3);
|
||||
t.addClass("radiobutton-f").hide();
|
||||
var _5=t.attr("name");
|
||||
if(_5){
|
||||
t.removeAttr("name").attr("radiobuttonName",_5);
|
||||
_4.find(".radiobutton-value").attr("name",_5);
|
||||
}
|
||||
return _4;
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"radiobutton");
|
||||
var _9=_8.options;
|
||||
var _a=_8.radiobutton;
|
||||
var _b="_easyui_radiobutton_"+(++_1);
|
||||
var _c=_a.find(".radiobutton-value").attr("id",_b);
|
||||
_c._unbind(".radiobutton")._bind("change.radiobutton",function(e){
|
||||
return false;
|
||||
});
|
||||
if(_9.label){
|
||||
if(typeof _9.label=="object"){
|
||||
_8.label=$(_9.label);
|
||||
_8.label.attr("for",_b);
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
_8.label=$("<label class=\"textbox-label\"></label>").html(_9.label);
|
||||
_8.label.css("textAlign",_9.labelAlign).attr("for",_b);
|
||||
if(_9.labelPosition=="after"){
|
||||
_8.label.insertAfter(_a);
|
||||
}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();
|
||||
}
|
||||
$(_7).radiobutton("setValue",_9.value);
|
||||
_d(_7,_9.checked);
|
||||
_e(_7,_9.readonly);
|
||||
_f(_7,_9.disabled);
|
||||
};
|
||||
function _10(_11){
|
||||
var _12=$.data(_11,"radiobutton");
|
||||
var _13=_12.options;
|
||||
var _14=_12.radiobutton;
|
||||
_14._unbind(".radiobutton")._bind("click.radiobutton",function(){
|
||||
if(!_13.disabled&&!_13.readonly){
|
||||
_d(_11,true);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _15(_16){
|
||||
var _17=$.data(_16,"radiobutton");
|
||||
var _18=_17.options;
|
||||
var _19=_17.radiobutton;
|
||||
_19._size(_18,_19.parent());
|
||||
if(_18.label&&_18.labelPosition){
|
||||
if(_18.labelPosition=="top"){
|
||||
_17.label._size({width:_18.labelWidth},_19);
|
||||
}else{
|
||||
_17.label._size({width:_18.labelWidth,height:_19.outerHeight()},_19);
|
||||
_17.label.css("lineHeight",_19.outerHeight()+"px");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _d(_1a,_1b){
|
||||
if(_1b){
|
||||
var f=$(_1a).closest("form");
|
||||
var _1c=$(_1a).attr("radiobuttonName");
|
||||
f.find(".radiobutton-f[radiobuttonName=\""+_1c+"\"]").each(function(){
|
||||
if(this!=_1a){
|
||||
_1d(this,false);
|
||||
}
|
||||
});
|
||||
_1d(_1a,true);
|
||||
}else{
|
||||
_1d(_1a,false);
|
||||
}
|
||||
function _1d(b,c){
|
||||
var _1e=$(b).data("radiobutton");
|
||||
var _1f=_1e.options;
|
||||
var _20=_1e.radiobutton;
|
||||
_20.find(".radiobutton-inner").css("display",c?"":"none");
|
||||
_20.find(".radiobutton-value")._propAttr("checked",c);
|
||||
if(c){
|
||||
_20.addClass("radiobutton-checked");
|
||||
$(_1e.label).addClass("textbox-label-checked");
|
||||
}else{
|
||||
_20.removeClass("radiobutton-checked");
|
||||
$(_1e.label).removeClass("textbox-label-checked");
|
||||
}
|
||||
if(_1f.checked!=c){
|
||||
_1f.checked=c;
|
||||
_1f.onChange.call($(b)[0],c);
|
||||
$(b).closest("form").trigger("_change",[$(b)[0]]);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _f(_21,_22){
|
||||
var _23=$.data(_21,"radiobutton");
|
||||
var _24=_23.options;
|
||||
var _25=_23.radiobutton;
|
||||
var rv=_25.find(".radiobutton-value");
|
||||
_24.disabled=_22;
|
||||
if(_22){
|
||||
$(_21).add(rv)._propAttr("disabled",true);
|
||||
_25.addClass("radiobutton-disabled");
|
||||
$(_23.label).addClass("textbox-label-disabled");
|
||||
}else{
|
||||
$(_21).add(rv)._propAttr("disabled",false);
|
||||
_25.removeClass("radiobutton-disabled");
|
||||
$(_23.label).removeClass("textbox-label-disabled");
|
||||
}
|
||||
};
|
||||
function _e(_26,_27){
|
||||
var _28=$.data(_26,"radiobutton");
|
||||
var _29=_28.options;
|
||||
_29.readonly=_27==undefined?true:_27;
|
||||
if(_29.readonly){
|
||||
_28.radiobutton.addClass("radiobutton-readonly");
|
||||
$(_28.label).addClass("textbox-label-readonly");
|
||||
}else{
|
||||
_28.radiobutton.removeClass("radiobutton-readonly");
|
||||
$(_28.label).removeClass("textbox-label-readonly");
|
||||
}
|
||||
};
|
||||
$.fn.radiobutton=function(_2a,_2b){
|
||||
if(typeof _2a=="string"){
|
||||
return $.fn.radiobutton.methods[_2a](this,_2b);
|
||||
}
|
||||
_2a=_2a||{};
|
||||
return this.each(function(){
|
||||
var _2c=$.data(this,"radiobutton");
|
||||
if(_2c){
|
||||
$.extend(_2c.options,_2a);
|
||||
}else{
|
||||
_2c=$.data(this,"radiobutton",{options:$.extend({},$.fn.radiobutton.defaults,$.fn.radiobutton.parseOptions(this),_2a),radiobutton:_2(this)});
|
||||
}
|
||||
_2c.options.originalChecked=_2c.options.checked;
|
||||
_6(this);
|
||||
_10(this);
|
||||
_15(this);
|
||||
});
|
||||
};
|
||||
$.fn.radiobutton.methods={options:function(jq){
|
||||
var _2d=jq.data("radiobutton");
|
||||
return $.extend(_2d.options,{value:_2d.radiobutton.find(".radiobutton-value").val()});
|
||||
},setValue:function(jq,_2e){
|
||||
return jq.each(function(){
|
||||
$(this).val(_2e);
|
||||
$.data(this,"radiobutton").radiobutton.find(".radiobutton-value").val(_2e);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,true);
|
||||
});
|
||||
},readonly:function(jq,_2f){
|
||||
return jq.each(function(){
|
||||
_e(this,_2f);
|
||||
});
|
||||
},check:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,true);
|
||||
});
|
||||
},uncheck:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _30=$(this).radiobutton("options");
|
||||
_d(this,_30.originalChecked);
|
||||
});
|
||||
}};
|
||||
$.fn.radiobutton.parseOptions=function(_31){
|
||||
var t=$(_31);
|
||||
return $.extend({},$.parser.parseOptions(_31,["label","labelPosition","labelAlign",{labelWidth:"number"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
|
||||
};
|
||||
$.fn.radiobutton.defaults={width:20,height:20,value:null,disabled:false,readonly:false,checked:false,label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",onChange:function(_32){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
173
static/jeasyui/plugins/jquery.resizable.js
Executable file
173
static/jeasyui/plugins/jquery.resizable.js
Executable file
@@ -0,0 +1,173 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(e){
|
||||
var _2=e.data;
|
||||
var _3=$.data(_2.target,"resizable").options;
|
||||
if(_2.dir.indexOf("e")!=-1){
|
||||
var _4=_2.startWidth+e.pageX-_2.startX;
|
||||
_4=Math.min(Math.max(_4,_3.minWidth),_3.maxWidth);
|
||||
_2.width=_4;
|
||||
}
|
||||
if(_2.dir.indexOf("s")!=-1){
|
||||
var _5=_2.startHeight+e.pageY-_2.startY;
|
||||
_5=Math.min(Math.max(_5,_3.minHeight),_3.maxHeight);
|
||||
_2.height=_5;
|
||||
}
|
||||
if(_2.dir.indexOf("w")!=-1){
|
||||
var _4=_2.startWidth-e.pageX+_2.startX;
|
||||
_4=Math.min(Math.max(_4,_3.minWidth),_3.maxWidth);
|
||||
_2.width=_4;
|
||||
_2.left=_2.startLeft+_2.startWidth-_2.width;
|
||||
}
|
||||
if(_2.dir.indexOf("n")!=-1){
|
||||
var _5=_2.startHeight-e.pageY+_2.startY;
|
||||
_5=Math.min(Math.max(_5,_3.minHeight),_3.maxHeight);
|
||||
_2.height=_5;
|
||||
_2.top=_2.startTop+_2.startHeight-_2.height;
|
||||
}
|
||||
};
|
||||
function _6(e){
|
||||
var _7=e.data;
|
||||
var t=$(_7.target);
|
||||
t.css({left:_7.left,top:_7.top});
|
||||
if(t.outerWidth()!=_7.width){
|
||||
t._outerWidth(_7.width);
|
||||
}
|
||||
if(t.outerHeight()!=_7.height){
|
||||
t._outerHeight(_7.height);
|
||||
}
|
||||
};
|
||||
function _8(e){
|
||||
$.fn.resizable.isResizing=true;
|
||||
$.data(e.data.target,"resizable").options.onStartResize.call(e.data.target,e);
|
||||
return false;
|
||||
};
|
||||
function _9(e){
|
||||
_1(e);
|
||||
if($.data(e.data.target,"resizable").options.onResize.call(e.data.target,e)!=false){
|
||||
_6(e);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
function _a(e){
|
||||
$.fn.resizable.isResizing=false;
|
||||
_1(e,true);
|
||||
_6(e);
|
||||
$.data(e.data.target,"resizable").options.onStopResize.call(e.data.target,e);
|
||||
$(document)._unbind(".resizable");
|
||||
$("body").css("cursor","");
|
||||
return false;
|
||||
};
|
||||
function _b(e){
|
||||
var _c=$(e.data.target).resizable("options");
|
||||
var tt=$(e.data.target);
|
||||
var _d="";
|
||||
var _e=tt.offset();
|
||||
var _f=tt.outerWidth();
|
||||
var _10=tt.outerHeight();
|
||||
var _11=_c.edge;
|
||||
if(e.pageY>_e.top&&e.pageY<_e.top+_11){
|
||||
_d+="n";
|
||||
}else{
|
||||
if(e.pageY<_e.top+_10&&e.pageY>_e.top+_10-_11){
|
||||
_d+="s";
|
||||
}
|
||||
}
|
||||
if(e.pageX>_e.left&&e.pageX<_e.left+_11){
|
||||
_d+="w";
|
||||
}else{
|
||||
if(e.pageX<_e.left+_f&&e.pageX>_e.left+_f-_11){
|
||||
_d+="e";
|
||||
}
|
||||
}
|
||||
var _12=_c.handles.split(",");
|
||||
_12=$.map(_12,function(h){
|
||||
return $.trim(h).toLowerCase();
|
||||
});
|
||||
if($.inArray("all",_12)>=0||$.inArray(_d,_12)>=0){
|
||||
return _d;
|
||||
}
|
||||
for(var i=0;i<_d.length;i++){
|
||||
var _13=$.inArray(_d.substr(i,1),_12);
|
||||
if(_13>=0){
|
||||
return _12[_13];
|
||||
}
|
||||
}
|
||||
return "";
|
||||
};
|
||||
$.fn.resizable=function(_14,_15){
|
||||
if(typeof _14=="string"){
|
||||
return $.fn.resizable.methods[_14](this,_15);
|
||||
}
|
||||
return this.each(function(){
|
||||
var _16=null;
|
||||
var _17=$.data(this,"resizable");
|
||||
if(_17){
|
||||
$(this)._unbind(".resizable");
|
||||
_16=$.extend(_17.options,_14||{});
|
||||
}else{
|
||||
_16=$.extend({},$.fn.resizable.defaults,$.fn.resizable.parseOptions(this),_14||{});
|
||||
$.data(this,"resizable",{options:_16});
|
||||
}
|
||||
if(_16.disabled==true){
|
||||
return;
|
||||
}
|
||||
$(this)._bind("mousemove.resizable",{target:this},function(e){
|
||||
if($.fn.resizable.isResizing){
|
||||
return;
|
||||
}
|
||||
var dir=_b(e);
|
||||
$(e.data.target).css("cursor",dir?dir+"-resize":"");
|
||||
})._bind("mouseleave.resizable",{target:this},function(e){
|
||||
$(e.data.target).css("cursor","");
|
||||
})._bind("mousedown.resizable",{target:this},function(e){
|
||||
var dir=_b(e);
|
||||
if(dir==""){
|
||||
return;
|
||||
}
|
||||
function _18(css){
|
||||
var val=parseInt($(e.data.target).css(css));
|
||||
if(isNaN(val)){
|
||||
return 0;
|
||||
}else{
|
||||
return val;
|
||||
}
|
||||
};
|
||||
var _19={target:e.data.target,dir:dir,startLeft:_18("left"),startTop:_18("top"),left:_18("left"),top:_18("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",_19,_8);
|
||||
$(document)._bind("mousemove.resizable",_19,_9);
|
||||
$(document)._bind("mouseup.resizable",_19,_a);
|
||||
$("body").css("cursor",dir+"-resize");
|
||||
});
|
||||
});
|
||||
};
|
||||
$.fn.resizable.methods={options:function(jq){
|
||||
return $.data(jq[0],"resizable").options;
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).resizable({disabled:false});
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).resizable({disabled:true});
|
||||
});
|
||||
}};
|
||||
$.fn.resizable.parseOptions=function(_1a){
|
||||
var t=$(_1a);
|
||||
return $.extend({},$.parser.parseOptions(_1a,["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){
|
||||
},onStopResize:function(e){
|
||||
}};
|
||||
$.fn.resizable.isResizing=false;
|
||||
})(jQuery);
|
||||
|
||||
132
static/jeasyui/plugins/jquery.searchbox.js
Executable file
132
static/jeasyui/plugins/jquery.searchbox.js
Executable file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"searchbox");
|
||||
var _4=_3.options;
|
||||
var _5=$.extend(true,[],_4.icons);
|
||||
_5.push({iconCls:"searchbox-button",handler:function(e){
|
||||
var t=$(e.data.target);
|
||||
var _6=t.searchbox("options");
|
||||
_6.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName"));
|
||||
}});
|
||||
_7();
|
||||
var _8=_9();
|
||||
$(_2).addClass("searchbox-f").textbox($.extend({},_4,{icons:_5,buttonText:(_8?_8.text:"")}));
|
||||
$(_2).attr("searchboxName",$(_2).attr("textboxName"));
|
||||
_3.searchbox=$(_2).next();
|
||||
_3.searchbox.addClass("searchbox");
|
||||
_a(_8);
|
||||
function _7(){
|
||||
if(_4.menu){
|
||||
_3.menu=$(_4.menu).menu();
|
||||
var _b=_3.menu.menu("options");
|
||||
var _c=_b.onClick;
|
||||
_b.onClick=function(_d){
|
||||
_a(_d);
|
||||
_c.call(this,_d);
|
||||
};
|
||||
}else{
|
||||
if(_3.menu){
|
||||
_3.menu.menu("destroy");
|
||||
}
|
||||
_3.menu=null;
|
||||
}
|
||||
};
|
||||
function _9(){
|
||||
if(_3.menu){
|
||||
var _e=_3.menu.children("div.menu-item:first");
|
||||
_3.menu.children("div.menu-item").each(function(){
|
||||
var _f=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)});
|
||||
if(_f.selected){
|
||||
_e=$(this);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return _3.menu.menu("getItem",_e[0]);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
};
|
||||
function _a(_10){
|
||||
if(!_10){
|
||||
return;
|
||||
}
|
||||
$(_2).textbox("button").menubutton({text:_10.text,iconCls:(_10.iconCls||null),menu:_3.menu,menuAlign:_4.buttonAlign,plain:false});
|
||||
_3.searchbox.find("input.textbox-value").attr("name",_10.name||_10.text);
|
||||
$(_2).searchbox("resize");
|
||||
};
|
||||
};
|
||||
$.fn.searchbox=function(_11,_12){
|
||||
if(typeof _11=="string"){
|
||||
var _13=$.fn.searchbox.methods[_11];
|
||||
if(_13){
|
||||
return _13(this,_12);
|
||||
}else{
|
||||
return this.textbox(_11,_12);
|
||||
}
|
||||
}
|
||||
_11=_11||{};
|
||||
return this.each(function(){
|
||||
var _14=$.data(this,"searchbox");
|
||||
if(_14){
|
||||
$.extend(_14.options,_11);
|
||||
}else{
|
||||
$.data(this,"searchbox",{options:$.extend({},$.fn.searchbox.defaults,$.fn.searchbox.parseOptions(this),_11)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.searchbox.methods={options:function(jq){
|
||||
var _15=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"searchbox").options,{width:_15.width,value:_15.value,originalValue:_15.originalValue,disabled:_15.disabled,readonly:_15.readonly});
|
||||
},menu:function(jq){
|
||||
return $.data(jq[0],"searchbox").menu;
|
||||
},getName:function(jq){
|
||||
return $.data(jq[0],"searchbox").searchbox.find("input.textbox-value").attr("name");
|
||||
},selectName:function(jq,_16){
|
||||
return jq.each(function(){
|
||||
var _17=$.data(this,"searchbox").menu;
|
||||
if(_17){
|
||||
_17.children("div.menu-item").each(function(){
|
||||
var _18=_17.menu("getItem",this);
|
||||
if(_18.name==_16){
|
||||
$(this).trigger("click");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
var _19=$(this).searchbox("menu");
|
||||
if(_19){
|
||||
_19.menu("destroy");
|
||||
}
|
||||
$(this).textbox("destroy");
|
||||
});
|
||||
}};
|
||||
$.fn.searchbox.parseOptions=function(_1a){
|
||||
var t=$(_1a);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_1a),$.parser.parseOptions(_1a,["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){
|
||||
e.preventDefault();
|
||||
var t=$(e.data.target);
|
||||
var _1b=t.searchbox("options");
|
||||
t.searchbox("setValue",$(this).val());
|
||||
_1b.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName"));
|
||||
return false;
|
||||
}
|
||||
}}),buttonAlign:"left",menu:null,searcher:function(_1c,_1d){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
245
static/jeasyui/plugins/jquery.sidemenu.js
Normal file
245
static/jeasyui/plugins/jquery.sidemenu.js
Normal file
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
$(_3).addClass("sidemenu");
|
||||
};
|
||||
function _4(_5,_6){
|
||||
var _7=$(_5).sidemenu("options");
|
||||
if(_6){
|
||||
$.extend(_7,{width:_6.width,height:_6.height});
|
||||
}
|
||||
$(_5)._size(_7);
|
||||
$(_5).find(".accordion").accordion("resize");
|
||||
};
|
||||
function _8(_9,_a,_b){
|
||||
var _c=$(_9).sidemenu("options");
|
||||
var tt=$("<ul class=\"sidemenu-tree\"></ul>").appendTo(_a);
|
||||
tt.tree({data:_b,animate:_c.animate,onBeforeSelect:function(_d){
|
||||
if(_d.children){
|
||||
return false;
|
||||
}
|
||||
},onSelect:function(_e){
|
||||
_12(_9,_e.id,true);
|
||||
},onExpand:function(_f){
|
||||
_25(_9,_f);
|
||||
},onCollapse:function(_10){
|
||||
_25(_9,_10);
|
||||
},onClick:function(_11){
|
||||
if(_11.children){
|
||||
if(_11.state=="open"){
|
||||
$(_11.target).addClass("tree-node-nonleaf-collapsed");
|
||||
}else{
|
||||
$(_11.target).removeClass("tree-node-nonleaf-collapsed");
|
||||
}
|
||||
$(this).tree("toggle",_11.target);
|
||||
}
|
||||
}});
|
||||
tt._unbind(".sidemenu")._bind("mouseleave.sidemenu",function(){
|
||||
$(_a).trigger("mouseleave");
|
||||
});
|
||||
_12(_9,_c.selectedItemId);
|
||||
};
|
||||
function _13(_14,_15,_16){
|
||||
var _17=$(_14).sidemenu("options");
|
||||
$(_15).tooltip({content:$("<div></div>"),position:_17.floatMenuPosition,valign:"top",data:_16,onUpdate:function(_18){
|
||||
var _19=$(this).tooltip("options");
|
||||
var _1a=_19.data;
|
||||
_18.accordion({width:_17.floatMenuWidth,multiple:false}).accordion("add",{title:_1a.text,collapsed:false,collapsible:false});
|
||||
_8(_14,_18.accordion("panels")[0],_1a.children);
|
||||
},onShow:function(){
|
||||
var t=$(this);
|
||||
var tip=t.tooltip("tip").addClass("sidemenu-tooltip");
|
||||
tip.children(".tooltip-content").addClass("sidemenu");
|
||||
tip.find(".accordion").accordion("resize");
|
||||
tip.add(tip.find("ul.tree"))._unbind(".sidemenu")._bind("mouseover.sidemenu",function(){
|
||||
t.tooltip("show");
|
||||
})._bind("mouseleave.sidemenu",function(){
|
||||
t.tooltip("hide");
|
||||
});
|
||||
t.tooltip("reposition");
|
||||
},onPosition:function(_1b,top){
|
||||
var tip=$(this).tooltip("tip");
|
||||
if(!_17.collapsed){
|
||||
tip.css({left:-999999});
|
||||
}else{
|
||||
if(top+tip.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
|
||||
top=$(window)._outerHeight()+$(document).scrollTop()-tip.outerHeight();
|
||||
tip.css("top",top);
|
||||
}
|
||||
}
|
||||
}});
|
||||
};
|
||||
function _1c(_1d,_1e){
|
||||
$(_1d).find(".sidemenu-tree").each(function(){
|
||||
_1e($(this));
|
||||
});
|
||||
$(_1d).find(".tooltip-f").each(function(){
|
||||
var tip=$(this).tooltip("tip");
|
||||
if(tip){
|
||||
tip.find(".sidemenu-tree").each(function(){
|
||||
_1e($(this));
|
||||
});
|
||||
$(this).tooltip("reposition");
|
||||
}
|
||||
});
|
||||
};
|
||||
function _12(_1f,_20,_21){
|
||||
var _22=null;
|
||||
var _23=$(_1f).sidemenu("options");
|
||||
_1c(_1f,function(t){
|
||||
t.find("div.tree-node-selected").removeClass("tree-node-selected");
|
||||
var _24=t.tree("find",_20);
|
||||
if(_24){
|
||||
$(_24.target).addClass("tree-node-selected");
|
||||
_23.selectedItemId=_24.id;
|
||||
t.trigger("mouseleave.sidemenu");
|
||||
_22=_24;
|
||||
}
|
||||
});
|
||||
if(_21&&_22){
|
||||
_23.onSelect.call(_1f,_22);
|
||||
}
|
||||
};
|
||||
function _25(_26,_27){
|
||||
_1c(_26,function(t){
|
||||
var _28=t.tree("find",_27.id);
|
||||
if(_28){
|
||||
var _29=t.tree("options");
|
||||
var _2a=_29.animate;
|
||||
_29.animate=false;
|
||||
t.tree(_27.state=="open"?"expand":"collapse",_28.target);
|
||||
_29.animate=_2a;
|
||||
}
|
||||
});
|
||||
};
|
||||
function _2b(_2c){
|
||||
var _2d=$(_2c).sidemenu("options");
|
||||
$(_2c).empty();
|
||||
if(_2d.data){
|
||||
$.easyui.forEach(_2d.data,true,function(_2e){
|
||||
if(!_2e.id){
|
||||
_2e.id="_easyui_sidemenu_"+(_1++);
|
||||
}
|
||||
if(!_2e.iconCls){
|
||||
_2e.iconCls="sidemenu-default-icon";
|
||||
}
|
||||
if(_2e.children){
|
||||
_2e.nodeCls="tree-node-nonleaf";
|
||||
if(!_2e.state){
|
||||
_2e.state="closed";
|
||||
}
|
||||
if(_2e.state=="open"){
|
||||
_2e.nodeCls="tree-node-nonleaf";
|
||||
}else{
|
||||
_2e.nodeCls="tree-node-nonleaf tree-node-nonleaf-collapsed";
|
||||
}
|
||||
}
|
||||
});
|
||||
var acc=$("<div></div>").appendTo(_2c);
|
||||
acc.accordion({fit:_2d.height=="auto"?false:true,border:_2d.border,multiple:_2d.multiple});
|
||||
var _2f=_2d.data;
|
||||
for(var i=0;i<_2f.length;i++){
|
||||
acc.accordion("add",{title:_2f[i].text,selected:_2f[i].state=="open",iconCls:_2f[i].iconCls,onBeforeExpand:function(){
|
||||
return !_2d.collapsed;
|
||||
}});
|
||||
var ap=acc.accordion("panels")[i];
|
||||
_8(_2c,ap,_2f[i].children);
|
||||
_13(_2c,ap.panel("header"),_2f[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _30(_31,_32){
|
||||
var _33=$(_31).sidemenu("options");
|
||||
_33.collapsed=_32;
|
||||
var acc=$(_31).find(".accordion");
|
||||
var _34=acc.accordion("panels");
|
||||
acc.accordion("options").animate=false;
|
||||
if(_33.collapsed){
|
||||
$(_31).addClass("sidemenu-collapsed");
|
||||
for(var i=0;i<_34.length;i++){
|
||||
var _35=_34[i];
|
||||
if(_35.panel("options").collapsed){
|
||||
_33.data[i].state="closed";
|
||||
}else{
|
||||
_33.data[i].state="open";
|
||||
acc.accordion("unselect",i);
|
||||
}
|
||||
var _36=_35.panel("header");
|
||||
_36.find(".panel-title").html("");
|
||||
_36.find(".panel-tool").hide();
|
||||
}
|
||||
}else{
|
||||
$(_31).removeClass("sidemenu-collapsed");
|
||||
for(var i=0;i<_34.length;i++){
|
||||
var _35=_34[i];
|
||||
if(_33.data[i].state=="open"){
|
||||
acc.accordion("select",i);
|
||||
}
|
||||
var _36=_35.panel("header");
|
||||
_36.find(".panel-title").html(_35.panel("options").title);
|
||||
_36.find(".panel-tool").show();
|
||||
}
|
||||
}
|
||||
acc.accordion("options").animate=_33.animate;
|
||||
};
|
||||
function _37(_38){
|
||||
$(_38).find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("destroy");
|
||||
});
|
||||
$(_38).remove();
|
||||
};
|
||||
$.fn.sidemenu=function(_39,_3a){
|
||||
if(typeof _39=="string"){
|
||||
var _3b=$.fn.sidemenu.methods[_39];
|
||||
return _3b(this,_3a);
|
||||
}
|
||||
_39=_39||{};
|
||||
return this.each(function(){
|
||||
var _3c=$.data(this,"sidemenu");
|
||||
if(_3c){
|
||||
$.extend(_3c.options,_39);
|
||||
}else{
|
||||
_3c=$.data(this,"sidemenu",{options:$.extend({},$.fn.sidemenu.defaults,$.fn.sidemenu.parseOptions(this),_39)});
|
||||
_2(this);
|
||||
}
|
||||
_4(this);
|
||||
_2b(this);
|
||||
_30(this,_3c.options.collapsed);
|
||||
});
|
||||
};
|
||||
$.fn.sidemenu.methods={options:function(jq){
|
||||
return jq.data("sidemenu").options;
|
||||
},resize:function(jq,_3d){
|
||||
return jq.each(function(){
|
||||
_4(this,_3d);
|
||||
});
|
||||
},collapse:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,true);
|
||||
});
|
||||
},expand:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,false);
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_37(this);
|
||||
});
|
||||
}};
|
||||
$.fn.sidemenu.parseOptions=function(_3e){
|
||||
var t=$(_3e);
|
||||
return $.extend({},$.parser.parseOptions(_3e,["width","height"]));
|
||||
};
|
||||
$.fn.sidemenu.defaults={width:200,height:"auto",border:true,animate:true,multiple:true,collapsed:false,data:null,floatMenuWidth:200,floatMenuPosition:"right",onSelect:function(_3f){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
347
static/jeasyui/plugins/jquery.slider.js
Executable file
347
static/jeasyui/plugins/jquery.slider.js
Executable file
@@ -0,0 +1,347 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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=$("<div class=\"slider\">"+"<div class=\"slider-inner\">"+"<a href=\"javascript:;\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>"+"</div>"+"<div class=\"slider-rule\"></div>"+"<div class=\"slider-rulelabel\"></div>"+"<div style=\"clear:both\"></div>"+"<input type=\"hidden\" class=\"slider-value\">"+"</div>").insertAfter(_2);
|
||||
var t=$(_2);
|
||||
t.addClass("slider-f").hide();
|
||||
var _4=t.attr("name");
|
||||
if(_4){
|
||||
_3.find("input.slider-value").attr("name",_4);
|
||||
t.removeAttr("name").attr("sliderName",_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,"slider");
|
||||
var _a=_9.options;
|
||||
var _b=_9.slider;
|
||||
if(_8){
|
||||
if(_8.width){
|
||||
_a.width=_8.width;
|
||||
}
|
||||
if(_8.height){
|
||||
_a.height=_8.height;
|
||||
}
|
||||
}
|
||||
_b._size(_a);
|
||||
if(_a.mode=="h"){
|
||||
_b.css("height","");
|
||||
_b.children("div").css("height","");
|
||||
}else{
|
||||
_b.css("width","");
|
||||
_b.children("div").css("width","");
|
||||
_b.children("div.slider-rule,div.slider-rulelabel,div.slider-inner")._outerHeight(_b._outerHeight());
|
||||
}
|
||||
_c(_7);
|
||||
};
|
||||
function _d(_e){
|
||||
var _f=$.data(_e,"slider");
|
||||
var _10=_f.options;
|
||||
var _11=_f.slider;
|
||||
var aa=_10.mode=="h"?_10.rule:_10.rule.slice(0).reverse();
|
||||
if(_10.reversed){
|
||||
aa=aa.slice(0).reverse();
|
||||
}
|
||||
_12(aa);
|
||||
function _12(aa){
|
||||
var _13=_11.find("div.slider-rule");
|
||||
var _14=_11.find("div.slider-rulelabel");
|
||||
_13.empty();
|
||||
_14.empty();
|
||||
for(var i=0;i<aa.length;i++){
|
||||
var _15=i*100/(aa.length-1)+"%";
|
||||
var _16=$("<span></span>").appendTo(_13);
|
||||
_16.css((_10.mode=="h"?"left":"top"),_15);
|
||||
if(aa[i]!="|"){
|
||||
_16=$("<span></span>").appendTo(_14);
|
||||
_16.html(aa[i]);
|
||||
if(_10.mode=="h"){
|
||||
_16.css({left:_15,marginLeft:-Math.round(_16.outerWidth()/2)});
|
||||
}else{
|
||||
_16.css({top:_15,marginTop:-Math.round(_16.outerHeight()/2)});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _17(_18){
|
||||
var _19=$.data(_18,"slider");
|
||||
var _1a=_19.options;
|
||||
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("<a href=\"javascript:;\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>");
|
||||
if(_1a.range){
|
||||
_1c.append("<a href=\"javascript:;\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>");
|
||||
}
|
||||
_1b.find("a.slider-handle").draggable({axis:_1a.mode,cursor:"pointer",disabled:_1a.disabled,onDrag:function(e){
|
||||
var _1d=e.data.left;
|
||||
var _1e=_1b.width();
|
||||
if(_1a.mode!="h"){
|
||||
_1d=e.data.top;
|
||||
_1e=_1b.height();
|
||||
}
|
||||
if(_1d<0||_1d>_1e){
|
||||
return false;
|
||||
}else{
|
||||
_1f(_1d,this);
|
||||
return false;
|
||||
}
|
||||
},onStartDrag:function(){
|
||||
_19.isDragging=true;
|
||||
_1a.onSlideStart.call(_18,_1a.value);
|
||||
},onStopDrag:function(e){
|
||||
_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;
|
||||
}});
|
||||
_1b.find("div.slider-inner")._unbind(".slider")._bind("mousedown.slider",function(e){
|
||||
if(_19.isDragging||_1a.disabled){
|
||||
return;
|
||||
}
|
||||
var pos=$(this).offset();
|
||||
_1f(_1a.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top));
|
||||
_1a.onComplete.call(_18,_1a.value);
|
||||
});
|
||||
function _20(_21){
|
||||
var dd=String(_1a.step).split(".");
|
||||
var _22=dd.length>1?dd[1].length:0;
|
||||
return parseFloat(_21.toFixed(_22));
|
||||
};
|
||||
function _1f(pos,_23){
|
||||
var _24=_25(_18,pos);
|
||||
var s=Math.abs(_24%_1a.step);
|
||||
if(s<_1a.step/2){
|
||||
_24-=s;
|
||||
}else{
|
||||
_24=_24-s+_1a.step;
|
||||
}
|
||||
_24=_20(_24);
|
||||
if(_1a.range){
|
||||
var v1=_1a.value[0];
|
||||
var v2=_1a.value[1];
|
||||
var m=parseFloat((v1+v2)/2);
|
||||
if(_23){
|
||||
var _26=$(_23).nextAll(".slider-handle").length>0;
|
||||
if(_24<=v2&&_26){
|
||||
v1=_24;
|
||||
}else{
|
||||
if(_24>=v1&&(!_26)){
|
||||
v2=_24;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(_24<v1){
|
||||
v1=_24;
|
||||
}else{
|
||||
if(_24>v2){
|
||||
v2=_24;
|
||||
}else{
|
||||
_24<m?v1=_24:v2=_24;
|
||||
}
|
||||
}
|
||||
}
|
||||
$(_18).slider("setValues",[v1,v2]);
|
||||
}else{
|
||||
$(_18).slider("setValue",_24);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _27(_28,_29){
|
||||
var _2a=$.data(_28,"slider");
|
||||
var _2b=_2a.options;
|
||||
var _2c=_2a.slider;
|
||||
var _2d=$.isArray(_2b.value)?_2b.value:[_2b.value];
|
||||
var _2e=[];
|
||||
if(!$.isArray(_29)){
|
||||
_29=$.map(String(_29).split(_2b.separator),function(v){
|
||||
return parseFloat(v);
|
||||
});
|
||||
}
|
||||
_2c.find(".slider-value").remove();
|
||||
var _2f=$(_28).attr("sliderName")||"";
|
||||
for(var i=0;i<_29.length;i++){
|
||||
var _30=_29[i];
|
||||
if(_30<_2b.min){
|
||||
_30=_2b.min;
|
||||
}
|
||||
if(_30>_2b.max){
|
||||
_30=_2b.max;
|
||||
}
|
||||
var _31=$("<input type=\"hidden\" class=\"slider-value\">").appendTo(_2c);
|
||||
_31.attr("name",_2f);
|
||||
_31.val(_30);
|
||||
_2e.push(_30);
|
||||
var _32=_2c.find(".slider-handle:eq("+i+")");
|
||||
var tip=_32.next();
|
||||
var pos=_33(_28,_30);
|
||||
if(_2b.showTip){
|
||||
tip.show();
|
||||
tip.html(_2b.tipFormatter.call(_28,_30));
|
||||
}else{
|
||||
tip.hide();
|
||||
}
|
||||
if(_2b.mode=="h"){
|
||||
var _34="left:"+pos+"px;";
|
||||
_32.attr("style",_34);
|
||||
tip.attr("style",_34+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px");
|
||||
}else{
|
||||
var _34="top:"+pos+"px;";
|
||||
_32.attr("style",_34);
|
||||
tip.attr("style",_34+"margin-left:"+(-Math.round(tip.outerWidth()))+"px");
|
||||
}
|
||||
}
|
||||
_2b.value=_2b.range?_2e:_2e[0];
|
||||
$(_28).val(_2b.range?_2e.join(_2b.separator):_2e[0]);
|
||||
if(_2d.join(",")!=_2e.join(",")){
|
||||
_2b.onChange.call(_28,_2b.value,(_2b.range?_2d:_2d[0]));
|
||||
}
|
||||
};
|
||||
function _c(_35){
|
||||
var _36=$.data(_35,"slider").options;
|
||||
var fn=_36.onChange;
|
||||
_36.onChange=function(){
|
||||
};
|
||||
_27(_35,_36.value);
|
||||
_36.onChange=fn;
|
||||
};
|
||||
function _33(_37,_38){
|
||||
var _39=$.data(_37,"slider");
|
||||
var _3a=_39.options;
|
||||
var _3b=_39.slider;
|
||||
var _3c=_3a.mode=="h"?_3b.width():_3b.height();
|
||||
var pos=_3a.converter.toPosition.call(_37,_38,_3c);
|
||||
if(_3a.mode=="v"){
|
||||
pos=_3b.height()-pos;
|
||||
}
|
||||
if(_3a.reversed){
|
||||
pos=_3c-pos;
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
function _25(_3d,pos){
|
||||
var _3e=$.data(_3d,"slider");
|
||||
var _3f=_3e.options;
|
||||
var _40=_3e.slider;
|
||||
var _41=_3f.mode=="h"?_40.width():_40.height();
|
||||
var pos=_3f.mode=="h"?(_3f.reversed?(_41-pos):pos):(_3f.reversed?pos:(_41-pos));
|
||||
var _42=_3f.converter.toValue.call(_3d,pos,_41);
|
||||
return _42;
|
||||
};
|
||||
$.fn.slider=function(_43,_44){
|
||||
if(typeof _43=="string"){
|
||||
return $.fn.slider.methods[_43](this,_44);
|
||||
}
|
||||
_43=_43||{};
|
||||
return this.each(function(){
|
||||
var _45=$.data(this,"slider");
|
||||
if(_45){
|
||||
$.extend(_45.options,_43);
|
||||
}else{
|
||||
_45=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_43),slider:_1(this)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
}
|
||||
var _46=_45.options;
|
||||
_46.min=parseFloat(_46.min);
|
||||
_46.max=parseFloat(_46.max);
|
||||
if(_46.range){
|
||||
if(!$.isArray(_46.value)){
|
||||
_46.value=$.map(String(_46.value).split(_46.separator),function(v){
|
||||
return parseFloat(v);
|
||||
});
|
||||
}
|
||||
if(_46.value.length<2){
|
||||
_46.value.push(_46.max);
|
||||
}
|
||||
}else{
|
||||
_46.value=parseFloat(_46.value);
|
||||
}
|
||||
_46.step=parseFloat(_46.step);
|
||||
_46.originalValue=_46.value;
|
||||
_17(this);
|
||||
_d(this);
|
||||
_6(this);
|
||||
});
|
||||
};
|
||||
$.fn.slider.methods={options:function(jq){
|
||||
return $.data(jq[0],"slider").options;
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this,"slider").slider.remove();
|
||||
$(this).remove();
|
||||
});
|
||||
},resize:function(jq,_47){
|
||||
return jq.each(function(){
|
||||
_6(this,_47);
|
||||
});
|
||||
},getValue:function(jq){
|
||||
return jq.slider("options").value;
|
||||
},getValues:function(jq){
|
||||
return jq.slider("options").value;
|
||||
},setValue:function(jq,_48){
|
||||
return jq.each(function(){
|
||||
_27(this,[_48]);
|
||||
});
|
||||
},setValues:function(jq,_49){
|
||||
return jq.each(function(){
|
||||
_27(this,_49);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
var _4a=$(this).slider("options");
|
||||
_27(this,_4a.range?[_4a.min,_4a.max]:[_4a.min]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _4b=$(this).slider("options");
|
||||
$(this).slider(_4b.range?"setValues":"setValue",_4b.originalValue);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this,"slider").options.disabled=false;
|
||||
_17(this);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this,"slider").options.disabled=true;
|
||||
_17(this);
|
||||
});
|
||||
}};
|
||||
$.fn.slider.parseOptions=function(_4c){
|
||||
var t=$(_4c);
|
||||
return $.extend({},$.parser.parseOptions(_4c,["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,range:false,value:0,separator:",",min:0,max:100,step:1,rule:[],tipFormatter:function(_4d){
|
||||
return _4d;
|
||||
},converter:{toPosition:function(_4e,_4f){
|
||||
var _50=$(this).slider("options");
|
||||
var p=(_4e-_50.min)/(_50.max-_50.min)*_4f;
|
||||
return p;
|
||||
},toValue:function(pos,_51){
|
||||
var _52=$(this).slider("options");
|
||||
var v=_52.min+(_52.max-_52.min)*(pos/_51);
|
||||
return v;
|
||||
}},onChange:function(_53,_54){
|
||||
},onSlideStart:function(_55){
|
||||
},onSlideEnd:function(_56){
|
||||
},onComplete:function(_57){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
128
static/jeasyui/plugins/jquery.spinner.js
Executable file
128
static/jeasyui/plugins/jquery.spinner.js
Executable file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"spinner");
|
||||
var _4=_3.options;
|
||||
var _5=$.extend(true,[],_4.icons);
|
||||
if(_4.spinAlign=="left"||_4.spinAlign=="right"){
|
||||
_4.spinArrow=true;
|
||||
_4.iconAlign=_4.spinAlign;
|
||||
var _6={iconCls:"spinner-button-updown",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");
|
||||
if(_4.spinArrow){
|
||||
var _10=_3.spinner.find(".spinner-button-updown");
|
||||
_10.append("<span class=\"spinner-arrow spinner-button-top\">"+"<span class=\"spinner-arrow-up\"></span>"+"</span>"+"<span class=\"spinner-arrow spinner-button-bottom\">"+"<span class=\"spinner-arrow-down\"></span>"+"</span>");
|
||||
}else{
|
||||
var _11=$("<a href=\"javascript:;\" class=\"textbox-button spinner-button\"></a>").addClass(_4.clsLeft).appendTo(_3.spinner);
|
||||
var _12=$("<a href=\"javascript:;\" class=\"textbox-button spinner-button\"></a>").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");
|
||||
}
|
||||
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(_17,_18){
|
||||
if(typeof _17=="string"){
|
||||
var _19=$.fn.spinner.methods[_17];
|
||||
if(_19){
|
||||
return _19(this,_18);
|
||||
}else{
|
||||
return this.textbox(_17,_18);
|
||||
}
|
||||
}
|
||||
_17=_17||{};
|
||||
return this.each(function(){
|
||||
var _1a=$.data(this,"spinner");
|
||||
if(_1a){
|
||||
$.extend(_1a.options,_17);
|
||||
}else{
|
||||
_1a=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_17)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.spinner.methods={options:function(jq){
|
||||
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(_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,spinAlign:"right",reversed:false,spin:function(_1d){
|
||||
},onSpinUp:function(){
|
||||
},onSpinDown:function(){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
49
static/jeasyui/plugins/jquery.splitbutton.js
Executable file
49
static/jeasyui/plugins/jquery.splitbutton.js
Executable file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"splitbutton").options;
|
||||
$(_2).menubutton(_3);
|
||||
$(_2).addClass("s-btn");
|
||||
};
|
||||
$.fn.splitbutton=function(_4,_5){
|
||||
if(typeof _4=="string"){
|
||||
var _6=$.fn.splitbutton.methods[_4];
|
||||
if(_6){
|
||||
return _6(this,_5);
|
||||
}else{
|
||||
return this.menubutton(_4,_5);
|
||||
}
|
||||
}
|
||||
_4=_4||{};
|
||||
return this.each(function(){
|
||||
var _7=$.data(this,"splitbutton");
|
||||
if(_7){
|
||||
$.extend(_7.options,_4);
|
||||
}else{
|
||||
$.data(this,"splitbutton",{options:$.extend({},$.fn.splitbutton.defaults,$.fn.splitbutton.parseOptions(this),_4)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.splitbutton.methods={options:function(jq){
|
||||
var _8=jq.menubutton("options");
|
||||
var _9=$.data(jq[0],"splitbutton").options;
|
||||
$.extend(_9,{disabled:_8.disabled,toggle:_8.toggle,selected:_8.selected});
|
||||
return _9;
|
||||
}};
|
||||
$.fn.splitbutton.parseOptions=function(_a){
|
||||
var t=$(_a);
|
||||
return $.extend({},$.fn.linkbutton.parseOptions(_a),$.parser.parseOptions(_a,["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);
|
||||
|
||||
234
static/jeasyui/plugins/jquery.switchbutton.js
Normal file
234
static/jeasyui/plugins/jquery.switchbutton.js
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
var _4=$("<span class=\"switchbutton\">"+"<span class=\"switchbutton-inner\">"+"<span class=\"switchbutton-on\"></span>"+"<span class=\"switchbutton-handle\"></span>"+"<span class=\"switchbutton-off\"></span>"+"<input class=\"switchbutton-value\" type=\"checkbox\" tabindex=\"-1\">"+"</span>"+"</span>").insertAfter(_3);
|
||||
var t=$(_3);
|
||||
t.addClass("switchbutton-f").hide();
|
||||
var _5=t.attr("name");
|
||||
if(_5){
|
||||
t.removeAttr("name").attr("switchbuttonName",_5);
|
||||
_4.find(".switchbutton-value").attr("name",_5);
|
||||
}
|
||||
_4._bind("_resize",function(e,_6){
|
||||
if($(this).hasClass("easyui-fluid")||_6){
|
||||
_7(_3);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return _4;
|
||||
};
|
||||
function _7(_8,_9){
|
||||
var _a=$.data(_8,"switchbutton");
|
||||
var _b=_a.options;
|
||||
var _c=_a.switchbutton;
|
||||
if(_9){
|
||||
$.extend(_b,_9);
|
||||
}
|
||||
var _d=_c.is(":visible");
|
||||
if(!_d){
|
||||
_c.appendTo("body");
|
||||
}
|
||||
_c._size(_b);
|
||||
if(_b.label&&_b.labelPosition){
|
||||
if(_b.labelPosition=="top"){
|
||||
_a.label._size({width:_b.labelWidth},_c);
|
||||
}else{
|
||||
_a.label._size({width:_b.labelWidth,height:_c.outerHeight()},_c);
|
||||
_a.label.css("lineHeight",_c.outerHeight()+"px");
|
||||
}
|
||||
}
|
||||
var w=_c.width();
|
||||
var h=_c.height();
|
||||
var w=_c.outerWidth();
|
||||
var h=_c.outerHeight();
|
||||
var _e=parseInt(_b.handleWidth)||_c.height();
|
||||
var _f=w*2-_e;
|
||||
_c.find(".switchbutton-inner").css({width:_f+"px",height:h+"px",lineHeight:h+"px"});
|
||||
_c.find(".switchbutton-handle")._outerWidth(_e)._outerHeight(h).css({marginLeft:-_e/2+"px"});
|
||||
_c.find(".switchbutton-on").css({width:(w-_e/2)+"px",textIndent:(_b.reversed?"":"-")+_e/2+"px"});
|
||||
_c.find(".switchbutton-off").css({width:(w-_e/2)+"px",textIndent:(_b.reversed?"-":"")+_e/2+"px"});
|
||||
_b.marginWidth=w-_e;
|
||||
_10(_8,_b.checked,false);
|
||||
if(!_d){
|
||||
_c.insertAfter(_8);
|
||||
}
|
||||
};
|
||||
function _11(_12){
|
||||
var _13=$.data(_12,"switchbutton");
|
||||
var _14=_13.options;
|
||||
var _15=_13.switchbutton;
|
||||
var _16=_15.find(".switchbutton-inner");
|
||||
var on=_16.find(".switchbutton-on").html(_14.onText);
|
||||
var off=_16.find(".switchbutton-off").html(_14.offText);
|
||||
var _17=_16.find(".switchbutton-handle").html(_14.handleText);
|
||||
if(_14.reversed){
|
||||
off.prependTo(_16);
|
||||
on.insertAfter(_17);
|
||||
}else{
|
||||
on.prependTo(_16);
|
||||
off.insertAfter(_17);
|
||||
}
|
||||
var _18="_easyui_switchbutton_"+(++_1);
|
||||
var _19=_15.find(".switchbutton-value")._propAttr("checked",_14.checked).attr("id",_18);
|
||||
_19._unbind(".switchbutton")._bind("change.switchbutton",function(e){
|
||||
return false;
|
||||
});
|
||||
_15.removeClass("switchbutton-reversed").addClass(_14.reversed?"switchbutton-reversed":"");
|
||||
if(_14.label){
|
||||
if(typeof _14.label=="object"){
|
||||
_13.label=$(_14.label);
|
||||
_13.label.attr("for",_18);
|
||||
}else{
|
||||
$(_13.label).remove();
|
||||
_13.label=$("<label class=\"textbox-label\"></label>").html(_14.label);
|
||||
_13.label.css("textAlign",_14.labelAlign).attr("for",_18);
|
||||
if(_14.labelPosition=="after"){
|
||||
_13.label.insertAfter(_15);
|
||||
}else{
|
||||
_13.label.insertBefore(_12);
|
||||
}
|
||||
_13.label.removeClass("textbox-label-left textbox-label-right textbox-label-top");
|
||||
_13.label.addClass("textbox-label-"+_14.labelPosition);
|
||||
}
|
||||
}else{
|
||||
$(_13.label).remove();
|
||||
}
|
||||
_10(_12,_14.checked);
|
||||
_1a(_12,_14.readonly);
|
||||
_1b(_12,_14.disabled);
|
||||
$(_12).switchbutton("setValue",_14.value);
|
||||
};
|
||||
function _10(_1c,_1d,_1e){
|
||||
var _1f=$.data(_1c,"switchbutton");
|
||||
var _20=_1f.options;
|
||||
var _21=_1f.switchbutton.find(".switchbutton-inner");
|
||||
var _22=_21.find(".switchbutton-on");
|
||||
var _23=_20.reversed?(_1d?_20.marginWidth:0):(_1d?0:_20.marginWidth);
|
||||
var dir=_22.css("float").toLowerCase();
|
||||
var css={};
|
||||
css["margin-"+dir]=-_23+"px";
|
||||
_1e?_21.animate(css,200):_21.css(css);
|
||||
var _24=_21.find(".switchbutton-value");
|
||||
$(_1c).add(_24)._propAttr("checked",_1d);
|
||||
if(_20.checked!=_1d){
|
||||
_20.checked=_1d;
|
||||
_20.onChange.call(_1c,_20.checked);
|
||||
$(_1c).closest("form").trigger("_change",[_1c]);
|
||||
}
|
||||
};
|
||||
function _1b(_25,_26){
|
||||
var _27=$.data(_25,"switchbutton");
|
||||
var _28=_27.options;
|
||||
var _29=_27.switchbutton;
|
||||
var _2a=_29.find(".switchbutton-value");
|
||||
if(_26){
|
||||
_28.disabled=true;
|
||||
$(_25).add(_2a)._propAttr("disabled",true);
|
||||
_29.addClass("switchbutton-disabled");
|
||||
_29.removeAttr("tabindex");
|
||||
}else{
|
||||
_28.disabled=false;
|
||||
$(_25).add(_2a)._propAttr("disabled",false);
|
||||
_29.removeClass("switchbutton-disabled");
|
||||
_29.attr("tabindex",$(_25).attr("tabindex")||"");
|
||||
}
|
||||
};
|
||||
function _1a(_2b,_2c){
|
||||
var _2d=$.data(_2b,"switchbutton");
|
||||
var _2e=_2d.options;
|
||||
_2e.readonly=_2c==undefined?true:_2c;
|
||||
_2d.switchbutton.removeClass("switchbutton-readonly").addClass(_2e.readonly?"switchbutton-readonly":"");
|
||||
};
|
||||
function _2f(_30){
|
||||
var _31=$.data(_30,"switchbutton");
|
||||
var _32=_31.options;
|
||||
_31.switchbutton._unbind(".switchbutton")._bind("click.switchbutton",function(){
|
||||
if(!_32.disabled&&!_32.readonly){
|
||||
_10(_30,_32.checked?false:true,true);
|
||||
}
|
||||
})._bind("keydown.switchbutton",function(e){
|
||||
if(e.which==13||e.which==32){
|
||||
if(!_32.disabled&&!_32.readonly){
|
||||
_10(_30,_32.checked?false:true,true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.switchbutton=function(_33,_34){
|
||||
if(typeof _33=="string"){
|
||||
return $.fn.switchbutton.methods[_33](this,_34);
|
||||
}
|
||||
_33=_33||{};
|
||||
return this.each(function(){
|
||||
var _35=$.data(this,"switchbutton");
|
||||
if(_35){
|
||||
$.extend(_35.options,_33);
|
||||
}else{
|
||||
_35=$.data(this,"switchbutton",{options:$.extend({},$.fn.switchbutton.defaults,$.fn.switchbutton.parseOptions(this),_33),switchbutton:_2(this)});
|
||||
}
|
||||
_35.options.originalChecked=_35.options.checked;
|
||||
_11(this);
|
||||
_7(this);
|
||||
_2f(this);
|
||||
});
|
||||
};
|
||||
$.fn.switchbutton.methods={options:function(jq){
|
||||
var _36=jq.data("switchbutton");
|
||||
return $.extend(_36.options,{value:_36.switchbutton.find(".switchbutton-value").val()});
|
||||
},resize:function(jq,_37){
|
||||
return jq.each(function(){
|
||||
_7(this,_37);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_1b(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_1b(this,true);
|
||||
});
|
||||
},readonly:function(jq,_38){
|
||||
return jq.each(function(){
|
||||
_1a(this,_38);
|
||||
});
|
||||
},check:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,true);
|
||||
});
|
||||
},uncheck:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,false);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,false);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _39=$(this).switchbutton("options");
|
||||
_10(this,_39.originalChecked);
|
||||
});
|
||||
},setValue:function(jq,_3a){
|
||||
return jq.each(function(){
|
||||
$(this).val(_3a);
|
||||
$.data(this,"switchbutton").switchbutton.find(".switchbutton-value").val(_3a);
|
||||
});
|
||||
}};
|
||||
$.fn.switchbutton.parseOptions=function(_3b){
|
||||
var t=$(_3b);
|
||||
return $.extend({},$.parser.parseOptions(_3b,["onText","offText","handleText",{handleWidth:"number",reversed:"boolean"},"label","labelPosition","labelAlign",{labelWidth:"number"}]),{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:30,checked:false,disabled:false,readonly:false,reversed:false,onText:"ON",offText:"OFF",handleText:"",value:"on",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",onChange:function(_3c){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
716
static/jeasyui/plugins/jquery.tabs.js
Executable file
716
static/jeasyui/plugins/jquery.tabs.js
Executable file
@@ -0,0 +1,716 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(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.showHeader){
|
||||
return;
|
||||
}
|
||||
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");
|
||||
if(_4.tabPosition=="left"||_4.tabPosition=="right"){
|
||||
if(!_6.length){
|
||||
return;
|
||||
}
|
||||
_6._outerWidth(_5.width());
|
||||
var _a={left:_4.tabPosition=="left"?"auto":0,right:_4.tabPosition=="left"?0:"auto",top:_4.toolPosition=="top"?0:"auto",bottom:_4.toolPosition=="top"?"auto":0};
|
||||
var _b={marginTop:_4.toolPosition=="top"?_6.outerHeight():0};
|
||||
_6.css(_a);
|
||||
_9.css(_b);
|
||||
return;
|
||||
}
|
||||
var _c=_5.outerHeight();
|
||||
if(_4.plain){
|
||||
_c-=_c-_5.height();
|
||||
}
|
||||
_6._outerHeight(_c);
|
||||
var _d=_1(_5.find("ul.tabs"));
|
||||
var _e=_5.width()-_6._outerWidth();
|
||||
if(_d>_e){
|
||||
_7.add(_8).show()._outerHeight(_c);
|
||||
if(_4.toolPosition=="left"){
|
||||
_6.css({left:_7.outerWidth(),right:""});
|
||||
_9.css({marginLeft:_7.outerWidth()+_6._outerWidth(),marginRight:_8._outerWidth(),width:_e-_7.outerWidth()-_8.outerWidth()});
|
||||
}else{
|
||||
_6.css({left:"",right:_8.outerWidth()});
|
||||
_9.css({marginLeft:_7.outerWidth(),marginRight:_8.outerWidth()+_6._outerWidth(),width:_e-_7.outerWidth()-_8.outerWidth()});
|
||||
}
|
||||
}else{
|
||||
_7.add(_8).hide();
|
||||
if(_4.toolPosition=="left"){
|
||||
_6.css({left:0,right:""});
|
||||
_9.css({marginLeft:_6._outerWidth(),marginRight:0,width:_e});
|
||||
}else{
|
||||
_6.css({left:"",right:0});
|
||||
_9.css({marginLeft:0,marginRight:_6._outerWidth(),width:_e});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _f(_10){
|
||||
var _11=$.data(_10,"tabs").options;
|
||||
var _12=$(_10).children("div.tabs-header");
|
||||
if(_11.tools){
|
||||
if(typeof _11.tools=="string"){
|
||||
$(_11.tools).addClass("tabs-tool").appendTo(_12);
|
||||
$(_11.tools).show();
|
||||
}else{
|
||||
_12.children("div.tabs-tool").remove();
|
||||
var _13=$("<div class=\"tabs-tool\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"height:100%\"><tr></tr></table></div>").appendTo(_12);
|
||||
var tr=_13.find("tr");
|
||||
for(var i=0;i<_11.tools.length;i++){
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var _14=$("<a href=\"javascript:;\"></a>").appendTo(td);
|
||||
_14[0].onclick=eval(_11.tools[i].handler||function(){
|
||||
});
|
||||
_14.linkbutton($.extend({},_11.tools[i],{plain:true}));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
_12.children("div.tabs-tool").remove();
|
||||
}
|
||||
};
|
||||
function _15(_16,_17){
|
||||
var _18=$.data(_16,"tabs");
|
||||
var _19=_18.options;
|
||||
var cc=$(_16);
|
||||
if(!_19.doSize){
|
||||
return;
|
||||
}
|
||||
if(_17){
|
||||
$.extend(_19,{width:_17.width,height:_17.height});
|
||||
}
|
||||
cc._size(_19);
|
||||
var _1a=cc.children("div.tabs-header");
|
||||
var _1b=cc.children("div.tabs-panels");
|
||||
var _1c=_1a.find("div.tabs-wrap");
|
||||
var ul=_1c.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(_19.tabPosition=="left"||_19.tabPosition=="right"){
|
||||
_1a._outerWidth(_19.showHeader?_19.headerWidth:0);
|
||||
_1b._outerWidth(cc.width()-_1a.outerWidth());
|
||||
_1a.add(_1b)._size("height",isNaN(parseInt(_19.height))?"":cc.height());
|
||||
_1c._outerWidth(_1a.width());
|
||||
ul._outerWidth(_1c.width()).css("height","");
|
||||
}else{
|
||||
_1a.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)").css("display",_19.showHeader?"block":"none");
|
||||
_1a._outerWidth(cc.width()).css("height","");
|
||||
if(_19.showHeader){
|
||||
_1a.css("background-color","");
|
||||
_1c.css("height","");
|
||||
}else{
|
||||
_1a.css("background-color","transparent");
|
||||
_1a._outerHeight(0);
|
||||
_1c._outerHeight(0);
|
||||
}
|
||||
ul._outerHeight(_19.tabHeight).css("width","");
|
||||
ul._outerHeight(ul.outerHeight()-ul.height()-1+_19.tabHeight).css("width","");
|
||||
_1b._size("height",isNaN(parseInt(_19.height))?"":(cc.height()-_1a.outerHeight()));
|
||||
_1b._size("width",cc.width());
|
||||
}
|
||||
if(_18.tabs.length){
|
||||
var d1=ul.outerWidth(true)-ul.width();
|
||||
var li=ul.children("li:first");
|
||||
var d2=li.outerWidth(true)-li.width();
|
||||
var _1d=_1a.width()-_1a.children(".tabs-tool:not(.tabs-tool-hidden)")._outerWidth();
|
||||
var _1e=Math.floor((_1d-d1-d2*_18.tabs.length)/_18.tabs.length);
|
||||
$.map(_18.tabs,function(p){
|
||||
_1f(p,(_19.justified&&$.inArray(_19.tabPosition,["top","bottom"])>=0)?_1e:undefined);
|
||||
});
|
||||
if(_19.justified&&$.inArray(_19.tabPosition,["top","bottom"])>=0){
|
||||
var _20=_1d-d1-_1(ul);
|
||||
_1f(_18.tabs[_18.tabs.length-1],_1e+_20);
|
||||
}
|
||||
}
|
||||
_2(_16);
|
||||
function _1f(p,_21){
|
||||
var _22=p.panel("options");
|
||||
var p_t=_22.tab.find(".tabs-inner");
|
||||
var _21=_21?_21:(parseInt(_22.tabWidth||_19.tabWidth||undefined));
|
||||
if(_21){
|
||||
p_t._outerWidth(_21);
|
||||
}else{
|
||||
p_t.css("width","");
|
||||
}
|
||||
p_t._outerHeight(_19.tabHeight);
|
||||
p_t.css("lineHeight",p_t.height()+"px");
|
||||
p_t.find(".easyui-fluid:visible").triggerHandler("_resize");
|
||||
};
|
||||
};
|
||||
function _23(_24){
|
||||
var _25=$.data(_24,"tabs").options;
|
||||
var tab=_26(_24);
|
||||
if(tab){
|
||||
var _27=$(_24).children("div.tabs-panels");
|
||||
var _28=_25.width=="auto"?"auto":_27.width();
|
||||
var _29=_25.height=="auto"?"auto":_27.height();
|
||||
tab.panel("resize",{width:_28,height:_29});
|
||||
}
|
||||
};
|
||||
function _2a(_2b){
|
||||
var _2c=$.data(_2b,"tabs").tabs;
|
||||
var cc=$(_2b).addClass("tabs-container");
|
||||
var _2d=$("<div class=\"tabs-panels\"></div>").insertBefore(cc);
|
||||
cc.children("div").each(function(){
|
||||
_2d[0].appendChild(this);
|
||||
});
|
||||
cc[0].appendChild(_2d[0]);
|
||||
$("<div class=\"tabs-header\">"+"<div class=\"tabs-scroller-left\"></div>"+"<div class=\"tabs-scroller-right\"></div>"+"<div class=\"tabs-wrap\">"+"<ul class=\"tabs\"></ul>"+"</div>"+"</div>").prependTo(_2b);
|
||||
cc.children("div.tabs-panels").children("div").each(function(i){
|
||||
var _2e=$.extend({},$.parser.parseOptions(this),{disabled:($(this).attr("disabled")?true:undefined),selected:($(this).attr("selected")?true:undefined)});
|
||||
_3e(_2b,_2e,$(this));
|
||||
});
|
||||
cc.children("div.tabs-header").find(".tabs-scroller-left, .tabs-scroller-right")._bind("mouseenter",function(){
|
||||
$(this).addClass("tabs-scroller-over");
|
||||
})._bind("mouseleave",function(){
|
||||
$(this).removeClass("tabs-scroller-over");
|
||||
});
|
||||
cc._bind("_resize",function(e,_2f){
|
||||
if($(this).hasClass("easyui-fluid")||_2f){
|
||||
_15(_2b);
|
||||
_23(_2b);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _30(_31){
|
||||
var _32=$.data(_31,"tabs");
|
||||
var _33=_32.options;
|
||||
$(_31).children("div.tabs-header")._unbind()._bind("click",function(e){
|
||||
if($(e.target).hasClass("tabs-scroller-left")){
|
||||
$(_31).tabs("scrollBy",-_33.scrollIncrement);
|
||||
}else{
|
||||
if($(e.target).hasClass("tabs-scroller-right")){
|
||||
$(_31).tabs("scrollBy",_33.scrollIncrement);
|
||||
}else{
|
||||
var li=$(e.target).closest("li");
|
||||
if(li.hasClass("tabs-disabled")){
|
||||
return false;
|
||||
}
|
||||
var a=$(e.target).closest(".tabs-close");
|
||||
if(a.length){
|
||||
_5d(_31,_34(li));
|
||||
}else{
|
||||
if(li.length){
|
||||
var _35=_34(li);
|
||||
var _36=_32.tabs[_35].panel("options");
|
||||
if(_36.collapsible){
|
||||
_36.closed?_53(_31,_35):_7b(_31,_35);
|
||||
}else{
|
||||
_53(_31,_35);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})._bind("contextmenu",function(e){
|
||||
var li=$(e.target).closest("li");
|
||||
if(li.hasClass("tabs-disabled")){
|
||||
return;
|
||||
}
|
||||
if(li.length){
|
||||
_33.onContextMenu.call(_31,e,li.find("span.tabs-title").html(),_34(li));
|
||||
}
|
||||
});
|
||||
function _34(li){
|
||||
var _37=0;
|
||||
li.parent().children("li").each(function(i){
|
||||
if(li[0]==this){
|
||||
_37=i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return _37;
|
||||
};
|
||||
};
|
||||
function _38(_39){
|
||||
var _3a=$.data(_39,"tabs").options;
|
||||
var _3b=$(_39).children("div.tabs-header");
|
||||
var _3c=$(_39).children("div.tabs-panels");
|
||||
_3b.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right");
|
||||
_3c.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right");
|
||||
if(_3a.tabPosition=="top"){
|
||||
_3b.insertBefore(_3c);
|
||||
}else{
|
||||
if(_3a.tabPosition=="bottom"){
|
||||
_3b.insertAfter(_3c);
|
||||
_3b.addClass("tabs-header-bottom");
|
||||
_3c.addClass("tabs-panels-top");
|
||||
}else{
|
||||
if(_3a.tabPosition=="left"){
|
||||
_3b.addClass("tabs-header-left");
|
||||
_3c.addClass("tabs-panels-right");
|
||||
}else{
|
||||
if(_3a.tabPosition=="right"){
|
||||
_3b.addClass("tabs-header-right");
|
||||
_3c.addClass("tabs-panels-left");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_3a.plain==true){
|
||||
_3b.addClass("tabs-header-plain");
|
||||
}else{
|
||||
_3b.removeClass("tabs-header-plain");
|
||||
}
|
||||
_3b.removeClass("tabs-header-narrow").addClass(_3a.narrow?"tabs-header-narrow":"");
|
||||
var _3d=_3b.find(".tabs");
|
||||
_3d.removeClass("tabs-pill").addClass(_3a.pill?"tabs-pill":"");
|
||||
_3d.removeClass("tabs-narrow").addClass(_3a.narrow?"tabs-narrow":"");
|
||||
_3d.removeClass("tabs-justified").addClass(_3a.justified?"tabs-justified":"");
|
||||
if(_3a.border==true){
|
||||
_3b.removeClass("tabs-header-noborder");
|
||||
_3c.removeClass("tabs-panels-noborder");
|
||||
}else{
|
||||
_3b.addClass("tabs-header-noborder");
|
||||
_3c.addClass("tabs-panels-noborder");
|
||||
}
|
||||
_3a.doSize=true;
|
||||
};
|
||||
function _3e(_3f,_40,pp){
|
||||
_40=_40||{};
|
||||
var _41=$.data(_3f,"tabs");
|
||||
var _42=_41.tabs;
|
||||
if(_40.index==undefined||_40.index>_42.length){
|
||||
_40.index=_42.length;
|
||||
}
|
||||
if(_40.index<0){
|
||||
_40.index=0;
|
||||
}
|
||||
var ul=$(_3f).children("div.tabs-header").find("ul.tabs");
|
||||
var _43=$(_3f).children("div.tabs-panels");
|
||||
var tab=$("<li>"+"<span class=\"tabs-inner\">"+"<span class=\"tabs-title\"></span>"+"<span class=\"tabs-icon\"></span>"+"</span>"+"</li>");
|
||||
if(!pp){
|
||||
pp=$("<div></div>");
|
||||
}
|
||||
if(_40.index>=_42.length){
|
||||
tab.appendTo(ul);
|
||||
pp.appendTo(_43);
|
||||
_42.push(pp);
|
||||
}else{
|
||||
tab.insertBefore(ul.children("li:eq("+_40.index+")"));
|
||||
pp.insertBefore(_43.children("div.panel:eq("+_40.index+")"));
|
||||
_42.splice(_40.index,0,pp);
|
||||
}
|
||||
pp.panel($.extend({},_40,{tab:tab,border:false,noheader:true,closed:true,doSize:false,iconCls:(_40.icon?_40.icon:undefined),onLoad:function(){
|
||||
if(_40.onLoad){
|
||||
_40.onLoad.apply(this,arguments);
|
||||
}
|
||||
_41.options.onLoad.call(_3f,$(this));
|
||||
},onBeforeOpen:function(){
|
||||
if(_40.onBeforeOpen){
|
||||
if(_40.onBeforeOpen.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var p=$(_3f).tabs("getSelected");
|
||||
if(p){
|
||||
if(p[0]!=this){
|
||||
$(_3f).tabs("unselect",_4d(_3f,p));
|
||||
p=$(_3f).tabs("getSelected");
|
||||
if(p){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
_23(_3f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var _44=$(this).panel("options");
|
||||
_44.tab.addClass("tabs-selected");
|
||||
var _45=$(_3f).find(">div.tabs-header>div.tabs-wrap");
|
||||
var _46=_44.tab.position().left;
|
||||
var _47=_46+_44.tab.outerWidth();
|
||||
if(_46<0||_47>_45.width()){
|
||||
var _48=_46-(_45.width()-_44.tab.width())/2;
|
||||
$(_3f).tabs("scrollBy",_48);
|
||||
}else{
|
||||
$(_3f).tabs("scrollBy",0);
|
||||
}
|
||||
var _49=$(this).panel("panel");
|
||||
_49.css("display","block");
|
||||
_23(_3f);
|
||||
_49.css("display","none");
|
||||
},onOpen:function(){
|
||||
if(_40.onOpen){
|
||||
_40.onOpen.call(this);
|
||||
}
|
||||
var _4a=$(this).panel("options");
|
||||
var _4b=_4d(_3f,this);
|
||||
_41.selectHis.push(_4b);
|
||||
_41.options.onSelect.call(_3f,_4a.title,_4b);
|
||||
},onBeforeClose:function(){
|
||||
if(_40.onBeforeClose){
|
||||
if(_40.onBeforeClose.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$(this).panel("options").tab.removeClass("tabs-selected");
|
||||
},onClose:function(){
|
||||
if(_40.onClose){
|
||||
_40.onClose.call(this);
|
||||
}
|
||||
var _4c=$(this).panel("options");
|
||||
_41.options.onUnselect.call(_3f,_4c.title,_4d(_3f,this));
|
||||
}}));
|
||||
$(_3f).tabs("update",{tab:pp,options:pp.panel("options"),type:"header"});
|
||||
};
|
||||
function _4e(_4f,_50){
|
||||
var _51=$.data(_4f,"tabs");
|
||||
var _52=_51.options;
|
||||
if(_50.selected==undefined){
|
||||
_50.selected=true;
|
||||
}
|
||||
_3e(_4f,_50);
|
||||
_52.onAdd.call(_4f,_50.title,_50.index);
|
||||
if(_50.selected){
|
||||
_53(_4f,_50.index);
|
||||
}
|
||||
};
|
||||
function _54(_55,_56){
|
||||
_56.type=_56.type||"all";
|
||||
var _57=$.data(_55,"tabs").selectHis;
|
||||
var pp=_56.tab;
|
||||
var _58=pp.panel("options");
|
||||
var _59=_58.title;
|
||||
$.extend(_58,_56.options,{iconCls:(_56.options.icon?_56.options.icon:undefined)});
|
||||
if(_56.type=="all"||_56.type=="body"){
|
||||
pp.panel();
|
||||
}
|
||||
if(_56.type=="all"||_56.type=="header"){
|
||||
var tab=_58.tab;
|
||||
if(_58.header){
|
||||
tab.find(".tabs-inner").html($(_58.header));
|
||||
}else{
|
||||
var _5a=tab.find("span.tabs-title");
|
||||
var _5b=tab.find("span.tabs-icon");
|
||||
_5a.html(_58.title);
|
||||
_5b.attr("class","tabs-icon");
|
||||
tab.find(".tabs-close").remove();
|
||||
if(_58.closable){
|
||||
_5a.addClass("tabs-closable");
|
||||
$("<span class=\"tabs-close\"></span>").appendTo(tab);
|
||||
}else{
|
||||
_5a.removeClass("tabs-closable");
|
||||
}
|
||||
if(_58.iconCls){
|
||||
_5a.addClass("tabs-with-icon");
|
||||
_5b.addClass(_58.iconCls);
|
||||
}else{
|
||||
_5a.removeClass("tabs-with-icon");
|
||||
}
|
||||
if(_58.tools){
|
||||
var _5c=tab.find("span.tabs-p-tool");
|
||||
if(!_5c.length){
|
||||
var _5c=$("<span class=\"tabs-p-tool\"></span>").insertAfter(tab.find(".tabs-inner"));
|
||||
}
|
||||
if($.isArray(_58.tools)){
|
||||
_5c.empty();
|
||||
for(var i=0;i<_58.tools.length;i++){
|
||||
var t=$("<a href=\"javascript:;\"></a>").appendTo(_5c);
|
||||
t.addClass(_58.tools[i].iconCls);
|
||||
if(_58.tools[i].handler){
|
||||
t._bind("click",{handler:_58.tools[i].handler},function(e){
|
||||
if($(this).parents("li").hasClass("tabs-disabled")){
|
||||
return;
|
||||
}
|
||||
e.data.handler.call(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(_58.tools).children().appendTo(_5c);
|
||||
}
|
||||
var pr=_5c.children().length*12;
|
||||
if(_58.closable){
|
||||
pr+=8;
|
||||
_5c.css("right","");
|
||||
}else{
|
||||
pr-=3;
|
||||
_5c.css("right","5px");
|
||||
}
|
||||
_5a.css("padding-right",pr+"px");
|
||||
}else{
|
||||
tab.find("span.tabs-p-tool").remove();
|
||||
_5a.css("padding-right","");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_58.disabled){
|
||||
_58.tab.addClass("tabs-disabled");
|
||||
}else{
|
||||
_58.tab.removeClass("tabs-disabled");
|
||||
}
|
||||
_15(_55);
|
||||
$.data(_55,"tabs").options.onUpdate.call(_55,_58.title,_4d(_55,pp));
|
||||
};
|
||||
function _5d(_5e,_5f){
|
||||
var _60=$.data(_5e,"tabs");
|
||||
var _61=_60.options;
|
||||
var _62=_60.tabs;
|
||||
var _63=_60.selectHis;
|
||||
if(!_64(_5e,_5f)){
|
||||
return;
|
||||
}
|
||||
var tab=_65(_5e,_5f);
|
||||
var _66=tab.panel("options").title;
|
||||
var _67=_4d(_5e,tab);
|
||||
if(_61.onBeforeClose.call(_5e,_66,_67)==false){
|
||||
return;
|
||||
}
|
||||
var tab=_65(_5e,_5f,true);
|
||||
tab.panel("options").tab.remove();
|
||||
tab.panel("destroy");
|
||||
_61.onClose.call(_5e,_66,_67);
|
||||
_15(_5e);
|
||||
var his=[];
|
||||
for(var i=0;i<_63.length;i++){
|
||||
var _68=_63[i];
|
||||
if(_68!=_67){
|
||||
his.push(_68>_67?_68-1:_68);
|
||||
}
|
||||
}
|
||||
_60.selectHis=his;
|
||||
var _69=$(_5e).tabs("getSelected");
|
||||
if(!_69&&his.length){
|
||||
_67=_60.selectHis.pop();
|
||||
$(_5e).tabs("select",_67);
|
||||
}
|
||||
};
|
||||
function _65(_6a,_6b,_6c){
|
||||
var _6d=$.data(_6a,"tabs").tabs;
|
||||
var tab=null;
|
||||
if(typeof _6b=="number"){
|
||||
if(_6b>=0&&_6b<_6d.length){
|
||||
tab=_6d[_6b];
|
||||
if(_6c){
|
||||
_6d.splice(_6b,1);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var tmp=$("<span></span>");
|
||||
for(var i=0;i<_6d.length;i++){
|
||||
var p=_6d[i];
|
||||
tmp.html(p.panel("options").title);
|
||||
var _6e=tmp.text();
|
||||
tmp.html(_6b);
|
||||
_6b=tmp.text();
|
||||
if(_6e==_6b){
|
||||
tab=p;
|
||||
if(_6c){
|
||||
_6d.splice(i,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
tmp.remove();
|
||||
}
|
||||
return tab;
|
||||
};
|
||||
function _4d(_6f,tab){
|
||||
var _70=$.data(_6f,"tabs").tabs;
|
||||
for(var i=0;i<_70.length;i++){
|
||||
if(_70[i][0]==$(tab)[0]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
function _26(_71){
|
||||
var _72=$.data(_71,"tabs").tabs;
|
||||
for(var i=0;i<_72.length;i++){
|
||||
var tab=_72[i];
|
||||
if(tab.panel("options").tab.hasClass("tabs-selected")){
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
function _73(_74){
|
||||
var _75=$.data(_74,"tabs");
|
||||
var _76=_75.tabs;
|
||||
for(var i=0;i<_76.length;i++){
|
||||
var _77=_76[i].panel("options");
|
||||
if(_77.selected&&!_77.disabled){
|
||||
_53(_74,i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
_53(_74,_75.options.selected);
|
||||
};
|
||||
function _53(_78,_79){
|
||||
var p=_65(_78,_79);
|
||||
if(p&&!p.is(":visible")){
|
||||
_7a(_78);
|
||||
if(!p.panel("options").disabled){
|
||||
p.panel("open");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _7b(_7c,_7d){
|
||||
var p=_65(_7c,_7d);
|
||||
if(p&&p.is(":visible")){
|
||||
_7a(_7c);
|
||||
p.panel("close");
|
||||
}
|
||||
};
|
||||
function _7a(_7e){
|
||||
$(_7e).children("div.tabs-panels").each(function(){
|
||||
$(this).stop(true,true);
|
||||
});
|
||||
};
|
||||
function _64(_7f,_80){
|
||||
return _65(_7f,_80)!=null;
|
||||
};
|
||||
function _81(_82,_83){
|
||||
var _84=$.data(_82,"tabs").options;
|
||||
_84.showHeader=_83;
|
||||
$(_82).tabs("resize");
|
||||
};
|
||||
function _85(_86,_87){
|
||||
var _88=$(_86).find(">.tabs-header>.tabs-tool");
|
||||
if(_87){
|
||||
_88.removeClass("tabs-tool-hidden").show();
|
||||
}else{
|
||||
_88.addClass("tabs-tool-hidden").hide();
|
||||
}
|
||||
$(_86).tabs("resize").tabs("scrollBy",0);
|
||||
};
|
||||
$.fn.tabs=function(_89,_8a){
|
||||
if(typeof _89=="string"){
|
||||
return $.fn.tabs.methods[_89](this,_8a);
|
||||
}
|
||||
_89=_89||{};
|
||||
return this.each(function(){
|
||||
var _8b=$.data(this,"tabs");
|
||||
if(_8b){
|
||||
$.extend(_8b.options,_89);
|
||||
}else{
|
||||
$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_89),tabs:[],selectHis:[]});
|
||||
_2a(this);
|
||||
}
|
||||
_f(this);
|
||||
_38(this);
|
||||
_15(this);
|
||||
_30(this);
|
||||
_73(this);
|
||||
});
|
||||
};
|
||||
$.fn.tabs.methods={options:function(jq){
|
||||
var cc=jq[0];
|
||||
var _8c=$.data(cc,"tabs").options;
|
||||
var s=_26(cc);
|
||||
_8c.selected=s?_4d(cc,s):-1;
|
||||
return _8c;
|
||||
},tabs:function(jq){
|
||||
return $.data(jq[0],"tabs").tabs;
|
||||
},resize:function(jq,_8d){
|
||||
return jq.each(function(){
|
||||
_15(this,_8d);
|
||||
_23(this);
|
||||
});
|
||||
},add:function(jq,_8e){
|
||||
return jq.each(function(){
|
||||
_4e(this,_8e);
|
||||
});
|
||||
},close:function(jq,_8f){
|
||||
return jq.each(function(){
|
||||
_5d(this,_8f);
|
||||
});
|
||||
},getTab:function(jq,_90){
|
||||
return _65(jq[0],_90);
|
||||
},getTabIndex:function(jq,tab){
|
||||
return _4d(jq[0],tab);
|
||||
},getSelected:function(jq){
|
||||
return _26(jq[0]);
|
||||
},select:function(jq,_91){
|
||||
return jq.each(function(){
|
||||
_53(this,_91);
|
||||
});
|
||||
},unselect:function(jq,_92){
|
||||
return jq.each(function(){
|
||||
_7b(this,_92);
|
||||
});
|
||||
},exists:function(jq,_93){
|
||||
return _64(jq[0],_93);
|
||||
},update:function(jq,_94){
|
||||
return jq.each(function(){
|
||||
_54(this,_94);
|
||||
});
|
||||
},enableTab:function(jq,_95){
|
||||
return jq.each(function(){
|
||||
var _96=$(this).tabs("getTab",_95).panel("options");
|
||||
_96.tab.removeClass("tabs-disabled");
|
||||
_96.disabled=false;
|
||||
});
|
||||
},disableTab:function(jq,_97){
|
||||
return jq.each(function(){
|
||||
var _98=$(this).tabs("getTab",_97).panel("options");
|
||||
_98.tab.addClass("tabs-disabled");
|
||||
_98.disabled=true;
|
||||
});
|
||||
},showHeader:function(jq){
|
||||
return jq.each(function(){
|
||||
_81(this,true);
|
||||
});
|
||||
},hideHeader:function(jq){
|
||||
return jq.each(function(){
|
||||
_81(this,false);
|
||||
});
|
||||
},showTool:function(jq){
|
||||
return jq.each(function(){
|
||||
_85(this,true);
|
||||
});
|
||||
},hideTool:function(jq){
|
||||
return jq.each(function(){
|
||||
_85(this,false);
|
||||
});
|
||||
},scrollBy:function(jq,_99){
|
||||
return jq.each(function(){
|
||||
var _9a=$(this).tabs("options");
|
||||
var _9b=$(this).find(">div.tabs-header>div.tabs-wrap");
|
||||
var pos=Math.min(_9b._scrollLeft()+_99,_9c());
|
||||
_9b.animate({scrollLeft:pos},_9a.scrollDuration);
|
||||
function _9c(){
|
||||
var w=0;
|
||||
var ul=_9b.children("ul");
|
||||
ul.children("li").each(function(){
|
||||
w+=$(this).outerWidth(true);
|
||||
});
|
||||
return w-_9b.width()+(ul.outerWidth()-ul.width());
|
||||
};
|
||||
});
|
||||
}};
|
||||
$.fn.tabs.parseOptions=function(_9d){
|
||||
return $.extend({},$.parser.parseOptions(_9d,["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:32,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(_9e){
|
||||
},onSelect:function(_9f,_a0){
|
||||
},onUnselect:function(_a1,_a2){
|
||||
},onBeforeClose:function(_a3,_a4){
|
||||
},onClose:function(_a5,_a6){
|
||||
},onAdd:function(_a7,_a8){
|
||||
},onUpdate:function(_a9,_aa){
|
||||
},onContextMenu:function(e,_ab,_ac){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
223
static/jeasyui/plugins/jquery.tagbox.js
Normal file
223
static/jeasyui/plugins/jquery.tagbox.js
Normal file
@@ -0,0 +1,223 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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;
|
||||
var _b=tb.outerWidth();
|
||||
tb.css({height:"",paddingLeft:_a.css("marginLeft"),paddingRight:_a.css("marginRight")});
|
||||
_a.css("margin",0);
|
||||
tb._outerWidth(_b);
|
||||
_23(_2);
|
||||
_12(this);
|
||||
_4.onResizing.call(_2,_8,_9);
|
||||
},onLoadSuccess:function(_c){
|
||||
_7();
|
||||
_4.onLoadSuccess.call(_2,_c);
|
||||
}}));
|
||||
_7();
|
||||
_23(_2);
|
||||
function _7(){
|
||||
$(_2).next().find(".tagbox-label").remove();
|
||||
var _d=$(_2).tagbox("textbox");
|
||||
var ss=[];
|
||||
$.map($(_2).tagbox("getValues"),function(_e,_f){
|
||||
var row=_4.finder.getRow(_2,_e);
|
||||
var _10=_4.tagFormatter.call(_2,_e,row);
|
||||
var cs={};
|
||||
var css=_4.tagStyler.call(_2,_e,row)||"";
|
||||
if(typeof css=="string"){
|
||||
cs={s:css};
|
||||
}else{
|
||||
cs={c:css["class"]||"",s:css["style"]||""};
|
||||
}
|
||||
var _11=$("<span class=\"tagbox-label\"></span>").insertBefore(_d).html(_10);
|
||||
_11.attr("tagbox-index",_f);
|
||||
_11.attr("style",cs.s).addClass(cs.c);
|
||||
$("<a href=\"javascript:;\" class=\"tagbox-remove\"></a>").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=$("<span></span>").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,"<").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);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combobox("reset").combobox("setText","");
|
||||
});
|
||||
}};
|
||||
$.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);
|
||||
|
||||
572
static/jeasyui/plugins/jquery.textbox.js
Normal file
572
static/jeasyui/plugins/jquery.textbox.js
Normal file
@@ -0,0 +1,572 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=0;
|
||||
function _2(_3){
|
||||
$(_3).addClass("textbox-f").hide();
|
||||
var _4=$("<span class=\"textbox\">"+"<input class=\"textbox-text\" autocomplete=\"off\">"+"<input type=\"hidden\" class=\"textbox-value\">"+"</span>").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 _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(_9.multiline){
|
||||
$("<textarea id=\""+_a+"\" class=\"textbox-text\" autocomplete=\"off\"></textarea>").prependTo(tb);
|
||||
}else{
|
||||
$("<input id=\""+_a+"\" type=\""+_9.type+"\" class=\"textbox-text\" autocomplete=\"off\">").prependTo(tb);
|
||||
}
|
||||
$("#"+_a).attr("tabindex",$(_7).attr("tabindex")||"").css("text-align",_7.style.textAlign||"");
|
||||
tb.find(".textbox-addon").remove();
|
||||
var bb=_9.icons?$.extend(true,[],_9.icons):[];
|
||||
if(_9.iconCls){
|
||||
bb.push({iconCls:_9.iconCls,disabled:true});
|
||||
}
|
||||
if(bb.length){
|
||||
var bc=$("<span class=\"textbox-addon\"></span>").prependTo(tb);
|
||||
bc.addClass("textbox-addon-"+_9.iconAlign);
|
||||
for(var i=0;i<bb.length;i++){
|
||||
bc.append("<a href=\"javascript:;\" class=\"textbox-icon "+bb[i].iconCls+"\" icon-index=\""+i+"\" tabindex=\"-1\"></a>");
|
||||
}
|
||||
}
|
||||
tb.find(".textbox-button").remove();
|
||||
if(_9.buttonText||_9.buttonIcon){
|
||||
var _b=$("<a href=\"javascript:;\" class=\"textbox-button\"></a>").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=$("<label class=\"textbox-label\"></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();
|
||||
}
|
||||
_c(_7);
|
||||
_d(_7,_9.disabled);
|
||||
_e(_7,_9.readonly);
|
||||
};
|
||||
function _f(_10){
|
||||
var _11=$.data(_10,"textbox");
|
||||
var tb=_11.textbox;
|
||||
tb.find(".textbox-text").validatebox("destroy");
|
||||
tb.remove();
|
||||
$(_11.label).remove();
|
||||
$(_10).remove();
|
||||
};
|
||||
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(_16.width))){
|
||||
var c=$(_13).clone();
|
||||
c.css("visibility","hidden");
|
||||
c.insertAfter(_13);
|
||||
_16.width=c.outerWidth();
|
||||
c.remove();
|
||||
}
|
||||
var _18=tb.is(":visible");
|
||||
if(!_18){
|
||||
tb.appendTo("body");
|
||||
}
|
||||
var _19=tb.find(".textbox-text");
|
||||
var btn=tb.find(".textbox-button");
|
||||
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()});
|
||||
}else{
|
||||
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 _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")){
|
||||
if(box.val()!==_23.value){
|
||||
_23.oldInputValue=box.val();
|
||||
box.val(_23.value);
|
||||
}
|
||||
}
|
||||
},onValidate:function(_27){
|
||||
var box=$(this);
|
||||
if(_23.oldInputValue!=undefined){
|
||||
box.val(_23.oldInputValue);
|
||||
_23.oldInputValue=undefined;
|
||||
}
|
||||
var tb=box.parent();
|
||||
if(_27){
|
||||
tb.removeClass("textbox-invalid");
|
||||
}else{
|
||||
tb.addClass("textbox-invalid");
|
||||
}
|
||||
_23.onValidate.call(_22,_27);
|
||||
}}));
|
||||
};
|
||||
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;
|
||||
}
|
||||
_2b.value=$(this).val();
|
||||
if(_2b.value==""){
|
||||
$(this).val(_2b.prompt).addClass("textbox-prompt");
|
||||
}else{
|
||||
$(this).removeClass("textbox-prompt");
|
||||
}
|
||||
tb.removeClass("textbox-focused");
|
||||
tb.closest(".form-field").removeClass("form-field-focused");
|
||||
})._bind("focus.textbox",function(e){
|
||||
_2b.hasFocusMe=true;
|
||||
if(tb.hasClass("textbox-focused")){
|
||||
return;
|
||||
}
|
||||
if($(this).val()!=_2b.value){
|
||||
$(this).val(_2b.value);
|
||||
}
|
||||
$(this).removeClass("textbox-prompt");
|
||||
tb.addClass("textbox-focused");
|
||||
tb.closest(".form-field").addClass("form-field-focused");
|
||||
});
|
||||
for(var _2d in _2b.inputEvents){
|
||||
_2c._bind(_2d+".textbox",{target:_29},_2b.inputEvents[_2d]);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
_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{
|
||||
_34.removeClass("textbox-icon-disabled");
|
||||
}
|
||||
});
|
||||
var btn=tb.find(".textbox-button");
|
||||
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 _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._propAttr("disabled",true);
|
||||
$(_38.label).addClass("textbox-label-disabled");
|
||||
}else{
|
||||
_3a.validatebox("enable");
|
||||
tb.removeClass("textbox-disabled");
|
||||
ss._propAttr("disabled",false);
|
||||
$(_38.label).removeClass("textbox-label-disabled");
|
||||
}
|
||||
};
|
||||
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);
|
||||
if(_3e.readonly){
|
||||
tb.addClass("textbox-readonly");
|
||||
$(_3d.label).addClass("textbox-label-readonly");
|
||||
}else{
|
||||
tb.removeClass("textbox-readonly");
|
||||
$(_3d.label).removeClass("textbox-label-readonly");
|
||||
}
|
||||
};
|
||||
$.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 _43=$(this).textbox("textbox");
|
||||
_43.validatebox(_40,_41);
|
||||
});
|
||||
}
|
||||
}
|
||||
_40=_40||{};
|
||||
return this.each(function(){
|
||||
var _44=$.data(this,"textbox");
|
||||
if(_44){
|
||||
$.extend(_44.options,_40);
|
||||
if(_40.value!=undefined){
|
||||
_44.options.originalValue=_40.value;
|
||||
}
|
||||
}else{
|
||||
_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,_46){
|
||||
return jq.each(function(){
|
||||
var t=$(this);
|
||||
if(t.data("textbox")){
|
||||
return;
|
||||
}
|
||||
if(!$(_46).data("textbox")){
|
||||
$(_46).textbox();
|
||||
}
|
||||
var _47=$.extend(true,{},$(_46).textbox("options"));
|
||||
var _48=t.attr("name")||"";
|
||||
t.addClass("textbox-f").hide();
|
||||
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(){
|
||||
_f(this);
|
||||
});
|
||||
},resize:function(jq,_4d){
|
||||
return jq.each(function(){
|
||||
_12(this,_4d);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,true);
|
||||
_28(this);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
_28(this);
|
||||
});
|
||||
},readonly:function(jq,_4e){
|
||||
return jq.each(function(){
|
||||
_e(this,_4e);
|
||||
_28(this);
|
||||
});
|
||||
},isValid:function(jq){
|
||||
return jq.textbox("textbox").validatebox("isValid");
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("setValue","");
|
||||
});
|
||||
},setText:function(jq,_4f){
|
||||
return jq.each(function(){
|
||||
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{
|
||||
_51.val(_50.prompt).addClass("textbox-prompt");
|
||||
}
|
||||
}
|
||||
if(_50.value){
|
||||
$(this).closest(".form-field").removeClass("form-field-empty");
|
||||
}else{
|
||||
$(this).closest(".form-field").addClass("form-field-empty");
|
||||
}
|
||||
$(this).textbox("validate");
|
||||
});
|
||||
},initValue:function(jq,_52){
|
||||
return jq.each(function(){
|
||||
var _53=$.data(this,"textbox");
|
||||
$(this).textbox("setText",_52);
|
||||
_53.textbox.find(".textbox-value").val(_52);
|
||||
$(this).val(_52);
|
||||
});
|
||||
},setValue:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
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 _57=jq.textbox("textbox");
|
||||
if(_57.is(":focus")){
|
||||
return _57.val();
|
||||
}else{
|
||||
return jq.textbox("options").value;
|
||||
}
|
||||
},getValue:function(jq){
|
||||
return jq.data("textbox").textbox.find(".textbox-value").val();
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _58=$(this).textbox("options");
|
||||
$(this).textbox("textbox").val(_58.originalValue);
|
||||
$(this).textbox("setValue",_58.originalValue);
|
||||
});
|
||||
},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{
|
||||
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{
|
||||
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(_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,{doSize:true,width:"auto",height:"auto",cls:null,prompt:"",value:"",type:"text",multiline:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:26,buttonText:"",buttonIcon:null,buttonAlign:"right",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",inputEvents:{blur:function(e){
|
||||
var t=$(e.data.target);
|
||||
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(_6b,_6c){
|
||||
},onResizing:function(_6d,_6e){
|
||||
},onResize:function(_6f,_70){
|
||||
},onClickButton:function(){
|
||||
},onClickIcon:function(_71){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
289
static/jeasyui/plugins/jquery.timepicker.js
Normal file
289
static/jeasyui/plugins/jquery.timepicker.js
Normal file
@@ -0,0 +1,289 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"timepicker");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("timepicker-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
_5(this);
|
||||
_6(_2);
|
||||
_13(_2,$(_2).timepicker("getValue"));
|
||||
}}));
|
||||
$(_2).timepicker("initValue",_4.value);
|
||||
function _5(_7){
|
||||
var _8=$(_7).timepicker("options");
|
||||
var _9=$(_7).combo("panel");
|
||||
_9._unbind(".timepicker")._bind("click.timepicker",function(e){
|
||||
if($(e.target).hasClass("datebox-button-a")){
|
||||
var _a=parseInt($(e.target).attr("datebox-button-index"));
|
||||
_8.buttons[_a].handler.call(e.target,_7);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _6(_b){
|
||||
var _c=$(_b).combo("panel");
|
||||
if(_c.children("div.datebox-button").length){
|
||||
return;
|
||||
}
|
||||
var _d=$("<div class=\"datebox-button\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%\"><tr></tr></table></div>").appendTo(_c);
|
||||
var tr=_d.find("tr");
|
||||
for(var i=0;i<_4.buttons.length;i++){
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var _e=_4.buttons[i];
|
||||
var t=$("<a class=\"datebox-button-a\" href=\"javascript:;\"></a>").html($.isFunction(_e.text)?_e.text(_b):_e.text).appendTo(td);
|
||||
t.attr("datebox-button-index",i);
|
||||
}
|
||||
tr.find("td").css("width",(100/_4.buttons.length)+"%");
|
||||
};
|
||||
};
|
||||
function _f(_10,_11){
|
||||
var _12=$(_10).data("timepicker").options;
|
||||
_13(_10,_11);
|
||||
_12.value=_14(_10);
|
||||
$(_10).combo("setValue",_12.value).combo("setText",_12.value);
|
||||
};
|
||||
function _13(_15,_16){
|
||||
var _17=$(_15).data("timepicker").options;
|
||||
if(_16){
|
||||
var _18=_16.split(" ");
|
||||
var hm=_18[0].split(":");
|
||||
_17.selectingHour=parseInt(hm[0],10);
|
||||
_17.selectingMinute=parseInt(hm[1],10);
|
||||
_17.selectingAmpm=_18[1];
|
||||
}else{
|
||||
_17.selectingHour=12;
|
||||
_17.selectingMinute=0;
|
||||
_17.selectingAmpm=_17.ampm[0];
|
||||
}
|
||||
_19(_15);
|
||||
};
|
||||
function _14(_1a){
|
||||
var _1b=$(_1a).data("timepicker").options;
|
||||
var h=_1b.selectingHour;
|
||||
var m=_1b.selectingMinute;
|
||||
var _1c=_1b.selectingAmpm;
|
||||
if(!_1c){
|
||||
_1c=_1b.ampm[0];
|
||||
}
|
||||
var v=(h<10?"0"+h:h)+":"+(m<10?"0"+m:m);
|
||||
if(!_1b.hour24){
|
||||
v+=" "+_1c;
|
||||
}
|
||||
return v;
|
||||
};
|
||||
function _19(_1d){
|
||||
var _1e=$(_1d).data("timepicker").options;
|
||||
var _1f=$(_1d).combo("panel");
|
||||
var _20=_1f.children(".timepicker-panel");
|
||||
if(!_20.length){
|
||||
var _20=$("<div class=\"timepicker-panel f-column\"></div>").prependTo(_1f);
|
||||
}
|
||||
_20.empty();
|
||||
if(_1e.panelHeight!="auto"){
|
||||
var _21=_1f.height()-_1f.find(".datebox-button").outerHeight();
|
||||
_20._outerHeight(_21);
|
||||
}
|
||||
_22(_1d);
|
||||
_23(_1d);
|
||||
_20.off(".timepicker");
|
||||
_20.on("click.timepicker",".title-hour",function(e){
|
||||
_1e.selectingType="hour";
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".title-minute",function(e){
|
||||
_1e.selectingType="minute";
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".title-am",function(e){
|
||||
_1e.selectingAmpm=_1e.ampm[0];
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".title-pm",function(e){
|
||||
_1e.selectingAmpm=_1e.ampm[1];
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".item",function(e){
|
||||
var _24=parseInt($(this).text(),10);
|
||||
if(_1e.selectingType=="hour"){
|
||||
_1e.selectingHour=_24;
|
||||
}else{
|
||||
_1e.selectingMinute=_24;
|
||||
}
|
||||
_19(_1d);
|
||||
});
|
||||
};
|
||||
function _22(_25){
|
||||
var _26=$(_25).data("timepicker").options;
|
||||
var _27=$(_25).combo("panel");
|
||||
var _28=_27.find(".timepicker-panel");
|
||||
var _29=_26.selectingHour;
|
||||
var _2a=_26.selectingMinute;
|
||||
$("<div class=\"panel-header f-noshrink f-row f-content-center\">"+"<div class=\"title title-hour\">"+(_29<10?"0"+_29:_29)+"</div>"+"<div class=\"sep\">:</div>"+"<div class=\"title title-minute\">"+(_2a<10?"0"+_2a:_2a)+"</div>"+"<div class=\"ampm f-column\">"+"<div class=\"title title-am\">"+_26.ampm[0]+"</div>"+"<div class=\"title title-pm\">"+_26.ampm[1]+"</div>"+"</div>"+"</div>").appendTo(_28);
|
||||
var _2b=_28.find(".panel-header");
|
||||
if(_26.selectingType=="hour"){
|
||||
_2b.find(".title-hour").addClass("title-selected");
|
||||
}else{
|
||||
_2b.find(".title-minute").addClass("title-selected");
|
||||
}
|
||||
if(_26.selectingAmpm==_26.ampm[0]){
|
||||
_2b.find(".title-am").addClass("title-selected");
|
||||
}
|
||||
if(_26.selectingAmpm==_26.ampm[1]){
|
||||
_2b.find(".title-pm").addClass("title-selected");
|
||||
}
|
||||
if(_26.hour24){
|
||||
_2b.find(".ampm").hide();
|
||||
}
|
||||
};
|
||||
function _23(_2c){
|
||||
var _2d=$(_2c).data("timepicker").options;
|
||||
var _2e=$(_2c).combo("panel");
|
||||
var _2f=_2e.find(".timepicker-panel");
|
||||
var _30=$("<div class=\"clock-wrap f-full f-column f-content-center\">"+"</div>").appendTo(_2f);
|
||||
var _31=_30.outerWidth();
|
||||
var _32=_30.outerHeight();
|
||||
var _33=Math.min(_31,_32)-20;
|
||||
var _34=_33/2;
|
||||
_31=_33;
|
||||
_32=_33;
|
||||
var _35=_2d.selectingType=="hour"?_2d.selectingHour:_2d.selectingMinute;
|
||||
var _36=_35/(_2d.selectingType=="hour"?12:60)*360;
|
||||
_36=parseFloat(_36).toFixed(4);
|
||||
var _37={transform:"rotate("+_36+"deg)",};
|
||||
if(_2d.hour24&&_2d.selectingType=="hour"){
|
||||
if(_35==0){
|
||||
_37.top=_2d.hourDistance[0]+"px";
|
||||
}else{
|
||||
if(_35<=12){
|
||||
_37.top=_2d.hourDistance[1]+"px";
|
||||
}
|
||||
}
|
||||
}
|
||||
var _38={width:_31+"px",height:_32+"px",marginLeft:-_31/2+"px",marginTop:-_32/2+"px"};
|
||||
var _39=[];
|
||||
_39.push("<div class=\"clock\">");
|
||||
_39.push("<div class=\"center\"></div>");
|
||||
_39.push("<div class=\"hand\">");
|
||||
_39.push("<div class=\"drag\"></div>");
|
||||
_39.push("</div>");
|
||||
var _3a=_3b();
|
||||
if(_2d.hour24&&_2d.selectingType=="hour"){
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _3c=parseInt(_3a[i],10);
|
||||
_3c+=12;
|
||||
if(_3c==24){
|
||||
_3c="00";
|
||||
}
|
||||
var cls="item f-column f-content-center";
|
||||
if(_3c==_35){
|
||||
cls+=" item-selected";
|
||||
}
|
||||
var _36=_3c/(_2d.selectingType=="hour"?12:60)*360*Math.PI/180;
|
||||
var x=(_34-20)*Math.sin(_36);
|
||||
var y=-(_34-20)*Math.cos(_36);
|
||||
_36=parseFloat(_36).toFixed(4);
|
||||
x=parseFloat(x).toFixed(4);
|
||||
y=parseFloat(y).toFixed(4);
|
||||
var _3d={transform:"translate("+x+"px,"+y+"px)"};
|
||||
var _3d="transform:translate("+x+"px,"+y+"px)";
|
||||
_39.push("<div class=\""+cls+"\" style=\""+_3d+"\">"+(_3c)+"</div>");
|
||||
}
|
||||
_34-=_2d.hourDistance[1]-_2d.hourDistance[0];
|
||||
}
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _3c=_3a[i];
|
||||
var cls="item f-column f-content-center";
|
||||
if(_3c==_35){
|
||||
cls+=" item-selected";
|
||||
}
|
||||
var _36=_3c/(_2d.selectingType=="hour"?12:60)*360*Math.PI/180;
|
||||
var x=(_34-20)*Math.sin(_36);
|
||||
var y=-(_34-20)*Math.cos(_36);
|
||||
_36=parseFloat(_36).toFixed(4);
|
||||
x=parseFloat(x).toFixed(4);
|
||||
y=parseFloat(y).toFixed(4);
|
||||
var _3d={transform:"translate("+x+"px,"+y+"px)"};
|
||||
var _3d="transform:translate("+x+"px,"+y+"px)";
|
||||
_39.push("<div class=\""+cls+"\" style=\""+_3d+"\">"+_3c+"</div>");
|
||||
}
|
||||
_39.push("</div>");
|
||||
_30.html(_39.join(""));
|
||||
_30.find(".clock").css(_38);
|
||||
_30.find(".hand").css(_37);
|
||||
function _3b(){
|
||||
var _3e=[];
|
||||
if(_2d.selectingType=="hour"){
|
||||
for(var i=0;i<12;i++){
|
||||
_3e.push(String(i));
|
||||
}
|
||||
_3e[0]="12";
|
||||
}else{
|
||||
for(var i=0;i<60;i+=5){
|
||||
_3e.push(i<10?"0"+i:String(i));
|
||||
}
|
||||
_3e[0]="00";
|
||||
}
|
||||
return _3e;
|
||||
};
|
||||
};
|
||||
$.fn.timepicker=function(_3f,_40){
|
||||
if(typeof _3f=="string"){
|
||||
var _41=$.fn.timepicker.methods[_3f];
|
||||
if(_41){
|
||||
return _41(this,_40);
|
||||
}else{
|
||||
return this.combo(_3f,_40);
|
||||
}
|
||||
}
|
||||
_3f=_3f||{};
|
||||
return this.each(function(){
|
||||
var _42=$.data(this,"timepicker");
|
||||
if(_42){
|
||||
$.extend(_42.options,_3f);
|
||||
}else{
|
||||
$.data(this,"timepicker",{options:$.extend({},$.fn.timepicker.defaults,$.fn.timepicker.parseOptions(this),_3f)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.timepicker.methods={options:function(jq){
|
||||
var _43=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"timepicker").options,{width:_43.width,height:_43.height,originalValue:_43.originalValue,disabled:_43.disabled,readonly:_43.readonly});
|
||||
},initValue:function(jq,_44){
|
||||
return jq.each(function(){
|
||||
var _45=$(this).timepicker("options");
|
||||
_45.value=_44;
|
||||
_13(this,_44);
|
||||
if(_44){
|
||||
_45.value=_14(this);
|
||||
$(this).combo("initValue",_45.value).combo("setText",_45.value);
|
||||
}
|
||||
});
|
||||
},setValue:function(jq,_46){
|
||||
return jq.each(function(){
|
||||
_f(this,_46);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _47=$(this).timepicker("options");
|
||||
$(this).timepicker("setValue",_47.originalValue);
|
||||
});
|
||||
}};
|
||||
$.fn.timepicker.parseOptions=function(_48){
|
||||
return $.extend({},$.fn.combo.parseOptions(_48),$.parser.parseOptions(_48,[{hour24:"boolean"}]));
|
||||
};
|
||||
$.fn.timepicker.defaults=$.extend({},$.fn.combo.defaults,{closeText:"Close",okText:"Ok",buttons:[{text:function(_49){
|
||||
return $(_49).timepicker("options").okText;
|
||||
},handler:function(_4a){
|
||||
$(_4a).timepicker("setValue",_14(_4a));
|
||||
$(this).closest("div.combo-panel").panel("close");
|
||||
}},{text:function(_4b){
|
||||
return $(_4b).timepicker("options").closeText;
|
||||
},handler:function(_4c){
|
||||
$(this).closest("div.combo-panel").panel("close");
|
||||
}}],editable:false,ampm:["am","pm"],value:"",selectingHour:12,selectingMinute:0,selectingType:"hour",hour24:false,hourDistance:[20,50]});
|
||||
})(jQuery);
|
||||
|
||||
199
static/jeasyui/plugins/jquery.timespinner.js
Executable file
199
static/jeasyui/plugins/jquery.timespinner.js
Executable file
@@ -0,0 +1,199 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,"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 _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 _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 _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 _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]);
|
||||
if(s2==_17.ampm[0]){
|
||||
s2=_17.ampm[1];
|
||||
}else{
|
||||
if(s2==_17.ampm[1]){
|
||||
s2=_17.ampm[0];
|
||||
}else{
|
||||
s2=parseInt(s2,10)||0;
|
||||
if(_17.selections.length-4==_17.highlight&&_17.hour12){
|
||||
if(s2==12){
|
||||
s2=0;
|
||||
}else{
|
||||
if(s2==11&&!_16){
|
||||
var tmp=s3.replace(_17.ampm[0],_17.ampm[1]);
|
||||
if(s3!=tmp){
|
||||
s3=tmp;
|
||||
}else{
|
||||
s3=s3.replace(_17.ampm[1],_17.ampm[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
s2=s2+_17.increment*(_16?-1:1);
|
||||
}
|
||||
}
|
||||
var v=s1+s2+s3;
|
||||
$(_15).timespinner("setValue",v);
|
||||
_a(_15);
|
||||
};
|
||||
$.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(_19,_1a);
|
||||
}
|
||||
}
|
||||
_19=_19||{};
|
||||
return this.each(function(){
|
||||
var _1c=$.data(this,"timespinner");
|
||||
if(_1c){
|
||||
$.extend(_1c.options,_19);
|
||||
}else{
|
||||
$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_19)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.timespinner.methods={options:function(jq){
|
||||
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(){
|
||||
_f(this,_1e);
|
||||
});
|
||||
},getHours:function(jq){
|
||||
var _1f=$.data(jq[0],"timespinner").options;
|
||||
var _20=_1f.parser.call(jq[0],jq.timespinner("getValue"));
|
||||
return _20?_20.getHours():null;
|
||||
},getMinutes:function(jq){
|
||||
var _21=$.data(jq[0],"timespinner").options;
|
||||
var _22=_21.parser.call(jq[0],jq.timespinner("getValue"));
|
||||
return _22?_22.getMinutes():null;
|
||||
},getSeconds:function(jq){
|
||||
var _23=$.data(jq[0],"timespinner").options;
|
||||
var _24=_23.parser.call(jq[0],jq.timespinner("getValue"));
|
||||
return _24?_24.getSeconds():null;
|
||||
}};
|
||||
$.fn.timespinner.parseOptions=function(_25){
|
||||
return $.extend({},$.fn.spinner.parseOptions(_25),$.parser.parseOptions(_25,["separator",{hour12:"boolean",showSeconds:"boolean",highlight:"number"}]));
|
||||
};
|
||||
$.fn.timespinner.defaults=$.extend({},$.fn.spinner.defaults,{inputEvents:$.extend({},$.fn.spinner.defaults.inputEvents,{click:function(e){
|
||||
_5.call(this,e);
|
||||
},blur:function(e){
|
||||
var t=$(e.data.target);
|
||||
t.timespinner("setValue",t.timespinner("getText"));
|
||||
},keydown:function(e){
|
||||
if(e.keyCode==13){
|
||||
var t=$(e.data.target);
|
||||
t.timespinner("setValue",t.timespinner("getText"));
|
||||
}
|
||||
}}),formatter:function(_26){
|
||||
if(!_26){
|
||||
return "";
|
||||
}
|
||||
var _27=$(this).timespinner("options");
|
||||
var _28=_26.getHours();
|
||||
var _29=_26.getMinutes();
|
||||
var _2a=_26.getSeconds();
|
||||
var _2b="";
|
||||
if(_27.hour12){
|
||||
_2b=_28>=12?_27.ampm[1]:_27.ampm[0];
|
||||
_28=_28%12;
|
||||
if(_28==0){
|
||||
_28=12;
|
||||
}
|
||||
}
|
||||
var tt=[_2c(_28),_2c(_29)];
|
||||
if(_27.showSeconds){
|
||||
tt.push(_2c(_2a));
|
||||
}
|
||||
var s=tt.join(_27.separator)+" "+_2b;
|
||||
return $.trim(s);
|
||||
function _2c(_2d){
|
||||
return (_2d<10?"0":"")+_2d;
|
||||
};
|
||||
},parser:function(s){
|
||||
var _2e=$(this).timespinner("options");
|
||||
var _2f=_30(s);
|
||||
if(_2f){
|
||||
var min=_30(_2e.min);
|
||||
var max=_30(_2e.max);
|
||||
if(min&&min>_2f){
|
||||
_2f=min;
|
||||
}
|
||||
if(max&&max<_2f){
|
||||
_2f=max;
|
||||
}
|
||||
}
|
||||
return _2f;
|
||||
function _30(s){
|
||||
if(!s){
|
||||
return null;
|
||||
}
|
||||
var ss=s.split(" ");
|
||||
var tt=ss[0].split(_2e.separator);
|
||||
var _31=parseInt(tt[0],10)||0;
|
||||
var _32=parseInt(tt[1],10)||0;
|
||||
var _33=parseInt(tt[2],10)||0;
|
||||
if(_2e.hour12){
|
||||
var _34=ss[1];
|
||||
if(_34==_2e.ampm[1]&&_31<12){
|
||||
_31+=12;
|
||||
}else{
|
||||
if(_34==_2e.ampm[0]&&_31==12){
|
||||
_31-=12;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Date(1900,0,0,_31,_32,_33);
|
||||
};
|
||||
},selections:[[0,2],[3,5],[6,8],[9,11]],separator:":",showSeconds:false,highlight:0,hour12:false,ampm:["AM","PM"],spin:function(_35){
|
||||
_14(this,_35);
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
238
static/jeasyui/plugins/jquery.tooltip.js
Executable file
238
static/jeasyui/plugins/jquery.tooltip.js
Executable file
@@ -0,0 +1,238 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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){
|
||||
$(_2).addClass("tooltip-f");
|
||||
};
|
||||
function _3(_4){
|
||||
var _5=$.data(_4,"tooltip").options;
|
||||
$(_4)._unbind(".tooltip")._bind(_5.showEvent+".tooltip",function(e){
|
||||
$(_4).tooltip("show",e);
|
||||
})._bind(_5.hideEvent+".tooltip",function(e){
|
||||
$(_4).tooltip("hide",e);
|
||||
})._bind("mousemove.tooltip",function(e){
|
||||
if(_5.trackMouse){
|
||||
_5.trackMouseX=e.pageX;
|
||||
_5.trackMouseY=e.pageY;
|
||||
$(_4).tooltip("reposition");
|
||||
}
|
||||
});
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"tooltip");
|
||||
if(_8.showTimer){
|
||||
clearTimeout(_8.showTimer);
|
||||
_8.showTimer=null;
|
||||
}
|
||||
if(_8.hideTimer){
|
||||
clearTimeout(_8.hideTimer);
|
||||
_8.hideTimer=null;
|
||||
}
|
||||
};
|
||||
function _9(_a){
|
||||
var _b=$.data(_a,"tooltip");
|
||||
if(!_b||!_b.tip){
|
||||
return;
|
||||
}
|
||||
var _c=_b.options;
|
||||
var _d=_b.tip;
|
||||
var _e={left:-100000,top:-100000};
|
||||
if($(_a).is(":visible")){
|
||||
_e=_f(_c.position);
|
||||
if(_c.position=="top"&&_e.top<0){
|
||||
_e=_f("bottom");
|
||||
}else{
|
||||
if((_c.position=="bottom")&&(_e.top+_d._outerHeight()>$(window)._outerHeight()+$(document).scrollTop())){
|
||||
_e=_f("top");
|
||||
}
|
||||
}
|
||||
if(_e.left<0){
|
||||
if(_c.position=="left"){
|
||||
_e=_f("right");
|
||||
}else{
|
||||
$(_a).tooltip("arrow").css("left",_d._outerWidth()/2+_e.left);
|
||||
_e.left=0;
|
||||
}
|
||||
}else{
|
||||
if(_e.left+_d._outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){
|
||||
if(_c.position=="right"){
|
||||
_e=_f("left");
|
||||
}else{
|
||||
var _10=_e.left;
|
||||
_e.left=$(window)._outerWidth()+$(document)._scrollLeft()-_d._outerWidth();
|
||||
$(_a).tooltip("arrow").css("left",_d._outerWidth()/2-(_e.left-_10));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_d.css({left:_e.left,top:_e.top,zIndex:(_c.zIndex!=undefined?_c.zIndex:($.fn.window?$.fn.window.defaults.zIndex++:""))});
|
||||
_c.onPosition.call(_a,_e.left,_e.top);
|
||||
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+_13;
|
||||
top=_c.trackMouseY+_14;
|
||||
}else{
|
||||
var t=$(_a);
|
||||
_12=t.offset().left+_13;
|
||||
top=t.offset().top+_14;
|
||||
}
|
||||
switch(_c.position){
|
||||
case "right":
|
||||
_12+=t._outerWidth()+12+(_c.trackMouse?12:0);
|
||||
if(_c.valign=="middle"){
|
||||
top-=(_d._outerHeight()-t._outerHeight())/2;
|
||||
}
|
||||
break;
|
||||
case "left":
|
||||
_12-=_d._outerWidth()+12+(_c.trackMouse?12:0);
|
||||
if(_c.valign=="middle"){
|
||||
top-=(_d._outerHeight()-t._outerHeight())/2;
|
||||
}
|
||||
break;
|
||||
case "top":
|
||||
_12-=(_d._outerWidth()-t._outerWidth())/2;
|
||||
top-=_d._outerHeight()+12+(_c.trackMouse?12:0);
|
||||
break;
|
||||
case "bottom":
|
||||
_12-=(_d._outerWidth()-t._outerWidth())/2;
|
||||
top+=t._outerHeight()+12+(_c.trackMouse?12:0);
|
||||
break;
|
||||
}
|
||||
return {left:_12,top:top};
|
||||
};
|
||||
};
|
||||
function _15(_16,e){
|
||||
var _17=$.data(_16,"tooltip");
|
||||
var _18=_17.options;
|
||||
var tip=_17.tip;
|
||||
if(!tip){
|
||||
tip=$("<div tabindex=\"-1\" class=\"tooltip\">"+"<div class=\"tooltip-content\"></div>"+"<div class=\"tooltip-arrow-outer\"></div>"+"<div class=\"tooltip-arrow\"></div>"+"</div>").appendTo("body");
|
||||
_17.tip=tip;
|
||||
_19(_16);
|
||||
}
|
||||
_6(_16);
|
||||
_17.showTimer=setTimeout(function(){
|
||||
$(_16).tooltip("reposition");
|
||||
tip.show();
|
||||
_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 _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 _19(_1f,_20){
|
||||
var _21=$.data(_1f,"tooltip");
|
||||
var _22=_21.options;
|
||||
if(_20){
|
||||
_22.content=_20;
|
||||
}
|
||||
if(!_21.tip){
|
||||
return;
|
||||
}
|
||||
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 _23(_24){
|
||||
var _25=$.data(_24,"tooltip");
|
||||
if(_25){
|
||||
_6(_24);
|
||||
var _26=_25.options;
|
||||
if(_25.tip){
|
||||
_25.tip.remove();
|
||||
}
|
||||
if(_26._title){
|
||||
$(_24).attr("title",_26._title);
|
||||
}
|
||||
$.removeData(_24,"tooltip");
|
||||
$(_24)._unbind(".tooltip").removeClass("tooltip-f");
|
||||
_26.onDestroy.call(_24);
|
||||
}
|
||||
};
|
||||
$.fn.tooltip=function(_27,_28){
|
||||
if(typeof _27=="string"){
|
||||
return $.fn.tooltip.methods[_27](this,_28);
|
||||
}
|
||||
_27=_27||{};
|
||||
return this.each(function(){
|
||||
var _29=$.data(this,"tooltip");
|
||||
if(_29){
|
||||
$.extend(_29.options,_27);
|
||||
}else{
|
||||
$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_27)});
|
||||
_1(this);
|
||||
}
|
||||
_3(this);
|
||||
_19(this);
|
||||
});
|
||||
};
|
||||
$.fn.tooltip.methods={options:function(jq){
|
||||
return $.data(jq[0],"tooltip").options;
|
||||
},tip:function(jq){
|
||||
return $.data(jq[0],"tooltip").tip;
|
||||
},arrow:function(jq){
|
||||
return jq.tooltip("tip").children(".tooltip-arrow-outer,.tooltip-arrow");
|
||||
},show:function(jq,e){
|
||||
return jq.each(function(){
|
||||
_15(this,e);
|
||||
});
|
||||
},hide:function(jq,e){
|
||||
return jq.each(function(){
|
||||
_1c(this,e);
|
||||
});
|
||||
},update:function(jq,_2a){
|
||||
return jq.each(function(){
|
||||
_19(this,_2a);
|
||||
});
|
||||
},reposition:function(jq){
|
||||
return jq.each(function(){
|
||||
_9(this);
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_23(this);
|
||||
});
|
||||
}};
|
||||
$.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(!_2c.content){
|
||||
_2c.content=_2c._title;
|
||||
}
|
||||
return _2c;
|
||||
};
|
||||
$.fn.tooltip.defaults={position:"bottom",valign:"middle",content:null,trackMouse:false,deltaX:0,deltaY:0,showEvent:"mouseenter",hideEvent:"mouseleave",showDelay:200,hideDelay:100,onShow:function(e){
|
||||
},onHide:function(e){
|
||||
},onUpdate:function(_2d){
|
||||
},onPosition:function(_2e,top){
|
||||
},onDestroy:function(){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
1265
static/jeasyui/plugins/jquery.tree.js
Executable file
1265
static/jeasyui/plugins/jquery.tree.js
Executable file
File diff suppressed because it is too large
Load Diff
1359
static/jeasyui/plugins/jquery.treegrid.js
Executable file
1359
static/jeasyui/plugins/jquery.treegrid.js
Executable file
File diff suppressed because it is too large
Load Diff
310
static/jeasyui/plugins/jquery.validatebox.js
Executable file
310
static/jeasyui/plugins/jquery.validatebox.js
Executable file
@@ -0,0 +1,310 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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){
|
||||
$(_2).addClass("validatebox-text");
|
||||
};
|
||||
function _3(_4){
|
||||
var _5=$.data(_4,"validatebox");
|
||||
_5.validating=false;
|
||||
if(_5.vtimer){
|
||||
clearTimeout(_5.vtimer);
|
||||
}
|
||||
if(_5.ftimer){
|
||||
clearTimeout(_5.ftimer);
|
||||
}
|
||||
$(_4).tooltip("destroy");
|
||||
$(_4)._unbind();
|
||||
$(_4).remove();
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"validatebox").options;
|
||||
$(_7)._unbind(".validatebox");
|
||||
if(_8.novalidate||_8.disabled){
|
||||
return;
|
||||
}
|
||||
for(var _9 in _8.events){
|
||||
$(_7)._bind(_9+".validatebox",{target:_7},_8.events[_9]);
|
||||
}
|
||||
};
|
||||
function _a(e){
|
||||
var _b=e.data.target;
|
||||
var _c=$.data(_b,"validatebox");
|
||||
var _d=_c.options;
|
||||
if($(_b).attr("readonly")){
|
||||
return;
|
||||
}
|
||||
_c.validating=true;
|
||||
_c.value=_d.val(_b);
|
||||
(function(){
|
||||
if(!$(_b).is(":visible")){
|
||||
_c.validating=false;
|
||||
}
|
||||
if(_c.validating){
|
||||
var _e=_d.val(_b);
|
||||
if(_c.value!=_e){
|
||||
_c.value=_e;
|
||||
if(_c.vtimer){
|
||||
clearTimeout(_c.vtimer);
|
||||
}
|
||||
_c.vtimer=setTimeout(function(){
|
||||
$(_b).validatebox("validate");
|
||||
},_d.delay);
|
||||
}else{
|
||||
if(_c.message){
|
||||
_d.err(_b,_c.message);
|
||||
}
|
||||
}
|
||||
_c.ftimer=setTimeout(arguments.callee,_d.interval);
|
||||
}
|
||||
})();
|
||||
};
|
||||
function _f(e){
|
||||
var _10=e.data.target;
|
||||
var _11=$.data(_10,"validatebox");
|
||||
var _12=_11.options;
|
||||
_11.validating=false;
|
||||
if(_11.vtimer){
|
||||
clearTimeout(_11.vtimer);
|
||||
_11.vtimer=undefined;
|
||||
}
|
||||
if(_11.ftimer){
|
||||
clearTimeout(_11.ftimer);
|
||||
_11.ftimer=undefined;
|
||||
}
|
||||
if(_12.validateOnBlur){
|
||||
setTimeout(function(){
|
||||
$(_10).validatebox("validate");
|
||||
},0);
|
||||
}
|
||||
_12.err(_10,_11.message,"hide");
|
||||
};
|
||||
function _13(e){
|
||||
var _14=e.data.target;
|
||||
var _15=$.data(_14,"validatebox");
|
||||
_15.options.err(_14,_15.message,"show");
|
||||
};
|
||||
function _16(e){
|
||||
var _17=e.data.target;
|
||||
var _18=$.data(_17,"validatebox");
|
||||
if(!_18.validating){
|
||||
_18.options.err(_17,_18.message,"hide");
|
||||
}
|
||||
};
|
||||
function _19(_1a,_1b,_1c){
|
||||
var _1d=$.data(_1a,"validatebox");
|
||||
var _1e=_1d.options;
|
||||
var t=$(_1a);
|
||||
if(_1c=="hide"||!_1b){
|
||||
t.tooltip("hide");
|
||||
}else{
|
||||
if((t.is(":focus")&&_1d.validating)||_1c=="show"){
|
||||
t.tooltip($.extend({},_1e.tipOptions,{content:_1b,position:_1e.tipPosition,deltaX:_1e.deltaX,deltaY:_1e.deltaY})).tooltip("show");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _1f(_20){
|
||||
var _21=$.data(_20,"validatebox");
|
||||
var _22=_21.options;
|
||||
var box=$(_20);
|
||||
_22.onBeforeValidate.call(_20);
|
||||
var _23=_24();
|
||||
_23?box.removeClass("validatebox-invalid"):box.addClass("validatebox-invalid");
|
||||
_22.err(_20,_21.message);
|
||||
_22.onValidate.call(_20,_23);
|
||||
return _23;
|
||||
function _25(msg){
|
||||
_21.message=msg;
|
||||
};
|
||||
function _26(_27,_28){
|
||||
var _29=_22.val(_20);
|
||||
var _2a=/([a-zA-Z_]+)(.*)/.exec(_27);
|
||||
var _2b=_22.rules[_2a[1]];
|
||||
if(_2b&&_29){
|
||||
var _2c=_28||_22.validParams||eval(_2a[2]);
|
||||
if(!_2b["validator"].call(_20,_29,_2c)){
|
||||
var _2d=_2b["message"];
|
||||
if(_2c){
|
||||
for(var i=0;i<_2c.length;i++){
|
||||
_2d=_2d.replace(new RegExp("\\{"+i+"\\}","g"),_2c[i]);
|
||||
}
|
||||
}
|
||||
_25(_22.invalidMessage||_2d);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _24(){
|
||||
_25("");
|
||||
if(!_22._validateOnCreate){
|
||||
setTimeout(function(){
|
||||
_22._validateOnCreate=true;
|
||||
},0);
|
||||
return true;
|
||||
}
|
||||
if(_22.novalidate||_22.disabled){
|
||||
return true;
|
||||
}
|
||||
if(_22.required){
|
||||
if(_22.val(_20)==""){
|
||||
_25(_22.missingMessage);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(_22.validType){
|
||||
if($.isArray(_22.validType)){
|
||||
for(var i=0;i<_22.validType.length;i++){
|
||||
if(!_26(_22.validType[i])){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(typeof _22.validType=="string"){
|
||||
if(!_26(_22.validType)){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
for(var _2e in _22.validType){
|
||||
var _2f=_22.validType[_2e];
|
||||
if(!_26(_2e,_2f)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
};
|
||||
function _30(_31,_32){
|
||||
var _33=$.data(_31,"validatebox").options;
|
||||
if(_32!=undefined){
|
||||
_33.disabled=_32;
|
||||
}
|
||||
if(_33.disabled){
|
||||
$(_31).addClass("validatebox-disabled")._propAttr("disabled",true);
|
||||
}else{
|
||||
$(_31).removeClass("validatebox-disabled")._propAttr("disabled",false);
|
||||
}
|
||||
};
|
||||
function _34(_35,_36){
|
||||
var _37=$.data(_35,"validatebox").options;
|
||||
_37.readonly=_36==undefined?true:_36;
|
||||
if(_37.readonly||!_37.editable){
|
||||
$(_35).triggerHandler("blur.validatebox");
|
||||
$(_35).addClass("validatebox-readonly")._propAttr("readonly",true);
|
||||
}else{
|
||||
$(_35).removeClass("validatebox-readonly")._propAttr("readonly",false);
|
||||
}
|
||||
};
|
||||
$.fn.validatebox=function(_38,_39){
|
||||
if(typeof _38=="string"){
|
||||
return $.fn.validatebox.methods[_38](this,_39);
|
||||
}
|
||||
_38=_38||{};
|
||||
return this.each(function(){
|
||||
var _3a=$.data(this,"validatebox");
|
||||
if(_3a){
|
||||
$.extend(_3a.options,_38);
|
||||
}else{
|
||||
_1(this);
|
||||
_3a=$.data(this,"validatebox",{options:$.extend({},$.fn.validatebox.defaults,$.fn.validatebox.parseOptions(this),_38)});
|
||||
}
|
||||
_3a.options._validateOnCreate=_3a.options.validateOnCreate;
|
||||
_30(this,_3a.options.disabled);
|
||||
_34(this,_3a.options.readonly);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
};
|
||||
$.fn.validatebox.methods={options:function(jq){
|
||||
return $.data(jq[0],"validatebox").options;
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_3(this);
|
||||
});
|
||||
},validate:function(jq){
|
||||
return jq.each(function(){
|
||||
_1f(this);
|
||||
});
|
||||
},isValid:function(jq){
|
||||
return _1f(jq[0]);
|
||||
},enableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).validatebox("options").novalidate=false;
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},disableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).validatebox("options").novalidate=true;
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},resetValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
var _3b=$(this).validatebox("options");
|
||||
_3b._validateOnCreate=_3b.validateOnCreate;
|
||||
_1f(this);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,false);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,true);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},readonly:function(jq,_3c){
|
||||
return jq.each(function(){
|
||||
_34(this,_3c);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
}};
|
||||
$.fn.validatebox.parseOptions=function(_3d){
|
||||
var t=$(_3d);
|
||||
return $.extend({},$.parser.parseOptions(_3d,["validType","missingMessage","invalidMessage","tipPosition",{delay:"number",interval:"number",deltaX:"number"},{editable:"boolean",validateOnCreate:"boolean",validateOnBlur:"boolean"}]),{required:(t.attr("required")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined),novalidate:(t.attr("novalidate")!=undefined?true:undefined)});
|
||||
};
|
||||
$.fn.validatebox.defaults={required:false,validType:null,validParams:null,delay:200,interval:200,missingMessage:"This field is required.",invalidMessage:null,tipPosition:"right",deltaX:0,deltaY:0,novalidate:false,editable:true,disabled:false,readonly:false,validateOnCreate:true,validateOnBlur:false,events:{focus:_a,blur:_f,mouseenter:_13,mouseleave:_16,click:function(e){
|
||||
var t=$(e.data.target);
|
||||
if(t.attr("type")=="checkbox"||t.attr("type")=="radio"){
|
||||
t.focus().validatebox("validate");
|
||||
}
|
||||
}},val:function(_3e){
|
||||
return $(_3e).val();
|
||||
},err:function(_3f,_40,_41){
|
||||
_19(_3f,_40,_41);
|
||||
},tipOptions:{showEvent:"none",hideEvent:"none",showDelay:0,hideDelay:0,zIndex:"",onShow:function(){
|
||||
$(this).tooltip("tip").css({color:"#000",borderColor:"#CC9933",backgroundColor:"#FFFFCC"});
|
||||
},onHide:function(){
|
||||
$(this).tooltip("destroy");
|
||||
}},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(_4a){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
323
static/jeasyui/plugins/jquery.window.js
Executable file
323
static/jeasyui/plugins/jquery.window.js
Executable file
@@ -0,0 +1,323 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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,_3){
|
||||
var _4=$.data(_2,"window");
|
||||
if(_3){
|
||||
if(_3.left!=null){
|
||||
_4.options.left=_3.left;
|
||||
}
|
||||
if(_3.top!=null){
|
||||
_4.options.top=_3.top;
|
||||
}
|
||||
}
|
||||
$(_2).panel("move",_4.options);
|
||||
if(_4.shadow){
|
||||
_4.shadow.css({left:_4.options.left,top:_4.options.top});
|
||||
}
|
||||
};
|
||||
function _5(_6,_7){
|
||||
var _8=$.data(_6,"window").options;
|
||||
var pp=$(_6).window("panel");
|
||||
var _9=pp._outerWidth();
|
||||
if(_8.inline){
|
||||
var _a=pp.parent();
|
||||
_8.left=Math.ceil((_a.width()-_9)/2+_a.scrollLeft());
|
||||
}else{
|
||||
var _b=_8.fixed?0:$(document).scrollLeft();
|
||||
_8.left=Math.ceil(($(window)._outerWidth()-_9)/2+_b);
|
||||
}
|
||||
if(_7){
|
||||
_1(_6);
|
||||
}
|
||||
};
|
||||
function _c(_d,_e){
|
||||
var _f=$.data(_d,"window").options;
|
||||
var pp=$(_d).window("panel");
|
||||
var _10=pp._outerHeight();
|
||||
if(_f.inline){
|
||||
var _11=pp.parent();
|
||||
_f.top=Math.ceil((_11.height()-_10)/2+_11.scrollTop());
|
||||
}else{
|
||||
var _12=_f.fixed?0:$(document).scrollTop();
|
||||
_f.top=Math.ceil(($(window)._outerHeight()-_10)/2+_12);
|
||||
}
|
||||
if(_e){
|
||||
_1(_d);
|
||||
}
|
||||
};
|
||||
function _13(_14){
|
||||
var _15=$.data(_14,"window");
|
||||
var _16=_15.options;
|
||||
var win=$(_14).panel($.extend({},_15.options,{border:false,doSize:true,closed:true,cls:"window "+(!_16.border?"window-thinborder window-noborder ":(_16.border=="thin"?"window-thinborder ":""))+(_16.cls||""),headerCls:"window-header "+(_16.headerCls||""),bodyCls:"window-body "+(_16.noheader?"window-body-noheader ":" ")+(_16.bodyCls||""),onBeforeDestroy:function(){
|
||||
if(_16.onBeforeDestroy.call(_14)==false){
|
||||
return false;
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.remove();
|
||||
}
|
||||
if(_15.mask){
|
||||
_15.mask.remove();
|
||||
}
|
||||
},onClose:function(){
|
||||
if(_15.shadow){
|
||||
_15.shadow.hide();
|
||||
}
|
||||
if(_15.mask){
|
||||
_15.mask.hide();
|
||||
}
|
||||
_16.onClose.call(_14);
|
||||
},onOpen:function(){
|
||||
if(_15.mask){
|
||||
_15.mask.css($.extend({display:"block",zIndex:$.fn.window.defaults.zIndex++},$.fn.window.getMaskSize(_14)));
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.css({display:"block",position:(_16.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++,left:_16.left,top:_16.top,width:_15.window._outerWidth(),height:_15.window._outerHeight()});
|
||||
}
|
||||
_15.window.css({position:(_16.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++});
|
||||
_16.onOpen.call(_14);
|
||||
},onResize:function(_17,_18){
|
||||
var _19=$(this).panel("options");
|
||||
$.extend(_16,{width:_19.width,height:_19.height,left:_19.left,top:_19.top});
|
||||
if(_15.shadow){
|
||||
_15.shadow.css({left:_16.left,top:_16.top,width:_15.window._outerWidth(),height:_15.window._outerHeight()});
|
||||
}
|
||||
_16.onResize.call(_14,_17,_18);
|
||||
},onMinimize:function(){
|
||||
if(_15.shadow){
|
||||
_15.shadow.hide();
|
||||
}
|
||||
if(_15.mask){
|
||||
_15.mask.hide();
|
||||
}
|
||||
_15.options.onMinimize.call(_14);
|
||||
},onBeforeCollapse:function(){
|
||||
if(_16.onBeforeCollapse.call(_14)==false){
|
||||
return false;
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.hide();
|
||||
}
|
||||
},onExpand:function(){
|
||||
if(_15.shadow){
|
||||
_15.shadow.show();
|
||||
}
|
||||
_16.onExpand.call(_14);
|
||||
}}));
|
||||
_15.window=win.panel("panel");
|
||||
if(_15.mask){
|
||||
_15.mask.remove();
|
||||
}
|
||||
if(_16.modal){
|
||||
_15.mask=$("<div class=\"window-mask\" style=\"display:none\"></div>").insertAfter(_15.window);
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.remove();
|
||||
}
|
||||
if(_16.shadow){
|
||||
_15.shadow=$("<div class=\"window-shadow\" style=\"display:none\"></div>").insertAfter(_15.window);
|
||||
}
|
||||
var _1a=_16.closed;
|
||||
if(_16.left==null){
|
||||
_5(_14);
|
||||
}
|
||||
if(_16.top==null){
|
||||
_c(_14);
|
||||
}
|
||||
_1(_14);
|
||||
if(!_1a){
|
||||
win.window("open");
|
||||
}
|
||||
};
|
||||
function _1b(_1c,top,_1d,_1e){
|
||||
var _1f=this;
|
||||
var _20=$.data(_1f,"window");
|
||||
var _21=_20.options;
|
||||
if(!_21.constrain){
|
||||
return {};
|
||||
}
|
||||
if($.isFunction(_21.constrain)){
|
||||
return _21.constrain.call(_1f,_1c,top,_1d,_1e);
|
||||
}
|
||||
var win=$(_1f).window("window");
|
||||
var _22=_21.inline?win.parent():$(window);
|
||||
var _23=_21.fixed?0:_22.scrollTop();
|
||||
if(_1c<0){
|
||||
_1c=0;
|
||||
}
|
||||
if(top<_23){
|
||||
top=_23;
|
||||
}
|
||||
if(_1c+_1d>_22.width()){
|
||||
if(_1d==win.outerWidth()){
|
||||
_1c=_22.width()-_1d;
|
||||
}else{
|
||||
_1d=_22.width()-_1c;
|
||||
}
|
||||
}
|
||||
if(top-_23+_1e>_22.height()){
|
||||
if(_1e==win.outerHeight()){
|
||||
top=_22.height()-_1e+_23;
|
||||
}else{
|
||||
_1e=_22.height()-top+_23;
|
||||
}
|
||||
}
|
||||
return {left:_1c,top:top,width:_1d,height:_1e};
|
||||
};
|
||||
function _24(_25){
|
||||
var _26=$.data(_25,"window");
|
||||
var _27=_26.options;
|
||||
_26.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_26.options.draggable==false,onBeforeDrag:function(e){
|
||||
if(_26.mask){
|
||||
_26.mask.css("z-index",$.fn.window.defaults.zIndex++);
|
||||
}
|
||||
if(_26.shadow){
|
||||
_26.shadow.css("z-index",$.fn.window.defaults.zIndex++);
|
||||
}
|
||||
_26.window.css("z-index",$.fn.window.defaults.zIndex++);
|
||||
},onStartDrag:function(e){
|
||||
_28(e);
|
||||
},onDrag:function(e){
|
||||
_29(e);
|
||||
return false;
|
||||
},onStopDrag:function(e){
|
||||
_2a(e,"move");
|
||||
}});
|
||||
_26.window.resizable({disabled:_26.options.resizable==false,onStartResize:function(e){
|
||||
_28(e);
|
||||
},onResize:function(e){
|
||||
_29(e);
|
||||
return false;
|
||||
},onStopResize:function(e){
|
||||
_2a(e,"resize");
|
||||
}});
|
||||
function _28(e){
|
||||
_26.window.css("position",_27.fixed?"fixed":"absolute");
|
||||
if(_26.shadow){
|
||||
_26.shadow.css("position",_27.fixed?"fixed":"absolute");
|
||||
}
|
||||
if(_26.pmask){
|
||||
_26.pmask.remove();
|
||||
}
|
||||
_26.pmask=$("<div class=\"window-proxy-mask\"></div>").insertAfter(_26.window);
|
||||
_26.pmask.css({display:"none",position:(_27.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_26.window._outerWidth(),height:_26.window._outerHeight()});
|
||||
if(_26.proxy){
|
||||
_26.proxy.remove();
|
||||
}
|
||||
_26.proxy=$("<div class=\"window-proxy\"></div>").insertAfter(_26.window);
|
||||
_26.proxy.css({display:"none",position:(_27.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top});
|
||||
_26.proxy._outerWidth(e.data.width)._outerHeight(e.data.height);
|
||||
_26.proxy.hide();
|
||||
setTimeout(function(){
|
||||
if(_26.pmask){
|
||||
_26.pmask.show();
|
||||
}
|
||||
if(_26.proxy){
|
||||
_26.proxy.show();
|
||||
}
|
||||
},500);
|
||||
};
|
||||
function _29(e){
|
||||
$.extend(e.data,_1b.call(_25,e.data.left,e.data.top,e.data.width,e.data.height));
|
||||
_26.pmask.show();
|
||||
_26.proxy.css({display:"block",left:e.data.left,top:e.data.top});
|
||||
_26.proxy._outerWidth(e.data.width);
|
||||
_26.proxy._outerHeight(e.data.height);
|
||||
};
|
||||
function _2a(e,_2b){
|
||||
_26.window.css("position",_27.fixed?"fixed":"absolute");
|
||||
if(_26.shadow){
|
||||
_26.shadow.css("position",_27.fixed?"fixed":"absolute");
|
||||
}
|
||||
$.extend(e.data,_1b.call(_25,e.data.left,e.data.top,e.data.width+0.1,e.data.height+0.1));
|
||||
$(_25).window(_2b,e.data);
|
||||
_26.pmask.remove();
|
||||
_26.pmask=null;
|
||||
_26.proxy.remove();
|
||||
_26.proxy=null;
|
||||
};
|
||||
};
|
||||
$(function(){
|
||||
if(!$._positionFixed){
|
||||
$(window).resize(function(){
|
||||
$("body>div.window-mask:visible").css({width:"",height:""});
|
||||
setTimeout(function(){
|
||||
$("body>div.window-mask:visible").css($.fn.window.getMaskSize());
|
||||
},50);
|
||||
});
|
||||
}
|
||||
});
|
||||
$.fn.window=function(_2c,_2d){
|
||||
if(typeof _2c=="string"){
|
||||
var _2e=$.fn.window.methods[_2c];
|
||||
if(_2e){
|
||||
return _2e(this,_2d);
|
||||
}else{
|
||||
return this.panel(_2c,_2d);
|
||||
}
|
||||
}
|
||||
_2c=_2c||{};
|
||||
return this.each(function(){
|
||||
var _2f=$.data(this,"window");
|
||||
if(_2f){
|
||||
$.extend(_2f.options,_2c);
|
||||
}else{
|
||||
_2f=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_2c)});
|
||||
if(!_2f.options.inline){
|
||||
document.body.appendChild(this);
|
||||
}
|
||||
}
|
||||
_13(this);
|
||||
_24(this);
|
||||
});
|
||||
};
|
||||
$.fn.window.methods={options:function(jq){
|
||||
var _30=jq.panel("options");
|
||||
var _31=$.data(jq[0],"window").options;
|
||||
return $.extend(_31,{closed:_30.closed,collapsed:_30.collapsed,minimized:_30.minimized,maximized:_30.maximized});
|
||||
},window:function(jq){
|
||||
return $.data(jq[0],"window").window;
|
||||
},move:function(jq,_32){
|
||||
return jq.each(function(){
|
||||
_1(this,_32);
|
||||
});
|
||||
},hcenter:function(jq){
|
||||
return jq.each(function(){
|
||||
_5(this,true);
|
||||
});
|
||||
},vcenter:function(jq){
|
||||
return jq.each(function(){
|
||||
_c(this,true);
|
||||
});
|
||||
},center:function(jq){
|
||||
return jq.each(function(){
|
||||
_5(this);
|
||||
_c(this);
|
||||
_1(this);
|
||||
});
|
||||
}};
|
||||
$.fn.window.getMaskSize=function(_33){
|
||||
var _34=$(_33).data("window");
|
||||
if(_34&&_34.options.inline){
|
||||
return {};
|
||||
}else{
|
||||
if($._positionFixed){
|
||||
return {position:"fixed"};
|
||||
}else{
|
||||
return {width:$(document).width(),height:$(document).height()};
|
||||
}
|
||||
}
|
||||
};
|
||||
$.fn.window.parseOptions=function(_35){
|
||||
return $.extend({},$.fn.panel.parseOptions(_35),$.parser.parseOptions(_35,[{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,fixed:false,constrain:false});
|
||||
})(jQuery);
|
||||
|
||||
462
static/jeasyui/src/easyloader.js
Normal file
462
static/jeasyui/src/easyloader.js
Normal file
@@ -0,0 +1,462 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* easyloader - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function(){
|
||||
var modules = {
|
||||
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']
|
||||
},
|
||||
radiobutton:{
|
||||
js:'jquery.radiobutton.js',
|
||||
css:'radiobutton.css'
|
||||
},
|
||||
checkbox:{
|
||||
js:'jquery.checkbox.js',
|
||||
css:'checkbox.css'
|
||||
},
|
||||
sidemenu:{
|
||||
js:'jquery.sidemenu.js',
|
||||
css:'sidemenu.css',
|
||||
dependencies:['accordion','tree','tooltip']
|
||||
},
|
||||
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']
|
||||
},
|
||||
timepicker:{
|
||||
js:'jquery.timepicker.js',
|
||||
css:'timepicker.css',
|
||||
dependencies:['combo']
|
||||
},
|
||||
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',
|
||||
css:'flex.css'
|
||||
},
|
||||
mobile:{
|
||||
js:'jquery.mobile.js'
|
||||
}
|
||||
};
|
||||
|
||||
var locales = {
|
||||
'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 queues = {};
|
||||
|
||||
function loadJs(url, callback){
|
||||
var done = false;
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.language = 'javascript';
|
||||
script.src = url;
|
||||
script.onload = script.onreadystatechange = function(){
|
||||
if (!done && (!script.readyState || script.readyState == 'loaded' || script.readyState == 'complete')){
|
||||
done = true;
|
||||
script.onload = script.onreadystatechange = null;
|
||||
if (callback){
|
||||
callback.call(script);
|
||||
}
|
||||
}
|
||||
}
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
||||
|
||||
function runJs(url, callback){
|
||||
loadJs(url, function(){
|
||||
document.getElementsByTagName("head")[0].removeChild(this);
|
||||
if (callback){
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadCss(url, callback){
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.media = 'screen';
|
||||
link.href = url;
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
if (callback){
|
||||
callback.call(link);
|
||||
}
|
||||
}
|
||||
|
||||
function loadSingle(name, callback){
|
||||
queues[name] = 'loading';
|
||||
|
||||
var module = modules[name];
|
||||
var jsStatus = 'loading';
|
||||
var cssStatus = (easyloader.css && module['css']) ? 'loading' : 'loaded';
|
||||
|
||||
if (easyloader.css && module['css']){
|
||||
if (/^http/i.test(module['css'])){
|
||||
var url = module['css'];
|
||||
} else {
|
||||
var url = easyloader.base + 'themes/' + easyloader.theme + '/' + module['css'];
|
||||
}
|
||||
loadCss(url, function(){
|
||||
cssStatus = 'loaded';
|
||||
if (jsStatus == 'loaded' && cssStatus == 'loaded'){
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (/^http/i.test(module['js'])){
|
||||
var url = module['js'];
|
||||
} else {
|
||||
var url = easyloader.base + 'plugins/' + module['js'];
|
||||
}
|
||||
loadJs(url, function(){
|
||||
jsStatus = 'loaded';
|
||||
if (jsStatus == 'loaded' && cssStatus == 'loaded'){
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
function finish(){
|
||||
queues[name] = 'loaded';
|
||||
easyloader.onProgress(name);
|
||||
if (callback){
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadModule(name, callback){
|
||||
var mm = [];
|
||||
var doLoad = false;
|
||||
|
||||
if (typeof name == 'string'){
|
||||
add(name);
|
||||
} else {
|
||||
for(var i=0; i<name.length; i++){
|
||||
add(name[i]);
|
||||
}
|
||||
}
|
||||
mm.unshift('parser');
|
||||
|
||||
function add(name){
|
||||
if (!modules[name]) return;
|
||||
var d = modules[name]['dependencies'];
|
||||
if (d){
|
||||
for(var i=0; i<d.length; i++){
|
||||
add(d[i]);
|
||||
}
|
||||
}
|
||||
mm.push(name);
|
||||
}
|
||||
|
||||
function finish(){
|
||||
if (callback){
|
||||
if (window.jQuery){
|
||||
window.jQuery.parser.parseVars();
|
||||
}
|
||||
callback();
|
||||
}
|
||||
easyloader.onLoad(name);
|
||||
}
|
||||
|
||||
var time = 0;
|
||||
function loadMm(){
|
||||
if (mm.length){
|
||||
var m = mm[0]; // the first module
|
||||
if (!queues[m]){
|
||||
doLoad = true;
|
||||
loadSingle(m, function(){
|
||||
mm.shift();
|
||||
loadMm();
|
||||
});
|
||||
} else if (queues[m] == 'loaded'){
|
||||
mm.shift();
|
||||
loadMm();
|
||||
} else {
|
||||
if (time < easyloader.timeout){
|
||||
time += 10;
|
||||
setTimeout(arguments.callee, 10);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (easyloader.locale && doLoad == true && locales[easyloader.locale]){
|
||||
var url = easyloader.base + 'locale/' + locales[easyloader.locale];
|
||||
runJs(url, function(){
|
||||
finish();
|
||||
});
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadMm();
|
||||
}
|
||||
|
||||
easyloader = {
|
||||
modules:modules,
|
||||
locales:locales,
|
||||
|
||||
base:'.',
|
||||
theme:'default',
|
||||
css:true,
|
||||
locale:null,
|
||||
timeout:2000,
|
||||
|
||||
load: function(name, callback){
|
||||
if (/\.css$/i.test(name)){
|
||||
if (/^http/i.test(name)){
|
||||
loadCss(name, callback);
|
||||
} else {
|
||||
loadCss(easyloader.base + name, callback);
|
||||
}
|
||||
} else if (/\.js$/i.test(name)){
|
||||
if (/^http/i.test(name)){
|
||||
loadJs(name, callback);
|
||||
} else {
|
||||
loadJs(easyloader.base + name, callback);
|
||||
}
|
||||
} else {
|
||||
loadModule(name, callback);
|
||||
}
|
||||
},
|
||||
|
||||
onProgress: function(name){},
|
||||
onLoad: function(name){}
|
||||
};
|
||||
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for(var i=0; i<scripts.length; i++){
|
||||
var src = scripts[i].src;
|
||||
if (!src) continue;
|
||||
var m = src.match(/easyloader\.js(\W|$)/i);
|
||||
if (m){
|
||||
easyloader.base = src.substring(0, m.index);
|
||||
}
|
||||
}
|
||||
|
||||
window.using = easyloader.load;
|
||||
|
||||
if (window.jQuery){
|
||||
jQuery(function(){
|
||||
easyloader.load('parser', function(){
|
||||
jQuery.parser.parse();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
})();
|
||||
494
static/jeasyui/src/jquery.accordion.js
Normal file
494
static/jeasyui/src/jquery.accordion.js
Normal file
@@ -0,0 +1,494 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* accordion - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* panel
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
|
||||
// function setSize(container, param){
|
||||
// var state = $.data(container, 'accordion');
|
||||
// var opts = state.options;
|
||||
// var panels = state.panels;
|
||||
// var cc = $(container);
|
||||
|
||||
// if (param){
|
||||
// $.extend(opts, {
|
||||
// width: param.width,
|
||||
// height: param.height
|
||||
// });
|
||||
// }
|
||||
// cc._size(opts);
|
||||
// var headerHeight = 0;
|
||||
// var bodyHeight = 'auto';
|
||||
// var headers = cc.find('>.panel>.accordion-header');
|
||||
// if (headers.length){
|
||||
// headerHeight = $(headers[0]).css('height', '')._outerHeight();
|
||||
// }
|
||||
// if (!isNaN(parseInt(opts.height))){
|
||||
// bodyHeight = cc.height() - headerHeight*headers.length;
|
||||
// }
|
||||
|
||||
// _resize(true, bodyHeight - _resize(false) + 1);
|
||||
|
||||
// function _resize(collapsible, height){
|
||||
// var totalHeight = 0;
|
||||
// for(var i=0; i<panels.length; i++){
|
||||
// var p = panels[i];
|
||||
// var h = p.panel('header')._outerHeight(headerHeight);
|
||||
// if (p.panel('options').collapsible == collapsible){
|
||||
// var pheight = isNaN(height) ? undefined : (height+headerHeight*h.length);
|
||||
// p.panel('resize', {
|
||||
// width: cc.width(),
|
||||
// height: (collapsible ? pheight : undefined)
|
||||
// });
|
||||
// totalHeight += p.panel('panel').outerHeight()-headerHeight*h.length;
|
||||
// }
|
||||
// }
|
||||
// return totalHeight;
|
||||
// }
|
||||
// }
|
||||
|
||||
function setSize(container, param){
|
||||
var state = $.data(container, 'accordion');
|
||||
var opts = state.options;
|
||||
var panels = state.panels;
|
||||
var cc = $(container);
|
||||
var isHorizontal = (opts.halign=='left' || opts.halign=='right');
|
||||
cc.children('.panel-last').removeClass('panel-last');
|
||||
cc.children('.panel:last').addClass('panel-last');
|
||||
|
||||
if (param){
|
||||
$.extend(opts, {
|
||||
width: param.width,
|
||||
height: param.height
|
||||
});
|
||||
}
|
||||
cc._size(opts);
|
||||
var headerHeight = 0;
|
||||
var bodyHeight = 'auto';
|
||||
var headers = cc.find('>.panel>.accordion-header');
|
||||
if (headers.length){
|
||||
if (isHorizontal){
|
||||
// $(panels[0]).panel('resize', {width:cc.width(),height:cc.height()});
|
||||
$(headers[0]).next().panel('resize', {width:cc.width(),height:cc.height()});
|
||||
headerHeight = $(headers[0])._outerWidth();
|
||||
} else {
|
||||
headerHeight = $(headers[0]).css('height', '')._outerHeight();
|
||||
}
|
||||
}
|
||||
if (!isNaN(parseInt(opts.height))){
|
||||
if (isHorizontal){
|
||||
bodyHeight = cc.width() - headerHeight*headers.length;
|
||||
} else {
|
||||
bodyHeight = cc.height() - headerHeight*headers.length;
|
||||
}
|
||||
}
|
||||
|
||||
// _resize(true, bodyHeight - _resize(false) + 1);
|
||||
_resize(true, bodyHeight - _resize(false));
|
||||
|
||||
function _resize(collapsible, height){
|
||||
var totalHeight = 0;
|
||||
for(var i=0; i<panels.length; i++){
|
||||
var p = panels[i];
|
||||
if (isHorizontal){
|
||||
var h = p.panel('header')._outerWidth(headerHeight);
|
||||
} else {
|
||||
var h = p.panel('header')._outerHeight(headerHeight);
|
||||
}
|
||||
if (p.panel('options').collapsible == collapsible){
|
||||
var pheight = isNaN(height) ? undefined : (height+headerHeight*h.length);
|
||||
if (isHorizontal){
|
||||
p.panel('resize', {
|
||||
height: cc.height(),
|
||||
width: (collapsible ? pheight : undefined)
|
||||
});
|
||||
totalHeight += p.panel('panel')._outerWidth()-headerHeight*h.length;
|
||||
} else {
|
||||
p.panel('resize', {
|
||||
width: cc.width(),
|
||||
height: (collapsible ? pheight : undefined)
|
||||
});
|
||||
totalHeight += p.panel('panel').outerHeight()-headerHeight*h.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
return totalHeight;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* find a panel by specified property, return the panel object or panel index.
|
||||
*/
|
||||
function findBy(container, property, value, all){
|
||||
var panels = $.data(container, 'accordion').panels;
|
||||
var pp = [];
|
||||
for(var i=0; i<panels.length; i++){
|
||||
var p = panels[i];
|
||||
if (property){
|
||||
if (p.panel('options')[property] == value){
|
||||
pp.push(p);
|
||||
}
|
||||
} else {
|
||||
if (p[0] == $(value)[0]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (property){
|
||||
return all ? pp : (pp.length ? pp[0] : null);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
function getSelections(container){
|
||||
return findBy(container, 'collapsed', false, true);
|
||||
}
|
||||
|
||||
function getSelected(container){
|
||||
var pp = getSelections(container);
|
||||
return pp.length ? pp[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get panel index, start with 0
|
||||
*/
|
||||
function getPanelIndex(container, panel){
|
||||
return findBy(container, null, panel);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the specified panel.
|
||||
*/
|
||||
function getPanel(container, which){
|
||||
var panels = $.data(container, 'accordion').panels;
|
||||
if (typeof which == 'number'){
|
||||
if (which < 0 || which >= panels.length){
|
||||
return null;
|
||||
} else {
|
||||
return panels[which];
|
||||
}
|
||||
}
|
||||
return findBy(container, 'title', which);
|
||||
}
|
||||
|
||||
function setProperties(container){
|
||||
var opts = $.data(container, 'accordion').options;
|
||||
var cc = $(container);
|
||||
if (opts.border){
|
||||
cc.removeClass('accordion-noborder');
|
||||
} else {
|
||||
cc.addClass('accordion-noborder');
|
||||
}
|
||||
}
|
||||
|
||||
function init(container){
|
||||
var state = $.data(container, 'accordion');
|
||||
var cc = $(container);
|
||||
cc.addClass('accordion');
|
||||
|
||||
state.panels = [];
|
||||
cc.children('div').each(function(){
|
||||
var opts = $.extend({}, $.parser.parseOptions(this), {
|
||||
selected: ($(this).attr('selected') ? true : undefined)
|
||||
});
|
||||
var pp = $(this);
|
||||
state.panels.push(pp);
|
||||
createPanel(container, pp, opts);
|
||||
});
|
||||
|
||||
cc._bind('_resize', function(e,force){
|
||||
if ($(this).hasClass('easyui-fluid') || force){
|
||||
setSize(container);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function createPanel(container, pp, options){
|
||||
var opts = $.data(container, '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
|
||||
}, options, {
|
||||
onBeforeExpand: function(){
|
||||
if (options.onBeforeExpand){
|
||||
if (options.onBeforeExpand.call(this) == false){return false}
|
||||
}
|
||||
if (!opts.multiple){
|
||||
// get all selected panel
|
||||
var all = $.grep(getSelections(container), function(p){
|
||||
return p.panel('options').collapsible;
|
||||
});
|
||||
for(var i=0; i<all.length; i++){
|
||||
unselect(container, getPanelIndex(container, all[i]));
|
||||
}
|
||||
}
|
||||
var header = $(this).panel('header');
|
||||
header.addClass('accordion-header-selected');
|
||||
header.find('.accordion-collapse').removeClass('accordion-expand');
|
||||
},
|
||||
onExpand: function(){
|
||||
$(container).find('>.panel-last>.accordion-header').removeClass('accordion-header-border');
|
||||
if (options.onExpand){options.onExpand.call(this)}
|
||||
opts.onSelect.call(container, $(this).panel('options').title, getPanelIndex(container, this));
|
||||
},
|
||||
onBeforeCollapse: function(){
|
||||
if (options.onBeforeCollapse){
|
||||
if (options.onBeforeCollapse.call(this) == false){return false}
|
||||
}
|
||||
$(container).find('>.panel-last>.accordion-header').addClass('accordion-header-border');
|
||||
var header = $(this).panel('header');
|
||||
header.removeClass('accordion-header-selected');
|
||||
header.find('.accordion-collapse').addClass('accordion-expand');
|
||||
},
|
||||
onCollapse: function(){
|
||||
if (isNaN(parseInt(opts.height))){
|
||||
$(container).find('>.panel-last>.accordion-header').removeClass('accordion-header-border');
|
||||
}
|
||||
if (options.onCollapse){options.onCollapse.call(this)}
|
||||
opts.onUnselect.call(container, $(this).panel('options').title, getPanelIndex(container, this));
|
||||
}
|
||||
}));
|
||||
|
||||
var header = pp.panel('header');
|
||||
var tool = header.children('div.panel-tool');
|
||||
tool.children('a.panel-tool-collapse').hide(); // hide the old collapse button
|
||||
var t = $('<a href="javascript:;"></a>').addClass('accordion-collapse accordion-expand').appendTo(tool);
|
||||
t._bind('click', function(){
|
||||
togglePanel(pp);
|
||||
return false;
|
||||
});
|
||||
pp.panel('options').collapsible ? t.show() : t.hide();
|
||||
if (opts.halign=='left' || opts.halign=='right'){
|
||||
t.hide();
|
||||
}
|
||||
|
||||
header._bind('click', function(){
|
||||
togglePanel(pp);
|
||||
return false;
|
||||
})
|
||||
|
||||
function togglePanel(p){
|
||||
var popts = p.panel('options');
|
||||
if (popts.collapsible){
|
||||
var index = getPanelIndex(container, p);
|
||||
if (popts.collapsed){
|
||||
select(container, index);
|
||||
} else {
|
||||
unselect(container, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* select and set the specified panel active
|
||||
*/
|
||||
function select(container, which){
|
||||
var p = getPanel(container, which);
|
||||
if (!p){return}
|
||||
stopAnimate(container);
|
||||
var opts = $.data(container, 'accordion').options;
|
||||
p.panel('expand', opts.animate);
|
||||
}
|
||||
|
||||
function unselect(container, which){
|
||||
var p = getPanel(container, which);
|
||||
if (!p){return}
|
||||
stopAnimate(container);
|
||||
var opts = $.data(container, 'accordion').options;
|
||||
p.panel('collapse', opts.animate);
|
||||
}
|
||||
|
||||
function doFirstSelect(container){
|
||||
var opts = $.data(container, 'accordion').options;
|
||||
$(container).find('>.panel-last>.accordion-header').addClass('accordion-header-border');
|
||||
|
||||
var p = findBy(container, 'selected', true);
|
||||
if (p){
|
||||
_select(getPanelIndex(container, p));
|
||||
} else {
|
||||
_select(opts.selected);
|
||||
}
|
||||
|
||||
function _select(index){
|
||||
var animate = opts.animate;
|
||||
opts.animate = false;
|
||||
select(container, index);
|
||||
opts.animate = animate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* stop the animation of all panels
|
||||
*/
|
||||
function stopAnimate(container){
|
||||
var panels = $.data(container, 'accordion').panels;
|
||||
for(var i=0; i<panels.length; i++){
|
||||
panels[i].stop(true,true);
|
||||
}
|
||||
}
|
||||
|
||||
function add(container, options){
|
||||
var state = $.data(container, 'accordion');
|
||||
var opts = state.options;
|
||||
var panels = state.panels;
|
||||
if (options.selected == undefined) options.selected = true;
|
||||
|
||||
stopAnimate(container);
|
||||
|
||||
var pp = $('<div></div>').appendTo(container);
|
||||
panels.push(pp);
|
||||
createPanel(container, pp, options);
|
||||
setSize(container);
|
||||
|
||||
opts.onAdd.call(container, options.title, panels.length-1);
|
||||
|
||||
if (options.selected){
|
||||
select(container, panels.length-1);
|
||||
}
|
||||
}
|
||||
|
||||
function remove(container, which){
|
||||
var state = $.data(container, 'accordion');
|
||||
var opts = state.options;
|
||||
var panels = state.panels;
|
||||
|
||||
stopAnimate(container);
|
||||
|
||||
var panel = getPanel(container, which);
|
||||
var title = panel.panel('options').title;
|
||||
var index = getPanelIndex(container, panel);
|
||||
|
||||
if (!panel){return}
|
||||
if (opts.onBeforeRemove.call(container, title, index) == false){return}
|
||||
|
||||
panels.splice(index, 1);
|
||||
panel.panel('destroy');
|
||||
if (panels.length){
|
||||
setSize(container);
|
||||
var curr = getSelected(container);
|
||||
if (!curr){
|
||||
select(container, 0);
|
||||
}
|
||||
}
|
||||
|
||||
opts.onRemove.call(container, title, index);
|
||||
}
|
||||
|
||||
$.fn.accordion = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.accordion.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'accordion');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
$.data(this, 'accordion', {
|
||||
options: $.extend({}, $.fn.accordion.defaults, $.fn.accordion.parseOptions(this), options),
|
||||
accordion: $(this).addClass('accordion'),
|
||||
panels: []
|
||||
});
|
||||
init(this);
|
||||
}
|
||||
|
||||
setProperties(this);
|
||||
setSize(this);
|
||||
doFirstSelect(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, param){
|
||||
return jq.each(function(){
|
||||
setSize(this, param);
|
||||
});
|
||||
},
|
||||
getSelections: function(jq){
|
||||
return getSelections(jq[0]);
|
||||
},
|
||||
getSelected: function(jq){
|
||||
return getSelected(jq[0]);
|
||||
},
|
||||
getPanel: function(jq, which){
|
||||
return getPanel(jq[0], which);
|
||||
},
|
||||
getPanelIndex: function(jq, panel){
|
||||
return getPanelIndex(jq[0], panel);
|
||||
},
|
||||
select: function(jq, which){
|
||||
return jq.each(function(){
|
||||
select(this, which);
|
||||
});
|
||||
},
|
||||
unselect: function(jq, which){
|
||||
return jq.each(function(){
|
||||
unselect(this, which);
|
||||
});
|
||||
},
|
||||
add: function(jq, options){
|
||||
return jq.each(function(){
|
||||
add(this, options);
|
||||
});
|
||||
},
|
||||
remove: function(jq, which){
|
||||
return jq.each(function(){
|
||||
remove(this, which);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.accordion.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.parser.parseOptions(target, [
|
||||
'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', // the header alignment: 'top','left','right'
|
||||
|
||||
onSelect: function(title, index){},
|
||||
onUnselect: function(title, index){},
|
||||
onAdd: function(title, index){},
|
||||
onBeforeRemove: function(title, index){},
|
||||
onRemove: function(title, index){}
|
||||
};
|
||||
})(jQuery);
|
||||
456
static/jeasyui/src/jquery.calendar.js
Normal file
456
static/jeasyui/src/jquery.calendar.js
Normal file
@@ -0,0 +1,456 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* calendar - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
|
||||
function setSize(target, param){
|
||||
var opts = $.data(target, 'calendar').options;
|
||||
var t = $(target);
|
||||
if (param){
|
||||
$.extend(opts, {
|
||||
width: param.width,
|
||||
height: param.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')){
|
||||
showSelectMenus(target);
|
||||
}
|
||||
}
|
||||
|
||||
function init(target){
|
||||
$(target).addClass('calendar').html(
|
||||
'<div class="calendar-header">' +
|
||||
'<div class="calendar-nav calendar-prevmonth"></div>' +
|
||||
'<div class="calendar-nav calendar-nextmonth"></div>' +
|
||||
'<div class="calendar-nav calendar-prevyear"></div>' +
|
||||
'<div class="calendar-nav calendar-nextyear"></div>' +
|
||||
'<div class="calendar-title">' +
|
||||
'<span class="calendar-text"></span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="calendar-body">' +
|
||||
'<div class="calendar-menu">' +
|
||||
'<div class="calendar-menu-year-inner">' +
|
||||
'<span class="calendar-nav calendar-menu-prev"></span>' +
|
||||
'<span><input class="calendar-menu-year" type="text"></span>' +
|
||||
'<span class="calendar-nav calendar-menu-next"></span>' +
|
||||
'</div>' +
|
||||
'<div class="calendar-menu-month-inner">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
|
||||
$(target)._bind('_resize', function(e,force){
|
||||
if ($(this).hasClass('easyui-fluid') || force){
|
||||
setSize(target);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function bindEvents(target){
|
||||
var opts = $.data(target, 'calendar').options;
|
||||
var menu = $(target).find('.calendar-menu');
|
||||
menu.find('.calendar-menu-year')._unbind('.calendar')._bind('keypress.calendar', function(e){
|
||||
if (e.keyCode == 13){
|
||||
setDate(true);
|
||||
}
|
||||
});
|
||||
$(target)._unbind('.calendar')._bind('mouseover.calendar', function(e){
|
||||
var t = toTarget(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 = toTarget(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 = toTarget(e.target);
|
||||
if (t.hasClass('calendar-menu-next') || t.hasClass('calendar-nextyear')){
|
||||
showYear(1);
|
||||
} else if (t.hasClass('calendar-menu-prev') || t.hasClass('calendar-prevyear')){
|
||||
showYear(-1);
|
||||
} else if (t.hasClass('calendar-menu-month')){
|
||||
menu.find('.calendar-selected').removeClass('calendar-selected');
|
||||
t.addClass('calendar-selected');
|
||||
setDate(true);
|
||||
} else if (t.hasClass('calendar-prevmonth')){
|
||||
showMonth(-1);
|
||||
} else if (t.hasClass('calendar-nextmonth')){
|
||||
showMonth(1);
|
||||
} else if (t.hasClass('calendar-text')){
|
||||
if (menu.is(':visible')){
|
||||
menu.hide();
|
||||
} else {
|
||||
showSelectMenus(target);
|
||||
}
|
||||
} else if (t.hasClass('calendar-day')){
|
||||
if (t.hasClass('calendar-disabled')){return}
|
||||
var oldValue = opts.current;
|
||||
t.closest('div.calendar-body').find('.calendar-selected').removeClass('calendar-selected');
|
||||
t.addClass('calendar-selected');
|
||||
var parts = t.attr('abbr').split(',');
|
||||
var y = parseInt(parts[0]);
|
||||
var m = parseInt(parts[1]);
|
||||
var d = parseInt(parts[2]);
|
||||
opts.current = new opts.Date(y, m-1, d);
|
||||
opts.onSelect.call(target, opts.current);
|
||||
if (!oldValue || oldValue.getTime() != opts.current.getTime()){
|
||||
opts.onChange.call(target, opts.current, oldValue);
|
||||
}
|
||||
if (opts.year != y || opts.month != m){
|
||||
opts.year = y;
|
||||
opts.month = m;
|
||||
show(target);
|
||||
}
|
||||
}
|
||||
});
|
||||
function toTarget(t){
|
||||
var day = $(t).closest('.calendar-day');
|
||||
if (day.length){
|
||||
return day;
|
||||
} else {
|
||||
return $(t);
|
||||
}
|
||||
}
|
||||
function setDate(hideMenu){
|
||||
var menu = $(target).find('.calendar-menu');
|
||||
var year = menu.find('.calendar-menu-year').val();
|
||||
var month = menu.find('.calendar-selected').attr('abbr');
|
||||
if (!isNaN(year)){
|
||||
opts.year = parseInt(year);
|
||||
opts.month = parseInt(month);
|
||||
show(target);
|
||||
}
|
||||
if (hideMenu){menu.hide()}
|
||||
}
|
||||
function showYear(delta){
|
||||
opts.year += delta;
|
||||
show(target);
|
||||
menu.find('.calendar-menu-year').val(opts.year);
|
||||
}
|
||||
function showMonth(delta){
|
||||
opts.month += delta;
|
||||
if (opts.month > 12){
|
||||
opts.year++;
|
||||
opts.month = 1;
|
||||
} else if (opts.month < 1){
|
||||
opts.year--;
|
||||
opts.month = 12;
|
||||
}
|
||||
show(target);
|
||||
|
||||
menu.find('td.calendar-selected').removeClass('calendar-selected');
|
||||
menu.find('td:eq(' + (opts.month-1) + ')').addClass('calendar-selected');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* show the select menu that can change year or month, if the menu is not be created then create it.
|
||||
*/
|
||||
function showSelectMenus(target){
|
||||
var opts = $.data(target, 'calendar').options;
|
||||
$(target).find('.calendar-menu').show();
|
||||
|
||||
if ($(target).find('.calendar-menu-month-inner').is(':empty')){
|
||||
$(target).find('.calendar-menu-month-inner').empty();
|
||||
var t = $('<table class="calendar-mtable"></table>').appendTo($(target).find('.calendar-menu-month-inner'));
|
||||
var idx = 0;
|
||||
for(var i=0; i<3; i++){
|
||||
var tr = $('<tr></tr>').appendTo(t);
|
||||
for(var j=0; j<4; j++){
|
||||
$('<td class="calendar-nav calendar-menu-month"></td>').html(opts.months[idx++]).attr('abbr',idx).appendTo(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var body = $(target).find('.calendar-body');
|
||||
var sele = $(target).find('.calendar-menu');
|
||||
var seleYear = sele.find('.calendar-menu-year-inner');
|
||||
var seleMonth = sele.find('.calendar-menu-month-inner');
|
||||
|
||||
seleYear.find('input').val(opts.year).focus();
|
||||
seleMonth.find('td.calendar-selected').removeClass('calendar-selected');
|
||||
seleMonth.find('td:eq('+(opts.month-1)+')').addClass('calendar-selected');
|
||||
|
||||
sele._outerWidth(body._outerWidth());
|
||||
sele._outerHeight(body._outerHeight());
|
||||
seleMonth._outerHeight(sele.height() - seleYear._outerHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
* get weeks data.
|
||||
*/
|
||||
function getWeeks(target, year, month){
|
||||
var opts = $.data(target, 'calendar').options;
|
||||
var dates = [];
|
||||
var lastDay = new opts.Date(year, month, 0).getDate();
|
||||
for(var i=1; i<=lastDay; i++) dates.push([year,month,i]);
|
||||
|
||||
// group date by week
|
||||
var weeks = [], week = [];
|
||||
var memoDay = -1;
|
||||
while(dates.length > 0){
|
||||
var date = dates.shift();
|
||||
week.push(date);
|
||||
var day = new opts.Date(date[0],date[1]-1,date[2]).getDay();
|
||||
if (memoDay == day){
|
||||
day = 0;
|
||||
} else if (day == (opts.firstDay==0 ? 7 : opts.firstDay) - 1){
|
||||
weeks.push(week);
|
||||
week = [];
|
||||
}
|
||||
memoDay = day;
|
||||
}
|
||||
if (week.length){
|
||||
weeks.push(week);
|
||||
}
|
||||
|
||||
var firstWeek = weeks[0];
|
||||
if (firstWeek.length < 7){
|
||||
while(firstWeek.length < 7){
|
||||
var firstDate = firstWeek[0];
|
||||
var date = new opts.Date(firstDate[0],firstDate[1]-1,firstDate[2]-1)
|
||||
firstWeek.unshift([date.getFullYear(), date.getMonth()+1, date.getDate()]);
|
||||
}
|
||||
} else {
|
||||
var firstDate = firstWeek[0];
|
||||
var week = [];
|
||||
for(var i=1; i<=7; i++){
|
||||
var date = new opts.Date(firstDate[0], firstDate[1]-1, firstDate[2]-i);
|
||||
week.unshift([date.getFullYear(), date.getMonth()+1, date.getDate()]);
|
||||
}
|
||||
weeks.unshift(week);
|
||||
}
|
||||
|
||||
var lastWeek = weeks[weeks.length-1];
|
||||
while(lastWeek.length < 7){
|
||||
var lastDate = lastWeek[lastWeek.length-1];
|
||||
var date = new opts.Date(lastDate[0], lastDate[1]-1, lastDate[2]+1);
|
||||
lastWeek.push([date.getFullYear(), date.getMonth()+1, date.getDate()]);
|
||||
}
|
||||
if (weeks.length < 6){
|
||||
var lastDate = lastWeek[lastWeek.length-1];
|
||||
var week = [];
|
||||
for(var i=1; i<=7; i++){
|
||||
var date = new opts.Date(lastDate[0], lastDate[1]-1, lastDate[2]+i);
|
||||
week.push([date.getFullYear(), date.getMonth()+1, date.getDate()]);
|
||||
}
|
||||
weeks.push(week);
|
||||
}
|
||||
|
||||
return weeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* show the calendar day.
|
||||
*/
|
||||
function show(target){
|
||||
var opts = $.data(target, 'calendar').options;
|
||||
if (opts.current && !opts.validator.call(target, opts.current)){
|
||||
opts.current = null;
|
||||
}
|
||||
|
||||
var now = new opts.Date();
|
||||
var todayInfo = now.getFullYear()+','+(now.getMonth()+1)+','+now.getDate();
|
||||
var currentInfo = opts.current ? (opts.current.getFullYear()+','+(opts.current.getMonth()+1)+','+opts.current.getDate()) : '';
|
||||
// calulate the saturday and sunday index
|
||||
var saIndex = 6 - opts.firstDay;
|
||||
var suIndex = saIndex + 1;
|
||||
if (saIndex >= 7) saIndex -= 7;
|
||||
if (suIndex >= 7) suIndex -= 7;
|
||||
|
||||
$(target).find('.calendar-title span').html(opts.months[opts.month-1] + ' ' + opts.year);
|
||||
|
||||
var body = $(target).find('div.calendar-body');
|
||||
body.children('table').remove();
|
||||
|
||||
var data = ['<table class="calendar-dtable" cellspacing="0" cellpadding="0" border="0">'];
|
||||
data.push('<thead><tr>');
|
||||
if (opts.showWeek){
|
||||
data.push('<th class="calendar-week">'+opts.weekNumberHeader+'</th>');
|
||||
}
|
||||
for(var i=opts.firstDay; i<opts.weeks.length; i++){
|
||||
data.push('<th>'+opts.weeks[i]+'</th>');
|
||||
}
|
||||
for(var i=0; i<opts.firstDay; i++){
|
||||
data.push('<th>'+opts.weeks[i]+'</th>');
|
||||
}
|
||||
data.push('</tr></thead>');
|
||||
|
||||
data.push('<tbody>');
|
||||
var weeks = getWeeks(target, opts.year, opts.month);
|
||||
for(var i=0; i<weeks.length; i++){
|
||||
var week = weeks[i];
|
||||
var cls = '';
|
||||
if (i == 0){cls = 'calendar-first';}
|
||||
else if (i == weeks.length - 1){cls = 'calendar-last';}
|
||||
data.push('<tr class="' + cls + '">');
|
||||
if (opts.showWeek){
|
||||
var weekNumber = opts.getWeekNumber(new opts.Date(week[0][0], parseInt(week[0][1])-1, week[0][2]));
|
||||
data.push('<td class="calendar-week">'+weekNumber+'</td>');
|
||||
}
|
||||
for(var j=0; j<week.length; j++){
|
||||
var day = week[j];
|
||||
var s = day[0]+','+day[1]+','+day[2];
|
||||
var dvalue = new opts.Date(day[0], parseInt(day[1])-1, day[2]);
|
||||
var d = opts.formatter.call(target, dvalue);
|
||||
var css = opts.styler.call(target, dvalue);
|
||||
var classValue = '';
|
||||
var styleValue = '';
|
||||
if (typeof css == 'string'){
|
||||
styleValue = css;
|
||||
} else if (css){
|
||||
classValue = css['class'] || '';
|
||||
styleValue = css['style'] || '';
|
||||
}
|
||||
|
||||
var cls = 'calendar-day';
|
||||
if (!(opts.year == day[0] && opts.month == day[1])){
|
||||
cls += ' calendar-other-month';
|
||||
}
|
||||
if (s == todayInfo){cls += ' calendar-today';}
|
||||
if (s == currentInfo){cls += ' calendar-selected';}
|
||||
if (j == saIndex){cls += ' calendar-saturday';}
|
||||
else if (j == suIndex){cls += ' calendar-sunday';}
|
||||
if (j == 0){cls += ' calendar-first';}
|
||||
else if (j == week.length-1){cls += ' calendar-last';}
|
||||
|
||||
cls += ' ' + classValue;
|
||||
if (!opts.validator.call(target, dvalue)){
|
||||
cls += ' calendar-disabled';
|
||||
}
|
||||
|
||||
data.push('<td class="' + cls + '" abbr="' + s + '" style="' + styleValue + '">' + d + '</td>');
|
||||
}
|
||||
data.push('</tr>');
|
||||
}
|
||||
data.push('</tbody>');
|
||||
data.push('</table>');
|
||||
|
||||
body.append(data.join(''));
|
||||
body.children('table.calendar-dtable').prependTo(body);
|
||||
|
||||
opts.onNavigate.call(target, opts.year, opts.month);
|
||||
}
|
||||
|
||||
$.fn.calendar = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.calendar.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'calendar');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
state = $.data(this, 'calendar', {
|
||||
options:$.extend({}, $.fn.calendar.defaults, $.fn.calendar.parseOptions(this), options)
|
||||
});
|
||||
init(this);
|
||||
}
|
||||
if (state.options.border == false){
|
||||
$(this).addClass('calendar-noborder');
|
||||
}
|
||||
setSize(this);
|
||||
bindEvents(this);
|
||||
show(this);
|
||||
$(this).find('div.calendar-menu').hide(); // hide the calendar menu
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.calendar.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'calendar').options;
|
||||
},
|
||||
resize: function(jq, param){
|
||||
return jq.each(function(){
|
||||
setSize(this, param);
|
||||
});
|
||||
},
|
||||
moveTo: function(jq, date){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).calendar('options');
|
||||
if (!date){
|
||||
var now = new opts.Date();
|
||||
$(this).calendar({
|
||||
year: now.getFullYear(),
|
||||
month: now.getMonth()+1,
|
||||
current: date
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (opts.validator.call(this, date)){
|
||||
var oldValue = opts.current;
|
||||
$(this).calendar({
|
||||
year: date.getFullYear(),
|
||||
month: date.getMonth()+1,
|
||||
current: date
|
||||
});
|
||||
if (!oldValue || oldValue.getTime() != date.getTime()){
|
||||
opts.onChange.call(this, opts.current, oldValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.calendar.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.parser.parseOptions(target, [
|
||||
'weekNumberHeader',{firstDay:'number',fit:'boolean',border:'boolean',showWeek:'boolean'}
|
||||
]));
|
||||
};
|
||||
|
||||
$.fn.calendar.defaults = {
|
||||
Date: Date,
|
||||
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());
|
||||
})(),
|
||||
weekNumberHeader:'',
|
||||
getWeekNumber: function(date){
|
||||
var checkDate = new Date(date.getTime());
|
||||
checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
|
||||
var time = checkDate.getTime();
|
||||
checkDate.setMonth(0);
|
||||
checkDate.setDate(1);
|
||||
return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
|
||||
},
|
||||
|
||||
formatter:function(date){return date.getDate()},
|
||||
styler:function(date){return ''},
|
||||
validator:function(date){return true},
|
||||
|
||||
onSelect: function(date){},
|
||||
onChange: function(newDate, oldDate){},
|
||||
onNavigate: function(year, month){}
|
||||
};
|
||||
})(jQuery);
|
||||
738
static/jeasyui/src/jquery.combobox.js
Normal file
738
static/jeasyui/src/jquery.combobox.js
Normal file
@@ -0,0 +1,738 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* combobox - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* combo
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function getRowIndex(target, value){
|
||||
var state = $.data(target, 'combobox');
|
||||
return $.easyui.indexOfArray(state.data, state.options.valueField, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* scroll panel to display the specified item
|
||||
*/
|
||||
function scrollTo(target, value){
|
||||
var opts = $.data(target, 'combobox').options;
|
||||
var panel = $(target).combo('panel');
|
||||
var item = opts.finder.getEl(target, value);
|
||||
if (item.length){
|
||||
if (item.position().top <= 0){
|
||||
var h = panel.scrollTop() + item.position().top;
|
||||
panel.scrollTop(h);
|
||||
} else if (item.position().top + item.outerHeight() > panel.height()){
|
||||
var h = panel.scrollTop() + item.position().top + item.outerHeight() - panel.height();
|
||||
panel.scrollTop(h);
|
||||
}
|
||||
}
|
||||
panel.triggerHandler('scroll'); // trigger the group sticking
|
||||
}
|
||||
|
||||
function nav(target, dir){
|
||||
var opts = $.data(target, 'combobox').options;
|
||||
var panel = $(target).combobox('panel');
|
||||
var item = panel.children('div.combobox-item-hover');
|
||||
if (!item.length){
|
||||
item = panel.children('div.combobox-item-selected');
|
||||
}
|
||||
item.removeClass('combobox-item-hover');
|
||||
var firstSelector = 'div.combobox-item:visible:not(.combobox-item-disabled):first';
|
||||
var lastSelector = 'div.combobox-item:visible:not(.combobox-item-disabled):last';
|
||||
if (!item.length){
|
||||
item = panel.children(dir=='next' ? firstSelector : lastSelector);
|
||||
} else {
|
||||
if (dir == 'next'){
|
||||
item = item.nextAll(firstSelector);
|
||||
if (!item.length){
|
||||
item = panel.children(firstSelector);
|
||||
}
|
||||
} else {
|
||||
item = item.prevAll(firstSelector);
|
||||
if (!item.length){
|
||||
item = panel.children(lastSelector);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.length){
|
||||
item.addClass('combobox-item-hover');
|
||||
var row = opts.finder.getRow(target, item);
|
||||
if (row){
|
||||
$(target).combobox('scrollTo', row[opts.valueField]);
|
||||
if (opts.selectOnNavigation){
|
||||
select(target, row[opts.valueField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* select the specified value
|
||||
*/
|
||||
function select(target, value, remainText){
|
||||
var opts = $.data(target, 'combobox').options;
|
||||
var values = $(target).combo('getValues');
|
||||
if ($.inArray(value+'', values) == -1){
|
||||
if (opts.multiple){
|
||||
values.push(value);
|
||||
} else {
|
||||
values = [value];
|
||||
}
|
||||
setValues(target, values, remainText);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* unselect the specified value
|
||||
*/
|
||||
function unselect(target, value){
|
||||
var opts = $.data(target, 'combobox').options;
|
||||
var values = $(target).combo('getValues');
|
||||
var index = $.inArray(value+'', values);
|
||||
if (index >= 0){
|
||||
values.splice(index, 1);
|
||||
setValues(target, values);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set values
|
||||
*/
|
||||
function setValues(target, values, remainText){
|
||||
var opts = $.data(target, 'combobox').options;
|
||||
var panel = $(target).combo('panel');
|
||||
|
||||
if (!$.isArray(values)){
|
||||
values = values.split(opts.separator);
|
||||
}
|
||||
if (!opts.multiple){
|
||||
values = values.length ? [values[0]] : [''];
|
||||
}
|
||||
|
||||
// unselect the old rows
|
||||
var oldValues = $(target).combo('getValues');
|
||||
if (panel.is(':visible')){
|
||||
panel.find('.combobox-item-selected').each(function(){
|
||||
var row = opts.finder.getRow(target, $(this));
|
||||
if (row){
|
||||
if ($.easyui.indexOfArray(oldValues, row[opts.valueField]) == -1){
|
||||
$(this).removeClass('combobox-item-selected');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$.map(oldValues, function(v){
|
||||
if ($.easyui.indexOfArray(values, v) == -1){
|
||||
var el = opts.finder.getEl(target, v);
|
||||
if (el.hasClass('combobox-item-selected')){
|
||||
el.removeClass('combobox-item-selected');
|
||||
opts.onUnselect.call(target, opts.finder.getRow(target, v));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var theRow = null;
|
||||
var vv = [], ss = [];
|
||||
for(var i=0; i<values.length; i++){
|
||||
var v = values[i];
|
||||
var s = v;
|
||||
var row = opts.finder.getRow(target, v);
|
||||
if (row){
|
||||
s = row[opts.textField];
|
||||
theRow = row;
|
||||
var el = opts.finder.getEl(target, v);
|
||||
if (!el.hasClass('combobox-item-selected')){
|
||||
el.addClass('combobox-item-selected');
|
||||
opts.onSelect.call(target, row);
|
||||
}
|
||||
} else {
|
||||
s = findText(v, opts.mappingRows) || v;
|
||||
}
|
||||
vv.push(v);
|
||||
ss.push(s);
|
||||
}
|
||||
|
||||
if (!remainText){
|
||||
$(target).combo('setText', ss.join(opts.separator));
|
||||
}
|
||||
if (opts.showItemIcon){
|
||||
var tb = $(target).combobox('textbox');
|
||||
tb.removeClass('textbox-bgicon ' + opts.textboxIconCls);
|
||||
if (theRow && theRow.iconCls){
|
||||
tb.addClass('textbox-bgicon ' + theRow.iconCls);
|
||||
opts.textboxIconCls = theRow.iconCls;
|
||||
}
|
||||
}
|
||||
$(target).combo('setValues', vv);
|
||||
panel.triggerHandler('scroll'); // trigger the group sticking
|
||||
|
||||
function findText(value, a){
|
||||
var item = $.easyui.getArrayItem(a, opts.valueField, value);
|
||||
return item ? item[opts.textField] : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load data, the old list items will be removed.
|
||||
*/
|
||||
function loadData(target, data, remainText){
|
||||
var state = $.data(target, 'combobox');
|
||||
var opts = state.options;
|
||||
state.data = opts.loadFilter.call(target, data);
|
||||
|
||||
opts.view.render.call(opts.view, target, $(target).combo('panel'), state.data);
|
||||
|
||||
var vv = $(target).combobox('getValues');
|
||||
$.easyui.forEach(state.data, false, function(row){
|
||||
if (row['selected']){
|
||||
$.easyui.addArrayItem(vv, row[opts.valueField]+'');
|
||||
}
|
||||
});
|
||||
if (opts.multiple){
|
||||
setValues(target, vv, remainText);
|
||||
} else {
|
||||
setValues(target, vv.length ? [vv[vv.length-1]] : [], remainText);
|
||||
}
|
||||
|
||||
opts.onLoadSuccess.call(target, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* request remote data if the url property is setted.
|
||||
*/
|
||||
function request(target, url, param, remainText){
|
||||
var opts = $.data(target, 'combobox').options;
|
||||
if (url){
|
||||
opts.url = url;
|
||||
}
|
||||
param = $.extend({}, opts.queryParams, param||{});
|
||||
// param = param || {};
|
||||
|
||||
if (opts.onBeforeLoad.call(target, param) == false) return;
|
||||
|
||||
opts.loader.call(target, param, function(data){
|
||||
loadData(target, data, remainText);
|
||||
}, function(){
|
||||
opts.onLoadError.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* do the query action
|
||||
*/
|
||||
function doQuery(target, q){
|
||||
var state = $.data(target, 'combobox');
|
||||
var opts = state.options;
|
||||
|
||||
var highlightItem = $();
|
||||
var qq = opts.multiple ? q.split(opts.separator) : [q];
|
||||
if (opts.mode == 'remote'){
|
||||
_setValues(qq);
|
||||
request(target, null, {q:q}, true);
|
||||
} else {
|
||||
var panel = $(target).combo('panel');
|
||||
panel.find('.combobox-item-hover').removeClass('combobox-item-hover');
|
||||
panel.find('.combobox-item,.combobox-group').hide();
|
||||
var data = state.data;
|
||||
var vv = [];
|
||||
$.map(qq, function(q){
|
||||
q = $.trim(q);
|
||||
var value = q;
|
||||
var group = undefined;
|
||||
highlightItem = $();
|
||||
for(var i=0; i<data.length; i++){
|
||||
var row = data[i];
|
||||
if (opts.filter.call(target, q, row)){
|
||||
var v = row[opts.valueField];
|
||||
var s = row[opts.textField];
|
||||
var g = row[opts.groupField];
|
||||
var item = opts.finder.getEl(target, v).show();
|
||||
if (s.toLowerCase() == q.toLowerCase()){
|
||||
value = v;
|
||||
if (opts.reversed){
|
||||
highlightItem = item;
|
||||
} else {
|
||||
select(target, v, true);
|
||||
}
|
||||
}
|
||||
if (opts.groupField && group != g){
|
||||
opts.finder.getGroupEl(target, g).show();
|
||||
group = g;
|
||||
}
|
||||
}
|
||||
}
|
||||
vv.push(value);
|
||||
});
|
||||
_setValues(vv);
|
||||
}
|
||||
function _setValues(vv){
|
||||
if (opts.reversed){
|
||||
highlightItem.addClass('combobox-item-hover');
|
||||
} else {
|
||||
setValues(target, opts.multiple ? (q?vv:[]) : vv, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doEnter(target){
|
||||
var t = $(target);
|
||||
var opts = t.combobox('options');
|
||||
var panel = t.combobox('panel');
|
||||
var item = panel.children('div.combobox-item-hover');
|
||||
if (item.length){
|
||||
item.removeClass('combobox-item-hover');
|
||||
var row = opts.finder.getRow(target, item);
|
||||
var value = row[opts.valueField];
|
||||
if (opts.multiple){
|
||||
if (item.hasClass('combobox-item-selected')){
|
||||
t.combobox('unselect', value);
|
||||
} else {
|
||||
t.combobox('select', value);
|
||||
}
|
||||
} else {
|
||||
t.combobox('select', value);
|
||||
}
|
||||
}
|
||||
var vv = [];
|
||||
$.map(t.combobox('getValues'), function(v){
|
||||
if (getRowIndex(target, v) >= 0){
|
||||
vv.push(v);
|
||||
}
|
||||
});
|
||||
t.combobox('setValues', vv);
|
||||
if (!opts.multiple){
|
||||
t.combobox('hidePanel');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create the component
|
||||
*/
|
||||
function create(target){
|
||||
var state = $.data(target, 'combobox');
|
||||
var opts = state.options;
|
||||
|
||||
$(target).addClass('combobox-f');
|
||||
$(target).combo($.extend({}, opts, {
|
||||
onShowPanel: function(){
|
||||
$(this).combo('panel').find('div.combobox-item:hidden,div.combobox-group:hidden').show();
|
||||
setValues(this, $(this).combobox('getValues'), true);
|
||||
$(this).combobox('scrollTo', $(this).combobox('getValue'));
|
||||
opts.onShowPanel.call(this);
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
function mouseoverHandler(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();
|
||||
}
|
||||
function mouseoutHandler(e){
|
||||
$(e.target).closest('div.combobox-item').removeClass('combobox-item-hover');
|
||||
e.stopPropagation();
|
||||
}
|
||||
function clickHandler(e){
|
||||
var target = $(this).panel('options').comboTarget;
|
||||
if (!target){return;}
|
||||
var opts = $(target).combobox('options');
|
||||
var item = $(e.target).closest('div.combobox-item');
|
||||
if (!item.length || item.hasClass('combobox-item-disabled')){return}
|
||||
var row = opts.finder.getRow(target, item);
|
||||
if (!row){return;}
|
||||
if (opts.blurTimer){
|
||||
clearTimeout(opts.blurTimer);
|
||||
opts.blurTimer = null;
|
||||
}
|
||||
opts.onClick.call(target, row);
|
||||
var value = row[opts.valueField];
|
||||
if (opts.multiple){
|
||||
if (item.hasClass('combobox-item-selected')){
|
||||
unselect(target, value);
|
||||
} else {
|
||||
select(target, value);
|
||||
}
|
||||
} else {
|
||||
$(target).combobox('setValue', value).combobox('hidePanel');
|
||||
}
|
||||
e.stopPropagation();
|
||||
}
|
||||
function scrollHandler(e){
|
||||
var target = $(this).panel('options').comboTarget;
|
||||
if (!target){return;}
|
||||
var opts = $(target).combobox('options');
|
||||
if (opts.groupPosition == 'sticky'){
|
||||
var stick = $(this).children('.combobox-stick');
|
||||
if (!stick.length){
|
||||
stick = $('<div class="combobox-stick"></div>').appendTo(this);
|
||||
}
|
||||
stick.hide();
|
||||
var state = $(target).data('combobox');
|
||||
$(this).children('.combobox-group:visible').each(function(){
|
||||
var g = $(this);
|
||||
var groupData = opts.finder.getGroup(target, g);
|
||||
var rowData = state.data[groupData.startIndex + groupData.count - 1];
|
||||
var last = opts.finder.getEl(target, rowData[opts.valueField]);
|
||||
if (g.position().top < 0 && last.position().top > 0){
|
||||
stick.show().html(g.html());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.combobox = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
var method = $.fn.combobox.methods[options];
|
||||
if (method){
|
||||
return method(this, param);
|
||||
} else {
|
||||
return this.combo(options, param);
|
||||
}
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'combobox');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
state = $.data(this, 'combobox', {
|
||||
options: $.extend({}, $.fn.combobox.defaults, $.fn.combobox.parseOptions(this), options),
|
||||
data: []
|
||||
});
|
||||
}
|
||||
create(this);
|
||||
if (state.options.data){
|
||||
loadData(this, state.options.data);
|
||||
} else {
|
||||
var data = $.fn.combobox.parseData(this);
|
||||
if (data.length){
|
||||
loadData(this, data);
|
||||
}
|
||||
}
|
||||
request(this);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
$.fn.combobox.methods = {
|
||||
options: function(jq){
|
||||
var copts = jq.combo('options');
|
||||
return $.extend($.data(jq[0], 'combobox').options, {
|
||||
width: copts.width,
|
||||
height: copts.height,
|
||||
originalValue: copts.originalValue,
|
||||
disabled: copts.disabled,
|
||||
readonly: copts.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, values){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).combobox('options');
|
||||
if ($.isArray(values)){
|
||||
values = $.map(values, function(value){
|
||||
if (value && typeof value == 'object'){
|
||||
$.easyui.addArrayItem(opts.mappingRows, opts.valueField, value);
|
||||
return value[opts.valueField];
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
});
|
||||
}
|
||||
setValues(this, values);
|
||||
});
|
||||
},
|
||||
setValue: function(jq, value){
|
||||
return jq.each(function(){
|
||||
$(this).combobox('setValues', $.isArray(value)?value:[value]);
|
||||
});
|
||||
},
|
||||
clear: function(jq){
|
||||
return jq.each(function(){
|
||||
setValues(this, []);
|
||||
});
|
||||
},
|
||||
reset: function(jq){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).combobox('options');
|
||||
if (opts.multiple){
|
||||
$(this).combobox('setValues', opts.originalValue);
|
||||
} else {
|
||||
$(this).combobox('setValue', opts.originalValue);
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData: function(jq, data){
|
||||
return jq.each(function(){
|
||||
loadData(this, data);
|
||||
});
|
||||
},
|
||||
reload: function(jq, url){
|
||||
return jq.each(function(){
|
||||
if (typeof url == 'string'){
|
||||
request(this, url);
|
||||
} else {
|
||||
if (url){
|
||||
var opts = $(this).combobox('options');
|
||||
opts.queryParams = url;
|
||||
}
|
||||
request(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
select: function(jq, value){
|
||||
return jq.each(function(){
|
||||
select(this, value);
|
||||
});
|
||||
},
|
||||
unselect: function(jq, value){
|
||||
return jq.each(function(){
|
||||
unselect(this, value);
|
||||
});
|
||||
},
|
||||
scrollTo: function(jq, value){
|
||||
return jq.each(function(){
|
||||
scrollTo(this, value);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.combobox.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target,[
|
||||
'valueField','textField','groupField','groupPosition','mode','method','url',
|
||||
{showItemIcon:'boolean',limitToList:'boolean'}
|
||||
]));
|
||||
};
|
||||
|
||||
$.fn.combobox.parseData = function(target){
|
||||
var data = [];
|
||||
var opts = $(target).combobox('options');
|
||||
$(target).children().each(function(){
|
||||
if (this.tagName.toLowerCase() == 'optgroup'){
|
||||
var group = $(this).attr('label');
|
||||
$(this).children().each(function(){
|
||||
_parseItem(this, group);
|
||||
});
|
||||
} else {
|
||||
_parseItem(this);
|
||||
}
|
||||
});
|
||||
return data;
|
||||
|
||||
function _parseItem(el, group){
|
||||
var t = $(el);
|
||||
var row = {};
|
||||
row[opts.valueField] = t.attr('value')!=undefined ? t.attr('value') : t.text();
|
||||
row[opts.textField] = t.text();
|
||||
row['iconCls'] = $.parser.parseOptions(el, ['iconCls']).iconCls;
|
||||
row['selected'] = t.is(':selected');
|
||||
row['disabled'] = t.is(':disabled');
|
||||
if (group){
|
||||
opts.groupField = opts.groupField || 'group';
|
||||
row[opts.groupField] = group;
|
||||
}
|
||||
data.push(row);
|
||||
}
|
||||
};
|
||||
|
||||
var COMBOBOX_SERNO = 0;
|
||||
var defaultView = {
|
||||
render: function(target, container, data){
|
||||
var state = $.data(target, 'combobox');
|
||||
var opts = state.options;
|
||||
var prefixId = $(target).attr('id')||'';
|
||||
|
||||
COMBOBOX_SERNO++;
|
||||
state.itemIdPrefix = prefixId + '_easyui_combobox_i' + COMBOBOX_SERNO;
|
||||
state.groupIdPrefix = prefixId + '_easyui_combobox_g' + COMBOBOX_SERNO;
|
||||
state.groups = [];
|
||||
|
||||
var dd = [];
|
||||
var group = undefined;
|
||||
for(var i=0; i<data.length; i++){
|
||||
var row = data[i];
|
||||
var v = row[opts.valueField]+'';
|
||||
var s = row[opts.textField];
|
||||
var g = row[opts.groupField];
|
||||
|
||||
if (g){
|
||||
if (group != g){
|
||||
group = g;
|
||||
state.groups.push({
|
||||
value: g,
|
||||
startIndex: i,
|
||||
count: 1
|
||||
});
|
||||
dd.push('<div id="' + (state.groupIdPrefix+'_'+(state.groups.length-1)) + '" class="combobox-group">');
|
||||
dd.push(opts.groupFormatter ? opts.groupFormatter.call(target, g) : g);
|
||||
dd.push('</div>');
|
||||
} else {
|
||||
state.groups[state.groups.length-1].count++;
|
||||
}
|
||||
} else {
|
||||
group = undefined;
|
||||
}
|
||||
|
||||
var cls = 'combobox-item' + (row.disabled ? ' combobox-item-disabled' : '') + (g ? ' combobox-gitem' : '');
|
||||
dd.push('<div id="' + (state.itemIdPrefix+'_'+i) + '" class="' + cls + '">');
|
||||
if (opts.showItemIcon && row.iconCls){
|
||||
dd.push('<span class="combobox-icon ' + row.iconCls + '"></span>');
|
||||
}
|
||||
dd.push(opts.formatter ? opts.formatter.call(target, row) : s);
|
||||
dd.push('</div>');
|
||||
}
|
||||
$(container).html(dd.join(''));
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.combobox.defaults = $.extend({}, $.fn.combo.defaults, {
|
||||
valueField: 'value',
|
||||
textField: 'text',
|
||||
groupPosition: 'static', // or 'sticky'
|
||||
groupField: null,
|
||||
groupFormatter: function(group){return group;},
|
||||
mode: 'local', // or 'remote'
|
||||
method: 'post',
|
||||
url: null,
|
||||
data: null,
|
||||
queryParams: {},
|
||||
showItemIcon: false,
|
||||
limitToList: false, // limit the inputed values to the listed items
|
||||
unselectedValues: [],
|
||||
mappingRows: [],
|
||||
view: defaultView,
|
||||
|
||||
keyHandler: {
|
||||
up: function(e){nav(this,'prev');e.preventDefault()},
|
||||
down: function(e){nav(this,'next');e.preventDefault()},
|
||||
left: function(e){},
|
||||
right: function(e){},
|
||||
enter: function(e){doEnter(this)},
|
||||
query: function(q,e){doQuery(this, q)}
|
||||
},
|
||||
inputEvents: $.extend({}, $.fn.combo.defaults.inputEvents, {
|
||||
blur: function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var target = e.data.target;
|
||||
var opts = $(target).combobox('options');
|
||||
if (opts.reversed || opts.limitToList){
|
||||
if (opts.blurTimer){
|
||||
clearTimeout(opts.blurTimer);
|
||||
}
|
||||
opts.blurTimer = setTimeout(function(){
|
||||
var existing = $(target).parent().length;
|
||||
if (existing){
|
||||
if (opts.reversed){
|
||||
$(target).combobox('setValues', $(target).combobox('getValues'));
|
||||
} else if (opts.limitToList){
|
||||
//doEnter(target);
|
||||
var vv = [];
|
||||
$.map($(target).combobox('getValues'), function(v){
|
||||
var index = $.easyui.indexOfArray($(target).combobox('getData'), opts.valueField, v);
|
||||
if (index >= 0){
|
||||
vv.push(v);
|
||||
}
|
||||
});
|
||||
$(target).combobox('setValues', vv);
|
||||
}
|
||||
opts.blurTimer = null;
|
||||
}
|
||||
},50);
|
||||
}
|
||||
}
|
||||
}),
|
||||
panelEvents: {
|
||||
mouseover: mouseoverHandler,
|
||||
mouseout: mouseoutHandler,
|
||||
mousedown: function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
},
|
||||
click: clickHandler,
|
||||
scroll: scrollHandler
|
||||
},
|
||||
filter: function(q, row){
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].toLowerCase().indexOf(q.toLowerCase()) >= 0;
|
||||
},
|
||||
formatter: function(row){
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField];
|
||||
},
|
||||
loader: function(param, success, error){
|
||||
var opts = $(this).combobox('options');
|
||||
if (!opts.url) return false;
|
||||
$.ajax({
|
||||
type: opts.method,
|
||||
url: opts.url,
|
||||
data: param,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
success(data);
|
||||
},
|
||||
error: function(){
|
||||
error.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
},
|
||||
loadFilter: function(data){
|
||||
return data;
|
||||
},
|
||||
finder:{
|
||||
getEl:function(target, value){
|
||||
var index = getRowIndex(target, value);
|
||||
var id = $.data(target, 'combobox').itemIdPrefix + '_' + index;
|
||||
return $('#'+id);
|
||||
},
|
||||
getGroupEl:function(target, gvalue){
|
||||
var state = $.data(target, 'combobox');
|
||||
var index = $.easyui.indexOfArray(state.groups, 'value', gvalue);
|
||||
var id = state.groupIdPrefix + '_' + index;
|
||||
return $('#'+id);
|
||||
},
|
||||
getGroup:function(target, p){
|
||||
var state = $.data(target, 'combobox');
|
||||
var index = p.attr('id').substr(state.groupIdPrefix.length+1);
|
||||
return state.groups[parseInt(index)];
|
||||
},
|
||||
getRow:function(target, p){
|
||||
var state = $.data(target, 'combobox');
|
||||
var index = (p instanceof $) ? p.attr('id').substr(state.itemIdPrefix.length+1) : getRowIndex(target, p);
|
||||
return state.data[parseInt(index)];
|
||||
}
|
||||
},
|
||||
|
||||
onBeforeLoad: function(param){},
|
||||
onLoadSuccess: function(data){},
|
||||
onLoadError: function(){},
|
||||
onSelect: function(record){},
|
||||
onUnselect: function(record){},
|
||||
onClick: function(record){}
|
||||
});
|
||||
})(jQuery);
|
||||
307
static/jeasyui/src/jquery.datebox.js
Normal file
307
static/jeasyui/src/jquery.datebox.js
Normal file
@@ -0,0 +1,307 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* datebox - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* calendar
|
||||
* combo
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
/**
|
||||
* create date box
|
||||
*/
|
||||
function createBox(target){
|
||||
var state = $.data(target, 'datebox');
|
||||
var opts = state.options;
|
||||
|
||||
$(target).addClass('datebox-f').combo($.extend({}, opts, {
|
||||
onShowPanel:function(){
|
||||
bindEvents(this);
|
||||
setButtons(this);
|
||||
setCalendar(this);
|
||||
setValue(this, $(this).datebox('getText'), true);
|
||||
opts.onShowPanel.call(this);
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* if the calendar isn't created, create it.
|
||||
*/
|
||||
if (!state.calendar){
|
||||
var panel = $(target).combo('panel').css('overflow','hidden');
|
||||
panel.panel('options').onBeforeDestroy = function(){
|
||||
var c = $(this).find('.calendar-shared');
|
||||
if (c.length){
|
||||
c.insertBefore(c[0].pholder);
|
||||
}
|
||||
};
|
||||
var cc = $('<div class="datebox-calendar-inner"></div>').prependTo(panel);
|
||||
if (opts.sharedCalendar){
|
||||
var c = $(opts.sharedCalendar);
|
||||
if (!c[0].pholder){
|
||||
c[0].pholder = $('<div class="calendar-pholder" style="display:none"></div>').insertAfter(c);
|
||||
}
|
||||
c.addClass('calendar-shared').appendTo(cc);
|
||||
if (!c.hasClass('calendar')){
|
||||
c.calendar();
|
||||
}
|
||||
state.calendar = c;
|
||||
} else {
|
||||
state.calendar = $('<div></div>').appendTo(cc).calendar();
|
||||
}
|
||||
|
||||
$.extend(state.calendar.calendar('options'), {
|
||||
fit:true,
|
||||
border:false,
|
||||
onSelect:function(date){
|
||||
var target = this.target;
|
||||
var opts = $(target).datebox('options');
|
||||
opts.onSelect.call(target, date);
|
||||
setValue(target, opts.formatter.call(target, date));
|
||||
$(target).combo('hidePanel');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(target).combo('textbox').parent().addClass('datebox');
|
||||
$(target).datebox('initValue', opts.value);
|
||||
|
||||
function bindEvents(target){
|
||||
var opts = $(target).datebox('options');
|
||||
var panel = $(target).combo('panel');
|
||||
panel._unbind('.datebox')._bind('click.datebox', function(e){
|
||||
if ($(e.target).hasClass('datebox-button-a')){
|
||||
var index = parseInt($(e.target).attr('datebox-button-index'));
|
||||
opts.buttons[index].handler.call(e.target, target);
|
||||
}
|
||||
});
|
||||
}
|
||||
function setButtons(target){
|
||||
var panel = $(target).combo('panel');
|
||||
if (panel.children('div.datebox-button').length){return}
|
||||
var button = $('<div class="datebox-button"><table cellspacing="0" cellpadding="0" style="width:100%"><tr></tr></table></div>').appendTo(panel);
|
||||
var tr = button.find('tr');
|
||||
for(var i=0; i<opts.buttons.length; i++){
|
||||
var td = $('<td></td>').appendTo(tr);
|
||||
var btn = opts.buttons[i];
|
||||
var t = $('<a class="datebox-button-a" href="javascript:;"></a>').html($.isFunction(btn.text) ? btn.text(target) : btn.text).appendTo(td);
|
||||
t.attr('datebox-button-index', i);
|
||||
}
|
||||
tr.find('td').css('width', (100/opts.buttons.length)+'%');
|
||||
}
|
||||
function setCalendar(target){
|
||||
var panel = $(target).combo('panel');
|
||||
var cc = panel.children('div.datebox-calendar-inner');
|
||||
panel.children()._outerWidth(panel.width());
|
||||
state.calendar.appendTo(cc);
|
||||
state.calendar[0].target = target;
|
||||
if (opts.panelHeight != 'auto'){
|
||||
var height = panel.height();
|
||||
panel.children().not(cc).each(function(){
|
||||
height -= $(this).outerHeight();
|
||||
});
|
||||
cc._outerHeight(height);
|
||||
}
|
||||
state.calendar.calendar('resize');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* called when user inputs some value in text box
|
||||
*/
|
||||
function doQuery(target, q){
|
||||
setValue(target, q, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* called when user press enter key
|
||||
*/
|
||||
function doEnter(target){
|
||||
var state = $.data(target, 'datebox');
|
||||
var opts = state.options;
|
||||
var current = state.calendar.calendar('options').current;
|
||||
if (current){
|
||||
setValue(target, opts.formatter.call(target, current));
|
||||
$(target).combo('hidePanel');
|
||||
}
|
||||
}
|
||||
|
||||
function setValue(target, value, remainText){
|
||||
var state = $.data(target, 'datebox');
|
||||
var opts = state.options;
|
||||
var calendar = state.calendar;
|
||||
calendar.calendar('moveTo', opts.parser.call(target, value));
|
||||
if (remainText){
|
||||
$(target).combo('setValue', value);
|
||||
} else {
|
||||
if (value){
|
||||
value = opts.formatter.call(target, calendar.calendar('options').current);
|
||||
}
|
||||
$(target).combo('setText', value).combo('setValue', value);
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.datebox = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
var method = $.fn.datebox.methods[options];
|
||||
if (method){
|
||||
return method(this, param);
|
||||
} else {
|
||||
return this.combo(options, param);
|
||||
}
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'datebox');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
$.data(this, 'datebox', {
|
||||
options: $.extend({}, $.fn.datebox.defaults, $.fn.datebox.parseOptions(this), options)
|
||||
});
|
||||
}
|
||||
createBox(this);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.datebox.methods = {
|
||||
options: function(jq){
|
||||
var copts = jq.combo('options');
|
||||
return $.extend($.data(jq[0], 'datebox').options, {
|
||||
width: copts.width,
|
||||
height: copts.height,
|
||||
originalValue: copts.originalValue,
|
||||
disabled: copts.disabled,
|
||||
readonly: copts.readonly
|
||||
});
|
||||
},
|
||||
cloneFrom: function(jq, from){
|
||||
return jq.each(function(){
|
||||
$(this).combo('cloneFrom', from);
|
||||
$.data(this, 'datebox', {
|
||||
options: $.extend(true, {}, $(from).datebox('options')),
|
||||
calendar: $(from).datebox('calendar')
|
||||
});
|
||||
$(this).addClass('datebox-f');
|
||||
});
|
||||
},
|
||||
calendar: function(jq){ // get the calendar object
|
||||
return $.data(jq[0], 'datebox').calendar;
|
||||
},
|
||||
initValue: function(jq, value){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).datebox('options');
|
||||
var value = opts.value;
|
||||
if (value){
|
||||
var date = opts.parser.call(this, value);
|
||||
value = opts.formatter.call(this, date);
|
||||
$(this).datebox('calendar').calendar('moveTo', date);
|
||||
}
|
||||
$(this).combo('initValue', value).combo('setText', value);
|
||||
});
|
||||
},
|
||||
setValue: function(jq, value){
|
||||
return jq.each(function(){
|
||||
setValue(this, value);
|
||||
});
|
||||
},
|
||||
reset: function(jq){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).datebox('options');
|
||||
$(this).datebox('setValue', opts.originalValue);
|
||||
});
|
||||
},
|
||||
setDate: function(jq, date){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).datebox('options');
|
||||
$(this).datebox('calendar').calendar('moveTo', date);
|
||||
setValue(this, date ? opts.formatter.call(this, date) : '');
|
||||
});
|
||||
},
|
||||
getDate: function(jq){
|
||||
if (jq.datebox('getValue')){
|
||||
return jq.datebox('calendar').calendar('options').current;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.datebox.parseOptions = function(target){
|
||||
return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target, ['sharedCalendar']));
|
||||
};
|
||||
|
||||
$.fn.datebox.defaults = $.extend({}, $.fn.combo.defaults, {
|
||||
panelWidth:250,
|
||||
panelHeight:'auto',
|
||||
sharedCalendar:null,
|
||||
|
||||
keyHandler: {
|
||||
up:function(e){},
|
||||
down:function(e){},
|
||||
left: function(e){},
|
||||
right: function(e){},
|
||||
enter:function(e){doEnter(this)},
|
||||
query:function(q,e){doQuery(this, q)}
|
||||
},
|
||||
currentText:'Today',
|
||||
closeText:'Close',
|
||||
okText:'Ok',
|
||||
|
||||
buttons:[{
|
||||
text: function(target){return $(target).datebox('options').currentText;},
|
||||
handler: function(target){
|
||||
var opts = $(target).datebox('options');
|
||||
var now = new Date();
|
||||
var current = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
$(target).datebox('calendar').calendar({
|
||||
year:current.getFullYear(),
|
||||
month:current.getMonth()+1,
|
||||
current:current
|
||||
});
|
||||
opts.onSelect.call(target, current);
|
||||
doEnter(target);
|
||||
}
|
||||
},{
|
||||
text: function(target){return $(target).datebox('options').closeText;},
|
||||
handler: function(target){
|
||||
$(this).closest('div.combo-panel').panel('close');
|
||||
}
|
||||
}],
|
||||
|
||||
formatter:function(date){
|
||||
var y = date.getFullYear();
|
||||
var m = date.getMonth()+1;
|
||||
var d = date.getDate();
|
||||
return (m<10?('0'+m):m)+'/'+(d<10?('0'+d):d)+'/'+y;
|
||||
},
|
||||
parser:function(s){
|
||||
var CDate = $.fn.calendar.defaults.Date;
|
||||
if ($(this).data('datebox')){
|
||||
CDate = $(this).datebox('calendar').calendar('options').Date;
|
||||
}
|
||||
if (!s) return new CDate();
|
||||
var ss = s.split('/');
|
||||
var m = parseInt(ss[0],10);
|
||||
var d = parseInt(ss[1],10);
|
||||
var y = parseInt(ss[2],10);
|
||||
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
|
||||
return new CDate(y,m-1,d);
|
||||
} else {
|
||||
return new CDate();
|
||||
}
|
||||
},
|
||||
|
||||
onSelect:function(date){}
|
||||
});
|
||||
})(jQuery);
|
||||
399
static/jeasyui/src/jquery.draggable.js
Normal file
399
static/jeasyui/src/jquery.draggable.js
Normal file
@@ -0,0 +1,399 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* draggable - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function drag(e){
|
||||
var state = $.data(e.data.target, 'draggable');
|
||||
var opts = state.options;
|
||||
var proxy = state.proxy;
|
||||
|
||||
var dragData = e.data;
|
||||
var left = dragData.startLeft + e.pageX - dragData.startX;
|
||||
var top = dragData.startTop + e.pageY - dragData.startY;
|
||||
|
||||
if (proxy){
|
||||
if (proxy.parent()[0] == document.body){
|
||||
if (opts.deltaX != null && opts.deltaX != undefined){
|
||||
left = e.pageX + opts.deltaX;
|
||||
} else {
|
||||
left = e.pageX - e.data.offsetWidth;
|
||||
}
|
||||
if (opts.deltaY != null && opts.deltaY != undefined){
|
||||
top = e.pageY + opts.deltaY;
|
||||
} else {
|
||||
top = e.pageY - e.data.offsetHeight;
|
||||
}
|
||||
} else {
|
||||
if (opts.deltaX != null && opts.deltaX != undefined){
|
||||
left += e.data.offsetWidth + opts.deltaX;
|
||||
}
|
||||
if (opts.deltaY != null && opts.deltaY != undefined){
|
||||
top += e.data.offsetHeight + opts.deltaY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (e.data.parent != document.body) {
|
||||
left += $(e.data.parent).scrollLeft();
|
||||
top += $(e.data.parent).scrollTop();
|
||||
}
|
||||
|
||||
if (opts.axis == 'h') {
|
||||
dragData.left = left;
|
||||
} else if (opts.axis == 'v') {
|
||||
dragData.top = top;
|
||||
} else {
|
||||
dragData.left = left;
|
||||
dragData.top = top;
|
||||
}
|
||||
}
|
||||
|
||||
function applyDrag(e){
|
||||
var state = $.data(e.data.target, 'draggable');
|
||||
var opts = state.options;
|
||||
var proxy = state.proxy;
|
||||
if (!proxy){
|
||||
proxy = $(e.data.target);
|
||||
}
|
||||
proxy.css({
|
||||
left:e.data.left,
|
||||
top:e.data.top
|
||||
});
|
||||
$('body').css('cursor', opts.cursor);
|
||||
}
|
||||
|
||||
function doDown(e){
|
||||
if (!$.fn.draggable.isDragging){return false;}
|
||||
|
||||
var state = $.data(e.data.target, 'draggable');
|
||||
var opts = state.options;
|
||||
|
||||
var droppables = $('.droppable:visible').filter(function(){
|
||||
return e.data.target != this;
|
||||
}).filter(function(){
|
||||
var accept = $.data(this, 'droppable').options.accept;
|
||||
if (accept){
|
||||
return $(accept).filter(function(){
|
||||
return this == e.data.target;
|
||||
}).length > 0;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
state.droppables = droppables;
|
||||
|
||||
var proxy = state.proxy;
|
||||
if (!proxy){
|
||||
if (opts.proxy){
|
||||
if (opts.proxy == 'clone'){
|
||||
proxy = $(e.data.target).clone().insertAfter(e.data.target);
|
||||
} else {
|
||||
proxy = opts.proxy.call(e.data.target, e.data.target);
|
||||
}
|
||||
state.proxy = proxy;
|
||||
} else {
|
||||
proxy = $(e.data.target);
|
||||
}
|
||||
}
|
||||
|
||||
proxy.css('position', 'absolute');
|
||||
drag(e);
|
||||
applyDrag(e);
|
||||
|
||||
opts.onStartDrag.call(e.data.target, e);
|
||||
return false;
|
||||
}
|
||||
|
||||
function doMove(e){
|
||||
if (!$.fn.draggable.isDragging){return false;}
|
||||
|
||||
var state = $.data(e.data.target, 'draggable');
|
||||
drag(e);
|
||||
if (state.options.onDrag.call(e.data.target, e) != false){
|
||||
applyDrag(e);
|
||||
}
|
||||
|
||||
var source = e.data.target;
|
||||
state.droppables.each(function(){
|
||||
var dropObj = $(this);
|
||||
if (dropObj.droppable('options').disabled){return;}
|
||||
|
||||
var p2 = dropObj.offset();
|
||||
if (e.pageX > p2.left && e.pageX < p2.left + dropObj.outerWidth()
|
||||
&& e.pageY > p2.top && e.pageY < p2.top + dropObj.outerHeight()){
|
||||
if (!this.entered){
|
||||
$(this).trigger('_dragenter', [source]);
|
||||
this.entered = true;
|
||||
}
|
||||
$(this).trigger('_dragover', [source]);
|
||||
} else {
|
||||
if (this.entered){
|
||||
$(this).trigger('_dragleave', [source]);
|
||||
this.entered = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function doUp(e){
|
||||
if (!$.fn.draggable.isDragging){
|
||||
clearDragging();
|
||||
return false;
|
||||
}
|
||||
|
||||
doMove(e);
|
||||
|
||||
var state = $.data(e.data.target, 'draggable');
|
||||
var proxy = state.proxy;
|
||||
var opts = state.options;
|
||||
opts.onEndDrag.call(e.data.target, e);
|
||||
if (opts.revert){
|
||||
if (checkDrop() == true){
|
||||
$(e.data.target).css({
|
||||
position:e.data.startPosition,
|
||||
left:e.data.startLeft,
|
||||
top:e.data.startTop
|
||||
});
|
||||
} else {
|
||||
if (proxy){
|
||||
var left, top;
|
||||
if (proxy.parent()[0] == document.body){
|
||||
left = e.data.startX - e.data.offsetWidth;
|
||||
top = e.data.startY - e.data.offsetHeight;
|
||||
} else {
|
||||
left = e.data.startLeft;
|
||||
top = e.data.startTop;
|
||||
}
|
||||
proxy.animate({
|
||||
left: left,
|
||||
top: top
|
||||
}, function(){
|
||||
removeProxy();
|
||||
});
|
||||
} else {
|
||||
$(e.data.target).animate({
|
||||
left:e.data.startLeft,
|
||||
top:e.data.startTop
|
||||
}, function(){
|
||||
$(e.data.target).css('position', e.data.startPosition);
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$(e.data.target).css({
|
||||
position:'absolute',
|
||||
left:e.data.left,
|
||||
top:e.data.top
|
||||
});
|
||||
checkDrop();
|
||||
}
|
||||
|
||||
opts.onStopDrag.call(e.data.target, e);
|
||||
|
||||
clearDragging();
|
||||
|
||||
function removeProxy(){
|
||||
if (proxy){
|
||||
proxy.remove();
|
||||
}
|
||||
state.proxy = null;
|
||||
}
|
||||
|
||||
function checkDrop(){
|
||||
var dropped = false;
|
||||
state.droppables.each(function(){
|
||||
var dropObj = $(this);
|
||||
if (dropObj.droppable('options').disabled){return;}
|
||||
|
||||
var p2 = dropObj.offset();
|
||||
if (e.pageX > p2.left && e.pageX < p2.left + dropObj.outerWidth()
|
||||
&& e.pageY > p2.top && e.pageY < p2.top + dropObj.outerHeight()){
|
||||
if (opts.revert){
|
||||
$(e.data.target).css({
|
||||
position:e.data.startPosition,
|
||||
left:e.data.startLeft,
|
||||
top:e.data.startTop
|
||||
});
|
||||
}
|
||||
$(this).triggerHandler('_drop', [e.data.target]);
|
||||
removeProxy();
|
||||
dropped = true;
|
||||
this.entered = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (!dropped && !opts.revert){
|
||||
removeProxy();
|
||||
}
|
||||
return dropped;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function clearDragging(){
|
||||
if ($.fn.draggable.timer){
|
||||
clearTimeout($.fn.draggable.timer);
|
||||
$.fn.draggable.timer = undefined;
|
||||
}
|
||||
$(document)._unbind('.draggable');
|
||||
$.fn.draggable.isDragging = false;
|
||||
setTimeout(function(){
|
||||
$('body').css('cursor','');
|
||||
},100);
|
||||
}
|
||||
|
||||
$.fn.draggable = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.draggable.methods[options](this, param);
|
||||
}
|
||||
|
||||
return this.each(function(){
|
||||
var opts;
|
||||
var state = $.data(this, 'draggable');
|
||||
if (state) {
|
||||
state.handle._unbind('.draggable');
|
||||
opts = $.extend(state.options, options);
|
||||
} else {
|
||||
opts = $.extend({}, $.fn.draggable.defaults, $.fn.draggable.parseOptions(this), options || {});
|
||||
}
|
||||
var handle = opts.handle ? (typeof opts.handle=='string' ? $(opts.handle, this) : opts.handle) : $(this);
|
||||
|
||||
$.data(this, 'draggable', {
|
||||
options: opts,
|
||||
handle: handle
|
||||
});
|
||||
|
||||
if (opts.disabled) {
|
||||
$(this).css('cursor', '');
|
||||
return;
|
||||
}
|
||||
|
||||
handle._unbind('.draggable')._bind('mousemove.draggable', {target:this}, function(e){
|
||||
if ($.fn.draggable.isDragging){return}
|
||||
var opts = $.data(e.data.target, 'draggable').options;
|
||||
if (checkArea(e)){
|
||||
$(this).css('cursor', opts.cursor);
|
||||
} else {
|
||||
$(this).css('cursor', '');
|
||||
}
|
||||
})._bind('mouseleave.draggable', {target:this}, function(e){
|
||||
$(this).css('cursor', '');
|
||||
})._bind('mousedown.draggable', {target:this}, function(e){
|
||||
if (checkArea(e) == false) return;
|
||||
$(this).css('cursor', '');
|
||||
|
||||
var position = $(e.data.target).position();
|
||||
var offset = $(e.data.target).offset();
|
||||
var data = {
|
||||
startPosition: $(e.data.target).css('position'),
|
||||
startLeft: position.left,
|
||||
startTop: position.top,
|
||||
left: position.left,
|
||||
top: position.top,
|
||||
startX: e.pageX,
|
||||
startY: e.pageY,
|
||||
width: $(e.data.target).outerWidth(),
|
||||
height: $(e.data.target).outerHeight(),
|
||||
offsetWidth: (e.pageX - offset.left),
|
||||
offsetHeight: (e.pageY - offset.top),
|
||||
target: e.data.target,
|
||||
parent: $(e.data.target).parent()[0]
|
||||
};
|
||||
|
||||
$.extend(e.data, data);
|
||||
var opts = $.data(e.data.target, 'draggable').options;
|
||||
if (opts.onBeforeDrag.call(e.data.target, e) == false) return;
|
||||
|
||||
$(document)._bind('mousedown.draggable', e.data, doDown);
|
||||
$(document)._bind('mousemove.draggable', e.data, doMove);
|
||||
$(document)._bind('mouseup.draggable', e.data, doUp);
|
||||
|
||||
$.fn.draggable.timer = setTimeout(function(){
|
||||
$.fn.draggable.isDragging = true;
|
||||
doDown(e);
|
||||
}, opts.delay);
|
||||
return false;
|
||||
});
|
||||
|
||||
// check if the handle can be dragged
|
||||
function checkArea(e) {
|
||||
var state = $.data(e.data.target, 'draggable');
|
||||
var handle = state.handle;
|
||||
var offset = $(handle).offset();
|
||||
var width = $(handle).outerWidth();
|
||||
var height = $(handle).outerHeight();
|
||||
var t = e.pageY - offset.top;
|
||||
var r = offset.left + width - e.pageX;
|
||||
var b = offset.top + height - e.pageY;
|
||||
var l = e.pageX - offset.left;
|
||||
|
||||
return Math.min(t,r,b,l) > state.options.edge;
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.draggable.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'draggable').options;
|
||||
},
|
||||
proxy: function(jq){
|
||||
return $.data(jq[0], 'draggable').proxy;
|
||||
},
|
||||
enable: function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).draggable({disabled:false});
|
||||
});
|
||||
},
|
||||
disable: function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).draggable({disabled:true});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.draggable.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({},
|
||||
$.parser.parseOptions(target, ['cursor','handle','axis',
|
||||
{'revert':'boolean','deltaX':'number','deltaY':'number','edge':'number','delay':'number'}]), {
|
||||
disabled: (t.attr('disabled') ? true : undefined)
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.draggable.defaults = {
|
||||
proxy:null, // 'clone' or a function that will create the proxy object,
|
||||
// the function has the source parameter that indicate the source object dragged.
|
||||
revert:false,
|
||||
cursor:'move',
|
||||
deltaX:null,
|
||||
deltaY:null,
|
||||
handle: null,
|
||||
disabled: false,
|
||||
edge:0,
|
||||
axis:null, // v or h
|
||||
delay:100,
|
||||
|
||||
onBeforeDrag: function(e){},
|
||||
onStartDrag: function(e){},
|
||||
onDrag: function(e){},
|
||||
onEndDrag: function(e){},
|
||||
onStopDrag: function(e){}
|
||||
};
|
||||
|
||||
$.fn.draggable.isDragging = false;
|
||||
|
||||
})(jQuery);
|
||||
81
static/jeasyui/src/jquery.droppable.js
Normal file
81
static/jeasyui/src/jquery.droppable.js
Normal file
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* droppable - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function init(target){
|
||||
$(target).addClass('droppable');
|
||||
$(target)._bind('_dragenter', function(e, source){
|
||||
$.data(target, 'droppable').options.onDragEnter.apply(target, [e, source]);
|
||||
});
|
||||
$(target)._bind('_dragleave', function(e, source){
|
||||
$.data(target, 'droppable').options.onDragLeave.apply(target, [e, source]);
|
||||
});
|
||||
$(target)._bind('_dragover', function(e, source){
|
||||
$.data(target, 'droppable').options.onDragOver.apply(target, [e, source]);
|
||||
});
|
||||
$(target)._bind('_drop', function(e, source){
|
||||
$.data(target, 'droppable').options.onDrop.apply(target, [e, source]);
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.droppable = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.droppable.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'droppable');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
init(this);
|
||||
$.data(this, 'droppable', {
|
||||
options: $.extend({}, $.fn.droppable.defaults, $.fn.droppable.parseOptions(this), options)
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.droppable.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'droppable').options;
|
||||
},
|
||||
enable: function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).droppable({disabled:false});
|
||||
});
|
||||
},
|
||||
disable: function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).droppable({disabled:true});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.droppable.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.parser.parseOptions(target, ['accept']), {
|
||||
disabled: (t.attr('disabled') ? true : undefined)
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.droppable.defaults = {
|
||||
accept:null,
|
||||
disabled:false,
|
||||
onDragEnter:function(e, source){},
|
||||
onDragOver:function(e, source){},
|
||||
onDragLeave:function(e, source){},
|
||||
onDrop:function(e, source){}
|
||||
};
|
||||
})(jQuery);
|
||||
496
static/jeasyui/src/jquery.form.js
Normal file
496
static/jeasyui/src/jquery.form.js
Normal file
@@ -0,0 +1,496 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* form - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
/**
|
||||
* submit the form
|
||||
*/
|
||||
function ajaxSubmit(target, options){
|
||||
var opts = $.data(target, 'form').options;
|
||||
$.extend(opts, options||{});
|
||||
|
||||
var param = $.extend({}, opts.queryParams);
|
||||
if (opts.onSubmit.call(target, param) == false){return;}
|
||||
|
||||
// $(target).find('.textbox-text:focus').blur();
|
||||
var input = $(target).find('.textbox-text:focus');
|
||||
input.triggerHandler('blur');
|
||||
input.focus();
|
||||
|
||||
var disabledFields = null; // the fields to be disabled
|
||||
if (opts.dirty){
|
||||
var ff = []; // all the dirty fields
|
||||
$.map(opts.dirtyFields, function(f){
|
||||
if ($(f).hasClass('textbox-f')){
|
||||
$(f).next().find('.textbox-value').each(function(){
|
||||
ff.push(this);
|
||||
});
|
||||
} else {
|
||||
ff.push(f);
|
||||
}
|
||||
});
|
||||
disabledFields = $(target).find('input[name]:enabled,textarea[name]:enabled,select[name]:enabled').filter(function(){
|
||||
return $.inArray(this, ff) == -1;
|
||||
});
|
||||
// disabledFields.attr('disabled', 'disabled');
|
||||
disabledFields._propAttr('disabled', true);
|
||||
}
|
||||
|
||||
if (opts.ajax){
|
||||
if (opts.iframe){
|
||||
submitIframe(target, param);
|
||||
} else {
|
||||
if (window.FormData !== undefined){
|
||||
submitXhr(target, param);
|
||||
} else {
|
||||
submitIframe(target, param);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$(target).submit();
|
||||
}
|
||||
|
||||
if (opts.dirty){
|
||||
// disabledFields.removeAttr('disabled');
|
||||
disabledFields._propAttr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
function submitIframe(target, param){
|
||||
var opts = $.data(target, 'form').options;
|
||||
var frameId = 'easyui_frame_' + (new Date().getTime());
|
||||
var frame = $('<iframe id='+frameId+' name='+frameId+'></iframe>').appendTo('body')
|
||||
frame.attr('src', window.ActiveXObject ? 'javascript:false' : 'about:blank');
|
||||
frame.css({
|
||||
position:'absolute',
|
||||
top:-1000,
|
||||
left:-1000
|
||||
});
|
||||
frame.bind('load', cb);
|
||||
|
||||
submit(param);
|
||||
|
||||
function submit(param){
|
||||
var form = $(target);
|
||||
if (opts.url){
|
||||
form.attr('action', opts.url);
|
||||
}
|
||||
var t = form.attr('target'), a = form.attr('action');
|
||||
form.attr('target', frameId);
|
||||
var paramFields = $();
|
||||
try {
|
||||
for(var n in param){
|
||||
var field = $('<input type="hidden" name="' + n + '">').val(param[n]).appendTo(form);
|
||||
paramFields = paramFields.add(field);
|
||||
}
|
||||
checkState();
|
||||
form[0].submit();
|
||||
} finally {
|
||||
form.attr('action', a);
|
||||
t ? form.attr('target', t) : form.removeAttr('target');
|
||||
paramFields.remove();
|
||||
}
|
||||
}
|
||||
|
||||
function checkState(){
|
||||
var f = $('#'+frameId);
|
||||
if (!f.length){return}
|
||||
try{
|
||||
var s = f.contents()[0].readyState;
|
||||
if (s && s.toLowerCase() == 'uninitialized'){
|
||||
setTimeout(checkState, 100);
|
||||
}
|
||||
} catch(e){
|
||||
cb();
|
||||
}
|
||||
}
|
||||
|
||||
var checkCount = 10;
|
||||
function cb(){
|
||||
var f = $('#'+frameId);
|
||||
if (!f.length){return}
|
||||
f.unbind();
|
||||
var data = '';
|
||||
try{
|
||||
var body = f.contents().find('body');
|
||||
data = body.html();
|
||||
if (data == ''){
|
||||
if (--checkCount){
|
||||
setTimeout(cb, 100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var ta = body.find('>textarea');
|
||||
if (ta.length){
|
||||
data = ta.val();
|
||||
} else {
|
||||
var pre = body.find('>pre');
|
||||
if (pre.length){
|
||||
data = pre.html();
|
||||
}
|
||||
}
|
||||
} catch(e){
|
||||
}
|
||||
opts.success.call(target, data);
|
||||
setTimeout(function(){
|
||||
f.unbind();
|
||||
f.remove();
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
function submitXhr(target, param){
|
||||
var opts = $.data(target, 'form').options;
|
||||
var formData = new FormData($(target)[0]);
|
||||
for(var name in param){
|
||||
formData.append(name, param[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 total = e.total;
|
||||
var position = e.loaded || e.position;
|
||||
var percent = Math.ceil(position * 100 / total);
|
||||
opts.onProgress.call(target, percent);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
},
|
||||
data: formData,
|
||||
dataType: 'html',
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
complete: function(res){
|
||||
opts.success.call(target, res.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* load form data
|
||||
* if data is a URL string type load from remote site,
|
||||
* otherwise load from local data object.
|
||||
*/
|
||||
function load(target, data){
|
||||
var opts = $.data(target, 'form').options;
|
||||
|
||||
if (typeof data == 'string'){
|
||||
var param = {};
|
||||
if (opts.onBeforeLoad.call(target, param) == false) return;
|
||||
|
||||
$.ajax({
|
||||
url: data,
|
||||
data: param,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
_load(data);
|
||||
},
|
||||
error: function(){
|
||||
opts.onLoadError.apply(target, arguments);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
_load(data);
|
||||
}
|
||||
|
||||
function _load(data){
|
||||
var form = $(target);
|
||||
for(var name in data){
|
||||
var val = data[name];
|
||||
if (!_checkField(name, val)){
|
||||
if (!_loadBox(name, val)){
|
||||
form.find('input[name="'+name+'"]').val(val);
|
||||
form.find('textarea[name="'+name+'"]').val(val);
|
||||
form.find('select[name="'+name+'"]').val(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
opts.onLoadSuccess.call(target, data);
|
||||
form.form('validate');
|
||||
}
|
||||
|
||||
/**
|
||||
* check the checkbox and radio fields
|
||||
*/
|
||||
function _checkField(name, val){
|
||||
var plugins = ['switchbutton','radiobutton','checkbox'];
|
||||
for(var i=0; i<plugins.length; i++){
|
||||
var plugin = plugins[i];
|
||||
var cc = $(target).find('['+plugin+'Name="'+name+'"]');
|
||||
if (cc.length){
|
||||
cc[plugin]('uncheck');
|
||||
cc.each(function(){
|
||||
if (_isChecked($(this)[plugin]('options').value, val)){
|
||||
$(this)[plugin]('check');
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var cc = $(target).find('input[name="'+name+'"][type=radio], input[name="'+name+'"][type=checkbox]');
|
||||
if (cc.length){
|
||||
cc._propAttr('checked', false);
|
||||
cc.each(function(){
|
||||
if (_isChecked($(this).val(), val)){
|
||||
$(this)._propAttr('checked', true);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function _isChecked(v, val){
|
||||
if (v == String(val) || $.inArray(v, $.isArray(val)?val:[val]) >= 0){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _loadBox(name, val){
|
||||
var field = $(target).find('[textboxName="'+name+'"],[sliderName="'+name+'"]');
|
||||
if (field.length){
|
||||
for(var i=0; i<opts.fieldTypes.length; i++){
|
||||
var type = opts.fieldTypes[i];
|
||||
var state = field.data(type);
|
||||
if (state){
|
||||
if (state.options.multiple || state.options.range){
|
||||
field[type]('setValues', val);
|
||||
} else {
|
||||
field[type]('setValue', val);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clear the form fields
|
||||
*/
|
||||
function clear(target){
|
||||
$('input,select,textarea', target).each(function(){
|
||||
if ($(this).hasClass('textbox-value')){return;}
|
||||
var t = this.type, tag = this.tagName.toLowerCase();
|
||||
if (t == 'text' || t == 'hidden' || t == 'password' || tag == 'textarea'){
|
||||
this.value = '';
|
||||
} else if (t == 'file'){
|
||||
var file = $(this);
|
||||
if (!file.hasClass('textbox-value')){
|
||||
var newfile = file.clone().val('');
|
||||
newfile.insertAfter(file);
|
||||
if (file.data('validatebox')){
|
||||
file.validatebox('destroy');
|
||||
newfile.validatebox();
|
||||
} else {
|
||||
file.remove();
|
||||
}
|
||||
}
|
||||
} else if (t == 'checkbox' || t == 'radio'){
|
||||
this.checked = false;
|
||||
} else if (tag == 'select'){
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var tmp = $();
|
||||
var form = $(target);
|
||||
var opts = $.data(target, 'form').options;
|
||||
for(var i=0; i<opts.fieldTypes.length; i++){
|
||||
var type = opts.fieldTypes[i];
|
||||
var field = form.find('.'+type+'-f').not(tmp);
|
||||
if (field.length && field[type]){
|
||||
field[type]('clear');
|
||||
tmp = tmp.add(field);
|
||||
}
|
||||
}
|
||||
form.form('validate');
|
||||
}
|
||||
|
||||
function reset(target){
|
||||
target.reset();
|
||||
var form = $(target);
|
||||
var opts = $.data(target, 'form').options;
|
||||
for(var i=opts.fieldTypes.length-1; i>=0; i--){
|
||||
var type = opts.fieldTypes[i];
|
||||
var field = form.find('.'+type+'-f');
|
||||
if (field.length && field[type]){
|
||||
field[type]('reset');
|
||||
}
|
||||
}
|
||||
form.form('validate');
|
||||
}
|
||||
|
||||
/**
|
||||
* set the form to make it can submit with ajax.
|
||||
*/
|
||||
function setForm(target){
|
||||
var options = $.data(target, 'form').options;
|
||||
$(target).unbind('.form');
|
||||
if (options.ajax){
|
||||
$(target).bind('submit.form', function(){
|
||||
setTimeout(function(){
|
||||
ajaxSubmit(target, options);
|
||||
}, 0);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$(target).bind('_change.form', function(e, t){
|
||||
if ($.inArray(t, options.dirtyFields) == -1){
|
||||
options.dirtyFields.push(t);
|
||||
}
|
||||
options.onChange.call(this, t);
|
||||
}).bind('change.form', function(e){
|
||||
var t = e.target;
|
||||
if (!$(t).hasClass('textbox-text')){
|
||||
if ($.inArray(t, options.dirtyFields) == -1){
|
||||
options.dirtyFields.push(t);
|
||||
}
|
||||
options.onChange.call(this, t);
|
||||
}
|
||||
});
|
||||
setValidation(target, options.novalidate);
|
||||
}
|
||||
|
||||
function initForm(target, options){
|
||||
options = options || {};
|
||||
var state = $.data(target, 'form');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
$.data(target, 'form', {
|
||||
options: $.extend({}, $.fn.form.defaults, $.fn.form.parseOptions(target), options)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function validate(target){
|
||||
if ($.fn.validatebox){
|
||||
var t = $(target);
|
||||
t.find('.validatebox-text:not(:disabled)').validatebox('validate');
|
||||
var invalidbox = t.find('.validatebox-invalid');
|
||||
invalidbox.filter(':not(:disabled):first').focus();
|
||||
return invalidbox.length == 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function setValidation(target, novalidate){
|
||||
var opts = $.data(target, 'form').options;
|
||||
opts.novalidate = novalidate;
|
||||
$(target).find('.validatebox-text:not(:disabled)').validatebox(novalidate ? 'disableValidation' : 'enableValidation');
|
||||
}
|
||||
|
||||
$.fn.form = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
this.each(function(){
|
||||
initForm(this);
|
||||
});
|
||||
return $.fn.form.methods[options](this, param);
|
||||
}
|
||||
|
||||
return this.each(function(){
|
||||
initForm(this, options);
|
||||
setForm(this);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.form.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'form').options;
|
||||
},
|
||||
submit: function(jq, options){
|
||||
return jq.each(function(){
|
||||
ajaxSubmit(this, options);
|
||||
});
|
||||
},
|
||||
load: function(jq, data){
|
||||
return jq.each(function(){
|
||||
load(this, data);
|
||||
});
|
||||
},
|
||||
clear: function(jq){
|
||||
return jq.each(function(){
|
||||
clear(this);
|
||||
});
|
||||
},
|
||||
reset: function(jq){
|
||||
return jq.each(function(){
|
||||
reset(this);
|
||||
});
|
||||
},
|
||||
validate: function(jq){
|
||||
return validate(jq[0]);
|
||||
},
|
||||
disableValidation: function(jq){
|
||||
return jq.each(function(){
|
||||
setValidation(this, true);
|
||||
});
|
||||
},
|
||||
enableValidation: function(jq){
|
||||
return jq.each(function(){
|
||||
setValidation(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(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.parser.parseOptions(target, [
|
||||
{ajax:'boolean',dirty:'boolean'}
|
||||
]), {
|
||||
url: (t.attr('action') ? t.attr('action') : undefined)
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.form.defaults = {
|
||||
fieldTypes: ['tagbox','combobox','combotree','combogrid','combotreegrid','datetimebox','datebox','timepicker','combo',
|
||||
'datetimespinner','timespinner','numberspinner','spinner',
|
||||
'slider','searchbox','numberbox','passwordbox','filebox','textbox','switchbutton','radiobutton','checkbox'],
|
||||
novalidate: false,
|
||||
ajax: true,
|
||||
iframe: true,
|
||||
dirty: false,
|
||||
dirtyFields: [],
|
||||
url: null,
|
||||
queryParams: {},
|
||||
onSubmit: function(param){return $(this).form('validate');},
|
||||
onProgress: function(percent){},
|
||||
success: function(data){},
|
||||
onBeforeLoad: function(param){},
|
||||
onLoadSuccess: function(data){},
|
||||
onLoadError: function(){},
|
||||
onChange: function(target){}
|
||||
};
|
||||
})(jQuery);
|
||||
235
static/jeasyui/src/jquery.linkbutton.js
Normal file
235
static/jeasyui/src/jquery.linkbutton.js
Normal file
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* linkbutton - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function setSize(target, param){
|
||||
var opts = $.data(target, 'linkbutton').options;
|
||||
if (param){
|
||||
$.extend(opts, param);
|
||||
}
|
||||
if (opts.width || opts.height || opts.fit){
|
||||
var btn = $(target);
|
||||
var parent = btn.parent();
|
||||
var isVisible = btn.is(':visible');
|
||||
if (!isVisible){
|
||||
var spacer = $('<div style="display:none"></div>').insertBefore(target);
|
||||
var style = {
|
||||
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(opts, parent);
|
||||
var left = btn.find('.l-btn-left');
|
||||
left.css('margin-top', 0);
|
||||
left.css('margin-top', parseInt((btn.height()-left.height())/2)+'px');
|
||||
if (!isVisible){
|
||||
btn.insertAfter(spacer);
|
||||
btn.css(style);
|
||||
spacer.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createButton(target) {
|
||||
var opts = $.data(target, 'linkbutton').options;
|
||||
var t = $(target).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-'+opts.size);
|
||||
if (opts.plain){t.addClass('l-btn-plain')}
|
||||
if (opts.outline){t.addClass('l-btn-outline')}
|
||||
if (opts.selected){
|
||||
t.addClass(opts.plain ? 'l-btn-selected l-btn-plain-selected' : 'l-btn-selected');
|
||||
}
|
||||
t.attr('group', opts.group || '');
|
||||
t.attr('id', opts.id || '');
|
||||
|
||||
var inner = $('<span class="l-btn-left"></span>').appendTo(t);
|
||||
if (opts.text){
|
||||
$('<span class="l-btn-text"></span>').html(opts.text).appendTo(inner);
|
||||
} else {
|
||||
$('<span class="l-btn-text l-btn-empty"> </span>').appendTo(inner);
|
||||
}
|
||||
if (opts.iconCls){
|
||||
$('<span class="l-btn-icon"> </span>').addClass(opts.iconCls).appendTo(inner);
|
||||
inner.addClass('l-btn-icon-'+opts.iconAlign);
|
||||
}
|
||||
|
||||
t._unbind('.linkbutton')._bind('focus.linkbutton',function(){
|
||||
if (!opts.disabled){
|
||||
$(this).addClass('l-btn-focus');
|
||||
}
|
||||
})._bind('blur.linkbutton',function(){
|
||||
$(this).removeClass('l-btn-focus');
|
||||
})._bind('click.linkbutton',function(){
|
||||
if (!opts.disabled){
|
||||
if (opts.toggle){
|
||||
if (opts.selected){
|
||||
$(this).linkbutton('unselect');
|
||||
} else {
|
||||
$(this).linkbutton('select');
|
||||
}
|
||||
}
|
||||
opts.onClick.call(this);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
|
||||
setSelected(target, opts.selected)
|
||||
setDisabled(target, opts.disabled);
|
||||
}
|
||||
|
||||
function setSelected(target, selected){
|
||||
var opts = $.data(target, 'linkbutton').options;
|
||||
if (selected){
|
||||
if (opts.group){
|
||||
$('a.l-btn[group="'+opts.group+'"]').each(function(){
|
||||
var o = $(this).linkbutton('options');
|
||||
if (o.toggle){
|
||||
$(this).removeClass('l-btn-selected l-btn-plain-selected');
|
||||
o.selected = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
$(target).addClass(opts.plain ? 'l-btn-selected l-btn-plain-selected' : 'l-btn-selected');
|
||||
opts.selected = true;
|
||||
} else {
|
||||
if (!opts.group){
|
||||
$(target).removeClass('l-btn-selected l-btn-plain-selected');
|
||||
opts.selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setDisabled(target, disabled){
|
||||
var state = $.data(target, 'linkbutton');
|
||||
var opts = state.options;
|
||||
$(target).removeClass('l-btn-disabled l-btn-plain-disabled');
|
||||
if (disabled){
|
||||
opts.disabled = true;
|
||||
var href = $(target).attr('href');
|
||||
if (href){
|
||||
state.href = href;
|
||||
$(target).attr('href', 'javascript:;');
|
||||
}
|
||||
if (target.onclick){
|
||||
state.onclick = target.onclick;
|
||||
target.onclick = null;
|
||||
}
|
||||
opts.plain ? $(target).addClass('l-btn-disabled l-btn-plain-disabled') : $(target).addClass('l-btn-disabled');
|
||||
} else {
|
||||
opts.disabled = false;
|
||||
if (state.href) {
|
||||
$(target).attr('href', state.href);
|
||||
}
|
||||
if (state.onclick) {
|
||||
target.onclick = state.onclick;
|
||||
}
|
||||
}
|
||||
$(target)._propAttr('disabled', disabled);
|
||||
}
|
||||
|
||||
$.fn.linkbutton = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.linkbutton.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'linkbutton');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
$.data(this, 'linkbutton', {
|
||||
options: $.extend({}, $.fn.linkbutton.defaults, $.fn.linkbutton.parseOptions(this), options)
|
||||
});
|
||||
// $(this).removeAttr('disabled');
|
||||
$(this)._propAttr('disabled', false);
|
||||
$(this)._bind('_resize', function(e, force){
|
||||
if ($(this).hasClass('easyui-fluid') || force){
|
||||
setSize(this);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
createButton(this);
|
||||
setSize(this);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.linkbutton.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'linkbutton').options;
|
||||
},
|
||||
resize: function(jq, param){
|
||||
return jq.each(function(){
|
||||
setSize(this, param);
|
||||
});
|
||||
},
|
||||
enable: function(jq){
|
||||
return jq.each(function(){
|
||||
setDisabled(this, false);
|
||||
});
|
||||
},
|
||||
disable: function(jq){
|
||||
return jq.each(function(){
|
||||
setDisabled(this, true);
|
||||
});
|
||||
},
|
||||
select: function(jq){
|
||||
return jq.each(function(){
|
||||
setSelected(this, true);
|
||||
});
|
||||
},
|
||||
unselect: function(jq){
|
||||
return jq.each(function(){
|
||||
setSelected(this, false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.linkbutton.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.parser.parseOptions(target,
|
||||
['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,
|
||||
outline: false,
|
||||
group: null,
|
||||
plain: false,
|
||||
text: '',
|
||||
iconCls: null,
|
||||
iconAlign: 'left',
|
||||
size: 'small', // small,large
|
||||
onClick: function(){}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
648
static/jeasyui/src/jquery.menu.js
Normal file
648
static/jeasyui/src/jquery.menu.js
Normal file
@@ -0,0 +1,648 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* menu - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
$(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').not('.menu-inline').menu('hide');
|
||||
hideMenu($('body>div.menu:visible').not('.menu-inline'));
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* initialize the target menu, the function can be invoked only once
|
||||
*/
|
||||
function init(target){
|
||||
var opts = $.data(target, 'menu').options;
|
||||
$(target).addClass('menu-top'); // the top menu
|
||||
opts.inline ? $(target).addClass('menu-inline') : $(target).appendTo('body');
|
||||
$(target)._bind('_resize', function(e, force){
|
||||
if ($(this).hasClass('easyui-fluid') || force){
|
||||
$(target).menu('resize', target);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
var menus = splitMenu($(target));
|
||||
for(var i=0; i<menus.length; i++){
|
||||
createMenu(target, menus[i]);
|
||||
}
|
||||
|
||||
function splitMenu(menu){
|
||||
var menus = [];
|
||||
menu.addClass('menu');
|
||||
menus.push(menu);
|
||||
if (!menu.hasClass('menu-content')){
|
||||
menu.children('div').each(function(){
|
||||
var submenu = $(this).children('div');
|
||||
if (submenu.length){
|
||||
submenu.appendTo('body');
|
||||
this.submenu = submenu; // point to the sub menu
|
||||
var mm = splitMenu(submenu);
|
||||
menus = menus.concat(mm);
|
||||
}
|
||||
});
|
||||
}
|
||||
return menus;
|
||||
}
|
||||
}
|
||||
|
||||
function createMenu(target, 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(){
|
||||
createItem(target, this);
|
||||
});
|
||||
$('<div class="menu-line"></div>').prependTo(menu);
|
||||
}
|
||||
setMenuSize(target, menu);
|
||||
if (!menu.hasClass('menu-inline')){
|
||||
menu.hide();
|
||||
}
|
||||
bindMenuEvent(target, menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* create the menu item
|
||||
*/
|
||||
function createItem(target, div, options){
|
||||
var item = $(div);
|
||||
var itemOpts = $.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
|
||||
}, options||{});
|
||||
itemOpts.onclick = itemOpts.onclick || itemOpts.handler || null;
|
||||
item.data('menuitem', {
|
||||
options: itemOpts
|
||||
});
|
||||
if (itemOpts.separator){
|
||||
item.addClass('menu-sep');
|
||||
}
|
||||
if (!item.hasClass('menu-sep')){
|
||||
item.addClass('menu-item');
|
||||
item.empty().append($('<div class="menu-text"></div>').html(itemOpts.text));
|
||||
if (itemOpts.iconCls){
|
||||
$('<div class="menu-icon"></div>').addClass(itemOpts.iconCls).appendTo(item);
|
||||
}
|
||||
if (itemOpts.id){
|
||||
item.attr('id', itemOpts.id);
|
||||
}
|
||||
if (itemOpts.onclick){
|
||||
if (typeof itemOpts.onclick == 'string'){
|
||||
item.attr('onclick', itemOpts.onclick);
|
||||
} else {
|
||||
item[0].onclick = eval(itemOpts.onclick);
|
||||
}
|
||||
}
|
||||
if (itemOpts.disabled){
|
||||
setDisabled(target, item[0], true);
|
||||
}
|
||||
if (item[0].submenu){
|
||||
$('<div class="menu-rightarrow"></div>').appendTo(item); // has sub menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setMenuSize(target, menu){
|
||||
var opts = $.data(target, 'menu').options;
|
||||
var style = menu.attr('style') || '';
|
||||
var isVisible = menu.is(':visible');
|
||||
menu.css({
|
||||
display: 'block',
|
||||
left: -10000,
|
||||
height: 'auto',
|
||||
overflow: 'hidden'
|
||||
});
|
||||
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 mopts = menu.data('menu').options;
|
||||
var width = mopts.width;
|
||||
var height = mopts.height;
|
||||
if (isNaN(parseInt(width))){
|
||||
width = 0;
|
||||
menu.find('div.menu-text').each(function(){
|
||||
if (width < $(this).outerWidth()){
|
||||
width = $(this).outerWidth();
|
||||
}
|
||||
});
|
||||
// width += 40;
|
||||
width = width ? width+40 : '';
|
||||
}
|
||||
var autoHeight = menu.outerHeight();
|
||||
if (isNaN(parseInt(height))){
|
||||
height = autoHeight;
|
||||
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();
|
||||
height = Math.min(height, Math.max(h1, h2));
|
||||
} else if (height > $(window)._outerHeight()){
|
||||
height = $(window).height();
|
||||
}
|
||||
}
|
||||
|
||||
menu.attr('style', style); // restore the original style
|
||||
menu.show();
|
||||
menu._size($.extend({}, mopts, {
|
||||
width: width,
|
||||
height: height,
|
||||
minWidth: mopts.minWidth || opts.minWidth,
|
||||
maxWidth: mopts.maxWidth || opts.maxWidth
|
||||
}));
|
||||
menu.find('.easyui-fluid').triggerHandler('_resize', [true]);
|
||||
menu.css('overflow', menu.outerHeight() < autoHeight ? 'auto' : 'hidden');
|
||||
menu.children('div.menu-line')._outerHeight(autoHeight-2);
|
||||
if (!isVisible){
|
||||
menu.hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* bind menu event
|
||||
*/
|
||||
function bindMenuEvent(target, menu){
|
||||
var state = $.data(target, 'menu');
|
||||
var opts = state.options;
|
||||
menu._unbind('.menu');
|
||||
for(var event in opts.events){
|
||||
menu._bind(event+'.menu', {target:target}, opts.events[event]);
|
||||
}
|
||||
}
|
||||
function mouseenterHandler(e){
|
||||
var target = e.data.target;
|
||||
var state = $.data(target, 'menu');
|
||||
if (state.timer){
|
||||
clearTimeout(state.timer);
|
||||
state.timer = null;
|
||||
}
|
||||
}
|
||||
function mouseleaveHandler(e){
|
||||
var target = e.data.target;
|
||||
var state = $.data(target, 'menu');
|
||||
if (state.options.hideOnUnhover){
|
||||
state.timer = setTimeout(function(){
|
||||
hideAll(target, $(target).hasClass('menu-inline'));
|
||||
}, state.options.duration);
|
||||
}
|
||||
}
|
||||
function mouseoverHandler(e){
|
||||
var target = e.data.target;
|
||||
var item = $(e.target).closest('.menu-item');
|
||||
if (item.length){
|
||||
item.siblings().each(function(){
|
||||
if (this.submenu){
|
||||
hideMenu(this.submenu);
|
||||
}
|
||||
$(this).removeClass('menu-active');
|
||||
});
|
||||
// show this menu
|
||||
item.addClass('menu-active');
|
||||
|
||||
if (item.hasClass('menu-item-disabled')){
|
||||
item.addClass('menu-active-disabled');
|
||||
return;
|
||||
}
|
||||
|
||||
var submenu = item[0].submenu;
|
||||
if (submenu){
|
||||
$(target).menu('show', {
|
||||
menu: submenu,
|
||||
parent: item
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function mouseoutHandler(e){
|
||||
var item = $(e.target).closest('.menu-item');
|
||||
if (item.length){
|
||||
item.removeClass('menu-active menu-active-disabled');
|
||||
var submenu = item[0].submenu;
|
||||
if (submenu){
|
||||
if (e.pageX>=parseInt(submenu.css('left'))){
|
||||
item.addClass('menu-active');
|
||||
} else {
|
||||
hideMenu(submenu);
|
||||
}
|
||||
} else {
|
||||
item.removeClass('menu-active');
|
||||
}
|
||||
}
|
||||
}
|
||||
function clickHandler(e){
|
||||
var target = e.data.target;
|
||||
var item = $(e.target).closest('.menu-item');
|
||||
if (item.length){
|
||||
var opts = $(target).data('menu').options;
|
||||
var itemOpts = item.data('menuitem').options;
|
||||
if (itemOpts.disabled){return;}
|
||||
if (!item[0].submenu){
|
||||
hideAll(target, opts.inline);
|
||||
if (itemOpts.href){
|
||||
location.href = itemOpts.href;
|
||||
}
|
||||
}
|
||||
item.trigger('mouseenter');
|
||||
opts.onClick.call(target, $(target).menu('getItem', item[0]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* hide top menu and it's all sub menus
|
||||
*/
|
||||
function hideAll(target, inline){
|
||||
var state = $.data(target, 'menu');
|
||||
if (state){
|
||||
if ($(target).is(':visible')){
|
||||
hideMenu($(target));
|
||||
if (inline){
|
||||
$(target).show();
|
||||
} else {
|
||||
state.options.onHide.call(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* show the menu, the 'param' object has one or more properties:
|
||||
* left: the left position to display
|
||||
* top: the top position to display
|
||||
* menu: the menu to display, if not defined, the 'target menu' is used
|
||||
* parent: the parent menu item to align to
|
||||
* alignTo: the element object to align to
|
||||
*/
|
||||
function showMenu(target, param){
|
||||
param = param || {};
|
||||
var left,top;
|
||||
var opts = $.data(target, 'menu').options;
|
||||
var menu = $(param.menu || target);
|
||||
$(target).menu('resize', menu[0]);
|
||||
if (menu.hasClass('menu-top')){
|
||||
$.extend(opts, param);
|
||||
left = opts.left;
|
||||
top = opts.top;
|
||||
if (opts.alignTo){
|
||||
var at = $(opts.alignTo);
|
||||
left = at.offset().left;
|
||||
top = at.offset().top + at._outerHeight();
|
||||
if (opts.align == 'right'){
|
||||
left += at.outerWidth() - menu.outerWidth();
|
||||
}
|
||||
}
|
||||
if (left + menu.outerWidth() > $(window)._outerWidth() + $(document)._scrollLeft()){
|
||||
left = $(window)._outerWidth() + $(document).scrollLeft() - menu.outerWidth() - 5;
|
||||
}
|
||||
if (left < 0){left = 0;}
|
||||
top = _fixTop(top, opts.alignTo);
|
||||
} else {
|
||||
var parent = param.parent; // the parent menu item
|
||||
left = parent.offset().left + parent.outerWidth() - 2;
|
||||
if (left + menu.outerWidth() + 5 > $(window)._outerWidth() + $(document).scrollLeft()){
|
||||
left = parent.offset().left - menu.outerWidth() + 2;
|
||||
}
|
||||
top = _fixTop(parent.offset().top - 3);
|
||||
}
|
||||
|
||||
function _fixTop(top, alignTo){
|
||||
if (top + menu.outerHeight() > $(window)._outerHeight() + $(document).scrollTop()){
|
||||
if (alignTo){
|
||||
top = $(alignTo).offset().top - menu._outerHeight();
|
||||
} else {
|
||||
top = $(window)._outerHeight() + $(document).scrollTop() - menu.outerHeight();
|
||||
}
|
||||
}
|
||||
if (top < 0){top = 0;}
|
||||
return top;
|
||||
}
|
||||
|
||||
menu.css(opts.position.call(target, menu[0], left, top));
|
||||
menu.show(0, function(){
|
||||
if (!menu[0].shadow){
|
||||
menu[0].shadow = $('<div class="menu-shadow"></div>').insertAfter(menu);
|
||||
}
|
||||
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')){
|
||||
opts.onShow.call(target);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hideMenu(menu){
|
||||
if (menu && menu.length){
|
||||
hideit(menu);
|
||||
menu.find('div.menu-item').each(function(){
|
||||
if (this.submenu){
|
||||
hideMenu(this.submenu);
|
||||
}
|
||||
$(this).removeClass('menu-active');
|
||||
});
|
||||
}
|
||||
|
||||
function hideit(m){
|
||||
m.stop(true,true);
|
||||
if (m[0].shadow){
|
||||
m[0].shadow.hide();
|
||||
}
|
||||
m.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function findItem(target, param){
|
||||
var result = null;
|
||||
var fn = $.isFunction(param) ? param : function(item){
|
||||
for(var p in param){
|
||||
if (item[p] != param[p]){
|
||||
return false;;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function find(menu){
|
||||
menu.children('div.menu-item').each(function(){
|
||||
var opts = $(this).data('menuitem').options;
|
||||
if (fn.call(target, opts) == true){
|
||||
result = $(target).menu('getItem', this);
|
||||
} else if (this.submenu && !result){
|
||||
find(this.submenu);
|
||||
}
|
||||
});
|
||||
}
|
||||
find($(target));
|
||||
return result;
|
||||
}
|
||||
|
||||
function setDisabled(target, itemEl, disabled){
|
||||
var t = $(itemEl);
|
||||
if (t.hasClass('menu-item')){
|
||||
var opts = t.data('menuitem').options;
|
||||
opts.disabled = disabled;
|
||||
if (disabled){
|
||||
t.addClass('menu-item-disabled');
|
||||
t[0].onclick = null;
|
||||
} else {
|
||||
t.removeClass('menu-item-disabled');
|
||||
t[0].onclick = opts.onclick;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function appendItem(target, param){
|
||||
var opts = $.data(target, 'menu').options;
|
||||
var menu = $(target);
|
||||
if (param.parent){
|
||||
if (!param.parent.submenu){
|
||||
var submenu = $('<div></div>').appendTo('body');
|
||||
param.parent.submenu = submenu;
|
||||
$('<div class="menu-rightarrow"></div>').appendTo(param.parent);
|
||||
createMenu(target, submenu);
|
||||
}
|
||||
menu = param.parent.submenu;
|
||||
}
|
||||
var div = $('<div></div>').appendTo(menu);
|
||||
createItem(target, div, param);
|
||||
}
|
||||
|
||||
function removeItem(target, itemEl){
|
||||
function removeit(el){
|
||||
if (el.submenu){
|
||||
el.submenu.children('div.menu-item').each(function(){
|
||||
removeit(this);
|
||||
});
|
||||
var shadow = el.submenu[0].shadow;
|
||||
if (shadow) shadow.remove();
|
||||
el.submenu.remove();
|
||||
}
|
||||
$(el).remove();
|
||||
}
|
||||
removeit(itemEl);
|
||||
}
|
||||
|
||||
function setVisible(target, itemEl, visible){
|
||||
var menu = $(itemEl).parent();
|
||||
if (visible){
|
||||
$(itemEl).show();
|
||||
} else {
|
||||
$(itemEl).hide();
|
||||
}
|
||||
setMenuSize(target, menu);
|
||||
}
|
||||
|
||||
function destroyMenu(target){
|
||||
$(target).children('div.menu-item').each(function(){
|
||||
removeItem(target, this);
|
||||
});
|
||||
if (target.shadow) target.shadow.remove();
|
||||
$(target).remove();
|
||||
}
|
||||
|
||||
$.fn.menu = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.menu.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'menu');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
state = $.data(this, 'menu', {
|
||||
options: $.extend({}, $.fn.menu.defaults, $.fn.menu.parseOptions(this), options)
|
||||
});
|
||||
init(this);
|
||||
}
|
||||
$(this).css({
|
||||
left: state.options.left,
|
||||
top: state.options.top
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.menu.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'menu').options;
|
||||
},
|
||||
show: function(jq, pos){
|
||||
return jq.each(function(){
|
||||
showMenu(this, pos);
|
||||
});
|
||||
},
|
||||
hide: function(jq){
|
||||
return jq.each(function(){
|
||||
hideAll(this);
|
||||
});
|
||||
},
|
||||
destroy: function(jq){
|
||||
return jq.each(function(){
|
||||
destroyMenu(this);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* set the menu item text
|
||||
* param: {
|
||||
* target: DOM object, indicate the menu item
|
||||
* text: string, the new text
|
||||
* }
|
||||
*/
|
||||
setText: function(jq, param){
|
||||
return jq.each(function(){
|
||||
var item = $(param.target).data('menuitem').options;
|
||||
item.text = param.text;
|
||||
$(param.target).children('div.menu-text').html(param.text);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* set the menu icon class
|
||||
* param: {
|
||||
* target: DOM object, indicate the menu item
|
||||
* iconCls: the menu item icon class
|
||||
* }
|
||||
*/
|
||||
setIcon: function(jq, param){
|
||||
return jq.each(function(){
|
||||
var item = $(param.target).data('menuitem').options;
|
||||
item.iconCls = param.iconCls;
|
||||
$(param.target).children('div.menu-icon').remove();
|
||||
if (param.iconCls){
|
||||
$('<div class="menu-icon"></div>').addClass(param.iconCls).appendTo(param.target);
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* get the menu item data that contains the following property:
|
||||
* {
|
||||
* target: DOM object, the menu item
|
||||
* id: the menu id
|
||||
* text: the menu item text
|
||||
* iconCls: the icon class
|
||||
* href: a remote address to redirect to
|
||||
* onclick: a function to be called when the item is clicked
|
||||
* }
|
||||
*/
|
||||
getItem: function(jq, itemEl){
|
||||
var item = $(itemEl).data('menuitem').options;
|
||||
return $.extend({}, item, {
|
||||
target: $(itemEl)[0]
|
||||
});
|
||||
},
|
||||
findItem: function(jq, text){
|
||||
if (typeof text == 'string'){
|
||||
return findItem(jq[0], function(item){
|
||||
return $('<div>'+item.text+'</div>').text() == text;
|
||||
});
|
||||
} else {
|
||||
return findItem(jq[0], text);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* append menu item, the param contains following properties:
|
||||
* parent,id,text,iconCls,href,onclick
|
||||
* when parent property is assigned, append menu item to it
|
||||
*/
|
||||
appendItem: function(jq, param){
|
||||
return jq.each(function(){
|
||||
appendItem(this, param);
|
||||
});
|
||||
},
|
||||
removeItem: function(jq, itemEl){
|
||||
return jq.each(function(){
|
||||
removeItem(this, itemEl);
|
||||
});
|
||||
},
|
||||
enableItem: function(jq, itemEl){
|
||||
return jq.each(function(){
|
||||
setDisabled(this, itemEl, false);
|
||||
});
|
||||
},
|
||||
disableItem: function(jq, itemEl){
|
||||
return jq.each(function(){
|
||||
setDisabled(this, itemEl, true);
|
||||
});
|
||||
},
|
||||
showItem: function(jq, itemEl){
|
||||
return jq.each(function(){
|
||||
setVisible(this, itemEl, true);
|
||||
});
|
||||
},
|
||||
hideItem: function(jq, itemEl){
|
||||
return jq.each(function(){
|
||||
setVisible(this, itemEl, false);
|
||||
});
|
||||
},
|
||||
resize: function(jq, menuEl){
|
||||
return jq.each(function(){
|
||||
setMenuSize(this, menuEl ? $(menuEl) : $(this));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.menu.parseOptions = function(target){
|
||||
return $.extend({}, $.parser.parseOptions(target, [
|
||||
{minWidth:'number',itemHeight:'number',duration:'number',hideOnUnhover:'boolean'},
|
||||
{fit:'boolean',inline:'boolean',noline:'boolean'}
|
||||
]));
|
||||
};
|
||||
|
||||
$.fn.menu.defaults = {
|
||||
zIndex:110000,
|
||||
left: 0,
|
||||
top: 0,
|
||||
alignTo: null,
|
||||
align: 'left',
|
||||
minWidth: 150,
|
||||
// itemHeight: 22,
|
||||
itemHeight: 32,
|
||||
duration: 100, // Defines duration time in milliseconds to hide when the mouse leaves the menu.
|
||||
hideOnUnhover: true, // Automatically hides the menu when mouse exits it
|
||||
inline: false, // true to stay inside its parent, false to go on top of all elements
|
||||
fit: false,
|
||||
noline: false,
|
||||
events: {
|
||||
mouseenter: mouseenterHandler,
|
||||
mouseleave: mouseleaveHandler,
|
||||
mouseover: mouseoverHandler,
|
||||
mouseout: mouseoutHandler,
|
||||
click: clickHandler
|
||||
},
|
||||
position: function(target, left, top){
|
||||
return {left:left,top:top}
|
||||
},
|
||||
onShow: function(){},
|
||||
onHide: function(){},
|
||||
onClick: function(item){}
|
||||
};
|
||||
})(jQuery);
|
||||
438
static/jeasyui/src/jquery.parser.js
Normal file
438
static/jeasyui/src/jquery.parser.js
Normal file
@@ -0,0 +1,438 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* parser - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
|
||||
(function($){
|
||||
$.easyui = {
|
||||
/**
|
||||
* Get the index of array item, return -1 when the item is not found.
|
||||
*/
|
||||
indexOfArray: function(a, o, id){
|
||||
for(var i=0,len=a.length; i<len; i++){
|
||||
if (id == undefined){
|
||||
if (a[i] == o){return i;}
|
||||
} else {
|
||||
if (a[i][o] == id){return i;}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
/**
|
||||
* Remove array item, 'o' parameter can be item object or id field name.
|
||||
* When 'o' parameter is the id field name, the 'id' parameter is valid.
|
||||
*/
|
||||
removeArrayItem: function(a, o, id){
|
||||
if (typeof o == 'string'){
|
||||
for(var i=0,len=a.length; i<len; i++){
|
||||
if (a[i][o] == id){
|
||||
a.splice(i, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var index = this.indexOfArray(a,o);
|
||||
if (index != -1){
|
||||
a.splice(index, 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Add un-duplicate array item, 'o' parameter is the id field name, if the 'r' object is exists, deny the action.
|
||||
*/
|
||||
addArrayItem: function(a, o, r){
|
||||
var index = this.indexOfArray(a, o, r ? r[o] : undefined);
|
||||
if (index == -1){
|
||||
a.push(r ? r : o);
|
||||
} else {
|
||||
a[index] = r ? r : o;
|
||||
}
|
||||
},
|
||||
getArrayItem: function(a, o, id){
|
||||
var index = this.indexOfArray(a, o, id);
|
||||
return index==-1 ? null : a[index];
|
||||
},
|
||||
forEach: function(data, deep, callback){
|
||||
var nodes = [];
|
||||
for(var i=0; i<data.length; i++){
|
||||
nodes.push(data[i]);
|
||||
}
|
||||
while(nodes.length){
|
||||
var node = nodes.shift();
|
||||
if (callback(node) == false){return;}
|
||||
if (deep && node.children){
|
||||
for(var i=node.children.length-1; i>=0; i--){
|
||||
nodes.unshift(node.children[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.parser = {
|
||||
auto: true,
|
||||
emptyFn: function(){},
|
||||
onComplete: function(context){},
|
||||
plugins:['draggable','droppable','resizable','pagination','tooltip',
|
||||
'linkbutton','menu','sidemenu','menubutton','splitbutton','switchbutton','progressbar','radiobutton','checkbox',
|
||||
'tree','textbox','passwordbox','maskedbox','filebox','combo','combobox','combotree','combogrid','combotreegrid','tagbox','numberbox','validatebox','searchbox',
|
||||
'spinner','numberspinner','timespinner','datetimespinner','calendar','datebox','datetimebox','timepicker','slider',
|
||||
'layout','panel','datagrid','propertygrid','treegrid','datalist','tabs','accordion','window','dialog','form'
|
||||
],
|
||||
parse: function(context){
|
||||
var aa = [];
|
||||
for(var i=0; i<$.parser.plugins.length; i++){
|
||||
var name = $.parser.plugins[i];
|
||||
var r = $('.easyui-' + name, context);
|
||||
if (r.length){
|
||||
if (r[name]){
|
||||
r.each(function(){
|
||||
$(this)[name]($.data(this, 'options')||{});
|
||||
});
|
||||
} else {
|
||||
aa.push({name:name,jq:r});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aa.length && window.easyloader){
|
||||
var names = [];
|
||||
for(var i=0; i<aa.length; i++){
|
||||
names.push(aa[i].name);
|
||||
}
|
||||
easyloader.load(names, function(){
|
||||
for(var i=0; i<aa.length; i++){
|
||||
var name = aa[i].name;
|
||||
var jq = aa[i].jq;
|
||||
jq.each(function(){
|
||||
$(this)[name]($.data(this, 'options')||{});
|
||||
});
|
||||
}
|
||||
$.parser.onComplete.call($.parser, context);
|
||||
});
|
||||
} else {
|
||||
$.parser.onComplete.call($.parser, context);
|
||||
}
|
||||
},
|
||||
|
||||
parseValue: function(property, value, parent, delta){
|
||||
delta = delta || 0;
|
||||
var v = $.trim(String(value||''));
|
||||
var endchar = v.substr(v.length-1, 1);
|
||||
if (endchar == '%'){
|
||||
v = parseFloat(v.substr(0, v.length-1));
|
||||
if (property.toLowerCase().indexOf('width') >= 0){
|
||||
delta += parent[0].offsetWidth-parent[0].clientWidth;
|
||||
v = Math.floor((parent.width()-delta) * v / 100.0);
|
||||
} else {
|
||||
delta += parent[0].offsetHeight-parent[0].clientHeight;
|
||||
v = Math.floor((parent.height()-delta) * v / 100.0);
|
||||
}
|
||||
} else {
|
||||
v = parseInt(v) || undefined;
|
||||
}
|
||||
return v;
|
||||
},
|
||||
|
||||
/**
|
||||
* parse options, including standard 'data-options' attribute.
|
||||
*
|
||||
* calling examples:
|
||||
* $.parser.parseOptions(target);
|
||||
* $.parser.parseOptions(target, ['id','title','width',{fit:'boolean',border:'boolean'},{min:'number'}]);
|
||||
*/
|
||||
parseOptions: function(target, properties){
|
||||
var t = $(target);
|
||||
var options = {};
|
||||
|
||||
var s = $.trim(t.attr('data-options'));
|
||||
if (s){
|
||||
if (s.substring(0, 1) != '{'){
|
||||
s = '{' + s + '}';
|
||||
}
|
||||
options = (new Function('return ' + s))();
|
||||
}
|
||||
$.map(['width','height','left','top','minWidth','maxWidth','minHeight','maxHeight'], function(p){
|
||||
var pv = $.trim(target.style[p] || '');
|
||||
if (pv){
|
||||
if (pv.indexOf('%') == -1){
|
||||
pv = parseInt(pv);
|
||||
if (isNaN(pv)){
|
||||
pv = undefined;
|
||||
}
|
||||
}
|
||||
options[p] = pv;
|
||||
}
|
||||
});
|
||||
|
||||
if (properties){
|
||||
var opts = {};
|
||||
for(var i=0; i<properties.length; i++){
|
||||
var pp = properties[i];
|
||||
if (typeof pp == 'string'){
|
||||
opts[pp] = t.attr(pp);
|
||||
} else {
|
||||
for(var name in pp){
|
||||
var type = pp[name];
|
||||
if (type == 'boolean'){
|
||||
opts[name] = t.attr(name) ? (t.attr(name) == 'true') : undefined;
|
||||
} else if (type == 'number'){
|
||||
opts[name] = t.attr(name)=='0' ? 0 : parseFloat(t.attr(name)) || undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$.extend(options, opts);
|
||||
}
|
||||
return options;
|
||||
},
|
||||
parseVars: function(){
|
||||
var d = $('<div style="position:absolute;top:-1000px;width:100px;height:100px;padding:5px"></div>').appendTo('body');
|
||||
$._boxModel = d.outerWidth()!=100;
|
||||
d.remove();
|
||||
d = $('<div style="position:fixed"></div>').appendTo('body');
|
||||
$._positionFixed = (d.css('position') == 'fixed');
|
||||
d.remove();
|
||||
}
|
||||
};
|
||||
$(function(){
|
||||
$.parser.parseVars();
|
||||
if (!window.easyloader && $.parser.auto){
|
||||
$.parser.parse();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* extend plugin to set box model width
|
||||
*/
|
||||
$.fn._outerWidth = function(width){
|
||||
if (width == undefined){
|
||||
if (this[0] == window){
|
||||
return this.width() || document.body.clientWidth;
|
||||
}
|
||||
return this.outerWidth()||0;
|
||||
}
|
||||
return this._size('width', width);
|
||||
};
|
||||
|
||||
/**
|
||||
* extend plugin to set box model height
|
||||
*/
|
||||
$.fn._outerHeight = function(height){
|
||||
if (height == undefined){
|
||||
if (this[0] == window){
|
||||
return this.height() || document.body.clientHeight;
|
||||
}
|
||||
return this.outerHeight()||0;
|
||||
}
|
||||
return this._size('height', height);
|
||||
};
|
||||
|
||||
$.fn._scrollLeft = function(left){
|
||||
if (left == undefined){
|
||||
return this.scrollLeft();
|
||||
} else {
|
||||
return this.each(function(){$(this).scrollLeft(left)});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn._propAttr = $.fn.prop || $.fn.attr;
|
||||
$.fn._bind = $.fn.on;
|
||||
$.fn._unbind = $.fn.off;
|
||||
|
||||
$.fn._size = function(options, parent){
|
||||
if (typeof options == 'string'){
|
||||
if (options == 'clear'){
|
||||
return this.each(function(){
|
||||
$(this).css({width:'',minWidth:'',maxWidth:'',height:'',minHeight:'',maxHeight:''});
|
||||
});
|
||||
} else if (options == 'fit'){
|
||||
return this.each(function(){
|
||||
_fit(this, this.tagName=='BODY' ? $('body') : $(this).parent(), true);
|
||||
});
|
||||
} else if (options == 'unfit'){
|
||||
return this.each(function(){
|
||||
_fit(this, $(this).parent(), false);
|
||||
});
|
||||
} else {
|
||||
if (parent == undefined){
|
||||
return _css(this[0], options);
|
||||
} else {
|
||||
return this.each(function(){
|
||||
_css(this, options, parent);
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return this.each(function(){
|
||||
parent = parent || $(this).parent();
|
||||
$.extend(options, _fit(this, parent, options.fit)||{});
|
||||
var r1 = _setSize(this, 'width', parent, options);
|
||||
var r2 = _setSize(this, 'height', parent, options);
|
||||
if (r1 || r2){
|
||||
$(this).addClass('easyui-fluid');
|
||||
} else {
|
||||
$(this).removeClass('easyui-fluid');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function _fit(target, parent, fit){
|
||||
if (!parent.length){return false;}
|
||||
var t = $(target)[0];
|
||||
var p = parent[0];
|
||||
var fcount = p.fcount || 0;
|
||||
if (fit){
|
||||
if (!t.fitted){
|
||||
t.fitted = true;
|
||||
p.fcount = fcount + 1;
|
||||
$(p).addClass('panel-noscroll');
|
||||
if (p.tagName == 'BODY'){
|
||||
$('html').addClass('panel-fit');
|
||||
}
|
||||
}
|
||||
return {
|
||||
width: ($(p).width()||1),
|
||||
height: ($(p).height()||1)
|
||||
};
|
||||
} else {
|
||||
if (t.fitted){
|
||||
t.fitted = false;
|
||||
p.fcount = fcount - 1;
|
||||
if (p.fcount == 0){
|
||||
$(p).removeClass('panel-noscroll');
|
||||
if (p.tagName == 'BODY'){
|
||||
$('html').removeClass('panel-fit');
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function _setSize(target, property, parent, options){
|
||||
var t = $(target);
|
||||
var p = property;
|
||||
var p1 = p.substr(0,1).toUpperCase() + p.substr(1);
|
||||
var min = $.parser.parseValue('min'+p1, options['min'+p1], parent);// || 0;
|
||||
var max = $.parser.parseValue('max'+p1, options['max'+p1], parent);// || 99999;
|
||||
var val = $.parser.parseValue(p, options[p], parent);
|
||||
var fluid = (String(options[p]||'').indexOf('%') >= 0 ? true : false);
|
||||
|
||||
if (!isNaN(val)){
|
||||
var v = Math.min(Math.max(val, min||0), max||99999);
|
||||
if (!fluid){
|
||||
options[p] = v;
|
||||
}
|
||||
t._size('min'+p1, '');
|
||||
t._size('max'+p1, '');
|
||||
t._size(p, v);
|
||||
} else {
|
||||
t._size(p, '');
|
||||
t._size('min'+p1, min);
|
||||
t._size('max'+p1, max);
|
||||
}
|
||||
return fluid || options.fit;
|
||||
}
|
||||
function _css(target, property, value){
|
||||
var t = $(target);
|
||||
if (value == undefined){
|
||||
value = parseInt(target.style[property]);
|
||||
if (isNaN(value)){return undefined;}
|
||||
if ($._boxModel){
|
||||
value += getDeltaSize();
|
||||
}
|
||||
return value;
|
||||
} else if (value === ''){
|
||||
t.css(property, '');
|
||||
} else {
|
||||
if ($._boxModel){
|
||||
value -= getDeltaSize();
|
||||
if (value < 0){value = 0;}
|
||||
}
|
||||
t.css(property, value+'px');
|
||||
}
|
||||
function getDeltaSize(){
|
||||
if (property.toLowerCase().indexOf('width') >= 0){
|
||||
return t.outerWidth() - t.width();
|
||||
} else {
|
||||
return t.outerHeight() - t.height();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
/**
|
||||
* support for mobile devices
|
||||
*/
|
||||
(function($){
|
||||
var longTouchTimer = null;
|
||||
var dblTouchTimer = null;
|
||||
var isDblClick = false;
|
||||
|
||||
function onTouchStart(e){
|
||||
if (e.touches.length != 1){return}
|
||||
if (!isDblClick){
|
||||
isDblClick = true;
|
||||
dblClickTimer = setTimeout(function(){
|
||||
isDblClick = false;
|
||||
}, 500);
|
||||
} else {
|
||||
clearTimeout(dblClickTimer);
|
||||
isDblClick = false;
|
||||
fire(e, 'dblclick');
|
||||
// e.preventDefault();
|
||||
}
|
||||
longTouchTimer = setTimeout(function(){
|
||||
fire(e, 'contextmenu', 3);
|
||||
}, 1000);
|
||||
fire(e, 'mousedown');
|
||||
if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
function onTouchMove(e){
|
||||
if (e.touches.length != 1){return}
|
||||
if (longTouchTimer){
|
||||
clearTimeout(longTouchTimer);
|
||||
}
|
||||
fire(e, 'mousemove');
|
||||
if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
function onTouchEnd(e){
|
||||
// if (e.touches.length > 0){return}
|
||||
if (longTouchTimer){
|
||||
clearTimeout(longTouchTimer);
|
||||
}
|
||||
fire(e, 'mouseup');
|
||||
if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
function fire(e, name, which){
|
||||
var event = new $.Event(name);
|
||||
event.pageX = e.changedTouches[0].pageX;
|
||||
event.pageY = e.changedTouches[0].pageY;
|
||||
event.which = which || 1;
|
||||
$(e.target).trigger(event);
|
||||
}
|
||||
|
||||
if (document.addEventListener){
|
||||
document.addEventListener("touchstart", onTouchStart, true);
|
||||
document.addEventListener("touchmove", onTouchMove, true);
|
||||
document.addEventListener("touchend", onTouchEnd, true);
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
107
static/jeasyui/src/jquery.progressbar.js
Normal file
107
static/jeasyui/src/jquery.progressbar.js
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* progressbar - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* none
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function init(target){
|
||||
$(target).addClass('progressbar');
|
||||
$(target).html('<div class="progressbar-text"></div><div class="progressbar-value"><div class="progressbar-text"></div></div>');
|
||||
$(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;
|
||||
},
|
||||
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);
|
||||
526
static/jeasyui/src/jquery.propertygrid.js
Normal file
526
static/jeasyui/src/jquery.propertygrid.js
Normal file
@@ -0,0 +1,526 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* propertygrid - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* datagrid
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
var currTarget;
|
||||
$(document)._unbind('.propertygrid')._bind('mousedown.propertygrid', function(e){
|
||||
var p = $(e.target).closest('div.datagrid-view,div.combo-panel');
|
||||
if (p.length){return;}
|
||||
stopEditing(currTarget);
|
||||
currTarget = undefined;
|
||||
});
|
||||
|
||||
function buildGrid(target){
|
||||
var state = $.data(target, 'propertygrid');
|
||||
var opts = $.data(target, 'propertygrid').options;
|
||||
$(target).datagrid($.extend({}, opts, {
|
||||
cls:'propertygrid',
|
||||
view:(opts.showGroup ? opts.groupView : opts.view),
|
||||
onBeforeEdit:function(index, row){
|
||||
if (opts.onBeforeEdit.call(target, index, row) == false){return false;}
|
||||
var dg = $(this);
|
||||
var row = dg.datagrid('getRows')[index];
|
||||
var col = dg.datagrid('getColumnOption', 'value');
|
||||
col.editor = row.editor;
|
||||
},
|
||||
onClickCell:function(index, field, value){
|
||||
if (currTarget != this){
|
||||
stopEditing(currTarget);
|
||||
currTarget = this;
|
||||
}
|
||||
if (opts.editIndex != index){
|
||||
stopEditing(currTarget);
|
||||
$(this).datagrid('beginEdit', index);
|
||||
var ed = $(this).datagrid('getEditor', {index:index,field:field});
|
||||
if (!ed){
|
||||
ed = $(this).datagrid('getEditor', {index:index,field:'value'});
|
||||
}
|
||||
if (ed){
|
||||
var t = $(ed.target);
|
||||
var input = t.data('textbox') ? t.textbox('textbox') : t;
|
||||
input.focus();
|
||||
opts.editIndex = index;
|
||||
}
|
||||
}
|
||||
opts.onClickCell.call(target, index, field, value);
|
||||
},
|
||||
loadFilter:function(data){
|
||||
stopEditing(this);
|
||||
return opts.loadFilter.call(this, data);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
function stopEditing(target){
|
||||
var t = $(target);
|
||||
if (!t.length){return}
|
||||
var opts = $.data(target, 'propertygrid').options;
|
||||
opts.finder.getTr(target, null, 'editing').each(function(){
|
||||
var index = parseInt($(this).attr('datagrid-row-index'));
|
||||
if (t.datagrid('validateRow', index)){
|
||||
t.datagrid('endEdit', index);
|
||||
} else {
|
||||
t.datagrid('cancelEdit', index);
|
||||
}
|
||||
});
|
||||
opts.editIndex = undefined;
|
||||
}
|
||||
|
||||
$.fn.propertygrid = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
var method = $.fn.propertygrid.methods[options];
|
||||
if (method){
|
||||
return method(this, param);
|
||||
} else {
|
||||
return this.datagrid(options, param);
|
||||
}
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'propertygrid');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
var opts = $.extend({}, $.fn.propertygrid.defaults, $.fn.propertygrid.parseOptions(this), options);
|
||||
opts.frozenColumns = $.extend(true, [], opts.frozenColumns);
|
||||
opts.columns = $.extend(true, [], opts.columns);
|
||||
$.data(this, 'propertygrid', {
|
||||
options: opts
|
||||
});
|
||||
}
|
||||
buildGrid(this);
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.propertygrid.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'propertygrid').options;
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.propertygrid.parseOptions = function(target){
|
||||
return $.extend({}, $.fn.datagrid.parseOptions(target), $.parser.parseOptions(target,[{showGroup:'boolean'}]));
|
||||
};
|
||||
|
||||
// the group view definition
|
||||
var groupview = $.extend({}, $.fn.datagrid.defaults.view, {
|
||||
render: function(target, container, frozen){
|
||||
var table = [];
|
||||
var groups = this.groups;
|
||||
for(var i=0; i<groups.length; i++){
|
||||
table.push(this.renderGroup.call(this, target, i, groups[i], frozen));
|
||||
}
|
||||
$(container).html(table.join(''));
|
||||
},
|
||||
|
||||
renderGroup: function(target, groupIndex, group, frozen){
|
||||
var state = $.data(target, 'datagrid');
|
||||
var opts = state.options;
|
||||
var fields = $(target).datagrid('getColumnFields', frozen);
|
||||
var hasFrozen = opts.frozenColumns && opts.frozenColumns.length;
|
||||
|
||||
if (frozen){
|
||||
if (!(opts.rownumbers || hasFrozen)){
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
var table = [];
|
||||
|
||||
var css = opts.groupStyler.call(target, group.value, group.rows);
|
||||
var cs = parseCss(css, 'datagrid-group');
|
||||
table.push('<div group-index=' + groupIndex + ' ' + cs + '>');
|
||||
if ((frozen && (opts.rownumbers || opts.frozenColumns.length)) ||
|
||||
(!frozen && !(opts.rownumbers || opts.frozenColumns.length))){
|
||||
table.push('<span class="datagrid-group-expander">');
|
||||
table.push('<span class="datagrid-row-expander datagrid-row-collapse"> </span>');
|
||||
table.push('</span>');
|
||||
}
|
||||
if ((frozen && hasFrozen) || (!frozen)){
|
||||
table.push('<span class="datagrid-group-title">');
|
||||
table.push(opts.groupFormatter.call(target, group.value, group.rows));
|
||||
table.push('</span>');
|
||||
}
|
||||
table.push('</div>');
|
||||
|
||||
table.push('<table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0"><tbody>');
|
||||
var index = group.startIndex;
|
||||
for(var j=0; j<group.rows.length; j++) {
|
||||
var css = opts.rowStyler ? opts.rowStyler.call(target, index, group.rows[j]) : '';
|
||||
var classValue = '';
|
||||
var styleValue = '';
|
||||
if (typeof css == 'string'){
|
||||
styleValue = css;
|
||||
} else if (css){
|
||||
classValue = css['class'] || '';
|
||||
styleValue = css['style'] || '';
|
||||
}
|
||||
|
||||
var cls = 'class="datagrid-row ' + (index % 2 && opts.striped ? 'datagrid-row-alt ' : ' ') + classValue + '"';
|
||||
var style = styleValue ? 'style="' + styleValue + '"' : '';
|
||||
var rowId = state.rowIdPrefix + '-' + (frozen?1:2) + '-' + index;
|
||||
table.push('<tr id="' + rowId + '" datagrid-row-index="' + index + '" ' + cls + ' ' + style + '>');
|
||||
table.push(this.renderRow.call(this, target, fields, frozen, index, group.rows[j]));
|
||||
table.push('</tr>');
|
||||
index++;
|
||||
}
|
||||
table.push('</tbody></table>');
|
||||
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<rows.length; i++){
|
||||
var row = rows[i];
|
||||
var group = getGroup(row[opts.groupField]);
|
||||
if (!group){
|
||||
group = {
|
||||
value: row[opts.groupField],
|
||||
rows: [row]
|
||||
};
|
||||
groups.push(group);
|
||||
} else {
|
||||
group.rows.push(row);
|
||||
}
|
||||
}
|
||||
|
||||
var index = 0;
|
||||
var newRows = [];
|
||||
for(var i=0; i<groups.length; i++){
|
||||
var group = groups[i];
|
||||
group.startIndex = index;
|
||||
index += group.rows.length;
|
||||
newRows = newRows.concat(group.rows);
|
||||
}
|
||||
|
||||
state.data.rows = newRows;
|
||||
this.groups = groups;
|
||||
|
||||
var that = this;
|
||||
setTimeout(function(){
|
||||
that.bindEvents(target);
|
||||
},0);
|
||||
|
||||
function getGroup(value){
|
||||
for(var i=0; i<groups.length; i++){
|
||||
var group = groups[i];
|
||||
if (group.value == value){
|
||||
return group;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function initCss(){
|
||||
if (!$('#datagrid-group-style').length){
|
||||
$('head').append(
|
||||
'<style id="datagrid-group-style">' +
|
||||
'.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-group-expander .datagrid-row-expander{margin:'+Math.floor((opts.groupHeight-16)/2)+'px 0;display:inline-block;width:16px;height:16px;cursor:pointer}' +
|
||||
'</style>'
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
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 opts = $(this).datagrid('options');
|
||||
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');
|
||||
if (opts.onExpandGroup){
|
||||
opts.onExpandGroup.call(this, groupIndex);
|
||||
}
|
||||
});
|
||||
},
|
||||
collapseGroup:function(jq, groupIndex){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).datagrid('options');
|
||||
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');
|
||||
if (opts.onCollapseGroup){
|
||||
opts.onCollapseGroup.call(this, groupIndex);
|
||||
}
|
||||
});
|
||||
},
|
||||
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();
|
||||
var ww = dc.body2.children('table.datagrid-btable:first').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<this.groups.length; i++){
|
||||
if (this.groups[i].value == row[opts.groupField]){
|
||||
group = this.groups[i];
|
||||
groupIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (group){
|
||||
if (index == undefined || index == null){
|
||||
index = state.data.rows.length;
|
||||
}
|
||||
if (index < group.startIndex){
|
||||
index = group.startIndex;
|
||||
} else if (index > 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<this.groups.length; i++){
|
||||
body.children('div.datagrid-group[group-index='+i+']').attr('group-index', i-1);
|
||||
}
|
||||
this.groups.splice(groupIndex, 1);
|
||||
}
|
||||
|
||||
this.setGroupIndex(target);
|
||||
},
|
||||
|
||||
setGroupIndex: function(target){
|
||||
var index = 0;
|
||||
for(var i=0; i<this.groups.length; i++){
|
||||
var group = this.groups[i];
|
||||
group.startIndex = index;
|
||||
index += group.rows.length;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// end of group view definition
|
||||
|
||||
$.fn.propertygrid.defaults = $.extend({}, $.fn.datagrid.defaults, {
|
||||
groupHeight:28,
|
||||
expanderWidth:20,
|
||||
singleSelect:true,
|
||||
remoteSort:false,
|
||||
fitColumns:true,
|
||||
loadMsg:'',
|
||||
frozenColumns:[[
|
||||
{field:'f',width:20,resizable:false}
|
||||
]],
|
||||
columns:[[
|
||||
{field:'name',title:'Name',width:100,sortable:true},
|
||||
{field:'value',title:'Value',width:100,resizable:false}
|
||||
]],
|
||||
|
||||
showGroup:false,
|
||||
groupView:groupview,
|
||||
groupField:'group',
|
||||
groupStyler: function(value,rows){return ''},
|
||||
groupFormatter:function(fvalue,rows){return fvalue}
|
||||
});
|
||||
})(jQuery);
|
||||
228
static/jeasyui/src/jquery.resizable.js
Normal file
228
static/jeasyui/src/jquery.resizable.js
Normal file
@@ -0,0 +1,228 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* resizable - EasyUI for jQuery
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function resize(e){
|
||||
var resizeData = e.data;
|
||||
var options = $.data(resizeData.target, 'resizable').options;
|
||||
if (resizeData.dir.indexOf('e') != -1) {
|
||||
var width = resizeData.startWidth + e.pageX - resizeData.startX;
|
||||
width = Math.min(
|
||||
Math.max(width, options.minWidth),
|
||||
options.maxWidth
|
||||
);
|
||||
resizeData.width = width;
|
||||
}
|
||||
if (resizeData.dir.indexOf('s') != -1) {
|
||||
var height = resizeData.startHeight + e.pageY - resizeData.startY;
|
||||
height = Math.min(
|
||||
Math.max(height, options.minHeight),
|
||||
options.maxHeight
|
||||
);
|
||||
resizeData.height = height;
|
||||
}
|
||||
if (resizeData.dir.indexOf('w') != -1) {
|
||||
var width = resizeData.startWidth - e.pageX + resizeData.startX;
|
||||
width = Math.min(
|
||||
Math.max(width, options.minWidth),
|
||||
options.maxWidth
|
||||
);
|
||||
resizeData.width = width;
|
||||
resizeData.left = resizeData.startLeft + resizeData.startWidth - resizeData.width;
|
||||
}
|
||||
if (resizeData.dir.indexOf('n') != -1) {
|
||||
var height = resizeData.startHeight - e.pageY + resizeData.startY;
|
||||
height = Math.min(
|
||||
Math.max(height, options.minHeight),
|
||||
options.maxHeight
|
||||
);
|
||||
resizeData.height = height;
|
||||
resizeData.top = resizeData.startTop + resizeData.startHeight - resizeData.height;
|
||||
}
|
||||
}
|
||||
|
||||
function applySize(e){
|
||||
var resizeData = e.data;
|
||||
var t = $(resizeData.target);
|
||||
t.css({
|
||||
left: resizeData.left,
|
||||
top: resizeData.top
|
||||
});
|
||||
if (t.outerWidth() != resizeData.width){t._outerWidth(resizeData.width)}
|
||||
if (t.outerHeight() != resizeData.height){t._outerHeight(resizeData.height)}
|
||||
}
|
||||
|
||||
function doDown(e){
|
||||
$.fn.resizable.isResizing = true;
|
||||
$.data(e.data.target, 'resizable').options.onStartResize.call(e.data.target, e);
|
||||
return false;
|
||||
}
|
||||
|
||||
function doMove(e){
|
||||
resize(e);
|
||||
if ($.data(e.data.target, 'resizable').options.onResize.call(e.data.target, e) != false){
|
||||
applySize(e)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function doUp(e){
|
||||
$.fn.resizable.isResizing = false;
|
||||
resize(e, true);
|
||||
applySize(e);
|
||||
$.data(e.data.target, 'resizable').options.onStopResize.call(e.data.target, e);
|
||||
$(document)._unbind('.resizable');
|
||||
$('body').css('cursor','');
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the resize direction
|
||||
function getDirection(e) {
|
||||
var opts = $(e.data.target).resizable('options');
|
||||
var tt = $(e.data.target);
|
||||
var dir = '';
|
||||
var offset = tt.offset();
|
||||
var width = tt.outerWidth();
|
||||
var height = tt.outerHeight();
|
||||
var edge = opts.edge;
|
||||
if (e.pageY > offset.top && e.pageY < offset.top + edge) {
|
||||
dir += 'n';
|
||||
} else if (e.pageY < offset.top + height && e.pageY > offset.top + height - edge) {
|
||||
dir += 's';
|
||||
}
|
||||
if (e.pageX > offset.left && e.pageX < offset.left + edge) {
|
||||
dir += 'w';
|
||||
} else if (e.pageX < offset.left + width && e.pageX > offset.left + width - edge) {
|
||||
dir += 'e';
|
||||
}
|
||||
|
||||
var handles = opts.handles.split(',');
|
||||
handles = $.map(handles, function(h){return $.trim(h).toLowerCase();});
|
||||
if ($.inArray('all', handles) >= 0 || $.inArray(dir, handles) >= 0){
|
||||
return dir;
|
||||
}
|
||||
for(var i=0; i<dir.length; i++){
|
||||
var index = $.inArray(dir.substr(i,1), handles);
|
||||
if (index >= 0){
|
||||
return handles[index];
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
$.fn.resizable = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.resizable.methods[options](this, param);
|
||||
}
|
||||
|
||||
return this.each(function(){
|
||||
var opts = null;
|
||||
var state = $.data(this, 'resizable');
|
||||
if (state) {
|
||||
$(this)._unbind('.resizable');
|
||||
opts = $.extend(state.options, options || {});
|
||||
} else {
|
||||
opts = $.extend({}, $.fn.resizable.defaults, $.fn.resizable.parseOptions(this), options || {});
|
||||
$.data(this, 'resizable', {
|
||||
options:opts
|
||||
});
|
||||
}
|
||||
|
||||
if (opts.disabled == true) {
|
||||
return;
|
||||
}
|
||||
$(this)._bind('mousemove.resizable', {target:this}, function(e){
|
||||
if ($.fn.resizable.isResizing){return}
|
||||
var dir = getDirection(e);
|
||||
$(e.data.target).css('cursor', dir ? dir+'-resize' : '');
|
||||
})._bind('mouseleave.resizable', {target:this}, function(e){
|
||||
$(e.data.target).css('cursor', '');
|
||||
})._bind('mousedown.resizable', {target:this}, function(e){
|
||||
var dir = getDirection(e);
|
||||
if (dir == ''){return;}
|
||||
|
||||
function getCssValue(css) {
|
||||
var val = parseInt($(e.data.target).css(css));
|
||||
if (isNaN(val)) {
|
||||
return 0;
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
var data = {
|
||||
target: e.data.target,
|
||||
dir: dir,
|
||||
startLeft: getCssValue('left'),
|
||||
startTop: getCssValue('top'),
|
||||
left: getCssValue('left'),
|
||||
top: getCssValue('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', data, doDown);
|
||||
$(document)._bind('mousemove.resizable', data, doMove);
|
||||
$(document)._bind('mouseup.resizable', data, doUp);
|
||||
$('body').css('cursor', dir+'-resize');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.resizable.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'resizable').options;
|
||||
},
|
||||
enable: function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).resizable({disabled:false});
|
||||
});
|
||||
},
|
||||
disable: function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).resizable({disabled:true});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.resizable.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({},
|
||||
$.parser.parseOptions(target, [
|
||||
'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,//$(document).width(),
|
||||
maxHeight: 10000,//$(document).height(),
|
||||
edge:5,
|
||||
onStartResize: function(e){},
|
||||
onResize: function(e){},
|
||||
onStopResize: function(e){}
|
||||
};
|
||||
|
||||
$.fn.resizable.isResizing = false;
|
||||
|
||||
})(jQuery);
|
||||
455
static/jeasyui/src/jquery.slider.js
Normal file
455
static/jeasyui/src/jquery.slider.js
Normal file
@@ -0,0 +1,455 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* slider - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* draggable
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function init(target){
|
||||
var slider = $('<div class="slider">' +
|
||||
'<div class="slider-inner">' +
|
||||
'<a href="javascript:;" class="slider-handle"></a>' +
|
||||
'<span class="slider-tip"></span>' +
|
||||
'</div>' +
|
||||
'<div class="slider-rule"></div>' +
|
||||
'<div class="slider-rulelabel"></div>' +
|
||||
'<div style="clear:both"></div>' +
|
||||
'<input type="hidden" class="slider-value">' +
|
||||
'</div>').insertAfter(target);
|
||||
var t = $(target);
|
||||
t.addClass('slider-f').hide();
|
||||
var name = t.attr('name');
|
||||
if (name){
|
||||
slider.find('input.slider-value').attr('name', name);
|
||||
t.removeAttr('name').attr('sliderName', name);
|
||||
}
|
||||
slider._bind('_resize', function(e,force){
|
||||
if ($(this).hasClass('easyui-fluid') || force){
|
||||
setSize(target);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return slider;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the slider size, for vertical slider, the height property is required
|
||||
*/
|
||||
function setSize(target, param){
|
||||
var state = $.data(target, 'slider');
|
||||
var opts = state.options;
|
||||
var slider = state.slider;
|
||||
|
||||
if (param){
|
||||
if (param.width) opts.width = param.width;
|
||||
if (param.height) opts.height = param.height;
|
||||
}
|
||||
slider._size(opts);
|
||||
if (opts.mode == 'h'){
|
||||
slider.css('height', '');
|
||||
slider.children('div').css('height', '');
|
||||
} else {
|
||||
slider.css('width', '');
|
||||
slider.children('div').css('width', '');
|
||||
slider.children('div.slider-rule,div.slider-rulelabel,div.slider-inner')._outerHeight(slider._outerHeight());
|
||||
}
|
||||
initValue(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* show slider rule if needed
|
||||
*/
|
||||
function showRule(target){
|
||||
var state = $.data(target, 'slider');
|
||||
var opts = state.options;
|
||||
var slider = state.slider;
|
||||
|
||||
var aa = opts.mode == 'h' ? opts.rule : opts.rule.slice(0).reverse();
|
||||
if (opts.reversed){
|
||||
aa = aa.slice(0).reverse();
|
||||
}
|
||||
_build(aa);
|
||||
|
||||
function _build(aa){
|
||||
var rule = slider.find('div.slider-rule');
|
||||
var label = slider.find('div.slider-rulelabel');
|
||||
rule.empty();
|
||||
label.empty();
|
||||
for(var i=0; i<aa.length; i++){
|
||||
var distance = i*100/(aa.length-1)+'%';
|
||||
var span = $('<span></span>').appendTo(rule);
|
||||
span.css((opts.mode=='h'?'left':'top'), distance);
|
||||
|
||||
// show the labels
|
||||
if (aa[i] != '|'){
|
||||
span = $('<span></span>').appendTo(label);
|
||||
span.html(aa[i]);
|
||||
if (opts.mode == 'h'){
|
||||
span.css({
|
||||
left: distance,
|
||||
marginLeft: -Math.round(span.outerWidth()/2)
|
||||
});
|
||||
} else {
|
||||
span.css({
|
||||
top: distance,
|
||||
marginTop: -Math.round(span.outerHeight()/2)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* build the slider and set some properties
|
||||
*/
|
||||
function buildSlider(target){
|
||||
var state = $.data(target, 'slider');
|
||||
var opts = state.options;
|
||||
var slider = state.slider;
|
||||
|
||||
slider.removeClass('slider-h slider-v slider-disabled');
|
||||
slider.addClass(opts.mode == 'h' ? 'slider-h' : 'slider-v');
|
||||
slider.addClass(opts.disabled ? 'slider-disabled' : '');
|
||||
|
||||
var inner = slider.find('.slider-inner');
|
||||
inner.html(
|
||||
'<a href="javascript:;" class="slider-handle"></a>' +
|
||||
'<span class="slider-tip"></span>'
|
||||
);
|
||||
if (opts.range){
|
||||
inner.append(
|
||||
'<a href="javascript:;" class="slider-handle"></a>' +
|
||||
'<span class="slider-tip"></span>'
|
||||
);
|
||||
}
|
||||
|
||||
slider.find('a.slider-handle').draggable({
|
||||
axis:opts.mode,
|
||||
cursor:'pointer',
|
||||
disabled: opts.disabled,
|
||||
onDrag:function(e){
|
||||
var left = e.data.left;
|
||||
var width = slider.width();
|
||||
if (opts.mode!='h'){
|
||||
left = e.data.top;
|
||||
width = slider.height();
|
||||
}
|
||||
if (left < 0 || left > width) {
|
||||
return false;
|
||||
} else {
|
||||
setPos(left, this);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
onStartDrag:function(){
|
||||
state.isDragging = true;
|
||||
opts.onSlideStart.call(target, opts.value);
|
||||
},
|
||||
onStopDrag:function(e){
|
||||
setPos(opts.mode=='h'?e.data.left:e.data.top, this);
|
||||
opts.onSlideEnd.call(target, opts.value);
|
||||
opts.onComplete.call(target, opts.value);
|
||||
state.isDragging = false;
|
||||
}
|
||||
});
|
||||
slider.find('div.slider-inner')._unbind('.slider')._bind('mousedown.slider', function(e){
|
||||
if (state.isDragging || opts.disabled){return}
|
||||
var pos = $(this).offset();
|
||||
setPos(opts.mode=='h'?(e.pageX-pos.left):(e.pageY-pos.top));
|
||||
opts.onComplete.call(target, opts.value);
|
||||
});
|
||||
|
||||
function fixVal(value){
|
||||
var dd = String(opts.step).split('.');
|
||||
var dlen = dd.length>1 ? dd[1].length : 0;
|
||||
return parseFloat(value.toFixed(dlen));
|
||||
}
|
||||
|
||||
function setPos(pos, handle){
|
||||
var value = pos2value(target, pos);
|
||||
var s = Math.abs(value % opts.step);
|
||||
if (s < opts.step/2){
|
||||
value -= s;
|
||||
} else {
|
||||
value = value - s + opts.step;
|
||||
}
|
||||
value = fixVal(value);
|
||||
if (opts.range){
|
||||
var v1 = opts.value[0];
|
||||
var v2 = opts.value[1];
|
||||
var m = parseFloat((v1+v2)/2);
|
||||
if (handle){
|
||||
var isLeft = $(handle).nextAll('.slider-handle').length > 0;
|
||||
if (value <= v2 && isLeft){
|
||||
v1 = value;
|
||||
} else if (value >= v1 && (!isLeft)){
|
||||
v2 = value;
|
||||
}
|
||||
} else {
|
||||
if (value < v1){
|
||||
v1 = value;
|
||||
} else if (value > v2){
|
||||
v2 = value;
|
||||
} else {
|
||||
value < m ? v1 = value : v2 = value;
|
||||
}
|
||||
}
|
||||
$(target).slider('setValues', [v1,v2]);
|
||||
} else {
|
||||
$(target).slider('setValue', value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set a specified value to slider
|
||||
*/
|
||||
function setValues(target, values){
|
||||
var state = $.data(target, 'slider');
|
||||
var opts = state.options;
|
||||
var slider = state.slider;
|
||||
var oldValues = $.isArray(opts.value) ? opts.value : [opts.value];
|
||||
var newValues = [];
|
||||
|
||||
if (!$.isArray(values)){
|
||||
values = $.map(String(values).split(opts.separator), function(v){
|
||||
return parseFloat(v);
|
||||
});
|
||||
}
|
||||
|
||||
slider.find('.slider-value').remove();
|
||||
var name = $(target).attr('sliderName') || '';
|
||||
for(var i=0; i<values.length; i++){
|
||||
var value = values[i];
|
||||
if (value < opts.min) value = opts.min;
|
||||
if (value > opts.max) value = opts.max;
|
||||
|
||||
var input = $('<input type="hidden" class="slider-value">').appendTo(slider);
|
||||
input.attr('name', name);
|
||||
input.val(value);
|
||||
newValues.push(value);
|
||||
|
||||
var handle = slider.find('.slider-handle:eq('+i+')');
|
||||
var tip = handle.next();
|
||||
var pos = value2pos(target, value);
|
||||
if (opts.showTip){
|
||||
tip.show();
|
||||
tip.html(opts.tipFormatter.call(target, value));
|
||||
} else {
|
||||
tip.hide();
|
||||
}
|
||||
|
||||
if (opts.mode == 'h'){
|
||||
var style = 'left:'+pos+'px;';
|
||||
handle.attr('style', style);
|
||||
tip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth()/2)) + 'px');
|
||||
} else {
|
||||
var style = 'top:' + pos + 'px;';
|
||||
handle.attr('style', style);
|
||||
tip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth())) + 'px');
|
||||
}
|
||||
}
|
||||
opts.value = opts.range ? newValues : newValues[0];
|
||||
$(target).val(opts.range ? newValues.join(opts.separator) : newValues[0]);
|
||||
|
||||
if (oldValues.join(',') != newValues.join(',')){
|
||||
opts.onChange.call(target, opts.value, (opts.range?oldValues:oldValues[0]));
|
||||
}
|
||||
}
|
||||
|
||||
function initValue(target){
|
||||
var opts = $.data(target, 'slider').options;
|
||||
var fn = opts.onChange;
|
||||
opts.onChange = function(){};
|
||||
setValues(target, opts.value);
|
||||
opts.onChange = fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* translate value to slider position
|
||||
*/
|
||||
function value2pos(target, value){
|
||||
var state = $.data(target, 'slider');
|
||||
var opts = state.options;
|
||||
var slider = state.slider;
|
||||
var size = opts.mode == 'h' ? slider.width() : slider.height();
|
||||
var pos = opts.converter.toPosition.call(target, value, size);
|
||||
if (opts.mode == 'v'){
|
||||
pos = slider.height() - pos;
|
||||
}
|
||||
if (opts.reversed){
|
||||
pos = size - pos;
|
||||
}
|
||||
return pos;
|
||||
// return pos.toFixed(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* translate slider position to value
|
||||
*/
|
||||
function pos2value(target, pos){
|
||||
var state = $.data(target, 'slider');
|
||||
var opts = state.options;
|
||||
var slider = state.slider;
|
||||
var size = opts.mode == 'h' ? slider.width() : slider.height();
|
||||
var pos = opts.mode=='h' ? (opts.reversed?(size-pos):pos) : (opts.reversed?pos:(size-pos));
|
||||
var value = opts.converter.toValue.call(target, pos, size);
|
||||
return value;
|
||||
// return value.toFixed(0);
|
||||
}
|
||||
|
||||
$.fn.slider = function(options, param){
|
||||
if (typeof options == 'string'){
|
||||
return $.fn.slider.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'slider');
|
||||
if (state){
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
state = $.data(this, 'slider', {
|
||||
options: $.extend({}, $.fn.slider.defaults, $.fn.slider.parseOptions(this), options),
|
||||
slider: init(this)
|
||||
});
|
||||
// $(this).removeAttr('disabled');
|
||||
$(this)._propAttr('disabled', false);
|
||||
}
|
||||
|
||||
var opts = state.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;
|
||||
|
||||
buildSlider(this);
|
||||
showRule(this);
|
||||
setSize(this);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.slider.methods = {
|
||||
options: function(jq){
|
||||
return $.data(jq[0], 'slider').options;
|
||||
},
|
||||
destroy: function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this, 'slider').slider.remove();
|
||||
$(this).remove();
|
||||
});
|
||||
},
|
||||
resize: function(jq, param){
|
||||
return jq.each(function(){
|
||||
setSize(this, param);
|
||||
});
|
||||
},
|
||||
getValue: function(jq){
|
||||
return jq.slider('options').value;
|
||||
},
|
||||
getValues: function(jq){
|
||||
return jq.slider('options').value;
|
||||
},
|
||||
setValue: function(jq, value){
|
||||
return jq.each(function(){
|
||||
setValues(this, [value]);
|
||||
});
|
||||
},
|
||||
setValues: function(jq, values){
|
||||
return jq.each(function(){
|
||||
setValues(this, values);
|
||||
});
|
||||
},
|
||||
clear: function(jq){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).slider('options');
|
||||
setValues(this, opts.range?[opts.min,opts.max]:[opts.min]);
|
||||
});
|
||||
},
|
||||
reset: function(jq){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).slider('options');
|
||||
$(this).slider(opts.range?'setValues':'setValue', opts.originalValue);
|
||||
});
|
||||
},
|
||||
enable: function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this, 'slider').options.disabled = false;
|
||||
buildSlider(this);
|
||||
});
|
||||
},
|
||||
disable: function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this, 'slider').options.disabled = true;
|
||||
buildSlider(this);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.slider.parseOptions = function(target){
|
||||
var t = $(target);
|
||||
return $.extend({}, $.parser.parseOptions(target, [
|
||||
'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', // 'h'(horizontal) or 'v'(vertical)
|
||||
reversed: false,
|
||||
showTip: false,
|
||||
disabled: false,
|
||||
range: false,
|
||||
value: 0,
|
||||
separator: ',',
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 1,
|
||||
rule: [], // [0,'|',100]
|
||||
tipFormatter: function(value){return value},
|
||||
converter:{
|
||||
toPosition:function(value, size){
|
||||
var opts = $(this).slider('options');
|
||||
var p = (value-opts.min)/(opts.max-opts.min)*size;
|
||||
return p;
|
||||
},
|
||||
toValue:function(pos, size){
|
||||
var opts = $(this).slider('options');
|
||||
var v = opts.min + (opts.max-opts.min)*(pos/size);
|
||||
return v;
|
||||
}
|
||||
},
|
||||
onChange: function(value, oldValue){},
|
||||
onSlideStart: function(value){},
|
||||
onSlideEnd: function(value){},
|
||||
onComplete: function(value){}
|
||||
};
|
||||
})(jQuery);
|
||||
934
static/jeasyui/src/jquery.tabs.js
Normal file
934
static/jeasyui/src/jquery.tabs.js
Normal file
@@ -0,0 +1,934 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* tabs - EasyUI for jQuery
|
||||
*
|
||||
* Dependencies:
|
||||
* panel
|
||||
* linkbutton
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
function getContentWidth(c){
|
||||
var w = 0;
|
||||
$(c).children().each(function(){
|
||||
w += $(this).outerWidth(true);
|
||||
});
|
||||
return w;
|
||||
}
|
||||
/**
|
||||
* set the tabs scrollers to show or not,
|
||||
* dependent on the tabs count and width
|
||||
*/
|
||||
function setScrollers(container) {
|
||||
var opts = $.data(container, 'tabs').options;
|
||||
if (!opts.showHeader){return}
|
||||
|
||||
var header = $(container).children('div.tabs-header');
|
||||
var tool = header.children('div.tabs-tool:not(.tabs-tool-hidden)');
|
||||
var sLeft = header.children('div.tabs-scroller-left');
|
||||
var sRight = header.children('div.tabs-scroller-right');
|
||||
var wrap = header.children('div.tabs-wrap');
|
||||
|
||||
if (opts.tabPosition == 'left' || opts.tabPosition == 'right'){
|
||||
if (!tool.length){return}
|
||||
tool._outerWidth(header.width());
|
||||
var toolCss = {
|
||||
left: opts.tabPosition == 'left' ? 'auto':0,
|
||||
right: opts.tabPosition == 'left' ? 0 : 'auto',
|
||||
top: opts.toolPosition == 'top' ? 0 : 'auto',
|
||||
bottom: opts.toolPosition == 'top' ? 'auto' : 0
|
||||
};
|
||||
var wrapCss = {
|
||||
marginTop: opts.toolPosition == 'top' ? tool.outerHeight() : 0
|
||||
};
|
||||
tool.css(toolCss);
|
||||
wrap.css(wrapCss);
|
||||
return;
|
||||
}
|
||||
|
||||
// set the tool height
|
||||
var tHeight = header.outerHeight();
|
||||
if (opts.plain){
|
||||
tHeight -= tHeight - header.height();
|
||||
}
|
||||
tool._outerHeight(tHeight);
|
||||
|
||||
var tabsWidth = getContentWidth(header.find('ul.tabs'));
|
||||
var cWidth = header.width() - tool._outerWidth();
|
||||
|
||||
if (tabsWidth > cWidth) {
|
||||
sLeft.add(sRight).show()._outerHeight(tHeight);
|
||||
if (opts.toolPosition == 'left'){
|
||||
tool.css({
|
||||
left: sLeft.outerWidth(),
|
||||
right: ''
|
||||
});
|
||||
wrap.css({
|
||||
marginLeft: sLeft.outerWidth() + tool._outerWidth(),
|
||||
marginRight: sRight._outerWidth(),
|
||||
width: cWidth - sLeft.outerWidth() - sRight.outerWidth()
|
||||
});
|
||||
} else {
|
||||
tool.css({
|
||||
left: '',
|
||||
right: sRight.outerWidth()
|
||||
});
|
||||
wrap.css({
|
||||
marginLeft: sLeft.outerWidth(),
|
||||
marginRight: sRight.outerWidth() + tool._outerWidth(),
|
||||
width: cWidth - sLeft.outerWidth() - sRight.outerWidth()
|
||||
});
|
||||
}
|
||||
} else {
|
||||
sLeft.add(sRight).hide();
|
||||
if (opts.toolPosition == 'left'){
|
||||
tool.css({
|
||||
left: 0,
|
||||
right: ''
|
||||
});
|
||||
wrap.css({
|
||||
marginLeft: tool._outerWidth(),
|
||||
marginRight: 0,
|
||||
width: cWidth
|
||||
});
|
||||
} else {
|
||||
tool.css({
|
||||
left: '',
|
||||
right: 0
|
||||
});
|
||||
wrap.css({
|
||||
marginLeft: 0,
|
||||
marginRight: tool._outerWidth(),
|
||||
width: cWidth
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addTools(container){
|
||||
var opts = $.data(container, 'tabs').options;
|
||||
var header = $(container).children('div.tabs-header');
|
||||
if (opts.tools) {
|
||||
if (typeof opts.tools == 'string'){
|
||||
$(opts.tools).addClass('tabs-tool').appendTo(header);
|
||||
$(opts.tools).show();
|
||||
} else {
|
||||
header.children('div.tabs-tool').remove();
|
||||
var tools = $('<div class="tabs-tool"><table cellspacing="0" cellpadding="0" style="height:100%"><tr></tr></table></div>').appendTo(header);
|
||||
var tr = tools.find('tr');
|
||||
for(var i=0; i<opts.tools.length; i++){
|
||||
var td = $('<td></td>').appendTo(tr);
|
||||
var tool = $('<a href="javascript:;"></a>').appendTo(td);
|
||||
tool[0].onclick = eval(opts.tools[i].handler || function(){});
|
||||
tool.linkbutton($.extend({}, opts.tools[i], {
|
||||
plain: true
|
||||
}));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
header.children('div.tabs-tool').remove();
|
||||
}
|
||||
}
|
||||
|
||||
function setSize(container, param) {
|
||||
var state = $.data(container, 'tabs');
|
||||
var opts = state.options;
|
||||
var cc = $(container);
|
||||
|
||||
if (!opts.doSize){return}
|
||||
if (param){
|
||||
$.extend(opts, {
|
||||
width: param.width,
|
||||
height: param.height
|
||||
});
|
||||
}
|
||||
cc._size(opts);
|
||||
|
||||
var header = cc.children('div.tabs-header');
|
||||
var panels = cc.children('div.tabs-panels');
|
||||
var wrap = header.find('div.tabs-wrap');
|
||||
var ul = wrap.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 (opts.tabPosition == 'left' || opts.tabPosition == 'right'){
|
||||
header._outerWidth(opts.showHeader ? opts.headerWidth : 0);
|
||||
panels._outerWidth(cc.width() - header.outerWidth());
|
||||
header.add(panels)._size('height', isNaN(parseInt(opts.height)) ? '' : cc.height());
|
||||
wrap._outerWidth(header.width());
|
||||
ul._outerWidth(wrap.width()).css('height','');
|
||||
} else {
|
||||
header.children('div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)').css('display', opts.showHeader?'block':'none');
|
||||
header._outerWidth(cc.width()).css('height','');
|
||||
if (opts.showHeader){
|
||||
header.css('background-color','');
|
||||
wrap.css('height','');
|
||||
} else {
|
||||
header.css('background-color','transparent');
|
||||
header._outerHeight(0);
|
||||
wrap._outerHeight(0);
|
||||
}
|
||||
ul._outerHeight(opts.tabHeight).css('width','');
|
||||
ul._outerHeight(ul.outerHeight()-ul.height()-1+opts.tabHeight).css('width','');
|
||||
|
||||
panels._size('height', isNaN(parseInt(opts.height)) ? '' : (cc.height()-header.outerHeight()));
|
||||
panels._size('width', cc.width());
|
||||
}
|
||||
|
||||
if (state.tabs.length){
|
||||
var d1 = ul.outerWidth(true) - ul.width();
|
||||
var li = ul.children('li:first');
|
||||
var d2 = li.outerWidth(true) - li.width();
|
||||
var hwidth = header.width() - header.children('.tabs-tool:not(.tabs-tool-hidden)')._outerWidth();
|
||||
var justifiedWidth = Math.floor((hwidth-d1-d2*state.tabs.length)/state.tabs.length);
|
||||
|
||||
$.map(state.tabs, function(p){
|
||||
setTabSize(p, (opts.justified && $.inArray(opts.tabPosition,['top','bottom'])>=0) ? justifiedWidth : undefined);
|
||||
});
|
||||
if (opts.justified && $.inArray(opts.tabPosition,['top','bottom'])>=0){
|
||||
var deltaWidth = hwidth - d1 - getContentWidth(ul);
|
||||
setTabSize(state.tabs[state.tabs.length-1], justifiedWidth+deltaWidth);
|
||||
}
|
||||
}
|
||||
setScrollers(container);
|
||||
|
||||
function setTabSize(p, width){
|
||||
var p_opts = p.panel('options');
|
||||
var p_t = p_opts.tab.find('.tabs-inner');
|
||||
var width = width ? width : (parseInt(p_opts.tabWidth||opts.tabWidth||undefined));
|
||||
if (width){
|
||||
p_t._outerWidth(width);
|
||||
} 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');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set selected tab panel size
|
||||
*/
|
||||
function setSelectedSize(container){
|
||||
var opts = $.data(container, 'tabs').options;
|
||||
var tab = getSelectedTab(container);
|
||||
if (tab){
|
||||
var panels = $(container).children('div.tabs-panels');
|
||||
var width = opts.width=='auto' ? 'auto' : panels.width();
|
||||
var height = opts.height=='auto' ? 'auto' : panels.height();
|
||||
tab.panel('resize', {
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* wrap the tabs header and body
|
||||
*/
|
||||
function wrapTabs(container) {
|
||||
var tabs = $.data(container, 'tabs').tabs;
|
||||
var cc = $(container).addClass('tabs-container');
|
||||
var panels = $('<div class="tabs-panels"></div>').insertBefore(cc);
|
||||
cc.children('div').each(function(){
|
||||
panels[0].appendChild(this);
|
||||
});
|
||||
cc[0].appendChild(panels[0]);
|
||||
$('<div class="tabs-header">'
|
||||
+ '<div class="tabs-scroller-left"></div>'
|
||||
+ '<div class="tabs-scroller-right"></div>'
|
||||
+ '<div class="tabs-wrap">'
|
||||
+ '<ul class="tabs"></ul>'
|
||||
+ '</div>'
|
||||
+ '</div>').prependTo(container);
|
||||
|
||||
cc.children('div.tabs-panels').children('div').each(function(i){
|
||||
var opts = $.extend({}, $.parser.parseOptions(this), {
|
||||
disabled: ($(this).attr('disabled') ? true : undefined),
|
||||
selected: ($(this).attr('selected') ? true : undefined)
|
||||
});
|
||||
createTab(container, 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.children('div.tabs-header').find('.tabs-scroller-left, .tabs-scroller-right')._bind('mouseenter', function(){
|
||||
$(this).addClass('tabs-scroller-over');
|
||||
})._bind('mouseleave', function(){
|
||||
$(this).removeClass('tabs-scroller-over');
|
||||
});
|
||||
cc._bind('_resize', function(e,force){
|
||||
if ($(this).hasClass('easyui-fluid') || force){
|
||||
setSize(container);
|
||||
setSelectedSize(container);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function bindEvents(container){
|
||||
var state = $.data(container, 'tabs')
|
||||
var opts = state.options;
|
||||
$(container).children('div.tabs-header')._unbind()._bind('click', function(e){
|
||||
if ($(e.target).hasClass('tabs-scroller-left')){
|
||||
$(container).tabs('scrollBy', -opts.scrollIncrement);
|
||||
} else if ($(e.target).hasClass('tabs-scroller-right')){
|
||||
$(container).tabs('scrollBy', opts.scrollIncrement);
|
||||
} else {
|
||||
var li = $(e.target).closest('li');
|
||||
if (li.hasClass('tabs-disabled')){return false;}
|
||||
var a = $(e.target).closest('.tabs-close');
|
||||
if (a.length){
|
||||
closeTab(container, getLiIndex(li));
|
||||
} else if (li.length){
|
||||
// selectTab(container, getLiIndex(li));
|
||||
var index = getLiIndex(li);
|
||||
var popts = state.tabs[index].panel('options');
|
||||
if (popts.collapsible){
|
||||
popts.closed ? selectTab(container, index) : unselectTab(container, index);
|
||||
} else {
|
||||
selectTab(container, index);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
})._bind('contextmenu', function(e){
|
||||
var li = $(e.target).closest('li');
|
||||
if (li.hasClass('tabs-disabled')){return;}
|
||||
if (li.length){
|
||||
opts.onContextMenu.call(container, e, li.find('span.tabs-title').html(), getLiIndex(li));
|
||||
}
|
||||
});
|
||||
|
||||
function getLiIndex(li){
|
||||
var index = 0;
|
||||
li.parent().children('li').each(function(i){
|
||||
if (li[0] == this){
|
||||
index = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
function setProperties(container){
|
||||
var opts = $.data(container, 'tabs').options;
|
||||
var header = $(container).children('div.tabs-header');
|
||||
var panels = $(container).children('div.tabs-panels');
|
||||
|
||||
header.removeClass('tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right');
|
||||
panels.removeClass('tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right');
|
||||
if (opts.tabPosition == 'top'){
|
||||
header.insertBefore(panels);
|
||||
} else if (opts.tabPosition == 'bottom'){
|
||||
header.insertAfter(panels);
|
||||
header.addClass('tabs-header-bottom');
|
||||
panels.addClass('tabs-panels-top');
|
||||
} else if (opts.tabPosition == 'left'){
|
||||
header.addClass('tabs-header-left');
|
||||
panels.addClass('tabs-panels-right');
|
||||
} else if (opts.tabPosition == 'right'){
|
||||
header.addClass('tabs-header-right');
|
||||
panels.addClass('tabs-panels-left');
|
||||
}
|
||||
|
||||
if (opts.plain == true) {
|
||||
header.addClass('tabs-header-plain');
|
||||
} else {
|
||||
header.removeClass('tabs-header-plain');
|
||||
}
|
||||
header.removeClass('tabs-header-narrow').addClass(opts.narrow?'tabs-header-narrow':'');
|
||||
var tabs = header.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){
|
||||
header.removeClass('tabs-header-noborder');
|
||||
panels.removeClass('tabs-panels-noborder');
|
||||
} else {
|
||||
header.addClass('tabs-header-noborder');
|
||||
panels.addClass('tabs-panels-noborder');
|
||||
}
|
||||
opts.doSize = true;
|
||||
}
|
||||
|
||||
function createTab(container, options, pp) {
|
||||
options = options || {};
|
||||
var state = $.data(container, 'tabs');
|
||||
var tabs = state.tabs;
|
||||
if (options.index == undefined || options.index > tabs.length){options.index = tabs.length}
|
||||
if (options.index < 0){options.index = 0}
|
||||
|
||||
var ul = $(container).children('div.tabs-header').find('ul.tabs');
|
||||
var panels = $(container).children('div.tabs-panels');
|
||||
var tab = $(
|
||||
'<li>' +
|
||||
// '<a href="javascript:;" class="tabs-inner">' +
|
||||
'<span class="tabs-inner">' +
|
||||
'<span class="tabs-title"></span>' +
|
||||
'<span class="tabs-icon"></span>' +
|
||||
'</span>' +
|
||||
'</li>');
|
||||
if (!pp){pp = $('<div></div>');}
|
||||
if (options.index >= tabs.length){
|
||||
tab.appendTo(ul);
|
||||
pp.appendTo(panels);
|
||||
tabs.push(pp);
|
||||
} else {
|
||||
tab.insertBefore(ul.children('li:eq('+options.index+')'));
|
||||
pp.insertBefore(panels.children('div.panel:eq('+options.index+')'));
|
||||
tabs.splice(options.index, 0, pp);
|
||||
}
|
||||
|
||||
// create panel
|
||||
pp.panel($.extend({}, options, {
|
||||
tab: tab,
|
||||
border: false,
|
||||
noheader: true,
|
||||
closed: true,
|
||||
doSize: false,
|
||||
iconCls: (options.icon ? options.icon : undefined),
|
||||
onLoad: function(){
|
||||
if (options.onLoad){
|
||||
options.onLoad.apply(this, arguments);
|
||||
}
|
||||
state.options.onLoad.call(container, $(this));
|
||||
},
|
||||
onBeforeOpen: function(){
|
||||
if (options.onBeforeOpen){
|
||||
if (options.onBeforeOpen.call(this) == false){return false;}
|
||||
}
|
||||
var p = $(container).tabs('getSelected');
|
||||
if (p){
|
||||
if (p[0] != this){
|
||||
$(container).tabs('unselect', getTabIndex(container, p));
|
||||
p = $(container).tabs('getSelected');
|
||||
if (p){
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
setSelectedSize(container);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var popts = $(this).panel('options');
|
||||
popts.tab.addClass('tabs-selected');
|
||||
// scroll the tab to center position if required.
|
||||
var wrap = $(container).find('>div.tabs-header>div.tabs-wrap');
|
||||
var left = popts.tab.position().left;
|
||||
var right = left + popts.tab.outerWidth();
|
||||
if (left < 0 || right > wrap.width()){
|
||||
var deltaX = left - (wrap.width()-popts.tab.width()) / 2;
|
||||
$(container).tabs('scrollBy', deltaX);
|
||||
} else {
|
||||
$(container).tabs('scrollBy', 0);
|
||||
}
|
||||
|
||||
var panel = $(this).panel('panel');
|
||||
panel.css('display','block');
|
||||
setSelectedSize(container);
|
||||
panel.css('display','none');
|
||||
},
|
||||
onOpen: function(){
|
||||
if (options.onOpen){
|
||||
options.onOpen.call(this);
|
||||
}
|
||||
var popts = $(this).panel('options');
|
||||
var index = getTabIndex(container, this);
|
||||
// state.selectHis.push(popts.title);
|
||||
state.selectHis.push(index);
|
||||
state.options.onSelect.call(container, popts.title, index);
|
||||
},
|
||||
onBeforeClose: function(){
|
||||
if (options.onBeforeClose){
|
||||
if (options.onBeforeClose.call(this) == false){return false;}
|
||||
}
|
||||
$(this).panel('options').tab.removeClass('tabs-selected');
|
||||
},
|
||||
onClose: function(){
|
||||
if (options.onClose){
|
||||
options.onClose.call(this);
|
||||
}
|
||||
var popts = $(this).panel('options');
|
||||
state.options.onUnselect.call(container, popts.title, getTabIndex(container, this));
|
||||
}
|
||||
}));
|
||||
|
||||
// only update the tab header
|
||||
$(container).tabs('update', {
|
||||
tab: pp,
|
||||
options: pp.panel('options'),
|
||||
type: 'header'
|
||||
});
|
||||
}
|
||||
|
||||
function addTab(container, options) {
|
||||
var state = $.data(container, 'tabs');
|
||||
var opts = state.options;
|
||||
if (options.selected == undefined) options.selected = true;
|
||||
|
||||
createTab(container, options);
|
||||
opts.onAdd.call(container, options.title, options.index);
|
||||
if (options.selected){
|
||||
selectTab(container, options.index); // select the added tab panel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* update tab panel, param has following properties:
|
||||
* tab: the tab panel to be updated
|
||||
* options: the tab panel options
|
||||
* type: the update type, possible values are: 'header','body','all'
|
||||
*/
|
||||
function updateTab(container, param){
|
||||
param.type = param.type || 'all';
|
||||
var selectHis = $.data(container, 'tabs').selectHis;
|
||||
var pp = param.tab; // the tab panel
|
||||
var opts = pp.panel('options'); // get the tab panel options
|
||||
var oldTitle = opts.title;
|
||||
$.extend(opts, param.options, {
|
||||
iconCls: (param.options.icon ? param.options.icon : undefined)
|
||||
});
|
||||
|
||||
if (param.type == 'all' || param.type == 'body'){
|
||||
pp.panel();
|
||||
}
|
||||
if (param.type == 'all' || param.type == 'header'){
|
||||
var tab = opts.tab;
|
||||
|
||||
if (opts.header){
|
||||
tab.find('.tabs-inner').html($(opts.header));
|
||||
} else {
|
||||
var s_title = tab.find('span.tabs-title');
|
||||
var s_icon = tab.find('span.tabs-icon');
|
||||
s_title.html(opts.title);
|
||||
s_icon.attr('class', 'tabs-icon');
|
||||
|
||||
tab.find('.tabs-close').remove();
|
||||
if (opts.closable){
|
||||
s_title.addClass('tabs-closable');
|
||||
// $('<a href="javascript:;" class="tabs-close"></a>').appendTo(tab);
|
||||
$('<span class="tabs-close"></span>').appendTo(tab);
|
||||
} else{
|
||||
s_title.removeClass('tabs-closable');
|
||||
}
|
||||
if (opts.iconCls){
|
||||
s_title.addClass('tabs-with-icon');
|
||||
s_icon.addClass(opts.iconCls);
|
||||
} else {
|
||||
s_title.removeClass('tabs-with-icon');
|
||||
}
|
||||
if (opts.tools){
|
||||
var p_tool = tab.find('span.tabs-p-tool');
|
||||
if (!p_tool.length){
|
||||
var p_tool = $('<span class="tabs-p-tool"></span>').insertAfter(tab.find('.tabs-inner'));
|
||||
}
|
||||
if ($.isArray(opts.tools)){
|
||||
p_tool.empty();
|
||||
for(var i=0; i<opts.tools.length; i++){
|
||||
var t = $('<a href="javascript:;"></a>').appendTo(p_tool);
|
||||
t.addClass(opts.tools[i].iconCls);
|
||||
if (opts.tools[i].handler){
|
||||
t._bind('click', {handler:opts.tools[i].handler}, function(e){
|
||||
if ($(this).parents('li').hasClass('tabs-disabled')){return;}
|
||||
e.data.handler.call(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$(opts.tools).children().appendTo(p_tool);
|
||||
}
|
||||
var pr = p_tool.children().length * 12;
|
||||
if (opts.closable) {
|
||||
pr += 8;
|
||||
p_tool.css('right', '');
|
||||
} else {
|
||||
pr -= 3;
|
||||
p_tool.css('right','5px');
|
||||
}
|
||||
s_title.css('padding-right', pr+'px');
|
||||
} else {
|
||||
tab.find('span.tabs-p-tool').remove();
|
||||
s_title.css('padding-right', '');
|
||||
}
|
||||
}
|
||||
// if (oldTitle != opts.title){
|
||||
// for(var i=0; i<selectHis.length; i++){
|
||||
// if (selectHis[i] == oldTitle){
|
||||
// selectHis[i] = opts.title;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
if (opts.disabled){
|
||||
opts.tab.addClass('tabs-disabled');
|
||||
} else {
|
||||
opts.tab.removeClass('tabs-disabled');
|
||||
}
|
||||
|
||||
setSize(container);
|
||||
|
||||
$.data(container, 'tabs').options.onUpdate.call(container, opts.title, getTabIndex(container, pp));
|
||||
}
|
||||
|
||||
/**
|
||||
* close a tab with specified index or title
|
||||
*/
|
||||
function closeTab(container, which) {
|
||||
var state = $.data(container, 'tabs');
|
||||
var opts = state.options;
|
||||
var tabs = state.tabs;
|
||||
var selectHis = state.selectHis;
|
||||
|
||||
if (!exists(container, which)) return;
|
||||
|
||||
var tab = getTab(container, which);
|
||||
var title = tab.panel('options').title;
|
||||
var index = getTabIndex(container, tab);
|
||||
|
||||
if (opts.onBeforeClose.call(container, title, index) == false) return;
|
||||
|
||||
var tab = getTab(container, which, true);
|
||||
tab.panel('options').tab.remove();
|
||||
tab.panel('destroy');
|
||||
|
||||
opts.onClose.call(container, title, index);
|
||||
|
||||
// setScrollers(container);
|
||||
setSize(container);
|
||||
|
||||
// remove the select history item
|
||||
var his = [];
|
||||
for(var i=0; i<selectHis.length; i++){
|
||||
var tindex = selectHis[i];
|
||||
if (tindex != index){
|
||||
his.push(tindex > index ? tindex-1 : tindex);
|
||||
}
|
||||
}
|
||||
state.selectHis = his;
|
||||
var selected = $(container).tabs('getSelected');
|
||||
if (!selected && his.length){
|
||||
index = state.selectHis.pop();
|
||||
$(container).tabs('select', index);
|
||||
}
|
||||
|
||||
// for(var i=0; i<selectHis.length; i++){
|
||||
// if (selectHis[i] == title){
|
||||
// selectHis.splice(i, 1);
|
||||
// i --;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // select the nearest tab panel
|
||||
// var hisTitle = selectHis.pop();
|
||||
// if (hisTitle){
|
||||
// selectTab(container, hisTitle);
|
||||
// } else if (tabs.length){
|
||||
// selectTab(container, 0);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* get the specified tab panel
|
||||
*/
|
||||
function getTab(container, which, removeit){
|
||||
var tabs = $.data(container, 'tabs').tabs;
|
||||
var tab = null;
|
||||
if (typeof which == 'number'){
|
||||
if (which >=0 && which < tabs.length){
|
||||
tab = tabs[which];
|
||||
if (removeit){
|
||||
tabs.splice(which, 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var tmp = $('<span></span>');
|
||||
for(var i=0; i<tabs.length; i++){
|
||||
var p = tabs[i];
|
||||
tmp.html(p.panel('options').title);
|
||||
var title = tmp.text();
|
||||
tmp.html(which);
|
||||
which = tmp.text();
|
||||
if (title == which){
|
||||
tab = p;
|
||||
if (removeit){
|
||||
tabs.splice(i, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
tmp.remove();
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
|
||||
function getTabIndex(container, tab){
|
||||
var tabs = $.data(container, 'tabs').tabs;
|
||||
for(var i=0; i<tabs.length; i++){
|
||||
if (tabs[i][0] == $(tab)[0]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function getSelectedTab(container){
|
||||
var tabs = $.data(container, 'tabs').tabs;
|
||||
for(var i=0; i<tabs.length; i++){
|
||||
var tab = tabs[i];
|
||||
if (tab.panel('options').tab.hasClass('tabs-selected')){
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* do first select action, if no tab is setted the first tab will be selected.
|
||||
*/
|
||||
function doFirstSelect(container){
|
||||
var state = $.data(container, 'tabs')
|
||||
var tabs = state.tabs;
|
||||
for(var i=0; i<tabs.length; i++){
|
||||
var opts = tabs[i].panel('options');
|
||||
if (opts.selected && !opts.disabled){
|
||||
selectTab(container, i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
selectTab(container, state.options.selected);
|
||||
}
|
||||
|
||||
function selectTab(container, which){
|
||||
var p = getTab(container, which);
|
||||
if (p && !p.is(':visible')){
|
||||
stopAnimate(container);
|
||||
if (!p.panel('options').disabled){
|
||||
p.panel('open');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unselectTab(container, which){
|
||||
var p = getTab(container, which);
|
||||
if (p && p.is(':visible')){
|
||||
stopAnimate(container);
|
||||
p.panel('close');
|
||||
}
|
||||
}
|
||||
|
||||
function stopAnimate(container){
|
||||
$(container).children('div.tabs-panels').each(function(){
|
||||
$(this).stop(true, true);
|
||||
});
|
||||
}
|
||||
|
||||
function exists(container, which){
|
||||
return getTab(container, which) != null;
|
||||
}
|
||||
|
||||
function showHeader(container, visible){
|
||||
var opts = $.data(container, 'tabs').options;
|
||||
opts.showHeader = visible;
|
||||
$(container).tabs('resize');
|
||||
}
|
||||
|
||||
function showTool(container, visible){
|
||||
var tool = $(container).find('>.tabs-header>.tabs-tool');
|
||||
if (visible){
|
||||
tool.removeClass('tabs-tool-hidden').show();
|
||||
} else {
|
||||
tool.addClass('tabs-tool-hidden').hide();
|
||||
}
|
||||
$(container).tabs('resize').tabs('scrollBy', 0);
|
||||
}
|
||||
|
||||
|
||||
$.fn.tabs = function(options, param){
|
||||
if (typeof options == 'string') {
|
||||
return $.fn.tabs.methods[options](this, param);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
return this.each(function(){
|
||||
var state = $.data(this, 'tabs');
|
||||
if (state) {
|
||||
$.extend(state.options, options);
|
||||
} else {
|
||||
$.data(this, 'tabs', {
|
||||
options: $.extend({},$.fn.tabs.defaults, $.fn.tabs.parseOptions(this), options),
|
||||
tabs: [],
|
||||
selectHis: []
|
||||
});
|
||||
wrapTabs(this);
|
||||
}
|
||||
|
||||
addTools(this);
|
||||
setProperties(this);
|
||||
setSize(this);
|
||||
bindEvents(this);
|
||||
|
||||
doFirstSelect(this);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.tabs.methods = {
|
||||
options: function(jq){
|
||||
var cc = jq[0];
|
||||
var opts = $.data(cc, 'tabs').options;
|
||||
var s = getSelectedTab(cc);
|
||||
opts.selected = s ? getTabIndex(cc, s) : -1;
|
||||
return opts;
|
||||
},
|
||||
tabs: function(jq){
|
||||
return $.data(jq[0], 'tabs').tabs;
|
||||
},
|
||||
resize: function(jq, param){
|
||||
return jq.each(function(){
|
||||
setSize(this, param);
|
||||
setSelectedSize(this);
|
||||
});
|
||||
},
|
||||
add: function(jq, options){
|
||||
return jq.each(function(){
|
||||
addTab(this, options);
|
||||
});
|
||||
},
|
||||
close: function(jq, which){
|
||||
return jq.each(function(){
|
||||
closeTab(this, which);
|
||||
});
|
||||
},
|
||||
getTab: function(jq, which){
|
||||
return getTab(jq[0], which);
|
||||
},
|
||||
getTabIndex: function(jq, tab){
|
||||
return getTabIndex(jq[0], tab);
|
||||
},
|
||||
getSelected: function(jq){
|
||||
return getSelectedTab(jq[0]);
|
||||
},
|
||||
select: function(jq, which){
|
||||
return jq.each(function(){
|
||||
selectTab(this, which);
|
||||
});
|
||||
},
|
||||
unselect: function(jq, which){
|
||||
return jq.each(function(){
|
||||
unselectTab(this, which);
|
||||
});
|
||||
},
|
||||
exists: function(jq, which){
|
||||
return exists(jq[0], which);
|
||||
},
|
||||
update: function(jq, options){
|
||||
return jq.each(function(){
|
||||
updateTab(this, options);
|
||||
});
|
||||
},
|
||||
enableTab: function(jq, which){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).tabs('getTab', which).panel('options');
|
||||
opts.tab.removeClass('tabs-disabled');
|
||||
opts.disabled = false;
|
||||
});
|
||||
},
|
||||
disableTab: function(jq, which){
|
||||
return jq.each(function(){
|
||||
var opts = $(this).tabs('getTab', which).panel('options');
|
||||
opts.tab.addClass('tabs-disabled');
|
||||
opts.disabled = true;
|
||||
});
|
||||
},
|
||||
showHeader: function(jq){
|
||||
return jq.each(function(){
|
||||
showHeader(this, true);
|
||||
});
|
||||
},
|
||||
hideHeader: function(jq){
|
||||
return jq.each(function(){
|
||||
showHeader(this, false);
|
||||
});
|
||||
},
|
||||
showTool: function(jq){
|
||||
return jq.each(function(){
|
||||
showTool(this, true);
|
||||
});
|
||||
},
|
||||
hideTool: function(jq){
|
||||
return jq.each(function(){
|
||||
showTool(this, false);
|
||||
});
|
||||
},
|
||||
scrollBy: function(jq, deltaX){ // scroll the tab header by the specified amount of pixels
|
||||
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() + deltaX, getMaxScrollWidth());
|
||||
wrap.animate({scrollLeft: pos}, opts.scrollDuration);
|
||||
|
||||
function getMaxScrollWidth(){
|
||||
var w = 0;
|
||||
var ul = wrap.children('ul');
|
||||
ul.children('li').each(function(){
|
||||
w += $(this).outerWidth(true);
|
||||
});
|
||||
return w - wrap.width() + (ul.outerWidth() - ul.width());
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.tabs.parseOptions = function(target){
|
||||
return $.extend({}, $.parser.parseOptions(target, [
|
||||
'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, // the tab header width, it is valid only when tabPosition set to 'left' or 'right'
|
||||
tabWidth: 'auto', // the tab width
|
||||
// tabHeight: 27, // the tab height
|
||||
tabHeight: 32, // the tab height
|
||||
selected: 0, // the initialized selected tab index
|
||||
showHeader: true,
|
||||
plain: false,
|
||||
fit: false,
|
||||
border: true,
|
||||
justified: false,
|
||||
narrow: false,
|
||||
pill: false,
|
||||
tools: null,
|
||||
toolPosition: 'right', // left,right,top,bottom
|
||||
tabPosition: 'top', // possible values: top,bottom
|
||||
scrollIncrement: 100,
|
||||
scrollDuration: 400,
|
||||
onLoad: function(panel){},
|
||||
onSelect: function(title, index){},
|
||||
onUnselect: function(title, index){},
|
||||
onBeforeClose: function(title, index){},
|
||||
onClose: function(title, index){},
|
||||
onAdd: function(title, index){},
|
||||
onUpdate: function(title, index){},
|
||||
onContextMenu: function(e, title, index){}
|
||||
};
|
||||
})(jQuery);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user