Adding Frameworks

This commit is contained in:
oesi
2016-11-22 10:38:29 +01:00
parent 4513da4cbb
commit 4e1fd64cf7
808 changed files with 169217 additions and 0 deletions
@@ -0,0 +1,2 @@
.idea
bower_components
+21
View File
@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2013 Mattias Holmlund, http://www.holmlund.se/mattias
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+119
View File
@@ -0,0 +1,119 @@
AngularJS Tablesort
===================
Allow tables to be sorted by clicking their headings.
Web site: [http://mattiash.github.io/angular-tablesort](http://mattiash.github.io/angular-tablesort)
Background
----------
When you use jquery to build your web-pages, it is very easy to add sorting-functionality to your tables - include [tablesorter](http://tablesorter.com) and annotate your column headings slightly to tell it what type of data your table contains.
The goal with this module is to make it just as easy to add sorting to AngularJS tables, but with proper use of angular features and not jquery.
Click once on a heading to sort ascending, twice for descending. Use shift-click to sort on more than one column.
Additionally, these directives also makes it easy to add a default row that is shown in empty tables to make
it explicit that the table is intentionally empty and not just broken.
Installation
------------
bower install angular-tablesort
or
npm install angular-tablesort
Usage
-----
Include the script in your markup
```html
<script src="bower_components/angular-tablesort/js/angular-tablesort.js"></script>
```
Include the module in your app
```js
angular.module('myApp', ['tableSort']);
```
The following code generates a table that can be sorted by clicking on the table headings:
```html
<table border="1" ts-wrapper>
<thead>
<tr>
<th ts-criteria="Id">Id</th>
<th ts-criteria="Name|lowercase" ts-default>Name</th>
<th ts-criteria="Price|parseFloat">Price</th>
<th ts-criteria="Quantity|parseInt">Quantity</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in items" ts-repeat>
<td>{{item.Name}}</td>
<td>{{item.Price | currency}}</td>
<td>{{item.Quantity}}</td>
</tr>
</tbody>
</table>
```
The `ts-wrapper` attribute must be set on element that surrounds both the headings and the ng-repeat statement.
The `ts-criteria` attribute tells tablesort which expression it should sort on when that element is clicked. Normally, the ts-criteria is the same as the expression that is shown in the column, but it doesn't have to be. The ts-criteria can also be filtered using the normal AngularJS filter syntax. Tablesort includes two filters parseInt and parseFloat that use the javascript functions of the same name, but any filter can be used.
The `ts-default` attribute can be set on one or more columns to sort on them in ascending order by default.
To sort in descending order, set ts-default to "descending"
The `ts-repeat` attribute must be set on the element with ng-repeat.
```html
<tr ng-repeat="item in items" ts-repeat>
```
Alternatively, `ts-repeat-start` and `ts-repeat-end` may be used to compliment the `ng-repeat-start` and `ng-repeat-end` directives.
```html
<tr ng-repeat-start="item in items track by item.Id" ts-repeat-start>
<td><input type="checkbox" ng-model="item.selected"></td>
<td>{{ item.Name }}</td>
</tr>
<tr ng-repeat-end data-ts-repeat-end ng-show="item.selected">
<td colspan="2">{{ item.Description }}</td>
</tr>
```
By default, the sorting will be done as the last operation in the ng-repeat expression. To override this behavior, use an explicit `tablesort` directive as part of your ng-repeat expression. E.g.
```html
<tr ng-repeat="item in items | limitTo: 10" ts-repeat>
```
This will first select the first 10 items in `items` and then sort them. Alternatively, you can insert an explicit tablesort in the pipe:
```html
<tr ng-repeat="item in items | tablesort | limitTo: 10" ts-repeat>
```
This will first sort the rows according to your specification and then only show the first 10 rows.
If the `ng-repeat` expression contains a `track by` statement (which is generally a good idea), that expression will
be used to provide a [stable](http://en.wikipedia.org/wiki/Sorting_algorithm#Stability) sort result.
CSS
---
All table headings that can be sorted on is styled with css-class `tablesort-sortable`. The table headings that the table is currently sorted on is styled with `tablesort-asc` or `tablesort-desc` classes depending on the sort-direction. A stylesheet is included to show that it works, but you probably want to build your own.
By default the content and look of the data for empty tables is controlled via css. It is inserted as one empty `<td>` spanning
all columns and placed inside a `<tr>` with class `showIfLast` The `<tr>` is placed at the top of each table.
To disable this feature add the attribute `ts-hide-no-data` to the `ts-repeat` row:
```html
<tr ng-repeat="item in items" ts-repeat ts-hide-no-data>
```
+10
View File
@@ -0,0 +1,10 @@
{
"name": "angular-tablesort",
"description": "Sort AngularJS tables easily",
"version": "1.1.2",
"main": ["./js/angular-tablesort.js"],
"dependencies": {
"angular": "*"
},
"ignore": []
}
+152
View File
@@ -0,0 +1,152 @@
<!DOCTYPE html>
<html>
<head>
<title>Angular Tablesort</title>
<link rel="stylesheet" href="tablesort.css"/>
</head>
<body>
<div ng-app="myApp">
<div ng-controller="tableTestCtrl">
<h1>Angular Tablesort</h1>
<table border="1" ts-wrapper>
<thead>
<tr>
<th>Select</th>
<th ts-criteria="Id">Id</th>
<th ts-criteria="Name|lowercase" ts-default>Name</th>
<th ts-criteria="Price|parseFloat">Price</th>
<th ts-criteria="Quantity|parseInt">Quantity</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in items track by item.Id" ts-repeat>
<td><input type="checkbox"></td>
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Price | currency}}</td>
<td>{{item.Quantity}}</td>
</tr>
</tbody>
</table>
<h1>Angular Tablesort with tablesort filter and max 5 entries</h1>
<table border="1" ts-wrapper>
<thead>
<tr>
<th>Select</th>
<th ts-criteria="Id">Id</th>
<th ts-criteria="Name|lowercase" ts-default>Name</th>
<th ts-criteria="Price|parseFloat">Price</th>
<th ts-criteria="Quantity|parseInt">Quantity</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in items | tablesort | limitTo: 5 track by item.Id" ts-repeat>
<td><input type="checkbox"></td>
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Price | currency}}</td>
<td>{{item.Quantity}}</td>
</tr>
</tbody>
</table>
<h1>Angular Tablesort with Multi-Element ts-repeat-start &amp; ts-repeat-end</h1>
<h2><em>Click Select to reveal item details.</em></h2>
<table border="1" data-ts-wrapper>
<thead>
<tr>
<th>Select</th>
<th data-ts-criteria="Id">Id</th>
<th data-ts-criteria="Name|lowercase" data-ts-default>Name</th>
<th data-ts-criteria="Price|parseFloat">Price</th>
<th data-ts-criteria="Quantity|parseInt">Quantity</th>
</tr>
</thead>
<tbody>
<tr data-ng-repeat-start="item in items track by item.Id" data-ts-repeat-start>
<td><input type="checkbox" data-ng-model="item.selected"></td>
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Price | currency}}</td>
<td>{{item.Quantity}}</td>
</tr>
<tr data-ng-repeat-end data-ts-repeat-end data-ng-show="item.selected">
<td colspan="5">{{item.Description}}</td>
</tr>
</tbody>
</table>
<h1>Empty table</h1>
<table border="1" ts-wrapper>
<thead>
<tr>
<th>Select</th>
<th ts-criteria="Id">Id</th>
<th ts-criteria="Name|lowercase" ts-default>Name</th>
<th ts-criteria="Price|parseFloat">Price</th>
<th ts-criteria="Quantity|parseInt">Quantity</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in noitems" ts-repeat ng-click="clickRow()">
<td><input type="checkbox"></td>
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Price | currency}}</td>
<td>{{item.Quantity}}</td>
</tr>
</tbody>
</table>
<h1>Empty table without "No data" row</h1>
<table border="1" ts-wrapper>
<thead>
<tr>
<th>Select</th>
<th ts-criteria="Id">Id</th>
<th ts-criteria="Name|lowercase" ts-default>Name</th>
<th ts-criteria="Price|parseFloat">Price</th>
<th ts-criteria="Quantity|parseInt">Quantity</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in noitems" ts-repeat ts-hide-no-data ng-click="clickRow()">
<td><input type="checkbox"></td>
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Price | currency}}</td>
<td>{{item.Quantity}}</td>
</tr>
</tbody>
</table>
<br />
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="js/angular-tablesort.js"></script>
<script>
var myApp = angular.module( 'myApp', ['tableSort'] )
.controller( "tableTestCtrl", function tableTestCtrl($scope) {
$scope.items = [
{Id: "01", Name: "A", Price: "1.00", Quantity: "1", Description: "This is the description for item A.", selected: false},
{Id: "02", Name: "B", Price: "10.00", Quantity: "1", Description: "This is the description for item B.", selected: false},
{Id: "04", Name: "C", Price: "9.50", Quantity: "10", Description: "This is the description for item C.", selected: false},
{Id: "03", Name: "a", Price: "9.00", Quantity: "2", Description: "This is the description for item a.", selected: false},
{Id: "06", Name: "b", Price: "100.00", Quantity: "2", Description: "This is the description for item b.", selected: false},
{Id: "05", Name: "c", Price: "1.20", Quantity: "2", Description: "This is the description for item c.", selected: false}
];
$scope.noitems = [];
$scope.clickRow = function () {
alert('You clicked the row.');
}
}
);
</script>
</body>
</html>
+2
View File
@@ -0,0 +1,2 @@
require('./js/angular-tablesort');
module.exports = 'tableSort';
@@ -0,0 +1,226 @@
/*
angular-tablesort v1.1.2
(c) 2013-2015 Mattias Holmlund, http://mattiash.github.io/angular-tablesort
License: MIT
*/
var tableSortModule = angular.module( 'tableSort', [] );
tableSortModule.directive('tsWrapper', ['$log', '$parse', function( $log, $parse ) {
'use strict';
return {
scope: true,
controller: ['$scope', function($scope) {
$scope.sortExpression = [];
$scope.headings = [];
var parse_sortexpr = function( expr ) {
return [$parse( expr ), null, false];
};
this.setSortField = function( sortexpr, element ) {
var i;
var expr = parse_sortexpr( sortexpr );
if( $scope.sortExpression.length === 1
&& $scope.sortExpression[0][0] === expr[0] ) {
if( $scope.sortExpression[0][2] ) {
element.removeClass( "tablesort-desc" );
element.addClass( "tablesort-asc" );
$scope.sortExpression[0][2] = false;
}
else {
element.removeClass( "tablesort-asc" );
element.addClass( "tablesort-desc" );
$scope.sortExpression[0][2] = true;
}
}
else {
for( i=0; i<$scope.headings.length; i=i+1 ) {
$scope.headings[i]
.removeClass( "tablesort-desc" )
.removeClass( "tablesort-asc" );
}
element.addClass( "tablesort-asc" );
$scope.sortExpression = [expr];
}
};
this.addSortField = function( sortexpr, element ) {
var i;
var toggle_order = false;
var expr = parse_sortexpr( sortexpr );
for( i=0; i<$scope.sortExpression.length; i=i+1 ) {
if( $scope.sortExpression[i][0] === expr[0] ) {
if( $scope.sortExpression[i][2] ) {
element.removeClass( "tablesort-desc" );
element.addClass( "tablesort-asc" );
$scope.sortExpression[i][2] = false;
}
else {
element.removeClass( "tablesort-asc" );
element.addClass( "tablesort-desc" );
$scope.sortExpression[i][2] = true;
}
toggle_order = true;
}
}
if( !toggle_order ) {
element.addClass( "tablesort-asc" );
$scope.sortExpression.push( expr );
}
};
this.setTrackBy = function( trackBy ) {
$scope.trackBy = trackBy;
};
this.registerHeading = function( headingelement ) {
$scope.headings.push( headingelement );
};
$scope.sortFun = function( a, b ) {
var i, aval, bval, descending, filterFun;
for( i=0; i<$scope.sortExpression.length; i=i+1 ){
aval = $scope.sortExpression[i][0](a);
bval = $scope.sortExpression[i][0](b);
filterFun = b[$scope.sortExpression[i][1]];
if( filterFun ) {
aval = filterFun( aval );
bval = filterFun( bval );
}
if( aval === undefined || aval === null ) {
aval = "";
}
if( bval === undefined || bval === null ) {
bval = "";
}
descending = $scope.sortExpression[i][2];
if( aval > bval ) {
return descending ? -1 : 1;
}
else if( aval < bval ) {
return descending ? 1 : -1;
}
}
// All the sort fields were equal. If there is a "track by" expression,
// use that as a tiebreaker to make the sort result stable.
if( $scope.trackBy ) {
aval = a[$scope.trackBy];
bval = b[$scope.trackBy];
if( aval === undefined || aval === null ) {
aval = "";
}
if( bval === undefined || bval === null ) {
bval = "";
}
if( aval > bval ) {
return descending ? -1 : 1;
}
else if( aval < bval ) {
return descending ? 1 : -1;
}
}
return 0;
};
}]
};
}]);
tableSortModule.directive('tsCriteria', function() {
return {
require: "^tsWrapper",
link: function(scope, element, attrs, tsWrapperCtrl) {
var clickingCallback = function(event) {
scope.$apply( function() {
if( event.shiftKey ) {
tsWrapperCtrl.addSortField(attrs.tsCriteria, element);
}
else {
tsWrapperCtrl.setSortField(attrs.tsCriteria, element);
}
} );
};
element.bind('click', clickingCallback);
element.addClass('tablesort-sortable');
if( "tsDefault" in attrs && attrs.tsDefault !== "0" ) {
tsWrapperCtrl.addSortField( attrs.tsCriteria, element );
if( attrs.tsDefault == "descending" ) {
tsWrapperCtrl.addSortField( attrs.tsCriteria, element );
}
}
tsWrapperCtrl.registerHeading( element );
}
};
});
tableSortModule.directive("tsRepeat", ['$compile', function($compile) {
return {
terminal: true,
multiElement: true,
require: "^tsWrapper",
priority: 1000000,
link: function(scope, element, attrs, tsWrapperCtrl) {
var repeatAttrs = ["ng-repeat", "data-ng-repeat", "ng-repeat-start", "data-ng-repeat-start"];
var ngRepeatDirective = repeatAttrs[0];
var tsRepeatDirective = "ts-repeat";
for (var i = 0; i < repeatAttrs.length; i++) {
if (angular.isDefined(element.attr(repeatAttrs[i]))) {
ngRepeatDirective = repeatAttrs[i];
tsRepeatDirective = ngRepeatDirective.replace(/^(data-)?ng/, '$1ts');
break;
}
}
var repeatExpr = element.attr(ngRepeatDirective);
var trackBy = null;
var trackByMatch = repeatExpr.match(/\s+track\s+by\s+\S+?\.(\S+)/);
if( trackByMatch ) {
trackBy = trackByMatch[1];
tsWrapperCtrl.setTrackBy(trackBy);
}
if (repeatExpr.search(/tablesort/) != -1) {
repeatExpr = repeatExpr.replace(/tablesort/,"tablesortOrderBy:sortFun");
} else {
repeatExpr = repeatExpr.replace(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(\s+track\s+by\s+[\s\S]+?)?\s*$/,
"$1 in $2 | tablesortOrderBy:sortFun$3");
}
if (angular.isUndefined(attrs.tsHideNoData)) {
var noDataRow = angular.element(element[0]).clone();
noDataRow.removeAttr(ngRepeatDirective);
noDataRow.removeAttr(tsRepeatDirective);
noDataRow.addClass("showIfLast");
noDataRow.children().remove();
noDataRow.append('<td colspan="' + element[0].childElementCount + '"></td>');
noDataRow = $compile(noDataRow)(scope);
element.parent().prepend(noDataRow);
}
angular.element(element[0]).attr(ngRepeatDirective, repeatExpr);
$compile(element, null, 1000000)(scope);
}
};
}]);
tableSortModule.filter( 'tablesortOrderBy', function(){
return function(array, sortfun ) {
if(!array) return;
var arrayCopy = [];
for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
return arrayCopy.sort( sortfun );
};
} );
tableSortModule.filter( 'parseInt', function(){
return function(input) {
return parseInt( input ) || null;
};
} );
tableSortModule.filter( 'parseFloat', function(){
return function(input) {
return parseFloat( input ) || null;
};
} );
+12
View File
@@ -0,0 +1,12 @@
{
"name": "angular-tablesort",
"version": "1.1.2",
"description": "Sort angularjs tables easily",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/mattiash/angular-tablesort.git"
},
"license": "MIT",
"homepage": "https://github.com/mattiash/angular-tablesort"
}
+56
View File
@@ -0,0 +1,56 @@
th.tablesort-sortable {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
cursor: pointer;
}
table .tablesort-sortable:after{
content:"";
float:right;
margin-top:7px;
visibility:hidden;
border-left:4px solid transparent;
border-right:4px solid transparent;
border-top:none;
border-bottom:4px solid #000;
}
table .tablesort-desc:after{
border-top:4px solid #000;
border-bottom:none;
}
table .tablesort-asc,table .tablesort-desc{
background-color:rgba(141, 192, 219, 0.25);
}
table .tablesort-sortable:hover:after, table .tablesort-asc:after, table .tablesort-desc:after {
visibility:visible;
}
/*
* Styling for the table row shown in empty tables
*/
/* The row is always added as the first row in a table
Hide it by default */
.showIfLast {
display: none;
}
/* Only show it if it is also the last row of the table. */
.showIfLast:last-child {
display: table-row;
}
.showIfLast td {
text-align: center;
}
.showIfLast td:after {
content: "No data";
}
+491
View File
@@ -0,0 +1,491 @@
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.
+190
View File
@@ -0,0 +1,190 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}};
var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"};
var _3={};
function _4(_5,_6){
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]);
}
}
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){
_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();
});
});
}
})();
File diff suppressed because it is too large Load Diff
+137
View File
@@ -0,0 +1,137 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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","filebox","searchbox","combo","combobox","combogrid","combotree","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){
if($.fn[_19]){
$.extend($.fn[_19].defaults,{height:32,iconWidth:28,tipPosition:"bottom"});
}
});
$.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){
$.extend($.fn[_1a].defaults,{height:32,iconWidth:56});
});
$.extend($.fn.menu.defaults,{itemHeight:30,noline:true});
})(jQuery);
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
This license agreement refers to jQuery EasyUI software - Freeware License.
jQuery EasyUI Team grants to you a limited, non-transferable and non-exclusive right to use, royalty-free, copy and redistribute the software.
The licensee has the right to use the software for a non-profit projects/sites. There are no limitations on the number of non-profit projects/sites you can use the software in, you can use it on any number of non-profit projects/sites you need. There is no time limit, you can use the software for any period of time you need. There is no restriction while you are developing your solution. There are no royalties of any kind involved.
The governmental entities are not allowed to use this freeware license.
The licensee is allowed to copy and redistribute the software but you may not:
a) Distribute the modified software or part(s) of it as standalone application.
b) Sublicense, rent, lease or lend any portion of the software.
c) Modify or remove any copyright notices from any of the software files.
jQuery EasyUI Team retains all ownership rights to the software.
+44
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View File
@@ -0,0 +1,45 @@
if ($.fn.pagination){
$.fn.pagination.defaults.beforePageText = 'P&aacute;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','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&oacute;n de correo v&aacute;lida.';
$.fn.validatebox.defaults.rules.url.message = 'Por favor ingrese una URL v&aacute;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&aacute;'];
$.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
});
}
+44
View File
@@ -0,0 +1,44 @@
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','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', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
$.fn.datebox.defaults.currentText = "Aujourd'hui";
$.fn.datebox.defaults.closeText = 'Fermer';
$.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
View File
@@ -0,0 +1,45 @@
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','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 = 'Aggiusta questo campo.';
}
if ($.fn.calendar){
$.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';
}
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
View 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','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
});
}
+44
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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
View 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','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;
};
}
+66
View 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','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
View 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','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]]
}
+320
View File
@@ -0,0 +1,320 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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);
if(_3){
$.extend(_5,{width:_3.width,height:_3.height});
}
cc._size(_5);
var _7=0;
var _8="auto";
var _9=cc.find(">.panel>.accordion-header");
if(_9.length){
_7=$(_9[0]).css("height","")._outerHeight();
}
if(!isNaN(parseInt(_5.height))){
_8=cc.height()-_7*_9.length;
}
_a(true,_8-_a(false)+1);
function _a(_b,_c){
var _d=0;
for(var i=0;i<_6.length;i++){
var p=_6[i];
var h=p.panel("header")._outerHeight(_7);
if(p.panel("options").collapsible==_b){
var _e=isNaN(_c)?undefined:(_c+_7*h.length);
p.panel("resize",{width:cc.width(),height:(_b?_e:undefined)});
_d+=p.panel("panel").outerHeight()-_7*h.length;
}
}
return _d;
};
};
function _f(_10,_11,_12,all){
var _13=$.data(_10,"accordion").panels;
var pp=[];
for(var i=0;i<_13.length;i++){
var p=_13[i];
if(_11){
if(p.panel("options")[_11]==_12){
pp.push(p);
}
}else{
if(p[0]==$(_12)[0]){
return i;
}
}
}
if(_11){
return all?pp:(pp.length?pp[0]:null);
}else{
return -1;
}
};
function _14(_15){
return _f(_15,"collapsed",false,true);
};
function _16(_17){
var pp=_14(_17);
return pp.length?pp[0]:null;
};
function _18(_19,_1a){
return _f(_19,null,_1a);
};
function _1b(_1c,_1d){
var _1e=$.data(_1c,"accordion").panels;
if(typeof _1d=="number"){
if(_1d<0||_1d>=_1e.length){
return null;
}else{
return _1e[_1d];
}
}
return _f(_1c,"title",_1d);
};
function _1f(_20){
var _21=$.data(_20,"accordion").options;
var cc=$(_20);
if(_21.border){
cc.removeClass("accordion-noborder");
}else{
cc.addClass("accordion-noborder");
}
};
function _22(_23){
var _24=$.data(_23,"accordion");
var cc=$(_23);
cc.addClass("accordion");
_24.panels=[];
cc.children("div").each(function(){
var _25=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)});
var pp=$(this);
_24.panels.push(pp);
_27(_23,pp,_25);
});
cc.bind("_resize",function(e,_26){
if($(this).hasClass("easyui-fluid")||_26){
_1(_23);
}
return false;
});
};
function _27(_28,pp,_29){
var _2a=$.data(_28,"accordion").options;
pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body"},_29,{onBeforeExpand:function(){
if(_29.onBeforeExpand){
if(_29.onBeforeExpand.call(this)==false){
return false;
}
}
if(!_2a.multiple){
var all=$.grep(_14(_28),function(p){
return p.panel("options").collapsible;
});
for(var i=0;i<all.length;i++){
_33(_28,_18(_28,all[i]));
}
}
var _2b=$(this).panel("header");
_2b.addClass("accordion-header-selected");
_2b.find(".accordion-collapse").removeClass("accordion-expand");
},onExpand:function(){
if(_29.onExpand){
_29.onExpand.call(this);
}
_2a.onSelect.call(_28,$(this).panel("options").title,_18(_28,this));
},onBeforeCollapse:function(){
if(_29.onBeforeCollapse){
if(_29.onBeforeCollapse.call(this)==false){
return false;
}
}
var _2c=$(this).panel("header");
_2c.removeClass("accordion-header-selected");
_2c.find(".accordion-collapse").addClass("accordion-expand");
},onCollapse:function(){
if(_29.onCollapse){
_29.onCollapse.call(this);
}
_2a.onUnselect.call(_28,$(this).panel("options").title,_18(_28,this));
}}));
var _2d=pp.panel("header");
var _2e=_2d.children("div.panel-tool");
_2e.children("a.panel-tool-collapse").hide();
var t=$("<a href=\"javascript:void(0)\"></a>").addClass("accordion-collapse accordion-expand").appendTo(_2e);
t.bind("click",function(){
_2f(pp);
return false;
});
pp.panel("options").collapsible?t.show():t.hide();
_2d.click(function(){
_2f(pp);
return false;
});
function _2f(p){
var _30=p.panel("options");
if(_30.collapsible){
var _31=_18(_28,p);
if(_30.collapsed){
_32(_28,_31);
}else{
_33(_28,_31);
}
}
};
};
function _32(_34,_35){
var p=_1b(_34,_35);
if(!p){
return;
}
_36(_34);
var _37=$.data(_34,"accordion").options;
p.panel("expand",_37.animate);
};
function _33(_38,_39){
var p=_1b(_38,_39);
if(!p){
return;
}
_36(_38);
var _3a=$.data(_38,"accordion").options;
p.panel("collapse",_3a.animate);
};
function _3b(_3c){
var _3d=$.data(_3c,"accordion").options;
var p=_f(_3c,"selected",true);
if(p){
_3e(_18(_3c,p));
}else{
_3e(_3d.selected);
}
function _3e(_3f){
var _40=_3d.animate;
_3d.animate=false;
_32(_3c,_3f);
_3d.animate=_40;
};
};
function _36(_41){
var _42=$.data(_41,"accordion").panels;
for(var i=0;i<_42.length;i++){
_42[i].stop(true,true);
}
};
function add(_43,_44){
var _45=$.data(_43,"accordion");
var _46=_45.options;
var _47=_45.panels;
if(_44.selected==undefined){
_44.selected=true;
}
_36(_43);
var pp=$("<div></div>").appendTo(_43);
_47.push(pp);
_27(_43,pp,_44);
_1(_43);
_46.onAdd.call(_43,_44.title,_47.length-1);
if(_44.selected){
_32(_43,_47.length-1);
}
};
function _48(_49,_4a){
var _4b=$.data(_49,"accordion");
var _4c=_4b.options;
var _4d=_4b.panels;
_36(_49);
var _4e=_1b(_49,_4a);
var _4f=_4e.panel("options").title;
var _50=_18(_49,_4e);
if(!_4e){
return;
}
if(_4c.onBeforeRemove.call(_49,_4f,_50)==false){
return;
}
_4d.splice(_50,1);
_4e.panel("destroy");
if(_4d.length){
_1(_49);
var _51=_16(_49);
if(!_51){
_32(_49,0);
}
}
_4c.onRemove.call(_49,_4f,_50);
};
$.fn.accordion=function(_52,_53){
if(typeof _52=="string"){
return $.fn.accordion.methods[_52](this,_53);
}
_52=_52||{};
return this.each(function(){
var _54=$.data(this,"accordion");
if(_54){
$.extend(_54.options,_52);
}else{
$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_52),accordion:$(this).addClass("accordion"),panels:[]});
_22(this);
}
_1f(this);
_1(this);
_3b(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,_55){
return jq.each(function(){
_1(this,_55);
});
},getSelections:function(jq){
return _14(jq[0]);
},getSelected:function(jq){
return _16(jq[0]);
},getPanel:function(jq,_56){
return _1b(jq[0],_56);
},getPanelIndex:function(jq,_57){
return _18(jq[0],_57);
},select:function(jq,_58){
return jq.each(function(){
_32(this,_58);
});
},unselect:function(jq,_59){
return jq.each(function(){
_33(this,_59);
});
},add:function(jq,_5a){
return jq.each(function(){
add(this,_5a);
});
},remove:function(jq,_5b){
return jq.each(function(){
_48(this,_5b);
});
}};
$.fn.accordion.parseOptions=function(_5c){
var t=$(_5c);
return $.extend({},$.parser.parseOptions(_5c,["width","height",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}]));
};
$.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,onSelect:function(_5d,_5e){
},onUnselect:function(_5f,_60){
},onAdd:function(_61,_62){
},onBeforeRemove:function(_63,_64){
},onRemove:function(_65,_66){
}};
})(jQuery);
+389
View File
@@ -0,0 +1,389 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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\"></input></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 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 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 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 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 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 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 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 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>");
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+"\">");
for(var j=0;j<_38.length;j++){
var day=_38[j];
var s=day[0]+","+day[1]+","+day[2];
var _39=new Date(day[0],parseInt(day[1])-1,day[2]);
var d=_30.formatter.call(_2f,_39);
var css=_30.styler.call(_2f,_39);
var _3a="";
var _3b="";
if(typeof css=="string"){
_3b=css;
}else{
if(css){
_3a=css["class"]||"";
_3b=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+=" "+_3a;
if(!_30.validator.call(_2f,_39)){
cls+=" calendar-disabled";
}
_36.push("<td class=\""+cls+"\" abbr=\""+s+"\" style=\""+_3b+"\">"+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(_3c,_3d){
if(typeof _3c=="string"){
return $.fn.calendar.methods[_3c](this,_3d);
}
_3c=_3c||{};
return this.each(function(){
var _3e=$.data(this,"calendar");
if(_3e){
$.extend(_3e.options,_3c);
}else{
_3e=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_3c)});
_6(this);
}
if(_3e.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,_3f){
return jq.each(function(){
_1(this,_3f);
});
},moveTo:function(jq,_40){
return jq.each(function(){
if(!_40){
var now=new Date();
$(this).calendar({year:now.getFullYear(),month:now.getMonth()+1,current:_40});
return;
}
var _41=$(this).calendar("options");
if(_41.validator.call(this,_40)){
var _42=_41.current;
$(this).calendar({year:_40.getFullYear(),month:_40.getMonth()+1,current:_40});
if(!_42||_42.getTime()!=_40.getTime()){
_41.onChange.call(this,_41.current,_42);
}
}
});
}};
$.fn.calendar.parseOptions=function(_43){
var t=$(_43);
return $.extend({},$.parser.parseOptions(_43,[{firstDay:"number",fit:"boolean",border:"boolean"}]));
};
$.fn.calendar.defaults={width:180,height:180,fit:false,border:true,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){
var d=new Date();
return new Date(d.getFullYear(),d.getMonth(),d.getDate());
})(),formatter:function(_44){
return _44.getDate();
},styler:function(_45){
return "";
},validator:function(_46){
return true;
},onSelect:function(_47){
},onChange:function(_48,_49){
},onNavigate:function(_4a,_4b){
}};
})(jQuery);
+363
View File
@@ -0,0 +1,363 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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("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);
},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){
_f(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");
};
function _b(_c){
var _d=$.data(_c,"combo");
var _e=_d.options;
var p=_d.panel;
if(p.is(":visible")){
p.panel("close");
}
if(!_e.cloned){
p.panel("destroy");
}
$(_c).textbox("destroy");
};
function _f(_10){
var _11=$.data(_10,"combo").panel;
if(_11.is(":visible")){
_12(_10);
}else{
var p=$(_10).closest("div.combo-panel");
$("div.combo-panel:visible").not(_11).not(p).panel("close");
$(_10).combo("showPanel");
}
$(_10).combo("textbox").focus();
};
function _1(_13){
$(_13).find(".combo-f").each(function(){
var p=$(this).combo("panel");
if(p.is(":visible")){
p.panel("close");
}
});
};
function _14(e){
var _15=e.data.target;
var _16=$.data(_15,"combo");
var _17=_16.options;
var _18=_16.panel;
if(!_17.editable){
_f(_15);
}else{
var p=$(_15).closest("div.combo-panel");
$("div.combo-panel:visible").not(_18).not(p).panel("close");
}
};
function _19(e){
var _1a=e.data.target;
var t=$(_1a);
var _1b=t.data("combo");
var _1c=t.combo("options");
switch(e.keyCode){
case 38:
_1c.keyHandler.up.call(_1a,e);
break;
case 40:
_1c.keyHandler.down.call(_1a,e);
break;
case 37:
_1c.keyHandler.left.call(_1a,e);
break;
case 39:
_1c.keyHandler.right.call(_1a,e);
break;
case 13:
e.preventDefault();
_1c.keyHandler.enter.call(_1a,e);
return false;
case 9:
case 27:
_12(_1a);
break;
default:
if(_1c.editable){
if(_1b.timer){
clearTimeout(_1b.timer);
}
_1b.timer=setTimeout(function(){
var q=t.combo("getText");
if(_1b.previousText!=q){
_1b.previousText=q;
t.combo("showPanel");
_1c.keyHandler.query.call(_1a,q,e);
t.combo("validate");
}
},_1c.delay);
}
}
};
function _1d(_1e){
var _1f=$.data(_1e,"combo");
var _20=_1f.combo;
var _21=_1f.panel;
var _22=$(_1e).combo("options");
var _23=_21.panel("options");
_23.comboTarget=_1e;
if(_23.closed){
_21.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999});
_21.panel("resize",{width:(_22.panelWidth?_22.panelWidth:_20._outerWidth()),height:_22.panelHeight});
_21.panel("panel").hide();
_21.panel("open");
}
(function(){
if(_21.is(":visible")){
_21.panel("move",{left:_24(),top:_25()});
setTimeout(arguments.callee,200);
}
})();
function _24(){
var _26=_20.offset().left;
if(_22.panelAlign=="right"){
_26+=_20._outerWidth()-_21._outerWidth();
}
if(_26+_21._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){
_26=$(window)._outerWidth()+$(document).scrollLeft()-_21._outerWidth();
}
if(_26<0){
_26=0;
}
return _26;
};
function _25(){
var top=_20.offset().top+_20._outerHeight();
if(top+_21._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
top=_20.offset().top-_21._outerHeight();
}
if(top<$(document).scrollTop()){
top=_20.offset().top+_20._outerHeight();
}
return top;
};
};
function _12(_27){
var _28=$.data(_27,"combo").panel;
_28.panel("close");
};
function _29(_2a,_2b){
var _2c=$.data(_2a,"combo");
var _2d=$(_2a).textbox("getText");
if(_2d!=_2b){
$(_2a).textbox("setText",_2b);
_2c.previousText=_2b;
}
};
function _2e(_2f){
var _30=[];
var _31=$.data(_2f,"combo").combo;
_31.find(".textbox-value").each(function(){
_30.push($(this).val());
});
return _30;
};
function _32(_33,_34){
var _35=$.data(_33,"combo");
var _36=_35.options;
var _37=_35.combo;
if(!$.isArray(_34)){
_34=_34.split(_36.separator);
}
var _38=_2e(_33);
_37.find(".textbox-value").remove();
var _39=$(_33).attr("textboxName")||"";
for(var i=0;i<_34.length;i++){
var _3a=$("<input type=\"hidden\" class=\"textbox-value\">").appendTo(_37);
_3a.attr("name",_39);
if(_36.disabled){
_3a.attr("disabled","disabled");
}
_3a.val(_34[i]);
}
var _3b=(function(){
if(_38.length!=_34.length){
return true;
}
var a1=$.extend(true,[],_38);
var a2=$.extend(true,[],_34);
a1.sort();
a2.sort();
for(var i=0;i<a1.length;i++){
if(a1[i]!=a2[i]){
return true;
}
}
return false;
})();
if(_3b){
if(_36.multiple){
_36.onChange.call(_33,_34,_38);
}else{
_36.onChange.call(_33,_34[0],_38[0]);
}
$(_33).closest("form").trigger("_change",[_33]);
}
};
function _3c(_3d){
var _3e=_2e(_3d);
return _3e[0];
};
function _3f(_40,_41){
_32(_40,[_41]);
};
function _42(_43){
var _44=$.data(_43,"combo").options;
var _45=_44.onChange;
_44.onChange=function(){
};
if(_44.multiple){
_32(_43,_44.value?_44.value:[]);
}else{
_3f(_43,_44.value);
}
_44.onChange=_45;
};
$.fn.combo=function(_46,_47){
if(typeof _46=="string"){
var _48=$.fn.combo.methods[_46];
if(_48){
return _48(this,_47);
}else{
return this.textbox(_46,_47);
}
}
_46=_46||{};
return this.each(function(){
var _49=$.data(this,"combo");
if(_49){
$.extend(_49.options,_46);
if(_46.value!=undefined){
_49.options.originalValue=_46.value;
}
}else{
_49=$.data(this,"combo",{options:$.extend({},$.fn.combo.defaults,$.fn.combo.parseOptions(this),_46),previousText:""});
_49.options.originalValue=_49.options.value;
}
_2(this);
_42(this);
});
};
$.fn.combo.methods={options:function(jq){
var _4a=jq.textbox("options");
return $.extend($.data(jq[0],"combo").options,{width:_4a.width,height:_4a.height,disabled:_4a.disabled,readonly:_4a.readonly});
},cloneFrom:function(jq,_4b){
return jq.each(function(){
$(this).textbox("cloneFrom",_4b);
$.data(this,"combo",{options:$.extend(true,{cloned:true},$(_4b).combo("options")),combo:$(this).next(),panel:$(_4b).combo("panel")});
$(this).addClass("combo-f").attr("comboName",$(this).attr("textboxName"));
});
},panel:function(jq){
return $.data(jq[0],"combo").panel;
},destroy:function(jq){
return jq.each(function(){
_b(this);
});
},showPanel:function(jq){
return jq.each(function(){
_1d(this);
});
},hidePanel:function(jq){
return jq.each(function(){
_12(this);
});
},clear:function(jq){
return jq.each(function(){
$(this).textbox("setText","");
var _4c=$.data(this,"combo").options;
if(_4c.multiple){
$(this).combo("setValues",[]);
}else{
$(this).combo("setValue","");
}
});
},reset:function(jq){
return jq.each(function(){
var _4d=$.data(this,"combo").options;
if(_4d.multiple){
$(this).combo("setValues",_4d.originalValue);
}else{
$(this).combo("setValue",_4d.originalValue);
}
});
},setText:function(jq,_4e){
return jq.each(function(){
_29(this,_4e);
});
},getValues:function(jq){
return _2e(jq[0]);
},setValues:function(jq,_4f){
return jq.each(function(){
_32(this,_4f);
});
},getValue:function(jq){
return _3c(jq[0]);
},setValue:function(jq,_50){
return jq.each(function(){
_3f(this,_50);
});
}};
$.fn.combo.parseOptions=function(_51){
var t=$(_51);
return $.extend({},$.fn.textbox.parseOptions(_51),$.parser.parseOptions(_51,["separator","panelAlign",{panelWidth:"number",hasDownArrow:"boolean",delay:"number",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:_14,keydown:_19,paste:_19,drop:_19},panelWidth:null,panelHeight:200,panelMinWidth:null,panelMaxWidth:null,panelMinHeight:null,panelMaxHeight:null,panelAlign:"left",multiple:false,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(_52,_53){
}});
})(jQuery);
+456
View File
@@ -0,0 +1,456 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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,_4){
var _5=$.data(_3,"combobox");
var _6=_5.options;
var _7=_5.data;
for(var i=0;i<_7.length;i++){
if(_7[i][_6.valueField]==_4){
return i;
}
}
return -1;
};
function _8(_9,_a){
var _b=$.data(_9,"combobox").options;
var _c=$(_9).combo("panel");
var _d=_b.finder.getEl(_9,_a);
if(_d.length){
if(_d.position().top<=0){
var h=_c.scrollTop()+_d.position().top;
_c.scrollTop(h);
}else{
if(_d.position().top+_d.outerHeight()>_c.height()){
var h=_c.scrollTop()+_d.position().top+_d.outerHeight()-_c.height();
_c.scrollTop(h);
}
}
}
};
function _e(_f,dir){
var _10=$.data(_f,"combobox").options;
var _11=$(_f).combobox("panel");
var _12=_11.children("div.combobox-item-hover");
if(!_12.length){
_12=_11.children("div.combobox-item-selected");
}
_12.removeClass("combobox-item-hover");
var _13="div.combobox-item:visible:not(.combobox-item-disabled):first";
var _14="div.combobox-item:visible:not(.combobox-item-disabled):last";
if(!_12.length){
_12=_11.children(dir=="next"?_13:_14);
}else{
if(dir=="next"){
_12=_12.nextAll(_13);
if(!_12.length){
_12=_11.children(_13);
}
}else{
_12=_12.prevAll(_13);
if(!_12.length){
_12=_11.children(_14);
}
}
}
if(_12.length){
_12.addClass("combobox-item-hover");
var row=_10.finder.getRow(_f,_12);
if(row){
_8(_f,row[_10.valueField]);
if(_10.selectOnNavigation){
_15(_f,row[_10.valueField]);
}
}
}
};
function _15(_16,_17){
var _18=$.data(_16,"combobox").options;
var _19=$(_16).combo("getValues");
if($.inArray(_17+"",_19)==-1){
if(_18.multiple){
_19.push(_17);
}else{
_19=[_17];
}
_1a(_16,_19);
_18.onSelect.call(_16,_18.finder.getRow(_16,_17));
}
};
function _1b(_1c,_1d){
var _1e=$.data(_1c,"combobox").options;
var _1f=$(_1c).combo("getValues");
var _20=$.inArray(_1d+"",_1f);
if(_20>=0){
_1f.splice(_20,1);
_1a(_1c,_1f);
_1e.onUnselect.call(_1c,_1e.finder.getRow(_1c,_1d));
}
};
function _1a(_21,_22,_23){
var _24=$.data(_21,"combobox").options;
var _25=$(_21).combo("panel");
if(!$.isArray(_22)){
_22=_22.split(_24.separator);
}
_25.find("div.combobox-item-selected").removeClass("combobox-item-selected");
var vv=[],ss=[];
for(var i=0;i<_22.length;i++){
var v=_22[i];
var s=v;
_24.finder.getEl(_21,v).addClass("combobox-item-selected");
var row=_24.finder.getRow(_21,v);
if(row){
s=row[_24.textField];
}
vv.push(v);
ss.push(s);
}
if(!_23){
$(_21).combo("setText",ss.join(_24.separator));
}
$(_21).combo("setValues",vv);
};
function _26(_27,_28,_29){
var _2a=$.data(_27,"combobox");
var _2b=_2a.options;
_2a.data=_2b.loadFilter.call(_27,_28);
_2a.groups=[];
_28=_2a.data;
var _2c=$(_27).combobox("getValues");
var dd=[];
var _2d=undefined;
for(var i=0;i<_28.length;i++){
var row=_28[i];
var v=row[_2b.valueField]+"";
var s=row[_2b.textField];
var g=row[_2b.groupField];
if(g){
if(_2d!=g){
_2d=g;
_2a.groups.push(g);
dd.push("<div id=\""+(_2a.groupIdPrefix+"_"+(_2a.groups.length-1))+"\" class=\"combobox-group\">");
dd.push(_2b.groupFormatter?_2b.groupFormatter.call(_27,g):g);
dd.push("</div>");
}
}else{
_2d=undefined;
}
var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":"");
dd.push("<div id=\""+(_2a.itemIdPrefix+"_"+i)+"\" class=\""+cls+"\">");
dd.push(_2b.formatter?_2b.formatter.call(_27,row):s);
dd.push("</div>");
if(row["selected"]&&$.inArray(v,_2c)==-1){
_2c.push(v);
}
}
$(_27).combo("panel").html(dd.join(""));
if(_2b.multiple){
_1a(_27,_2c,_29);
}else{
_1a(_27,_2c.length?[_2c[_2c.length-1]]:[],_29);
}
_2b.onLoadSuccess.call(_27,_28);
};
function _2e(_2f,url,_30,_31){
var _32=$.data(_2f,"combobox").options;
if(url){
_32.url=url;
}
_30=$.extend({},_32.queryParams,_30||{});
if(_32.onBeforeLoad.call(_2f,_30)==false){
return;
}
_32.loader.call(_2f,_30,function(_33){
_26(_2f,_33,_31);
},function(){
_32.onLoadError.apply(this,arguments);
});
};
function _34(_35,q){
var _36=$.data(_35,"combobox");
var _37=_36.options;
var qq=_37.multiple?q.split(_37.separator):[q];
if(_37.mode=="remote"){
_38(qq);
_2e(_35,null,{q:q},true);
}else{
var _39=$(_35).combo("panel");
_39.find("div.combobox-item-selected,div.combobox-item-hover").removeClass("combobox-item-selected combobox-item-hover");
_39.find("div.combobox-item,div.combobox-group").hide();
var _3a=_36.data;
var vv=[];
$.map(qq,function(q){
q=$.trim(q);
var _3b=q;
var _3c=undefined;
for(var i=0;i<_3a.length;i++){
var row=_3a[i];
if(_37.filter.call(_35,q,row)){
var v=row[_37.valueField];
var s=row[_37.textField];
var g=row[_37.groupField];
var _3d=_37.finder.getEl(_35,v).show();
if(s.toLowerCase()==q.toLowerCase()){
_3b=v;
_3d.addClass("combobox-item-selected");
_37.onSelect.call(_35,row);
}
if(_37.groupField&&_3c!=g){
$("#"+_36.groupIdPrefix+"_"+$.inArray(g,_36.groups)).show();
_3c=g;
}
}
}
vv.push(_3b);
});
_38(vv);
}
function _38(vv){
_1a(_35,_37.multiple?(q?vv:[]):vv,true);
};
};
function _3e(_3f){
var t=$(_3f);
var _40=t.combobox("options");
var _41=t.combobox("panel");
var _42=_41.children("div.combobox-item-hover");
if(_42.length){
var row=_40.finder.getRow(_3f,_42);
var _43=row[_40.valueField];
if(_40.multiple){
if(_42.hasClass("combobox-item-selected")){
t.combobox("unselect",_43);
}else{
t.combobox("select",_43);
}
}else{
t.combobox("select",_43);
}
}
var vv=[];
$.map(t.combobox("getValues"),function(v){
if(_2(_3f,v)>=0){
vv.push(v);
}
});
t.combobox("setValues",vv);
if(!_40.multiple){
t.combobox("hidePanel");
}
};
function _44(_45){
var _46=$.data(_45,"combobox");
var _47=_46.options;
_1++;
_46.itemIdPrefix="_easyui_combobox_i"+_1;
_46.groupIdPrefix="_easyui_combobox_g"+_1;
$(_45).addClass("combobox-f");
$(_45).combo($.extend({},_47,{onShowPanel:function(){
$(_45).combo("panel").find("div.combobox-item:hidden,div.combobox-group:hidden").show();
_8(_45,$(_45).combobox("getValue"));
_47.onShowPanel.call(_45);
}}));
$(_45).combo("panel").unbind().bind("mouseover",function(e){
$(this).children("div.combobox-item-hover").removeClass("combobox-item-hover");
var _48=$(e.target).closest("div.combobox-item");
if(!_48.hasClass("combobox-item-disabled")){
_48.addClass("combobox-item-hover");
}
e.stopPropagation();
}).bind("mouseout",function(e){
$(e.target).closest("div.combobox-item").removeClass("combobox-item-hover");
e.stopPropagation();
}).bind("click",function(e){
var _49=$(e.target).closest("div.combobox-item");
if(!_49.length||_49.hasClass("combobox-item-disabled")){
return;
}
var row=_47.finder.getRow(_45,_49);
if(!row){
return;
}
var _4a=row[_47.valueField];
if(_47.multiple){
if(_49.hasClass("combobox-item-selected")){
_1b(_45,_4a);
}else{
_15(_45,_4a);
}
}else{
_15(_45,_4a);
$(_45).combo("hidePanel");
}
e.stopPropagation();
});
};
$.fn.combobox=function(_4b,_4c){
if(typeof _4b=="string"){
var _4d=$.fn.combobox.methods[_4b];
if(_4d){
return _4d(this,_4c);
}else{
return this.combo(_4b,_4c);
}
}
_4b=_4b||{};
return this.each(function(){
var _4e=$.data(this,"combobox");
if(_4e){
$.extend(_4e.options,_4b);
}else{
_4e=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_4b),data:[]});
}
_44(this);
if(_4e.options.data){
_26(this,_4e.options.data);
}else{
var _4f=$.fn.combobox.parseData(this);
if(_4f.length){
_26(this,_4f);
}
}
_2e(this);
});
};
$.fn.combobox.methods={options:function(jq){
var _50=jq.combo("options");
return $.extend($.data(jq[0],"combobox").options,{width:_50.width,height:_50.height,originalValue:_50.originalValue,disabled:_50.disabled,readonly:_50.readonly});
},getData:function(jq){
return $.data(jq[0],"combobox").data;
},setValues:function(jq,_51){
return jq.each(function(){
_1a(this,_51);
});
},setValue:function(jq,_52){
return jq.each(function(){
_1a(this,[_52]);
});
},clear:function(jq){
return jq.each(function(){
$(this).combo("clear");
var _53=$(this).combo("panel");
_53.find("div.combobox-item-selected").removeClass("combobox-item-selected");
});
},reset:function(jq){
return jq.each(function(){
var _54=$(this).combobox("options");
if(_54.multiple){
$(this).combobox("setValues",_54.originalValue);
}else{
$(this).combobox("setValue",_54.originalValue);
}
});
},loadData:function(jq,_55){
return jq.each(function(){
_26(this,_55);
});
},reload:function(jq,url){
return jq.each(function(){
if(typeof url=="string"){
_2e(this,url);
}else{
if(url){
var _56=$(this).combobox("options");
_56.queryParams=url;
}
_2e(this);
}
});
},select:function(jq,_57){
return jq.each(function(){
_15(this,_57);
});
},unselect:function(jq,_58){
return jq.each(function(){
_1b(this,_58);
});
}};
$.fn.combobox.parseOptions=function(_59){
var t=$(_59);
return $.extend({},$.fn.combo.parseOptions(_59),$.parser.parseOptions(_59,["valueField","textField","groupField","mode","method","url"]));
};
$.fn.combobox.parseData=function(_5a){
var _5b=[];
var _5c=$(_5a).combobox("options");
$(_5a).children().each(function(){
if(this.tagName.toLowerCase()=="optgroup"){
var _5d=$(this).attr("label");
$(this).children().each(function(){
_5e(this,_5d);
});
}else{
_5e(this);
}
});
return _5b;
function _5e(el,_5f){
var t=$(el);
var row={};
row[_5c.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text();
row[_5c.textField]=t.text();
row["selected"]=t.is(":selected");
row["disabled"]=t.is(":disabled");
if(_5f){
_5c.groupField=_5c.groupField||"group";
row[_5c.groupField]=_5f;
}
_5b.push(row);
};
};
$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupField:null,groupFormatter:function(_60){
return _60;
},mode:"local",method:"post",url:null,data:null,queryParams:{},keyHandler:{up:function(e){
_e(this,"prev");
e.preventDefault();
},down:function(e){
_e(this,"next");
e.preventDefault();
},left:function(e){
},right:function(e){
},enter:function(e){
_3e(this);
},query:function(q,e){
_34(this,q);
}},filter:function(q,row){
var _61=$(this).combobox("options");
return row[_61.textField].toLowerCase().indexOf(q.toLowerCase())==0;
},formatter:function(row){
var _62=$(this).combobox("options");
return row[_62.textField];
},loader:function(_63,_64,_65){
var _66=$(this).combobox("options");
if(!_66.url){
return false;
}
$.ajax({type:_66.method,url:_66.url,data:_63,dataType:"json",success:function(_67){
_64(_67);
},error:function(){
_65.apply(this,arguments);
}});
},loadFilter:function(_68){
return _68;
},finder:{getEl:function(_69,_6a){
var _6b=_2(_69,_6a);
var id=$.data(_69,"combobox").itemIdPrefix+"_"+_6b;
return $("#"+id);
},getRow:function(_6c,p){
var _6d=$.data(_6c,"combobox");
var _6e=(p instanceof jQuery)?p.attr("id").substr(_6d.itemIdPrefix.length+1):_2(_6c,p);
return _6d.data[parseInt(_6e)];
}},onBeforeLoad:function(_6f){
},onLoadSuccess:function(){
},onLoadError:function(){
},onSelect:function(_70){
},onUnselect:function(_71){
}});
})(jQuery);
+320
View File
@@ -0,0 +1,320 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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(){
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:function(_b){
var _c=$(_2).combo("getValues");
var _d=_4.onSelect;
_4.onSelect=function(){
};
_15(_2,_c,_3.remainText);
_4.onSelect=_d;
_4.onLoadSuccess.apply(_2,arguments);
},onClickRow:_e,onSelect:function(_f,row){
_10();
_4.onSelect.call(this,_f,row);
},onUnselect:function(_11,row){
_10();
_4.onUnselect.call(this,_11,row);
},onSelectAll:function(_12){
_10();
_4.onSelectAll.call(this,_12);
},onUnselectAll:function(_13){
if(_4.multiple){
_10();
}
_4.onUnselectAll.call(this,_13);
}}));
function _e(_14,row){
_3.remainText=false;
_10();
if(!_4.multiple){
$(_2).combo("hidePanel");
}
_4.onClickRow.call(this,_14,row);
};
function _10(){
var vv=$.map(_5.datagrid("getSelections"),function(row){
return row[_4.idField];
});
vv=vv.concat(_4.unselectedValues);
if(!_4.multiple){
vv=vv.length?[vv[0]]:[""];
}
_15(_2,vv,_3.remainText);
};
};
function nav(_16,dir){
var _17=$.data(_16,"combogrid");
var _18=_17.options;
var _19=_17.grid;
var _1a=_19.datagrid("getRows").length;
if(!_1a){
return;
}
var tr=_18.finder.getTr(_19[0],null,"highlight");
if(!tr.length){
tr=_18.finder.getTr(_19[0],null,"selected");
}
var _1b;
if(!tr.length){
_1b=(dir=="next"?0:_1a-1);
}else{
var _1b=parseInt(tr.attr("datagrid-row-index"));
_1b+=(dir=="next"?1:-1);
if(_1b<0){
_1b=_1a-1;
}
if(_1b>=_1a){
_1b=0;
}
}
_19.datagrid("highlightRow",_1b);
if(_18.selectOnNavigation){
_17.remainText=false;
_19.datagrid("selectRow",_1b);
}
};
function _15(_1c,_1d,_1e){
var _1f=$.data(_1c,"combogrid");
var _20=_1f.options;
var _21=_1f.grid;
var _22=$(_1c).combo("getValues");
var _23=$(_1c).combo("options");
var _24=_23.onChange;
_23.onChange=function(){
};
var _25=_21.datagrid("options");
var _26=_25.onSelect;
var _27=_25.onUnselectAll;
_25.onSelect=_25.onUnselectAll=function(){
};
if(!$.isArray(_1d)){
_1d=_1d.split(_20.separator);
}
var _28=[];
$.map(_21.datagrid("getSelections"),function(row){
if($.inArray(row[_20.idField],_1d)>=0){
_28.push(row);
}
});
_21.datagrid("clearSelections");
_21.data("datagrid").selectedRows=_28;
var ss=[];
for(var i=0;i<_1d.length;i++){
var _29=_1d[i];
var _2a=_21.datagrid("getRowIndex",_29);
if(_2a>=0){
_21.datagrid("selectRow",_2a);
}
ss.push(_2b(_29,_21.datagrid("getRows"))||_2b(_29,_21.datagrid("getSelections"))||_2b(_29,_20.mappingRows)||_29);
}
_20.unselectedValues=[];
var _2c=$.map(_28,function(row){
return row[_20.idField];
});
$.map(_1d,function(_2d){
if($.inArray(_2d,_2c)==-1){
_20.unselectedValues.push(_2d);
}
});
$(_1c).combo("setValues",_22);
_23.onChange=_24;
_25.onSelect=_26;
_25.onUnselectAll=_27;
if(!_1e){
var s=ss.join(_20.separator);
if($(_1c).combo("getText")!=s){
$(_1c).combo("setText",s);
}
}
$(_1c).combo("setValues",_1d);
function _2b(_2e,a){
for(var i=0;i<a.length;i++){
if(_2e==a[i][_20.idField]){
return a[i][_20.textField];
}
}
return undefined;
};
};
function _2f(_30,q){
var _31=$.data(_30,"combogrid");
var _32=_31.options;
var _33=_31.grid;
_31.remainText=true;
if(_32.multiple&&!q){
_15(_30,[],true);
}else{
_15(_30,[q],true);
}
if(_32.mode=="remote"){
_33.datagrid("clearSelections");
_33.datagrid("load",$.extend({},_32.queryParams,{q:q}));
}else{
if(!q){
return;
}
_33.datagrid("clearSelections").datagrid("highlightRow",-1);
var _34=_33.datagrid("getRows");
var qq=_32.multiple?q.split(_32.separator):[q];
$.map(qq,function(q){
q=$.trim(q);
if(q){
$.map(_34,function(row,i){
if(q==row[_32.textField]){
_33.datagrid("selectRow",i);
}else{
if(_32.filter.call(_30,q,row)){
_33.datagrid("highlightRow",i);
}
}
});
}
});
}
};
function _35(_36){
var _37=$.data(_36,"combogrid");
var _38=_37.options;
var _39=_37.grid;
var tr=_38.finder.getTr(_39[0],null,"highlight");
_37.remainText=false;
if(tr.length){
var _3a=parseInt(tr.attr("datagrid-row-index"));
if(_38.multiple){
if(tr.hasClass("datagrid-row-selected")){
_39.datagrid("unselectRow",_3a);
}else{
_39.datagrid("selectRow",_3a);
}
}else{
_39.datagrid("selectRow",_3a);
}
}
var vv=[];
$.map(_39.datagrid("getSelections"),function(row){
vv.push(row[_38.idField]);
});
$(_36).combogrid("setValues",vv);
if(!_38.multiple){
$(_36).combogrid("hidePanel");
}
};
$.fn.combogrid=function(_3b,_3c){
if(typeof _3b=="string"){
var _3d=$.fn.combogrid.methods[_3b];
if(_3d){
return _3d(this,_3c);
}else{
return this.combo(_3b,_3c);
}
}
_3b=_3b||{};
return this.each(function(){
var _3e=$.data(this,"combogrid");
if(_3e){
$.extend(_3e.options,_3b);
}else{
_3e=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_3b)});
}
_1(this);
});
};
$.fn.combogrid.methods={options:function(jq){
var _3f=jq.combo("options");
return $.extend($.data(jq[0],"combogrid").options,{width:_3f.width,height:_3f.height,originalValue:_3f.originalValue,disabled:_3f.disabled,readonly:_3f.readonly});
},grid:function(jq){
return $.data(jq[0],"combogrid").grid;
},setValues:function(jq,_40){
return jq.each(function(){
var _41=$(this).combogrid("options");
if($.isArray(_40)){
_40=$.map(_40,function(_42){
if(typeof _42=="object"){
var v=_42[_41.idField];
(function(){
for(var i=0;i<_41.mappingRows.length;i++){
if(v==_41.mappingRows[i][_41.idField]){
return;
}
}
_41.mappingRows.push(_42);
})();
return v;
}else{
return _42;
}
});
}
_15(this,_40);
});
},setValue:function(jq,_43){
return jq.each(function(){
$(this).combogrid("setValues",[_43]);
});
},clear:function(jq){
return jq.each(function(){
$(this).combogrid("grid").datagrid("clearSelections");
$(this).combo("clear");
});
},reset:function(jq){
return jq.each(function(){
var _44=$(this).combogrid("options");
if(_44.multiple){
$(this).combogrid("setValues",_44.originalValue);
}else{
$(this).combogrid("setValue",_44.originalValue);
}
});
}};
$.fn.combogrid.parseOptions=function(_45){
var t=$(_45);
return $.extend({},$.fn.combo.parseOptions(_45),$.fn.datagrid.parseOptions(_45),$.parser.parseOptions(_45,["idField","textField","mode"]));
};
$.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{height:22,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){
_35(this);
},query:function(q,e){
_2f(this,q);
}},filter:function(q,row){
var _46=$(this).combogrid("options");
return (row[_46.textField]||"").toLowerCase().indexOf(q.toLowerCase())==0;
}});
})(jQuery);
+191
View File
@@ -0,0 +1,191 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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(_4);
var _6=$(_2).combo("panel");
if(!_5){
_5=$("<ul></ul>").appendTo(_6);
$.data(_2,"combotree").tree=_5;
}
_5.tree($.extend({},_4,{checkbox:_4.multiple,onLoadSuccess:function(_7,_8){
var _9=$(_2).combotree("getValues");
if(_4.multiple){
var _a=_5.tree("getChecked");
for(var i=0;i<_a.length;i++){
var id=_a[i].id;
(function(){
for(var i=0;i<_9.length;i++){
if(id==_9[i]){
return;
}
}
_9.push(id);
})();
}
}
$(_2).combotree("setValues",_9);
_4.onLoadSuccess.call(this,_7,_8);
},onClick:function(_b){
if(_4.multiple){
$(this).tree(_b.checked?"uncheck":"check",_b.target);
}else{
$(_2).combo("hidePanel");
}
_e(_2);
_4.onClick.call(this,_b);
},onCheck:function(_c,_d){
_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=[],ss=[];
if(_11.multiple){
var _13=_12.tree("getChecked");
for(var i=0;i<_13.length;i++){
vv.push(_13[i].id);
ss.push(_13[i].text);
}
}else{
var _14=_12.tree("getSelected");
if(_14){
vv.push(_14.id);
ss.push(_14.text);
}
}
$(_f).combo("setText",ss.join(_11.separator)).combo("setValues",_11.multiple?vv:(vv.length?vv:[""]));
};
function _15(_16,_17){
var _18=$.data(_16,"combotree");
var _19=_18.options;
var _1a=_18.tree;
var _1b=_1a.tree("options");
var _1c=_1b.onCheck;
var _1d=_1b.onSelect;
_1b.onCheck=_1b.onSelect=function(){
};
_1a.find("span.tree-checkbox").addClass("tree-checkbox0").removeClass("tree-checkbox1 tree-checkbox2");
if(!$.isArray(_17)){
_17=_17.split(_19.separator);
}
var vv=$.map(_17,function(_1e){
return String(_1e);
});
var ss=[];
$.map(vv,function(v){
var _1f=_1a.tree("find",v);
if(_1f){
_1a.tree("check",_1f.target).tree("select",_1f.target);
ss.push(_1f.text);
}else{
ss.push(v);
}
});
if(_19.multiple){
var _20=_1a.tree("getChecked");
$.map(_20,function(_21){
var id=String(_21.id);
if($.inArray(id,vv)==-1){
vv.push(id);
ss.push(_21.text);
}
});
}
_1b.onCheck=_1c;
_1b.onSelect=_1d;
$(_16).combo("setText",ss.join(_19.separator)).combo("setValues",_19.multiple?vv:(vv.length?vv:[""]));
};
$.fn.combotree=function(_22,_23){
if(typeof _22=="string"){
var _24=$.fn.combotree.methods[_22];
if(_24){
return _24(this,_23);
}else{
return this.combo(_22,_23);
}
}
_22=_22||{};
return this.each(function(){
var _25=$.data(this,"combotree");
if(_25){
$.extend(_25.options,_22);
}else{
$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_22)});
}
_1(this);
});
};
$.fn.combotree.methods={options:function(jq){
var _26=jq.combo("options");
return $.extend($.data(jq[0],"combotree").options,{width:_26.width,height:_26.height,originalValue:_26.originalValue,disabled:_26.disabled,readonly:_26.readonly});
},clone:function(jq,_27){
var t=jq.combo("clone",_27);
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,_28){
return jq.each(function(){
var _29=$.data(this,"combotree").options;
_29.data=_28;
var _2a=$.data(this,"combotree").tree;
_2a.tree("loadData",_28);
});
},reload:function(jq,url){
return jq.each(function(){
var _2b=$.data(this,"combotree").options;
var _2c=$.data(this,"combotree").tree;
if(url){
_2b.url=url;
}
_2c.tree({url:_2b.url});
});
},setValues:function(jq,_2d){
return jq.each(function(){
_15(this,_2d);
});
},setValue:function(jq,_2e){
return jq.each(function(){
_15(this,[_2e]);
});
},clear:function(jq){
return jq.each(function(){
var _2f=$.data(this,"combotree").tree;
_2f.find("div.tree-node-selected").removeClass("tree-node-selected");
var cc=_2f.tree("getChecked");
for(var i=0;i<cc.length;i++){
_2f.tree("uncheck",cc[i].target);
}
$(this).combo("clear");
});
},reset:function(jq){
return jq.each(function(){
var _30=$(this).combotree("options");
if(_30.multiple){
$(this).combotree("setValues",_30.originalValue);
}else{
$(this).combotree("setValue",_30.originalValue);
}
});
}};
$.fn.combotree.parseOptions=function(_31){
return $.extend({},$.fn.combo.parseOptions(_31),$.fn.tree.parseOptions(_31));
};
$.fn.combotree.defaults=$.extend({},$.fn.combo.defaults,$.fn.tree.defaults,{editable:false});
})(jQuery);
File diff suppressed because it is too large Load Diff
+136
View File
@@ -0,0 +1,136 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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);
+212
View File
@@ -0,0 +1,212 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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");
_18(_a,_b.formatter.call(_a,_9));
$(_a).combo("hidePanel");
_b.onSelect.call(_a,_9);
}});
}
$(_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:void(0)\"></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){
_2c=_2b.formatter.call(this,_2b.parser.call(this,_2c));
}
$(this).combo("initValue",_2c).combo("setText",_2c);
});
},setValue:function(jq,_2d){
return jq.each(function(){
_18(this,_2d);
});
},reset:function(jq){
return jq.each(function(){
var _2e=$(this).datebox("options");
$(this).datebox("setValue",_2e.originalValue);
});
}};
$.fn.datebox.parseOptions=function(_2f){
return $.extend({},$.fn.combo.parseOptions(_2f),$.parser.parseOptions(_2f,["sharedCalendar"]));
};
$.fn.datebox.defaults=$.extend({},$.fn.combo.defaults,{panelWidth:180,panelHeight:"auto",sharedCalendar:null,keyHandler:{up:function(e){
},down:function(e){
},left:function(e){
},right:function(e){
},enter:function(e){
_19(this);
},query:function(q,e){
_16(this,q);
}},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_30){
return $(_30).datebox("options").currentText;
},handler:function(_31){
var now=new Date();
$(_31).datebox("calendar").calendar({year:now.getFullYear(),month:now.getMonth()+1,current:new Date(now.getFullYear(),now.getMonth(),now.getDate())});
_19(_31);
}},{text:function(_32){
return $(_32).datebox("options").closeText;
},handler:function(_33){
$(this).closest("div.combo-panel").panel("close");
}}],formatter:function(_34){
var y=_34.getFullYear();
var m=_34.getMonth()+1;
var d=_34.getDate();
return (m<10?("0"+m):m)+"/"+(d<10?("0"+d):d)+"/"+y;
},parser:function(s){
if(!s){
return new Date();
}
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 Date(y,m-1,d);
}else{
return new Date();
}
},onSelect:function(_35){
}});
})(jQuery);
+178
View File
@@ -0,0 +1,178 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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});
$(_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){
_23=_22.formatter.call(this,_22.parser.call(this,_23));
}
$(this).combo("initValue",_23).combo("setText",_23);
});
},setValue:function(jq,_24){
return jq.each(function(){
_d(this,_24);
});
},reset:function(jq){
return jq.each(function(){
var _25=$(this).datetimebox("options");
$(this).datetimebox("setValue",_25.originalValue);
});
}};
$.fn.datetimebox.parseOptions=function(_26){
var t=$(_26);
return $.extend({},$.fn.datebox.parseOptions(_26),$.parser.parseOptions(_26,["timeSeparator","spinnerWidth",{showSeconds:"boolean"}]));
};
$.fn.datetimebox.defaults=$.extend({},$.fn.datebox.defaults,{spinnerWidth:"100%",showSeconds:true,timeSeparator:":",keyHandler:{up:function(e){
},down:function(e){
},left:function(e){
},right:function(e){
},enter:function(e){
_e(this);
},query:function(q,e){
_b(this,q);
}},buttons:[{text:function(_27){
return $(_27).datetimebox("options").currentText;
},handler:function(_28){
var _29=$(_28).datetimebox("options");
_d(_28,_29.formatter.call(_28,new Date()));
$(_28).datetimebox("hidePanel");
}},{text:function(_2a){
return $(_2a).datetimebox("options").okText;
},handler:function(_2b){
_e(_2b);
}},{text:function(_2c){
return $(_2c).datetimebox("options").closeText;
},handler:function(_2d){
$(_2d).datetimebox("hidePanel");
}}],formatter:function(_2e){
var h=_2e.getHours();
var M=_2e.getMinutes();
var s=_2e.getSeconds();
function _2f(_30){
return (_30<10?"0":"")+_30;
};
var _31=$(this).datetimebox("spinner").timespinner("options").separator;
var r=$.fn.datebox.defaults.formatter(_2e)+" "+_2f(h)+_31+_2f(M);
if($(this).datetimebox("options").showSeconds){
r+=_31+_2f(s);
}
return r;
},parser:function(s){
if($.trim(s)==""){
return new Date();
}
var dt=s.split(" ");
var d=$.fn.datebox.defaults.parser(dt[0]);
if(dt.length<2){
return d;
}
var _32=$(this).datetimebox("spinner").timespinner("options").separator;
var tt=dt[1].split(_32);
var _33=parseInt(tt[0],10)||0;
var _34=parseInt(tt[1],10)||0;
var _35=parseInt(tt[2],10)||0;
return new Date(d.getFullYear(),d.getMonth(),d.getDate(),_33,_34,_35);
}});
})(jQuery);
@@ -0,0 +1,61 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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]);
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]]});
})(jQuery);
+136
View File
@@ -0,0 +1,136 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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:void(0)\"></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:void(0)\"></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({position:"relative",borderTopWidth:(_f?1:0),top:(_f?tb.length:0)});
bb.insertAfter(_c).css({position:"relative",top:-1});
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);
+304
View File
@@ -0,0 +1,304 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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").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;
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).trigger("_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,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){
},onStopDrag:function(e){
}};
$.fn.draggable.isDragging=false;
})(jQuery);
+62
View File
@@ -0,0 +1,62 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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);
+82
View File
@@ -0,0 +1,82 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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.attr("disabled","disabled");
}else{
_6.removeAttr("disabled");
}
}
};
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.change(function(){
$(_9).filebox("setText",this.value);
_b.onChange.call(_9,this.value,_b.oldValue);
_b.oldValue=this.value;
});
return _c;
};
$.fn.filebox=function(_d,_e){
if(typeof _d=="string"){
var _f=$.fn.filebox.methods[_d];
if(_f){
return _f(this,_e);
}else{
return this.textbox(_d,_e);
}
}
_d=_d||{};
return this.each(function(){
var _10=$.data(this,"filebox");
if(_10){
$.extend(_10.options,_d);
}else{
$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_d)});
}
_2(this);
});
};
$.fn.filebox.methods={options:function(jq){
var _11=jq.textbox("options");
return $.extend($.data(jq[0],"filebox").options,{width:_11.width,value:_11.value,originalValue:_11.originalValue,disabled:_11.disabled,readonly:_11.readonly});
},clear:function(jq){
return jq.each(function(){
$(this).textbox("clear");
_7(this);
});
},reset:function(jq){
return jq.each(function(){
$(this).filebox("clear");
});
}};
$.fn.filebox.parseOptions=function(_12){
return $.extend({},$.fn.textbox.parseOptions(_12),{});
};
$.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{}});
})(jQuery);
+329
View File
@@ -0,0 +1,329 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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;
}
$(_2).find(".textbox-text:focus").blur();
var _6="easyui_frame_"+(new Date().getTime());
var _7=$("<iframe id="+_6+" name="+_6+"></iframe>").appendTo("body");
_7.attr("src",window.ActiveXObject?"javascript:false":"about:blank");
_7.css({position:"absolute",top:-1000,left:-1000});
_7.bind("load",cb);
_8(_5);
function _8(_9){
var _a=$(_2);
if(_4.url){
_a.attr("action",_4.url);
}
var t=_a.attr("target"),a=_a.attr("action");
_a.attr("target",_6);
var _b=$();
try{
for(var n in _9){
var _c=$("<input type=\"hidden\" name=\""+n+"\">").val(_9[n]).appendTo(_a);
_b=_b.add(_c);
}
_d();
_a[0].submit();
}
finally{
_a.attr("action",a);
t?_a.attr("target",t):_a.removeAttr("target");
_b.remove();
}
};
function _d(){
var f=$("#"+_6);
if(!f.length){
return;
}
try{
var s=f.contents()[0].readyState;
if(s&&s.toLowerCase()=="uninitialized"){
setTimeout(_d,100);
}
}
catch(e){
cb();
}
};
var _e=10;
function cb(){
var f=$("#"+_6);
if(!f.length){
return;
}
f.unbind();
var _f="";
try{
var _10=f.contents().find("body");
_f=_10.html();
if(_f==""){
if(--_e){
setTimeout(cb,100);
return;
}
}
var ta=_10.find(">textarea");
if(ta.length){
_f=ta.val();
}else{
var pre=_10.find(">pre");
if(pre.length){
_f=pre.html();
}
}
}
catch(e){
}
_4.success(_f);
setTimeout(function(){
f.unbind();
f.remove();
},100);
};
};
function _11(_12,_13){
var _14=$.data(_12,"form").options;
if(typeof _13=="string"){
var _15={};
if(_14.onBeforeLoad.call(_12,_15)==false){
return;
}
$.ajax({url:_13,data:_15,dataType:"json",success:function(_16){
_17(_16);
},error:function(){
_14.onLoadError.apply(_12,arguments);
}});
}else{
_17(_13);
}
function _17(_18){
var _19=$(_12);
for(var _1a in _18){
var val=_18[_1a];
if(!_1b(_1a,val)){
if(!_1c(_1a,val)){
_19.find("input[name=\""+_1a+"\"]").val(val);
_19.find("textarea[name=\""+_1a+"\"]").val(val);
_19.find("select[name=\""+_1a+"\"]").val(val);
}
}
}
_14.onLoadSuccess.call(_12,_18);
_19.form("validate");
};
function _1b(_1d,val){
var cc=$(_12).find("[switchbuttonName=\""+_1d+"\"]");
if(cc.length){
cc.switchbutton("uncheck");
cc.each(function(){
if(_1e($(this).switchbutton("options").value,val)){
$(this).switchbutton("check");
}
});
return true;
}
cc=$(_12).find("input[name=\""+_1d+"\"][type=radio], input[name=\""+_1d+"\"][type=checkbox]");
if(cc.length){
cc._propAttr("checked",false);
cc.each(function(){
if(_1e($(this).val(),val)){
$(this)._propAttr("checked",true);
}
});
return true;
}
return false;
};
function _1e(v,val){
if(v==String(val)||$.inArray(v,$.isArray(val)?val:[val])>=0){
return true;
}else{
return false;
}
};
function _1c(_1f,val){
var _20=$(_12).find("[textboxName=\""+_1f+"\"],[sliderName=\""+_1f+"\"]");
if(_20.length){
for(var i=0;i<_14.fieldTypes.length;i++){
var _21=_14.fieldTypes[i];
var _22=_20.data(_21);
if(_22){
if(_22.options.multiple||_22.options.range){
_20[_21]("setValues",val);
}else{
_20[_21]("setValue",val);
}
return true;
}
}
}
return false;
};
};
function _23(_24){
$("input,select,textarea",_24).each(function(){
var t=this.type,tag=this.tagName.toLowerCase();
if(t=="text"||t=="hidden"||t=="password"||tag=="textarea"){
this.value="";
}else{
if(t=="file"){
var _25=$(this);
if(!_25.hasClass("textbox-value")){
var _26=_25.clone().val("");
_26.insertAfter(_25);
if(_25.data("validatebox")){
_25.validatebox("destroy");
_26.validatebox();
}else{
_25.remove();
}
}
}else{
if(t=="checkbox"||t=="radio"){
this.checked=false;
}else{
if(tag=="select"){
this.selectedIndex=-1;
}
}
}
}
});
var _27=$(_24);
var _28=$.data(_24,"form").options;
for(var i=_28.fieldTypes.length-1;i>=0;i--){
var _29=_28.fieldTypes[i];
var _2a=_27.find("."+_29+"-f");
if(_2a.length&&_2a[_29]){
_2a[_29]("clear");
}
}
_27.form("validate");
};
function _2b(_2c){
_2c.reset();
var _2d=$(_2c);
var _2e=$.data(_2c,"form").options;
for(var i=_2e.fieldTypes.length-1;i>=0;i--){
var _2f=_2e.fieldTypes[i];
var _30=_2d.find("."+_2f+"-f");
if(_30.length&&_30[_2f]){
_30[_2f]("reset");
}
}
_2d.form("validate");
};
function _31(_32){
var _33=$.data(_32,"form").options;
$(_32).unbind(".form");
if(_33.ajax){
$(_32).bind("submit.form",function(){
setTimeout(function(){
_1(_32,_33);
},0);
return false;
});
}
$(_32).bind("_change.form",function(e,t){
_33.onChange.call(this,t);
}).bind("change.form",function(e){
var t=e.target;
if(!$(t).hasClass("textbox-text")){
_33.onChange.call(this,t);
}
});
_34(_32,_33.novalidate);
};
function _35(_36,_37){
_37=_37||{};
var _38=$.data(_36,"form");
if(_38){
$.extend(_38.options,_37);
}else{
$.data(_36,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_36),_37)});
}
};
function _39(_3a){
if($.fn.validatebox){
var t=$(_3a);
t.find(".validatebox-text:not(:disabled)").validatebox("validate");
var _3b=t.find(".validatebox-invalid");
_3b.filter(":not(:disabled):first").focus();
return _3b.length==0;
}
return true;
};
function _34(_3c,_3d){
var _3e=$.data(_3c,"form").options;
_3e.novalidate=_3d;
$(_3c).find(".validatebox-text:not(:disabled)").validatebox(_3d?"disableValidation":"enableValidation");
};
$.fn.form=function(_3f,_40){
if(typeof _3f=="string"){
this.each(function(){
_35(this);
});
return $.fn.form.methods[_3f](this,_40);
}
return this.each(function(){
_35(this,_3f);
_31(this);
});
};
$.fn.form.methods={options:function(jq){
return $.data(jq[0],"form").options;
},submit:function(jq,_41){
return jq.each(function(){
_1(this,_41);
});
},load:function(jq,_42){
return jq.each(function(){
_11(this,_42);
});
},clear:function(jq){
return jq.each(function(){
_23(this);
});
},reset:function(jq){
return jq.each(function(){
_2b(this);
});
},validate:function(jq){
return _39(jq[0]);
},disableValidation:function(jq){
return jq.each(function(){
_34(this,true);
});
},enableValidation:function(jq){
return jq.each(function(){
_34(this,false);
});
}};
$.fn.form.parseOptions=function(_43){
var t=$(_43);
return $.extend({},$.parser.parseOptions(_43,[{ajax:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)});
};
$.fn.form.defaults={fieldTypes:["combobox","combotree","combogrid","datetimebox","datebox","combo","datetimespinner","timespinner","numberspinner","spinner","slider","searchbox","numberbox","textbox","switchbutton"],novalidate:false,ajax:true,url:null,queryParams:{},onSubmit:function(_44){
return $(this).form("validate");
},success:function(_45){
},onBeforeLoad:function(_46){
},onLoadSuccess:function(_47){
},onLoadError:function(){
},onChange:function(_48){
}};
})(jQuery);
+483
View File
@@ -0,0 +1,483 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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(cc){
var _15=cc.layout("options");
var _16=_15.onAdd;
_15.onAdd=function(){
};
cc.children("div").each(function(){
var _17=$.fn.layout.parsePanelOptions(this);
if("north,south,east,west,center".indexOf(_17.region)>=0){
_19(_13,_17,this);
}
});
_15.onAdd=_16;
};
cc.children("form").length?_14(cc.children("form")):_14(cc);
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:void(0)\"></a>").addClass(_20).appendTo(_1e);
t.bind("click",{dir:dir},function(e){
_2d(_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=$(">div.layout-split-proxy-v",_1a);
_27.css("top",e.pageY-$(_1a).offset().top-_27.height()/2);
}else{
var _27=$(">div.layout-split-proxy-h",_1a);
_27.css("left",e.pageX-$(_1a).offset().left-_27.width()/2);
}
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(_29,_2a){
var _2b=$.data(_29,"layout").panels;
if(_2b[_2a].length){
_2b[_2a].panel("destroy");
_2b[_2a]=$();
var _2c="expand"+_2a.substring(0,1).toUpperCase()+_2a.substring(1);
if(_2b[_2c]){
_2b[_2c].panel("destroy");
_2b[_2c]=undefined;
}
$(_29).layout("options").onRemove.call(_29,_2a);
}
};
function _2d(_2e,_2f,_30){
if(_30==undefined){
_30="normal";
}
var _31=$.data(_2e,"layout").panels;
var p=_31[_2f];
var _32=p.panel("options");
if(_32.onBeforeCollapse.call(p)==false){
return;
}
var _33="expand"+_2f.substring(0,1).toUpperCase()+_2f.substring(1);
if(!_31[_33]){
_31[_33]=_34(_2f);
var ep=_31[_33].panel("panel");
if(!_32.expandMode){
ep.css("cursor","default");
}else{
ep.bind("click",function(){
if(_32.expandMode=="dock"){
_41(_2e,_2f);
}else{
p.panel("expand",false).panel("open");
var _35=_36();
p.panel("resize",_35.collapse);
p.panel("panel").animate(_35.expand,function(){
$(this).unbind(".layout").bind("mouseleave.layout",{region:_2f},function(e){
if(_1==true){
return;
}
if($("body>div.combo-p>div.combo-panel:visible").length){
return;
}
_2d(_2e,e.data.region);
});
$(_2e).layout("options").onExpand.call(_2e,_2f);
});
}
return false;
});
}
}
var _37=_36();
if(!_a(_31[_33])){
_31.center.panel("resize",_37.resizeC);
}
p.panel("panel").animate(_37.collapse,_30,function(){
p.panel("collapse",false).panel("close");
_31[_33].panel("open").panel("resize",_37.expandP);
$(this).unbind(".layout");
$(_2e).layout("options").onCollapse.call(_2e,_2f);
});
function _34(dir){
var _38={"east":"left","west":"right","north":"down","south":"up"};
var _39=(_32.region=="north"||_32.region=="south");
var _3a="layout-button-"+_38[dir];
var p=$("<div></div>").appendTo(_2e);
p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:"&nbsp;",iconCls:(_32.hideCollapsedContent?null:_32.iconCls),closed:true,minWidth:0,minHeight:0,doSize:false,region:_32.region,collapsedSize:_32.collapsedSize,noheader:(!_39&&_32.hideExpandTool),tools:((_39&&_32.hideExpandTool)?null:[{iconCls:_3a,handler:function(){
_41(_2e,_2f);
return false;
}}])}));
if(!_32.hideCollapsedContent){
var _3b=typeof _32.collapsedContent=="function"?_32.collapsedContent.call(p[0],_32.title):_32.collapsedContent;
_39?p.panel("setTitle",_3b):p.html(_3b);
}
p.panel("panel").hover(function(){
$(this).addClass("layout-expand-over");
},function(){
$(this).removeClass("layout-expand-over");
});
return p;
};
function _36(){
var cc=$(_2e);
var _3c=_31.center.panel("options");
var _3d=_32.collapsedSize;
if(_2f=="east"){
var _3e=p.panel("panel")._outerWidth();
var _3f=_3c.width+_3e-_3d;
if(_32.split||!_32.border){
_3f++;
}
return {resizeC:{width:_3f},expand:{left:cc.width()-_3e},expandP:{top:_3c.top,left:cc.width()-_3d,width:_3d,height:_3c.height},collapse:{left:cc.width(),top:_3c.top,height:_3c.height}};
}else{
if(_2f=="west"){
var _3e=p.panel("panel")._outerWidth();
var _3f=_3c.width+_3e-_3d;
if(_32.split||!_32.border){
_3f++;
}
return {resizeC:{width:_3f,left:_3d-1},expand:{left:0},expandP:{left:0,top:_3c.top,width:_3d,height:_3c.height},collapse:{left:-_3e,top:_3c.top,height:_3c.height}};
}else{
if(_2f=="north"){
var _40=p.panel("panel")._outerHeight();
var hh=_3c.height;
if(!_a(_31.expandNorth)){
hh+=_40-_3d+((_32.split||!_32.border)?1:0);
}
_31.east.add(_31.west).add(_31.expandEast).add(_31.expandWest).panel("resize",{top:_3d-1,height:hh});
return {resizeC:{top:_3d-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_3d},collapse:{top:-_40,width:cc.width()}};
}else{
if(_2f=="south"){
var _40=p.panel("panel")._outerHeight();
var hh=_3c.height;
if(!_a(_31.expandSouth)){
hh+=_40-_3d+((_32.split||!_32.border)?1:0);
}
_31.east.add(_31.west).add(_31.expandEast).add(_31.expandWest).panel("resize",{height:hh});
return {resizeC:{height:hh},expand:{top:cc.height()-_40},expandP:{top:cc.height()-_3d,left:0,width:cc.width(),height:_3d},collapse:{top:cc.height(),width:cc.width()}};
}
}
}
}
};
};
function _41(_42,_43){
var _44=$.data(_42,"layout").panels;
var p=_44[_43];
var _45=p.panel("options");
if(_45.onBeforeExpand.call(p)==false){
return;
}
var _46="expand"+_43.substring(0,1).toUpperCase()+_43.substring(1);
if(_44[_46]){
_44[_46].panel("close");
p.panel("panel").stop(true,true);
p.panel("expand",false).panel("open");
var _47=_48();
p.panel("resize",_47.collapse);
p.panel("panel").animate(_47.expand,function(){
_2(_42);
$(_42).layout("options").onExpand.call(_42,_43);
});
}
function _48(){
var cc=$(_42);
var _49=_44.center.panel("options");
if(_43=="east"&&_44.expandEast){
return {collapse:{left:cc.width(),top:_49.top,height:_49.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}};
}else{
if(_43=="west"&&_44.expandWest){
return {collapse:{left:-p.panel("panel")._outerWidth(),top:_49.top,height:_49.height},expand:{left:0}};
}else{
if(_43=="north"&&_44.expandNorth){
return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}};
}else{
if(_43=="south"&&_44.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 _4a(_4b){
var _4c=$.data(_4b,"layout");
var _4d=_4c.options;
var _4e=_4c.panels;
var _4f=_4d.onCollapse;
_4d.onCollapse=function(){
};
_50("east");
_50("west");
_50("north");
_50("south");
_4d.onCollapse=_4f;
function _50(_51){
var p=_4e[_51];
if(p.length&&p.panel("options").collapsed){
_2d(_4b,_51,0);
}
};
};
function _52(_53,_54,_55){
var p=$(_53).layout("panel",_54);
p.panel("options").split=_55;
var cls="layout-split-"+_54;
var _56=p.panel("panel").removeClass(cls);
if(_55){
_56.addClass(cls);
}
_56.resizable({disabled:(!_55)});
_2(_53);
};
$.fn.layout=function(_57,_58){
if(typeof _57=="string"){
return $.fn.layout.methods[_57](this,_58);
}
_57=_57||{};
return this.each(function(){
var _59=$.data(this,"layout");
if(_59){
$.extend(_59.options,_57);
}else{
var _5a=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_57);
$.data(this,"layout",{options:_5a,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}});
_12(this);
}
_2(this);
_4a(this);
});
};
$.fn.layout.methods={options:function(jq){
return $.data(jq[0],"layout").options;
},resize:function(jq,_5b){
return jq.each(function(){
_2(this,_5b);
});
},panel:function(jq,_5c){
return $.data(jq[0],"layout").panels[_5c];
},collapse:function(jq,_5d){
return jq.each(function(){
_2d(this,_5d);
});
},expand:function(jq,_5e){
return jq.each(function(){
_41(this,_5e);
});
},add:function(jq,_5f){
return jq.each(function(){
_19(this,_5f);
_2(this);
if($(this).layout("panel",_5f.region).panel("options").collapsed){
_2d(this,_5f.region,0);
}
});
},remove:function(jq,_60){
return jq.each(function(){
_28(this,_60);
_2(this);
});
},split:function(jq,_61){
return jq.each(function(){
_52(this,_61,true);
});
},unsplit:function(jq,_62){
return jq.each(function(){
_52(this,_62,false);
});
}};
$.fn.layout.parseOptions=function(_63){
return $.extend({},$.parser.parseOptions(_63,[{fit:"boolean"}]));
};
$.fn.layout.defaults={fit:false,onExpand:function(_64){
},onCollapse:function(_65){
},onAdd:function(_66){
},onRemove:function(_67){
}};
$.fn.layout.parsePanelOptions=function(_68){
var t=$(_68);
return $.extend({},$.fn.panel.parseOptions(_68),$.parser.parseOptions(_68,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}]));
};
$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapsedSize:28,expandMode:"float",hideExpandTool:false,hideCollapsedContent:true,collapsedContent:function(_69){
var p=$(this);
var _6a=p.panel("options");
if(_6a.region=="north"||_6a.region=="south"){
return _69;
}
var _6b=_6a.collapsedSize-2;
var _6c=(_6b-16)/2;
_6c=_6b-_6c;
var cc=[];
if(_6a.iconCls){
cc.push("<div class=\"panel-icon "+_6a.iconCls+"\"></div>");
}
cc.push("<div class=\"panel-title layout-expand-title");
cc.push(_6a.iconCls?" layout-expand-with-icon":"");
cc.push("\" style=\"left:"+_6c+"px\">");
cc.push(_69);
cc.push("</div>");
return cc.join("");
},minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000});
})(jQuery);
+184
View File
@@ -0,0 +1,184 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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\">&nbsp;</span>").appendTo(_e);
}
if(_d.iconCls){
$("<span class=\"l-btn-icon\">&nbsp;</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:void(0)");
}
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;
}
}
};
$.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).removeAttr("disabled");
$(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);
+504
View File
@@ -0,0 +1,504 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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++){
_8(_6[i]);
}
function _7(_9){
var _a=[];
_9.addClass("menu");
_a.push(_9);
if(!_9.hasClass("menu-content")){
_9.children("div").each(function(){
var _b=$(this).children("div");
if(_b.length){
_b.appendTo("body");
this.submenu=_b;
var mm=_7(_b);
_a=_a.concat(mm);
}
});
}
return _a;
};
function _8(_c){
var wh=$.parser.parseOptions(_c[0],["width","height"]);
_c[0].originalHeight=wh.height||0;
if(_c.hasClass("menu-content")){
_c[0].originalWidth=wh.width||_c._outerWidth();
}else{
_c[0].originalWidth=wh.width||0;
_c.children("div").each(function(){
var _d=$(this);
var _e=$.extend({},$.parser.parseOptions(this,["name","iconCls","href",{separator:"boolean"}]),{disabled:(_d.attr("disabled")?true:undefined)});
if(_e.separator){
_d.addClass("menu-sep");
}
if(!_d.hasClass("menu-sep")){
_d[0].itemName=_e.name||"";
_d[0].itemHref=_e.href||"";
var _f=_d.addClass("menu-item").html();
_d.empty().append($("<div class=\"menu-text\"></div>").html(_f));
if(_e.iconCls){
$("<div class=\"menu-icon\"></div>").addClass(_e.iconCls).appendTo(_d);
}
if(_e.disabled){
_10(_3,_d[0],true);
}
if(_d[0].submenu){
$("<div class=\"menu-rightarrow\"></div>").appendTo(_d);
}
_11(_3,_d);
}
});
$("<div class=\"menu-line\"></div>").prependTo(_c);
}
_12(_3,_c);
if(!_c.hasClass("menu-inline")){
_c.hide();
}
_13(_3,_c);
};
};
function _12(_14,_15){
var _16=$.data(_14,"menu").options;
var _17=_15.attr("style")||"";
_15.css({display:"block",left:-10000,height:"auto",overflow:"hidden"});
_15.find(".menu-item").each(function(){
$(this)._outerHeight(_16.itemHeight);
$(this).find(".menu-text").css({height:(_16.itemHeight-2)+"px",lineHeight:(_16.itemHeight-2)+"px"});
});
_15.removeClass("menu-noline").addClass(_16.noline?"menu-noline":"");
var _18=_15[0].originalWidth||"auto";
if(isNaN(parseInt(_18))){
_18=0;
_15.find("div.menu-text").each(function(){
if(_18<$(this)._outerWidth()){
_18=$(this)._outerWidth();
}
});
_18+=40;
}
var _19=_15.outerHeight();
var _1a=_15[0].originalHeight||"auto";
if(isNaN(parseInt(_1a))){
_1a=_19;
if(_15.hasClass("menu-top")&&_16.alignTo){
var at=$(_16.alignTo);
var h1=at.offset().top-$(document).scrollTop();
var h2=$(window)._outerHeight()+$(document).scrollTop()-at.offset().top-at._outerHeight();
_1a=Math.min(_1a,Math.max(h1,h2));
}else{
if(_1a>$(window)._outerHeight()){
_1a=$(window).height();
}
}
}
_15.attr("style",_17);
_15._size({fit:(_15[0]==_14?_16.fit:false),width:_18,minWidth:_16.minWidth,height:_1a});
_15.css("overflow",_15.outerHeight()<_19?"auto":"hidden");
_15.children("div.menu-line")._outerHeight(_19-2);
};
function _13(_1b,_1c){
if(_1c.hasClass("menu-inline")){
return;
}
var _1d=$.data(_1b,"menu");
_1c.unbind(".menu").bind("mouseenter.menu",function(){
if(_1d.timer){
clearTimeout(_1d.timer);
_1d.timer=null;
}
}).bind("mouseleave.menu",function(){
if(_1d.options.hideOnUnhover){
_1d.timer=setTimeout(function(){
_1e(_1b,$(_1b).hasClass("menu-inline"));
},_1d.options.duration);
}
});
};
function _11(_1f,_20){
if(!_20.hasClass("menu-item")){
return;
}
_20.unbind(".menu");
_20.bind("click.menu",function(){
if($(this).hasClass("menu-item-disabled")){
return;
}
if(!this.submenu){
_1e(_1f,$(_1f).hasClass("menu-inline"));
var _21=this.itemHref;
if(_21){
location.href=_21;
}
}
$(this).trigger("mouseenter");
var _22=$(_1f).menu("getItem",this);
$.data(_1f,"menu").options.onClick.call(_1f,_22);
}).bind("mouseenter.menu",function(e){
_20.siblings().each(function(){
if(this.submenu){
_1(this.submenu);
}
$(this).removeClass("menu-active");
});
_20.addClass("menu-active");
if($(this).hasClass("menu-item-disabled")){
_20.addClass("menu-active-disabled");
return;
}
var _23=_20[0].submenu;
if(_23){
$(_1f).menu("show",{menu:_23,parent:_20});
}
}).bind("mouseleave.menu",function(e){
_20.removeClass("menu-active menu-active-disabled");
var _24=_20[0].submenu;
if(_24){
if(e.pageX>=parseInt(_24.css("left"))){
_20.addClass("menu-active");
}else{
_1(_24);
}
}else{
_20.removeClass("menu-active");
}
});
};
function _1e(_25,_26){
var _27=$.data(_25,"menu");
if(_27){
if($(_25).is(":visible")){
_1($(_25));
if(_26){
$(_25).show();
}else{
_27.options.onHide.call(_25);
}
}
}
return false;
};
function _28(_29,_2a){
var _2b,top;
_2a=_2a||{};
var _2c=$(_2a.menu||_29);
$(_29).menu("resize",_2c[0]);
if(_2c.hasClass("menu-top")){
var _2d=$.data(_29,"menu").options;
$.extend(_2d,_2a);
_2b=_2d.left;
top=_2d.top;
if(_2d.alignTo){
var at=$(_2d.alignTo);
_2b=at.offset().left;
top=at.offset().top+at._outerHeight();
if(_2d.align=="right"){
_2b+=at.outerWidth()-_2c.outerWidth();
}
}
if(_2b+_2c.outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){
_2b=$(window)._outerWidth()+$(document).scrollLeft()-_2c.outerWidth()-5;
}
if(_2b<0){
_2b=0;
}
top=_2e(top,_2d.alignTo);
}else{
var _2f=_2a.parent;
_2b=_2f.offset().left+_2f.outerWidth()-2;
if(_2b+_2c.outerWidth()+5>$(window)._outerWidth()+$(document).scrollLeft()){
_2b=_2f.offset().left-_2c.outerWidth()+2;
}
top=_2e(_2f.offset().top-3);
}
function _2e(top,_30){
if(top+_2c.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
if(_30){
top=$(_30).offset().top-_2c._outerHeight();
}else{
top=$(window)._outerHeight()+$(document).scrollTop()-_2c.outerHeight();
}
}
if(top<0){
top=0;
}
return top;
};
_2c.css({left:_2b,top:top});
_2c.show(0,function(){
if(!_2c[0].shadow){
_2c[0].shadow=$("<div class=\"menu-shadow\"></div>").insertAfter(_2c);
}
_2c[0].shadow.css({display:(_2c.hasClass("menu-inline")?"none":"block"),zIndex:$.fn.menu.defaults.zIndex++,left:_2c.css("left"),top:_2c.css("top"),width:_2c.outerWidth(),height:_2c.outerHeight()});
_2c.css("z-index",$.fn.menu.defaults.zIndex++);
if(_2c.hasClass("menu-top")){
$.data(_2c[0],"menu").options.onShow.call(_2c[0]);
}
});
};
function _1(_31){
if(_31&&_31.length){
_32(_31);
_31.find("div.menu-item").each(function(){
if(this.submenu){
_1(this.submenu);
}
$(this).removeClass("menu-active");
});
}
function _32(m){
m.stop(true,true);
if(m[0].shadow){
m[0].shadow.hide();
}
m.hide();
};
};
function _33(_34,_35){
var _36=null;
var tmp=$("<div></div>");
function _37(_38){
_38.children("div.menu-item").each(function(){
var _39=$(_34).menu("getItem",this);
var s=tmp.empty().html(_39.text).text();
if(_35==$.trim(s)){
_36=_39;
}else{
if(this.submenu&&!_36){
_37(this.submenu);
}
}
});
};
_37($(_34));
tmp.remove();
return _36;
};
function _10(_3a,_3b,_3c){
var t=$(_3b);
if(!t.hasClass("menu-item")){
return;
}
if(_3c){
t.addClass("menu-item-disabled");
if(_3b.onclick){
_3b.onclick1=_3b.onclick;
_3b.onclick=null;
}
}else{
t.removeClass("menu-item-disabled");
if(_3b.onclick1){
_3b.onclick=_3b.onclick1;
_3b.onclick1=null;
}
}
};
function _3d(_3e,_3f){
var _40=$.data(_3e,"menu").options;
var _41=$(_3e);
if(_3f.parent){
if(!_3f.parent.submenu){
var _42=$("<div class=\"menu\"><div class=\"menu-line\"></div></div>").appendTo("body");
_42.hide();
_3f.parent.submenu=_42;
$("<div class=\"menu-rightarrow\"></div>").appendTo(_3f.parent);
}
_41=_3f.parent.submenu;
}
if(_3f.separator){
var _43=$("<div class=\"menu-sep\"></div>").appendTo(_41);
}else{
var _43=$("<div class=\"menu-item\"></div>").appendTo(_41);
$("<div class=\"menu-text\"></div>").html(_3f.text).appendTo(_43);
}
if(_3f.iconCls){
$("<div class=\"menu-icon\"></div>").addClass(_3f.iconCls).appendTo(_43);
}
if(_3f.id){
_43.attr("id",_3f.id);
}
if(_3f.name){
_43[0].itemName=_3f.name;
}
if(_3f.href){
_43[0].itemHref=_3f.href;
}
if(_3f.onclick){
if(typeof _3f.onclick=="string"){
_43.attr("onclick",_3f.onclick);
}else{
_43[0].onclick=eval(_3f.onclick);
}
}
if(_3f.handler){
_43[0].onclick=eval(_3f.handler);
}
if(_3f.disabled){
_10(_3e,_43[0],true);
}
_11(_3e,_43);
_13(_3e,_41);
_12(_3e,_41);
};
function _44(_45,_46){
function _47(el){
if(el.submenu){
el.submenu.children("div.menu-item").each(function(){
_47(this);
});
var _48=el.submenu[0].shadow;
if(_48){
_48.remove();
}
el.submenu.remove();
}
$(el).remove();
};
var _49=$(_46).parent();
_47(_46);
_12(_45,_49);
};
function _4a(_4b,_4c,_4d){
var _4e=$(_4c).parent();
if(_4d){
$(_4c).show();
}else{
$(_4c).hide();
}
_12(_4b,_4e);
};
function _4f(_50){
$(_50).children("div.menu-item").each(function(){
_44(_50,this);
});
if(_50.shadow){
_50.shadow.remove();
}
$(_50).remove();
};
$.fn.menu=function(_51,_52){
if(typeof _51=="string"){
return $.fn.menu.methods[_51](this,_52);
}
_51=_51||{};
return this.each(function(){
var _53=$.data(this,"menu");
if(_53){
$.extend(_53.options,_51);
}else{
_53=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_51)});
_2(this);
}
$(this).css({left:_53.options.left,top:_53.options.top});
});
};
$.fn.menu.methods={options:function(jq){
return $.data(jq[0],"menu").options;
},show:function(jq,pos){
return jq.each(function(){
_28(this,pos);
});
},hide:function(jq){
return jq.each(function(){
_1e(this);
});
},destroy:function(jq){
return jq.each(function(){
_4f(this);
});
},setText:function(jq,_54){
return jq.each(function(){
$(_54.target).children("div.menu-text").html(_54.text);
});
},setIcon:function(jq,_55){
return jq.each(function(){
$(_55.target).children("div.menu-icon").remove();
if(_55.iconCls){
$("<div class=\"menu-icon\"></div>").addClass(_55.iconCls).appendTo(_55.target);
}
});
},getItem:function(jq,_56){
var t=$(_56);
var _57={target:_56,id:t.attr("id"),text:$.trim(t.children("div.menu-text").html()),disabled:t.hasClass("menu-item-disabled"),name:_56.itemName,href:_56.itemHref,onclick:_56.onclick};
var _58=t.children("div.menu-icon");
if(_58.length){
var cc=[];
var aa=_58.attr("class").split(" ");
for(var i=0;i<aa.length;i++){
if(aa[i]!="menu-icon"){
cc.push(aa[i]);
}
}
_57.iconCls=cc.join(" ");
}
return _57;
},findItem:function(jq,_59){
return _33(jq[0],_59);
},appendItem:function(jq,_5a){
return jq.each(function(){
_3d(this,_5a);
});
},removeItem:function(jq,_5b){
return jq.each(function(){
_44(this,_5b);
});
},enableItem:function(jq,_5c){
return jq.each(function(){
_10(this,_5c,false);
});
},disableItem:function(jq,_5d){
return jq.each(function(){
_10(this,_5d,true);
});
},showItem:function(jq,_5e){
return jq.each(function(){
_4a(this,_5e,true);
});
},hideItem:function(jq,_5f){
return jq.each(function(){
_4a(this,_5f,false);
});
},resize:function(jq,_60){
return jq.each(function(){
_12(this,$(_60));
});
}};
$.fn.menu.parseOptions=function(_61){
return $.extend({},$.parser.parseOptions(_61,[{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:120,itemHeight:22,duration:100,hideOnUnhover:true,inline:false,fit:false,noline:false,onShow:function(){
},onHide:function(){
},onClick:function(_62){
}};
})(jQuery);
+128
View File
@@ -0,0 +1,128 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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("click.menubutton",function(){
if(!_13()){
_14(_10);
return false;
}
}).bind("mouseenter.menubutton",function(){
if(!_13()){
_12=setTimeout(function(){
_14(_10);
},_11.duration);
return false;
}
}).bind("mouseleave.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).removeAttr("disabled");
}
_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,cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}});
})(jQuery);
+179
View File
@@ -0,0 +1,179 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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;
}
}
}
}
});
};
function _4(){
$(document).unbind(".messager");
};
function _5(_6){
var _7=$.extend({},$.messager.defaults,{modal:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},title:"",width:250,height:100,minHeight:0,showType:"slide",showSpeed:600,content:_6.msg,timeout:4000},_6);
var _8=$("<div class=\"messager-body\"></div>").appendTo("body");
_8.dialog($.extend({},_7,{noheader:(_7.title?false:true),openAnimation:(_7.showType),closeAnimation:(_7.showType=="show"?"hide":_7.showType),openDuration:_7.showSpeed,closeDuration:_7.showSpeed,onOpen:function(){
_8.dialog("dialog").hover(function(){
if(_7.timer){
clearTimeout(_7.timer);
}
},function(){
_9();
});
_9();
function _9(){
if(_7.timeout>0){
_7.timer=setTimeout(function(){
if(_8.length&&_8.data("dialog")){
_8.dialog("close");
}
},_7.timeout);
}
};
if(_6.onOpen){
_6.onOpen.call(this);
}else{
_7.onOpen.call(this);
}
},onClose:function(){
if(_7.timer){
clearTimeout(_7.timer);
}
if(_6.onClose){
_6.onClose.call(this);
}else{
_7.onClose.call(this);
}
_8.dialog("destroy");
}}));
_8.dialog("dialog").css(_7.style);
_8.dialog("open");
return _8;
};
function _a(_b){
_1();
var _c=$("<div class=\"messager-body\"></div>").appendTo("body");
_c.dialog($.extend({},_b,{noheader:(_b.title?false:true),onClose:function(){
_4();
if(_b.onClose){
_b.onClose.call(this);
}
setTimeout(function(){
_c.dialog("destroy");
},100);
}}));
var _d=_c.dialog("dialog").addClass("messager-window");
_d.find(".dialog-button").addClass("messager-button").find("a:first").focus();
return _c;
};
function _e(_f,_10){
_f.dialog("close");
_f.dialog("options").fn(_10);
};
$.messager={show:function(_11){
return _5(_11);
},alert:function(_12,msg,_13,fn){
var _14=typeof _12=="object"?_12:{title:_12,msg:msg,icon:_13,fn:fn};
var cls=_14.icon?"messager-icon messager-"+_14.icon:"";
_14=$.extend({},$.messager.defaults,{content:"<div class=\""+cls+"\"></div>"+"<div>"+_14.msg+"</div>"+"<div style=\"clear:both;\"/>"},_14);
if(!_14.buttons){
_14.buttons=[{text:_14.ok,onClick:function(){
_e(dlg);
}}];
}
var dlg=_a(_14);
return dlg;
},confirm:function(_15,msg,fn){
var _16=typeof _15=="object"?_15:{title:_15,msg:msg,fn:fn};
_16=$.extend({},$.messager.defaults,{content:"<div class=\"messager-icon messager-question\"></div>"+"<div>"+_16.msg+"</div>"+"<div style=\"clear:both;\"/>"},_16);
if(!_16.buttons){
_16.buttons=[{text:_16.ok,onClick:function(){
_e(dlg,true);
}},{text:_16.cancel,onClick:function(){
_e(dlg,false);
}}];
}
var dlg=_a(_16);
return dlg;
},prompt:function(_17,msg,fn){
var _18=typeof _17=="object"?_17:{title:_17,msg:msg,fn:fn};
_18=$.extend({},$.messager.defaults,{content:"<div class=\"messager-icon messager-question\"></div>"+"<div>"+_18.msg+"</div>"+"<br/>"+"<div style=\"clear:both;\"/>"+"<div><input class=\"messager-input\" type=\"text\"/></div>"},_18);
if(!_18.buttons){
_18.buttons=[{text:_18.ok,onClick:function(){
_e(dlg,dlg.find(".messager-input").val());
}},{text:_18.cancel,onClick:function(){
_e(dlg);
}}];
}
var dlg=_a(_18);
dlg.find("input.messager-input").focus();
return dlg;
},progress:function(_19){
var _1a={bar:function(){
return $("body>div.messager-window").find("div.messager-p-bar");
},close:function(){
var dlg=$("body>div.messager-window>div.messager-body:has(div.messager-progress)");
if(dlg.length){
dlg.dialog("close");
}
}};
if(typeof _19=="string"){
var _1b=_1a[_19];
return _1b();
}
_19=_19||{};
var _1c=$.extend({},{title:"",minHeight:0,content:undefined,msg:"",text:undefined,interval:300},_19);
var dlg=_a($.extend({},$.messager.defaults,{content:"<div class=\"messager-progress\"><div class=\"messager-p-msg\">"+_1c.msg+"</div><div class=\"messager-p-bar\"></div></div>",closable:false,doSize:false},_1c,{onClose:function(){
if(this.timer){
clearInterval(this.timer);
}
if(_19.onClose){
_19.onClose.call(this);
}else{
$.messager.defaults.onClose.call(this);
}
}}));
var bar=dlg.find("div.messager-p-bar");
bar.progressbar({text:_1c.text});
dlg.dialog("resize");
if(_1c.interval){
dlg[0].timer=setInterval(function(){
var v=bar.progressbar("getValue");
v+=10;
if(v>100){
v=0;
}
bar.progressbar("setValue",v);
},_1c.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);
+137
View File
@@ -0,0 +1,137 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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","filebox","searchbox","combo","combobox","combogrid","combotree","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){
if($.fn[_19]){
$.extend($.fn[_19].defaults,{height:32,iconWidth:28,tipPosition:"bottom"});
}
});
$.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){
$.extend($.fn[_1a].defaults,{height:32,iconWidth:56});
});
$.extend($.fn.menu.defaults,{itemHeight:30,noline:true});
})(jQuery);
+174
View File
@@ -0,0 +1,174 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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;
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});
},fix:function(jq){
return jq.each(function(){
$(this).numberbox("setValue",$(this).numberbox("getText"));
});
},setValue:function(jq,_12){
return jq.each(function(){
_7(this,_12);
});
},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(_13){
var t=$(_13);
return $.extend({},$.fn.textbox.parseOptions(_13),$.parser.parseOptions(_13,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)});
};
$.fn.numberbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{keypress:function(e){
var _14=e.data.target;
var _15=$(_14).numberbox("options");
return _15.filter.call(_14,e);
},blur:function(e){
var _16=e.data.target;
$(_16).numberbox("setValue",$(_16).numberbox("getText"));
},keydown:function(e){
if(e.keyCode==13){
var _17=e.data.target;
$(_17).numberbox("setValue",$(_17).numberbox("getText"));
}
}},min:null,max:null,precision:0,decimalSeparator:".",groupSeparator:"",prefix:"",suffix:"",filter:function(e){
var _18=$(this).numberbox("options");
var s=$(this).numberbox("getText");
if(e.which==13){
return true;
}
if(e.which==45){
return (s.indexOf("-")==-1?true:false);
}
var c=String.fromCharCode(e.which);
if(c==_18.decimalSeparator){
return (s.indexOf(c)==-1?true:false);
}else{
if(c==_18.groupSeparator){
return true;
}else{
if((e.which>=48&&e.which<=57&&e.ctrlKey==false&&e.shiftKey==false)||e.which==0||e.which==8){
return true;
}else{
if(e.ctrlKey==true&&(e.which==99||e.which==118)){
return true;
}else{
return false;
}
}
}
}
},formatter:function(_19){
if(!_19){
return _19;
}
_19=_19+"";
var _1a=$(this).numberbox("options");
var s1=_19,s2="";
var _1b=_19.indexOf(".");
if(_1b>=0){
s1=_19.substring(0,_1b);
s2=_19.substring(_1b+1,_19.length);
}
if(_1a.groupSeparator){
var p=/(\d+)(\d{3})/;
while(p.test(s1)){
s1=s1.replace(p,"$1"+_1a.groupSeparator+"$2");
}
}
if(s2){
return _1a.prefix+s1+_1a.decimalSeparator+s2+_1a.suffix;
}else{
return _1a.prefix+s1+_1a.suffix;
}
},parser:function(s){
s=s+"";
var _1c=$(this).numberbox("options");
if(parseFloat(s)!=s){
if(_1c.prefix){
s=$.trim(s.replace(new RegExp("\\"+$.trim(_1c.prefix),"g"),""));
}
if(_1c.suffix){
s=$.trim(s.replace(new RegExp("\\"+$.trim(_1c.suffix),"g"),""));
}
if(_1c.groupSeparator){
s=$.trim(s.replace(new RegExp("\\"+_1c.groupSeparator,"g"),""));
}
if(_1c.decimalSeparator){
s=$.trim(s.replace(new RegExp("\\"+_1c.decimalSeparator,"g"),"."));
}
s=s.replace(/\s/g,"");
}
var val=parseFloat(s).toFixed(_1c.precision);
if(isNaN(val)){
val="";
}else{
if(typeof (_1c.min)=="number"&&val<_1c.min){
val=_1c.min.toFixed(_1c.precision);
}else{
if(typeof (_1c.max)=="number"&&val>_1c.max){
val=_1c.max.toFixed(_1c.precision);
}
}
}
return val;
}});
})(jQuery);
@@ -0,0 +1,58 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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(_3).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);
+286
View File
@@ -0,0 +1,286 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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={};
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.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);
}
}
}
}
}
}
}
}
}
}
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:void(0)\"></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 class=\"pagination-info\"></div>").appendTo(_5);
$("<div style=\"clear:both;\"></div>").appendTo(_5);
function _9(_c){
var _d=_4.nav[_c];
var a=$("<a href=\"javascript:void(0)\"></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;
_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:void(0)\"></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",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)});
};
$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh"],onSelectPage:function(_29,_2a){
},onBeforeRefresh:function(_2b,_2c){
},onRefresh:function(_2d,_2e){
},onChangePageSize:function(_2f){
},beforePageText:"Page",afterPageText:"of {pages}",displayMsg:"Displaying {from} to {to} of {total} items",nav:{first:{iconCls:"pagination-first",handler:function(){
var _30=$(this).pagination("options");
if(_30.pageNumber>1){
$(this).pagination("select",1);
}
}},prev:{iconCls:"pagination-prev",handler:function(){
var _31=$(this).pagination("options");
if(_31.pageNumber>1){
$(this).pagination("select",_31.pageNumber-1);
}
}},next:{iconCls:"pagination-next",handler:function(){
var _32=$(this).pagination("options");
var _33=Math.ceil(_32.total/_32.pageSize);
if(_32.pageNumber<_33){
$(this).pagination("select",_32.pageNumber+1);
}
}},last:{iconCls:"pagination-last",handler:function(){
var _34=$(this).pagination("options");
var _35=Math.ceil(_34.total/_34.pageSize);
if(_34.pageNumber<_35){
$(this).pagination("select",_35);
}
}},refresh:{iconCls:"pagination-refresh",handler:function(){
var _36=$(this).pagination("options");
if(_36.onBeforeRefresh.call(this,_36.pageNumber,_36.pageSize)!=false){
$(this).pagination("select",_36.pageNumber);
_36.onRefresh.call(this,_36.pageNumber,_36.pageSize);
}
}}}};
})(jQuery);
+613
View File
@@ -0,0 +1,613 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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");
if(_5){
$.extend(_7,{width:_5.width,height:_5.height,minWidth:_5.minWidth,maxWidth:_5.maxWidth,minHeight:_5.minHeight,maxHeight:_5.maxHeight,left:_5.left,top:_5.top});
}
_8._size(_7);
_9.add(_a)._outerWidth(_8.width());
if(!isNaN(parseInt(_7.height))){
_a._outerHeight(_8.height()-_9._outerHeight()-_b._outerHeight());
}else{
_a.css("height","");
var _c=$.parser.parseValue("minHeight",_7.minHeight,_8.parent());
var _d=$.parser.parseValue("maxHeight",_7.maxHeight,_8.parent());
var _e=_9._outerHeight()+_b._outerHeight()+_8._outerHeight()-_8.height();
_a._size("minHeight",_c?(_c-_e):"");
_a._size("maxHeight",_d?(_d-_e):"");
}
_8.css({height:"",minHeight:"",maxHeight:"",left:_7.left,top:_7.top});
_7.onResize.apply(_4,[_7.width,_7.height]);
$(_4).panel("doLayout");
};
function _f(_10,_11){
var _12=$.data(_10,"panel").options;
var _13=$.data(_10,"panel").panel;
if(_11){
if(_11.left!=null){
_12.left=_11.left;
}
if(_11.top!=null){
_12.top=_11.top;
}
}
_13.css({left:_12.left,top:_12.top});
_12.onMove.apply(_10,[_12.left,_12.top]);
};
function _14(_15){
$(_15).addClass("panel-body")._size("clear");
var _16=$("<div class=\"panel\"></div>").insertBefore(_15);
_16[0].appendChild(_15);
_16.bind("_resize",function(e,_17){
if($(this).hasClass("easyui-fluid")||_17){
_3(_15);
}
return false;
});
return _16;
};
function _18(_19){
var _1a=$.data(_19,"panel");
var _1b=_1a.options;
var _1c=_1a.panel;
_1c.css(_1b.style);
_1c.addClass(_1b.cls);
_1d();
_1e();
var _1f=$(_19).panel("header");
var _20=$(_19).panel("body");
var _21=$(_19).siblings(".panel-footer");
if(_1b.border){
_1f.removeClass("panel-header-noborder");
_20.removeClass("panel-body-noborder");
_21.removeClass("panel-footer-noborder");
}else{
_1f.addClass("panel-header-noborder");
_20.addClass("panel-body-noborder");
_21.addClass("panel-footer-noborder");
}
_1f.addClass(_1b.headerCls);
_20.addClass(_1b.bodyCls);
$(_19).attr("id",_1b.id||"");
if(_1b.content){
$(_19).panel("clear");
$(_19).html(_1b.content);
$.parser.parse($(_19));
}
function _1d(){
if(_1b.noheader||(!_1b.title&&!_1b.header)){
_1(_1c.children(".panel-header"));
_1c.children(".panel-body").addClass("panel-body-noheader");
}else{
if(_1b.header){
$(_1b.header).addClass("panel-header").prependTo(_1c);
}else{
var _22=_1c.children(".panel-header");
if(!_22.length){
_22=$("<div class=\"panel-header\"></div>").prependTo(_1c);
}
if(!$.isArray(_1b.tools)){
_22.find("div.panel-tool .panel-tool-a").appendTo(_1b.tools);
}
_22.empty();
var _23=$("<div class=\"panel-title\"></div>").html(_1b.title).appendTo(_22);
if(_1b.iconCls){
_23.addClass("panel-with-icon");
$("<div class=\"panel-icon\"></div>").addClass(_1b.iconCls).appendTo(_22);
}
var _24=$("<div class=\"panel-tool\"></div>").appendTo(_22);
_24.bind("click",function(e){
e.stopPropagation();
});
if(_1b.tools){
if($.isArray(_1b.tools)){
$.map(_1b.tools,function(t){
_25(_24,t.iconCls,eval(t.handler));
});
}else{
$(_1b.tools).children().each(function(){
$(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(_24);
});
}
}
if(_1b.collapsible){
_25(_24,"panel-tool-collapse",function(){
if(_1b.collapsed==true){
_4d(_19,true);
}else{
_3b(_19,true);
}
});
}
if(_1b.minimizable){
_25(_24,"panel-tool-min",function(){
_58(_19);
});
}
if(_1b.maximizable){
_25(_24,"panel-tool-max",function(){
if(_1b.maximized==true){
_5c(_19);
}else{
_3a(_19);
}
});
}
if(_1b.closable){
_25(_24,"panel-tool-close",function(){
_3c(_19);
});
}
}
_1c.children("div.panel-body").removeClass("panel-body-noheader");
}
};
function _25(c,_26,_27){
var a=$("<a href=\"javascript:void(0)\"></a>").addClass(_26).appendTo(c);
a.bind("click",_27);
};
function _1e(){
if(_1b.footer){
$(_1b.footer).addClass("panel-footer").appendTo(_1c);
$(_19).addClass("panel-body-nobottom");
}else{
_1c.children(".panel-footer").remove();
$(_19).removeClass("panel-body-nobottom");
}
};
};
function _28(_29,_2a){
var _2b=$.data(_29,"panel");
var _2c=_2b.options;
if(_2d){
_2c.queryParams=_2a;
}
if(!_2c.href){
return;
}
if(!_2b.isLoaded||!_2c.cache){
var _2d=$.extend({},_2c.queryParams);
if(_2c.onBeforeLoad.call(_29,_2d)==false){
return;
}
_2b.isLoaded=false;
$(_29).panel("clear");
if(_2c.loadingMessage){
$(_29).html($("<div class=\"panel-loading\"></div>").html(_2c.loadingMessage));
}
_2c.loader.call(_29,_2d,function(_2e){
var _2f=_2c.extractor.call(_29,_2e);
$(_29).html(_2f);
$.parser.parse($(_29));
_2c.onLoad.apply(_29,arguments);
_2b.isLoaded=true;
},function(){
_2c.onLoadError.apply(_29,arguments);
});
}
};
function _30(_31){
var t=$(_31);
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 _32(_33){
$(_33).panel("doLayout",true);
};
function _34(_35,_36){
var _37=$.data(_35,"panel").options;
var _38=$.data(_35,"panel").panel;
if(_36!=true){
if(_37.onBeforeOpen.call(_35)==false){
return;
}
}
_38.stop(true,true);
if($.isFunction(_37.openAnimation)){
_37.openAnimation.call(_35,cb);
}else{
switch(_37.openAnimation){
case "slide":
_38.slideDown(_37.openDuration,cb);
break;
case "fade":
_38.fadeIn(_37.openDuration,cb);
break;
case "show":
_38.show(_37.openDuration,cb);
break;
default:
_38.show();
cb();
}
}
function cb(){
_37.closed=false;
_37.minimized=false;
var _39=_38.children(".panel-header").find("a.panel-tool-restore");
if(_39.length){
_37.maximized=true;
}
_37.onOpen.call(_35);
if(_37.maximized==true){
_37.maximized=false;
_3a(_35);
}
if(_37.collapsed==true){
_37.collapsed=false;
_3b(_35);
}
if(!_37.collapsed){
_28(_35);
_32(_35);
}
};
};
function _3c(_3d,_3e){
var _3f=$.data(_3d,"panel").options;
var _40=$.data(_3d,"panel").panel;
if(_3e!=true){
if(_3f.onBeforeClose.call(_3d)==false){
return;
}
}
_40.stop(true,true);
_40._size("unfit");
if($.isFunction(_3f.closeAnimation)){
_3f.closeAnimation.call(_3d,cb);
}else{
switch(_3f.closeAnimation){
case "slide":
_40.slideUp(_3f.closeDuration,cb);
break;
case "fade":
_40.fadeOut(_3f.closeDuration,cb);
break;
case "hide":
_40.hide(_3f.closeDuration,cb);
break;
default:
_40.hide();
cb();
}
}
function cb(){
_3f.closed=true;
_3f.onClose.call(_3d);
};
};
function _41(_42,_43){
var _44=$.data(_42,"panel");
var _45=_44.options;
var _46=_44.panel;
if(_43!=true){
if(_45.onBeforeDestroy.call(_42)==false){
return;
}
}
$(_42).panel("clear").panel("clear","footer");
_1(_46);
_45.onDestroy.call(_42);
};
function _3b(_47,_48){
var _49=$.data(_47,"panel").options;
var _4a=$.data(_47,"panel").panel;
var _4b=_4a.children(".panel-body");
var _4c=_4a.children(".panel-header").find("a.panel-tool-collapse");
if(_49.collapsed==true){
return;
}
_4b.stop(true,true);
if(_49.onBeforeCollapse.call(_47)==false){
return;
}
_4c.addClass("panel-tool-expand");
if(_48==true){
_4b.slideUp("normal",function(){
_49.collapsed=true;
_49.onCollapse.call(_47);
});
}else{
_4b.hide();
_49.collapsed=true;
_49.onCollapse.call(_47);
}
};
function _4d(_4e,_4f){
var _50=$.data(_4e,"panel").options;
var _51=$.data(_4e,"panel").panel;
var _52=_51.children(".panel-body");
var _53=_51.children(".panel-header").find("a.panel-tool-collapse");
if(_50.collapsed==false){
return;
}
_52.stop(true,true);
if(_50.onBeforeExpand.call(_4e)==false){
return;
}
_53.removeClass("panel-tool-expand");
if(_4f==true){
_52.slideDown("normal",function(){
_50.collapsed=false;
_50.onExpand.call(_4e);
_28(_4e);
_32(_4e);
});
}else{
_52.show();
_50.collapsed=false;
_50.onExpand.call(_4e);
_28(_4e);
_32(_4e);
}
};
function _3a(_54){
var _55=$.data(_54,"panel").options;
var _56=$.data(_54,"panel").panel;
var _57=_56.children(".panel-header").find("a.panel-tool-max");
if(_55.maximized==true){
return;
}
_57.addClass("panel-tool-restore");
if(!$.data(_54,"panel").original){
$.data(_54,"panel").original={width:_55.width,height:_55.height,left:_55.left,top:_55.top,fit:_55.fit};
}
_55.left=0;
_55.top=0;
_55.fit=true;
_3(_54);
_55.minimized=false;
_55.maximized=true;
_55.onMaximize.call(_54);
};
function _58(_59){
var _5a=$.data(_59,"panel").options;
var _5b=$.data(_59,"panel").panel;
_5b._size("unfit");
_5b.hide();
_5a.minimized=true;
_5a.maximized=false;
_5a.onMinimize.call(_59);
};
function _5c(_5d){
var _5e=$.data(_5d,"panel").options;
var _5f=$.data(_5d,"panel").panel;
var _60=_5f.children(".panel-header").find("a.panel-tool-max");
if(_5e.maximized==false){
return;
}
_5f.show();
_60.removeClass("panel-tool-restore");
$.extend(_5e,$.data(_5d,"panel").original);
_3(_5d);
_5e.minimized=false;
_5e.maximized=false;
$.data(_5d,"panel").original=null;
_5e.onRestore.call(_5d);
};
function _61(_62,_63){
$.data(_62,"panel").options.title=_63;
$(_62).panel("header").find("div.panel-title").html(_63);
};
var _64=null;
$(window).unbind(".panel").bind("resize.panel",function(){
if(_64){
clearTimeout(_64);
}
_64=setTimeout(function(){
var _65=$("body.layout");
if(_65.length){
_65.layout("resize");
$("body").children(".easyui-fluid:visible").each(function(){
$(this).triggerHandler("_resize");
});
}else{
$("body").panel("doLayout");
}
_64=null;
},100);
});
$.fn.panel=function(_66,_67){
if(typeof _66=="string"){
return $.fn.panel.methods[_66](this,_67);
}
_66=_66||{};
return this.each(function(){
var _68=$.data(this,"panel");
var _69;
if(_68){
_69=$.extend(_68.options,_66);
_68.isLoaded=false;
}else{
_69=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_66);
$(this).attr("title","");
_68=$.data(this,"panel",{options:_69,panel:_14(this),isLoaded:false});
}
_18(this);
if(_69.doSize==true){
_68.panel.css("display","block");
_3(this);
}
if(_69.closed==true||_69.minimized==true){
_68.panel.hide();
}else{
_34(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,_6a){
return jq.each(function(){
_61(this,_6a);
});
},open:function(jq,_6b){
return jq.each(function(){
_34(this,_6b);
});
},close:function(jq,_6c){
return jq.each(function(){
_3c(this,_6c);
});
},destroy:function(jq,_6d){
return jq.each(function(){
_41(this,_6d);
});
},clear:function(jq,_6e){
return jq.each(function(){
_30(_6e=="footer"?$(this).panel("footer"):this);
});
},refresh:function(jq,_6f){
return jq.each(function(){
var _70=$.data(this,"panel");
_70.isLoaded=false;
if(_6f){
if(typeof _6f=="string"){
_70.options.href=_6f;
}else{
_70.options.queryParams=_6f;
}
}
_28(this);
});
},resize:function(jq,_71){
return jq.each(function(){
_3(this,_71);
});
},doLayout:function(jq,all){
return jq.each(function(){
_72(this,"body");
_72($(this).siblings(".panel-footer")[0],"footer");
function _72(_73,_74){
if(!_73){
return;
}
var _75=_73==$("body")[0];
var s=$(_73).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_76,el){
var p=$(el).parents(".panel-"+_74+":first");
return _75?p.length==0:p[0]==_73;
});
s.each(function(){
$(this).triggerHandler("_resize",[all||false]);
});
};
});
},move:function(jq,_77){
return jq.each(function(){
_f(this,_77);
});
},maximize:function(jq){
return jq.each(function(){
_3a(this);
});
},minimize:function(jq){
return jq.each(function(){
_58(this);
});
},restore:function(jq){
return jq.each(function(){
_5c(this);
});
},collapse:function(jq,_78){
return jq.each(function(){
_3b(this,_78);
});
},expand:function(jq,_79){
return jq.each(function(){
_4d(this,_79);
});
}};
$.fn.panel.parseOptions=function(_7a){
var t=$(_7a);
var hh=t.children(".panel-header,header");
var ff=t.children(".panel-footer,footer");
return $.extend({},$.parser.parseOptions(_7a,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method","header","footer",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined),header:(hh.length?hh.removeClass("panel-header"):undefined),footer:(ff.length?ff.removeClass("panel-footer"):undefined)});
};
$.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,header:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_7b,_7c,_7d){
var _7e=$(this).panel("options");
if(!_7e.href){
return false;
}
$.ajax({type:_7e.method,url:_7e.href,cache:false,data:_7b,dataType:"html",success:function(_7f){
_7c(_7f);
},error:function(){
_7d.apply(this,arguments);
}});
},extractor:function(_80){
var _81=/<body[^>]*>((.|[\n\r])*)<\/body>/im;
var _82=_81.exec(_80);
if(_82){
return _82[1];
}else{
return _80;
}
},onBeforeLoad:function(_83){
},onLoad:function(){
},onLoadError:function(){
},onBeforeOpen:function(){
},onOpen:function(){
},onBeforeClose:function(){
},onClose:function(){
},onBeforeDestroy:function(){
},onDestroy:function(){
},onResize:function(_84,_85){
},onMove:function(_86,top){
},onMaximize:function(){
},onRestore:function(){
},onMinimize:function(){
},onBeforeCollapse:function(){
},onBeforeExpand:function(){
},onCollapse:function(){
},onExpand:function(){
}};
})(jQuery);
+325
View File
@@ -0,0 +1,325 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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($){
$.parser={auto:true,onComplete:function(_1){
},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","switchbutton","progressbar","tree","textbox","filebox","combo","combobox","combotree","combogrid","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_2){
var aa=[];
for(var i=0;i<$.parser.plugins.length;i++){
var _3=$.parser.plugins[i];
var r=$(".easyui-"+_3,_2);
if(r.length){
if(r[_3]){
r[_3]();
}else{
aa.push({name:_3,jq:r});
}
}
}
if(aa.length&&window.easyloader){
var _4=[];
for(var i=0;i<aa.length;i++){
_4.push(aa[i].name);
}
easyloader.load(_4,function(){
for(var i=0;i<aa.length;i++){
var _5=aa[i].name;
var jq=aa[i].jq;
jq[_5]();
}
$.parser.onComplete.call($.parser,_2);
});
}else{
$.parser.onComplete.call($.parser,_2);
}
},parseValue:function(_6,_7,_8,_9){
_9=_9||0;
var v=$.trim(String(_7||""));
var _a=v.substr(v.length-1,1);
if(_a=="%"){
v=parseInt(v.substr(0,v.length-1));
if(_6.toLowerCase().indexOf("width")>=0){
v=Math.floor((_8.width()-_9)*v/100);
}else{
v=Math.floor((_8.height()-_9)*v/100);
}
}else{
v=parseInt(v)||undefined;
}
return v;
},parseOptions:function(_b,_c){
var t=$(_b);
var _d={};
var s=$.trim(t.attr("data-options"));
if(s){
if(s.substring(0,1)!="{"){
s="{"+s+"}";
}
_d=(new Function("return "+s))();
}
$.map(["width","height","left","top","minWidth","maxWidth","minHeight","maxHeight"],function(p){
var pv=$.trim(_b.style[p]||"");
if(pv){
if(pv.indexOf("%")==-1){
pv=parseInt(pv)||undefined;
}
_d[p]=pv;
}
});
if(_c){
var _e={};
for(var i=0;i<_c.length;i++){
var pp=_c[i];
if(typeof pp=="string"){
_e[pp]=t.attr(pp);
}else{
for(var _f in pp){
var _10=pp[_f];
if(_10=="boolean"){
_e[_f]=t.attr(_f)?(t.attr(_f)=="true"):undefined;
}else{
if(_10=="number"){
_e[_f]=t.attr(_f)=="0"?0:parseFloat(t.attr(_f))||undefined;
}
}
}
}
}
$.extend(_d,_e);
}
return _d;
}};
$(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();
if(!window.easyloader&&$.parser.auto){
$.parser.parse();
}
});
$.fn._outerWidth=function(_11){
if(_11==undefined){
if(this[0]==window){
return this.width()||document.body.clientWidth;
}
return this.outerWidth()||0;
}
return this._size("width",_11);
};
$.fn._outerHeight=function(_12){
if(_12==undefined){
if(this[0]==window){
return this.height()||document.body.clientHeight;
}
return this.outerHeight()||0;
}
return this._size("height",_12);
};
$.fn._scrollLeft=function(_13){
if(_13==undefined){
return this.scrollLeft();
}else{
return this.each(function(){
$(this).scrollLeft(_13);
});
}
};
$.fn._propAttr=$.fn.prop||$.fn.attr;
$.fn._size=function(_14,_15){
if(typeof _14=="string"){
if(_14=="clear"){
return this.each(function(){
$(this).css({width:"",minWidth:"",maxWidth:"",height:"",minHeight:"",maxHeight:""});
});
}else{
if(_14=="fit"){
return this.each(function(){
_16(this,this.tagName=="BODY"?$("body"):$(this).parent(),true);
});
}else{
if(_14=="unfit"){
return this.each(function(){
_16(this,$(this).parent(),false);
});
}else{
if(_15==undefined){
return _17(this[0],_14);
}else{
return this.each(function(){
_17(this,_14,_15);
});
}
}
}
}
}else{
return this.each(function(){
_15=_15||$(this).parent();
$.extend(_14,_16(this,_15,_14.fit)||{});
var r1=_18(this,"width",_15,_14);
var r2=_18(this,"height",_15,_14);
if(r1||r2){
$(this).addClass("easyui-fluid");
}else{
$(this).removeClass("easyui-fluid");
}
});
}
function _16(_19,_1a,fit){
if(!_1a.length){
return false;
}
var t=$(_19)[0];
var p=_1a[0];
var _1b=p.fcount||0;
if(fit){
if(!t.fitted){
t.fitted=true;
p.fcount=_1b+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=_1b-1;
if(p.fcount==0){
$(p).removeClass("panel-noscroll");
if(p.tagName=="BODY"){
$("html").removeClass("panel-fit");
}
}
}
return false;
}
};
function _18(_1c,_1d,_1e,_1f){
var t=$(_1c);
var p=_1d;
var p1=p.substr(0,1).toUpperCase()+p.substr(1);
var min=$.parser.parseValue("min"+p1,_1f["min"+p1],_1e);
var max=$.parser.parseValue("max"+p1,_1f["max"+p1],_1e);
var val=$.parser.parseValue(p,_1f[p],_1e);
var _20=(String(_1f[p]||"").indexOf("%")>=0?true:false);
if(!isNaN(val)){
var v=Math.min(Math.max(val,min||0),max||99999);
if(!_20){
_1f[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 _20||_1f.fit;
};
function _17(_21,_22,_23){
var t=$(_21);
if(_23==undefined){
_23=parseInt(_21.style[_22]);
if(isNaN(_23)){
return undefined;
}
if($._boxModel){
_23+=_24();
}
return _23;
}else{
if(_23===""){
t.css(_22,"");
}else{
if($._boxModel){
_23-=_24();
if(_23<0){
_23=0;
}
}
t.css(_22,_23+"px");
}
}
function _24(){
if(_22.toLowerCase().indexOf("width")>=0){
return t.outerWidth()-t.width();
}else{
return t.outerHeight()-t.height();
}
};
};
};
})(jQuery);
(function($){
var _25=null;
var _26=null;
var _27=false;
function _28(e){
if(e.touches.length!=1){
return;
}
if(!_27){
_27=true;
dblClickTimer=setTimeout(function(){
_27=false;
},500);
}else{
clearTimeout(dblClickTimer);
_27=false;
_29(e,"dblclick");
}
_25=setTimeout(function(){
_29(e,"contextmenu",3);
},1000);
_29(e,"mousedown");
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
e.preventDefault();
}
};
function _2a(e){
if(e.touches.length!=1){
return;
}
if(_25){
clearTimeout(_25);
}
_29(e,"mousemove");
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
e.preventDefault();
}
};
function _2b(e){
if(_25){
clearTimeout(_25);
}
_29(e,"mouseup");
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
e.preventDefault();
}
};
function _29(e,_2c,_2d){
var _2e=new $.Event(_2c);
_2e.pageX=e.changedTouches[0].pageX;
_2e.pageY=e.changedTouches[0].pageY;
_2e.which=_2d||1;
$(e.target).trigger(_2e);
};
if(document.addEventListener){
document.addEventListener("touchstart",_28,true);
document.addEventListener("touchmove",_2a,true);
document.addEventListener("touchend",_2b,true);
}
})(jQuery);
+84
View File
@@ -0,0 +1,84 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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);
+330
View File
@@ -0,0 +1,330 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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=[];
_25.push("<div class=\"datagrid-group\" group-index="+_1f+">");
if((_21&&(_23.rownumbers||_23.frozenColumns.length))||(!_21&&!(_23.rownumbers||_23.frozenColumns.length))){
_25.push("<span class=\"datagrid-group-expander\">");
_25.push("<span class=\"datagrid-row-expander datagrid-row-collapse\">&nbsp;</span>");
_25.push("</span>");
}
if(!_21){
_25.push("<span class=\"datagrid-group-title\">");
_25.push(_23.groupFormatter.call(_1e,_20.value,_20.rows));
_25.push("</span>");
}
_25.push("</div>");
_25.push("<table class=\"datagrid-btable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody>");
var _26=_20.startIndex;
for(var j=0;j<_20.rows.length;j++){
var css=_23.rowStyler?_23.rowStyler.call(_1e,_26,_20.rows[j]):"";
var _27="";
var _28="";
if(typeof css=="string"){
_28=css;
}else{
if(css){
_27=css["class"]||"";
_28=css["style"]||"";
}
}
var cls="class=\"datagrid-row "+(_26%2&&_23.striped?"datagrid-row-alt ":" ")+_27+"\"";
var _29=_28?"style=\""+_28+"\"":"";
var _2a=_22.rowIdPrefix+"-"+(_21?1:2)+"-"+_26;
_25.push("<tr id=\""+_2a+"\" datagrid-row-index=\""+_26+"\" "+cls+" "+_29+">");
_25.push(this.renderRow.call(this,_1e,_24,_21,_26,_20.rows[j]));
_25.push("</tr>");
_26++;
}
_25.push("</tbody></table>");
return _25.join("");
},bindEvents:function(_2b){
var _2c=$.data(_2b,"datagrid");
var dc=_2c.dc;
var _2d=dc.body1.add(dc.body2);
var _2e=($.data(_2d[0],"events")||$._data(_2d[0],"events")).click[0].handler;
_2d.unbind("click").bind("click",function(e){
var tt=$(e.target);
var _2f=tt.closest("span.datagrid-row-expander");
if(_2f.length){
var _30=_2f.closest("div.datagrid-group").attr("group-index");
if(_2f.hasClass("datagrid-row-collapse")){
$(_2b).datagrid("collapseGroup",_30);
}else{
$(_2b).datagrid("expandGroup",_30);
}
}else{
_2e(e);
}
e.stopPropagation();
});
},onBeforeRender:function(_31,_32){
var _33=$.data(_31,"datagrid");
var _34=_33.options;
_35();
var _36=[];
for(var i=0;i<_32.length;i++){
var row=_32[i];
var _37=_38(row[_34.groupField]);
if(!_37){
_37={value:row[_34.groupField],rows:[row]};
_36.push(_37);
}else{
_37.rows.push(row);
}
}
var _39=0;
var _3a=[];
for(var i=0;i<_36.length;i++){
var _37=_36[i];
_37.startIndex=_39;
_39+=_37.rows.length;
_3a=_3a.concat(_37.rows);
}
_33.data.rows=_3a;
this.groups=_36;
var _3b=this;
setTimeout(function(){
_3b.bindEvents(_31);
},0);
function _38(_3c){
for(var i=0;i<_36.length;i++){
var _3d=_36[i];
if(_3d.value==_3c){
return _3d;
}
}
return null;
};
function _35(){
if(!$("#datagrid-group-style").length){
$("head").append("<style id=\"datagrid-group-style\">"+".datagrid-group{height:"+_34.groupHeight+"px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;}"+".datagrid-group-title,.datagrid-group-expander{display:inline-block;vertical-align:bottom;height:100%;line-height:"+_34.groupHeight+"px;padding:0 4px;}"+".datagrid-group-expander{width:"+_34.expanderWidth+"px;text-align:center;padding:0}"+".datagrid-row-expander{margin:"+Math.floor((_34.groupHeight-16)/2)+"px 0;display:inline-block;width:16px;height:16px;cursor:pointer}"+"</style>");
}
};
}});
$.extend($.fn.datagrid.methods,{groups:function(jq){
return jq.datagrid("options").view.groups;
},expandGroup:function(jq,_3e){
return jq.each(function(){
var _3f=$.data(this,"datagrid").dc.view;
var _40=_3f.find(_3e!=undefined?"div.datagrid-group[group-index=\""+_3e+"\"]":"div.datagrid-group");
var _41=_40.find("span.datagrid-row-expander");
if(_41.hasClass("datagrid-row-expand")){
_41.removeClass("datagrid-row-expand").addClass("datagrid-row-collapse");
_40.next("table").show();
}
$(this).datagrid("fixRowHeight");
});
},collapseGroup:function(jq,_42){
return jq.each(function(){
var _43=$.data(this,"datagrid").dc.view;
var _44=_43.find(_42!=undefined?"div.datagrid-group[group-index=\""+_42+"\"]":"div.datagrid-group");
var _45=_44.find("span.datagrid-row-expander");
if(_45.hasClass("datagrid-row-collapse")){
_45.removeClass("datagrid-row-collapse").addClass("datagrid-row-expand");
_44.next("table").hide();
}
$(this).datagrid("fixRowHeight");
});
}});
$.extend(_18,{refreshGroupTitle:function(_46,_47){
var _48=$.data(_46,"datagrid");
var _49=_48.options;
var dc=_48.dc;
var _4a=this.groups[_47];
var _4b=dc.body2.children("div.datagrid-group[group-index="+_47+"]").find("span.datagrid-group-title");
_4b.html(_49.groupFormatter.call(_46,_4a.value,_4a.rows));
},insertRow:function(_4c,_4d,row){
var _4e=$.data(_4c,"datagrid");
var _4f=_4e.options;
var dc=_4e.dc;
var _50=null;
var _51;
if(!_4e.data.rows.length){
$(_4c).datagrid("loadData",[row]);
return;
}
for(var i=0;i<this.groups.length;i++){
if(this.groups[i].value==row[_4f.groupField]){
_50=this.groups[i];
_51=i;
break;
}
}
if(_50){
if(_4d==undefined||_4d==null){
_4d=_4e.data.rows.length;
}
if(_4d<_50.startIndex){
_4d=_50.startIndex;
}else{
if(_4d>_50.startIndex+_50.rows.length){
_4d=_50.startIndex+_50.rows.length;
}
}
$.fn.datagrid.defaults.view.insertRow.call(this,_4c,_4d,row);
if(_4d>=_50.startIndex+_50.rows.length){
_52(_4d,true);
_52(_4d,false);
}
_50.rows.splice(_4d-_50.startIndex,0,row);
}else{
_50={value:row[_4f.groupField],rows:[row],startIndex:_4e.data.rows.length};
_51=this.groups.length;
dc.body1.append(this.renderGroup.call(this,_4c,_51,_50,true));
dc.body2.append(this.renderGroup.call(this,_4c,_51,_50,false));
this.groups.push(_50);
_4e.data.rows.push(row);
}
this.refreshGroupTitle(_4c,_51);
function _52(_53,_54){
var _55=_54?1:2;
var _56=_4f.finder.getTr(_4c,_53-1,"body",_55);
var tr=_4f.finder.getTr(_4c,_53,"body",_55);
tr.insertAfter(_56);
};
},updateRow:function(_57,_58,row){
var _59=$.data(_57,"datagrid").options;
$.fn.datagrid.defaults.view.updateRow.call(this,_57,_58,row);
var tb=_59.finder.getTr(_57,_58,"body",2).closest("table.datagrid-btable");
var _5a=parseInt(tb.prev().attr("group-index"));
this.refreshGroupTitle(_57,_5a);
},deleteRow:function(_5b,_5c){
var _5d=$.data(_5b,"datagrid");
var _5e=_5d.options;
var dc=_5d.dc;
var _5f=dc.body1.add(dc.body2);
var tb=_5e.finder.getTr(_5b,_5c,"body",2).closest("table.datagrid-btable");
var _60=parseInt(tb.prev().attr("group-index"));
$.fn.datagrid.defaults.view.deleteRow.call(this,_5b,_5c);
var _61=this.groups[_60];
if(_61.rows.length>1){
_61.rows.splice(_5c-_61.startIndex,1);
this.refreshGroupTitle(_5b,_60);
}else{
_5f.children("div.datagrid-group[group-index="+_60+"]").remove();
for(var i=_60+1;i<this.groups.length;i++){
_5f.children("div.datagrid-group[group-index="+i+"]").attr("group-index",i-1);
}
this.groups.splice(_60,1);
}
var _5c=0;
for(var i=0;i<this.groups.length;i++){
var _61=this.groups[i];
_61.startIndex=_5c;
_5c+=_61.rows.length;
}
}});
$.fn.propertygrid.defaults=$.extend({},$.fn.datagrid.defaults,{groupHeight:21,expanderWidth:16,singleSelect:true,remoteSort:false,fitColumns:true,loadMsg:"",frozenColumns:[[{field:"f",width:16,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",groupFormatter:function(_62,_63){
return _62;
}});
})(jQuery);
+170
View File
@@ -0,0 +1,170 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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.resizable=function(_1,_2){
if(typeof _1=="string"){
return $.fn.resizable.methods[_1](this,_2);
}
function _3(e){
var _4=e.data;
var _5=$.data(_4.target,"resizable").options;
if(_4.dir.indexOf("e")!=-1){
var _6=_4.startWidth+e.pageX-_4.startX;
_6=Math.min(Math.max(_6,_5.minWidth),_5.maxWidth);
_4.width=_6;
}
if(_4.dir.indexOf("s")!=-1){
var _7=_4.startHeight+e.pageY-_4.startY;
_7=Math.min(Math.max(_7,_5.minHeight),_5.maxHeight);
_4.height=_7;
}
if(_4.dir.indexOf("w")!=-1){
var _6=_4.startWidth-e.pageX+_4.startX;
_6=Math.min(Math.max(_6,_5.minWidth),_5.maxWidth);
_4.width=_6;
_4.left=_4.startLeft+_4.startWidth-_4.width;
}
if(_4.dir.indexOf("n")!=-1){
var _7=_4.startHeight-e.pageY+_4.startY;
_7=Math.min(Math.max(_7,_5.minHeight),_5.maxHeight);
_4.height=_7;
_4.top=_4.startTop+_4.startHeight-_4.height;
}
};
function _8(e){
var _9=e.data;
var t=$(_9.target);
t.css({left:_9.left,top:_9.top});
if(t.outerWidth()!=_9.width){
t._outerWidth(_9.width);
}
if(t.outerHeight()!=_9.height){
t._outerHeight(_9.height);
}
};
function _a(e){
$.fn.resizable.isResizing=true;
$.data(e.data.target,"resizable").options.onStartResize.call(e.data.target,e);
return false;
};
function _b(e){
_3(e);
if($.data(e.data.target,"resizable").options.onResize.call(e.data.target,e)!=false){
_8(e);
}
return false;
};
function _c(e){
$.fn.resizable.isResizing=false;
_3(e,true);
_8(e);
$.data(e.data.target,"resizable").options.onStopResize.call(e.data.target,e);
$(document).unbind(".resizable");
$("body").css("cursor","");
return false;
};
return this.each(function(){
var _d=null;
var _e=$.data(this,"resizable");
if(_e){
$(this).unbind(".resizable");
_d=$.extend(_e.options,_1||{});
}else{
_d=$.extend({},$.fn.resizable.defaults,$.fn.resizable.parseOptions(this),_1||{});
$.data(this,"resizable",{options:_d});
}
if(_d.disabled==true){
return;
}
$(this).bind("mousemove.resizable",{target:this},function(e){
if($.fn.resizable.isResizing){
return;
}
var _f=_10(e);
if(_f==""){
$(e.data.target).css("cursor","");
}else{
$(e.data.target).css("cursor",_f+"-resize");
}
}).bind("mouseleave.resizable",{target:this},function(e){
$(e.data.target).css("cursor","");
}).bind("mousedown.resizable",{target:this},function(e){
var dir=_10(e);
if(dir==""){
return;
}
function _11(css){
var val=parseInt($(e.data.target).css(css));
if(isNaN(val)){
return 0;
}else{
return val;
}
};
var _12={target:e.data.target,dir:dir,startLeft:_11("left"),startTop:_11("top"),left:_11("left"),top:_11("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",_12,_a);
$(document).bind("mousemove.resizable",_12,_b);
$(document).bind("mouseup.resizable",_12,_c);
$("body").css("cursor",dir+"-resize");
});
function _10(e){
var tt=$(e.data.target);
var dir="";
var _13=tt.offset();
var _14=tt.outerWidth();
var _15=tt.outerHeight();
var _16=_d.edge;
if(e.pageY>_13.top&&e.pageY<_13.top+_16){
dir+="n";
}else{
if(e.pageY<_13.top+_15&&e.pageY>_13.top+_15-_16){
dir+="s";
}
}
if(e.pageX>_13.left&&e.pageX<_13.left+_16){
dir+="w";
}else{
if(e.pageX<_13.left+_14&&e.pageX>_13.left+_14-_16){
dir+="e";
}
}
var _17=_d.handles.split(",");
for(var i=0;i<_17.length;i++){
var _18=_17[i].replace(/(^\s*)|(\s*$)/g,"");
if(_18=="all"||_18==dir){
return dir;
}
}
return "";
};
});
};
$.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(_19){
var t=$(_19);
return $.extend({},$.parser.parseOptions(_19,["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
View File
@@ -0,0 +1,132 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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).triggerHandler("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);
+339
View File
@@ -0,0 +1,339 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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:void(0)\" 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:void(0)\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>");
if(_1a.range){
_1c.append("<a href=\"javascript:void(0)\" 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 _1f(pos,_20){
var _21=_22(_18,pos);
var s=Math.abs(_21%_1a.step);
if(s<_1a.step/2){
_21-=s;
}else{
_21=_21-s+_1a.step;
}
if(_1a.range){
var v1=_1a.value[0];
var v2=_1a.value[1];
var m=parseFloat((v1+v2)/2);
if(_20){
var _23=$(_20).nextAll(".slider-handle").length>0;
if(_21<=v2&&_23){
v1=_21;
}else{
if(_21>=v1&&(!_23)){
v2=_21;
}
}
}else{
if(_21<v1){
v1=_21;
}else{
if(_21>v2){
v2=_21;
}else{
_21<m?v1=_21:v2=_21;
}
}
}
$(_18).slider("setValues",[v1,v2]);
}else{
$(_18).slider("setValue",_21);
}
};
};
function _24(_25,_26){
var _27=$.data(_25,"slider");
var _28=_27.options;
var _29=_27.slider;
var _2a=$.isArray(_28.value)?_28.value:[_28.value];
var _2b=[];
if(!$.isArray(_26)){
_26=$.map(String(_26).split(_28.separator),function(v){
return parseFloat(v);
});
}
_29.find(".slider-value").remove();
var _2c=$(_25).attr("sliderName")||"";
for(var i=0;i<_26.length;i++){
var _2d=_26[i];
if(_2d<_28.min){
_2d=_28.min;
}
if(_2d>_28.max){
_2d=_28.max;
}
var _2e=$("<input type=\"hidden\" class=\"slider-value\">").appendTo(_29);
_2e.attr("name",_2c);
_2e.val(_2d);
_2b.push(_2d);
var _2f=_29.find(".slider-handle:eq("+i+")");
var tip=_2f.next();
var pos=_30(_25,_2d);
if(_28.showTip){
tip.show();
tip.html(_28.tipFormatter.call(_25,_2d));
}else{
tip.hide();
}
if(_28.mode=="h"){
var _31="left:"+pos+"px;";
_2f.attr("style",_31);
tip.attr("style",_31+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px");
}else{
var _31="top:"+pos+"px;";
_2f.attr("style",_31);
tip.attr("style",_31+"margin-left:"+(-Math.round(tip.outerWidth()))+"px");
}
}
_28.value=_28.range?_2b:_2b[0];
$(_25).val(_28.range?_2b.join(_28.separator):_2b[0]);
if(_2a.join(",")!=_2b.join(",")){
_28.onChange.call(_25,_28.value,(_28.range?_2a:_2a[0]));
}
};
function _c(_32){
var _33=$.data(_32,"slider").options;
var fn=_33.onChange;
_33.onChange=function(){
};
_24(_32,_33.value);
_33.onChange=fn;
};
function _30(_34,_35){
var _36=$.data(_34,"slider");
var _37=_36.options;
var _38=_36.slider;
var _39=_37.mode=="h"?_38.width():_38.height();
var pos=_37.converter.toPosition.call(_34,_35,_39);
if(_37.mode=="v"){
pos=_38.height()-pos;
}
if(_37.reversed){
pos=_39-pos;
}
return pos.toFixed(0);
};
function _22(_3a,pos){
var _3b=$.data(_3a,"slider");
var _3c=_3b.options;
var _3d=_3b.slider;
var _3e=_3c.mode=="h"?_3d.width():_3d.height();
var pos=_3c.mode=="h"?(_3c.reversed?(_3e-pos):pos):(_3c.reversed?pos:(_3e-pos));
var _3f=_3c.converter.toValue.call(_3a,pos,_3e);
return _3f.toFixed(0);
};
$.fn.slider=function(_40,_41){
if(typeof _40=="string"){
return $.fn.slider.methods[_40](this,_41);
}
_40=_40||{};
return this.each(function(){
var _42=$.data(this,"slider");
if(_42){
$.extend(_42.options,_40);
}else{
_42=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_40),slider:_1(this)});
$(this).removeAttr("disabled");
}
var _43=_42.options;
_43.min=parseFloat(_43.min);
_43.max=parseFloat(_43.max);
if(_43.range){
if(!$.isArray(_43.value)){
_43.value=$.map(String(_43.value).split(_43.separator),function(v){
return parseFloat(v);
});
}
if(_43.value.length<2){
_43.value.push(_43.max);
}
}else{
_43.value=parseFloat(_43.value);
}
_43.step=parseFloat(_43.step);
_43.originalValue=_43.value;
_17(this);
_d(this);
_6(this);
});
};
$.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,_44){
return jq.each(function(){
_6(this,_44);
});
},getValue:function(jq){
return jq.slider("options").value;
},getValues:function(jq){
return jq.slider("options").value;
},setValue:function(jq,_45){
return jq.each(function(){
_24(this,[_45]);
});
},setValues:function(jq,_46){
return jq.each(function(){
_24(this,_46);
});
},clear:function(jq){
return jq.each(function(){
var _47=$(this).slider("options");
_24(this,_47.range?[_47.min,_47.max]:[_47.min]);
});
},reset:function(jq){
return jq.each(function(){
var _48=$(this).slider("options");
$(this).slider(_48.range?"setValues":"setValue",_48.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(_49){
var t=$(_49);
return $.extend({},$.parser.parseOptions(_49,["width","height","mode",{reversed:"boolean",showTip:"boolean",range:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)});
};
$.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,range:false,value:0,separator:",",min:0,max:100,step:1,rule:[],tipFormatter:function(_4a){
return _4a;
},converter:{toPosition:function(_4b,_4c){
var _4d=$(this).slider("options");
return (_4b-_4d.min)/(_4d.max-_4d.min)*_4c;
},toValue:function(pos,_4e){
var _4f=$(this).slider("options");
return _4f.min+(_4f.max-_4f.min)*(pos/_4e);
}},onChange:function(_50,_51){
},onSlideStart:function(_52){
},onSlideEnd:function(_53){
},onComplete:function(_54){
}};
})(jQuery);
+74
View File
@@ -0,0 +1,74 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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);
_5.push({iconCls:"spinner-arrow",handler:function(e){
_6(e);
}});
$(_2).addClass("spinner-f").textbox($.extend({},_4,{icons:_5}));
var _7=$(_2).textbox("getIcon",_5.length-1);
_7.append("<a href=\"javascript:void(0)\" class=\"spinner-arrow-up\" tabindex=\"-1\"></a>");
_7.append("<a href=\"javascript:void(0)\" class=\"spinner-arrow-down\" tabindex=\"-1\"></a>");
$(_2).attr("spinnerName",$(_2).attr("textboxName"));
_3.spinner=$(_2).next();
_3.spinner.addClass("spinner");
};
function _6(e){
var _8=e.data.target;
var _9=$(_8).spinner("options");
var up=$(e.target).closest("a.spinner-arrow-up");
if(up.length){
_9.spin.call(_8,false);
_9.onSpinUp.call(_8);
$(_8).spinner("validate");
}
var _a=$(e.target).closest("a.spinner-arrow-down");
if(_a.length){
_9.spin.call(_8,true);
_9.onSpinDown.call(_8);
$(_8).spinner("validate");
}
};
$.fn.spinner=function(_b,_c){
if(typeof _b=="string"){
var _d=$.fn.spinner.methods[_b];
if(_d){
return _d(this,_c);
}else{
return this.textbox(_b,_c);
}
}
_b=_b||{};
return this.each(function(){
var _e=$.data(this,"spinner");
if(_e){
$.extend(_e.options,_b);
}else{
_e=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_b)});
}
_1(this);
});
};
$.fn.spinner.methods={options:function(jq){
var _f=jq.textbox("options");
return $.extend($.data(jq[0],"spinner").options,{width:_f.width,value:_f.value,originalValue:_f.originalValue,disabled:_f.disabled,readonly:_f.readonly});
}};
$.fn.spinner.parseOptions=function(_10){
return $.extend({},$.fn.textbox.parseOptions(_10),$.parser.parseOptions(_10,["min","max",{increment:"number"}]));
};
$.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spin:function(_11){
},onSpinUp:function(){
},onSpinDown:function(){
}});
})(jQuery);
+49
View File
@@ -0,0 +1,49 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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).removeAttr("disabled");
}
_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);
+193
View File
@@ -0,0 +1,193 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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=$("<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\">"+"</span>"+"</span>").insertAfter(_2);
var t=$(_2);
t.addClass("switchbutton-f").hide();
var _4=t.attr("name");
if(_4){
t.removeAttr("name").attr("switchbuttonName",_4);
_3.find(".switchbutton-value").attr("name",_4);
}
_3.bind("_resize",function(e,_5){
if($(this).hasClass("easyui-fluid")||_5){
_6(_2);
}
return false;
});
return _3;
};
function _6(_7,_8){
var _9=$.data(_7,"switchbutton");
var _a=_9.options;
var _b=_9.switchbutton;
if(_8){
$.extend(_a,_8);
}
var _c=_b.is(":visible");
if(!_c){
_b.appendTo("body");
}
_b._size(_a);
var w=_b.width();
var h=_b.height();
var w=_b.outerWidth();
var h=_b.outerHeight();
var _d=parseInt(_a.handleWidth)||_b.height();
var _e=w*2-_d;
_b.find(".switchbutton-inner").css({width:_e+"px",height:h+"px",lineHeight:h+"px"});
_b.find(".switchbutton-handle")._outerWidth(_d)._outerHeight(h).css({marginLeft:-_d/2+"px"});
_b.find(".switchbutton-on").css({width:(w-_d/2)+"px",textIndent:(_a.reversed?"":"-")+_d/2+"px"});
_b.find(".switchbutton-off").css({width:(w-_d/2)+"px",textIndent:(_a.reversed?"-":"")+_d/2+"px"});
_a.marginWidth=w-_d;
_f(_7,_a.checked,false);
if(!_c){
_b.insertAfter(_7);
}
};
function _10(_11){
var _12=$.data(_11,"switchbutton");
var _13=_12.options;
var _14=_12.switchbutton;
var _15=_14.find(".switchbutton-inner");
var on=_15.find(".switchbutton-on").html(_13.onText);
var off=_15.find(".switchbutton-off").html(_13.offText);
var _16=_15.find(".switchbutton-handle").html(_13.handleText);
if(_13.reversed){
off.prependTo(_15);
on.insertAfter(_16);
}else{
on.prependTo(_15);
off.insertAfter(_16);
}
_14.find(".switchbutton-value")._propAttr("checked",_13.checked);
_14.removeClass("switchbutton-disabled").addClass(_13.disabled?"switchbutton-disabled":"");
_14.removeClass("switchbutton-reversed").addClass(_13.reversed?"switchbutton-reversed":"");
_f(_11,_13.checked);
_17(_11,_13.readonly);
$(_11).switchbutton("setValue",_13.value);
};
function _f(_18,_19,_1a){
var _1b=$.data(_18,"switchbutton");
var _1c=_1b.options;
_1c.checked=_19;
var _1d=_1b.switchbutton.find(".switchbutton-inner");
var _1e=_1d.find(".switchbutton-on");
var _1f=_1c.reversed?(_1c.checked?_1c.marginWidth:0):(_1c.checked?0:_1c.marginWidth);
var dir=_1e.css("float").toLowerCase();
var css={};
css["margin-"+dir]=-_1f+"px";
_1a?_1d.animate(css,200):_1d.css(css);
var _20=_1d.find(".switchbutton-value");
var ck=_20.is(":checked");
$(_18).add(_20)._propAttr("checked",_1c.checked);
if(ck!=_1c.checked){
_1c.onChange.call(_18,_1c.checked);
}
};
function _21(_22,_23){
var _24=$.data(_22,"switchbutton");
var _25=_24.options;
var _26=_24.switchbutton;
var _27=_26.find(".switchbutton-value");
if(_23){
_25.disabled=true;
$(_22).add(_27).attr("disabled","disabled");
_26.addClass("switchbutton-disabled");
}else{
_25.disabled=false;
$(_22).add(_27).removeAttr("disabled");
_26.removeClass("switchbutton-disabled");
}
};
function _17(_28,_29){
var _2a=$.data(_28,"switchbutton");
var _2b=_2a.options;
_2b.readonly=_29==undefined?true:_29;
_2a.switchbutton.removeClass("switchbutton-readonly").addClass(_2b.readonly?"switchbutton-readonly":"");
};
function _2c(_2d){
var _2e=$.data(_2d,"switchbutton");
var _2f=_2e.options;
_2e.switchbutton.unbind(".switchbutton").bind("click.switchbutton",function(){
if(!_2f.disabled&&!_2f.readonly){
_f(_2d,_2f.checked?false:true,true);
}
});
};
$.fn.switchbutton=function(_30,_31){
if(typeof _30=="string"){
return $.fn.switchbutton.methods[_30](this,_31);
}
_30=_30||{};
return this.each(function(){
var _32=$.data(this,"switchbutton");
if(_32){
$.extend(_32.options,_30);
}else{
_32=$.data(this,"switchbutton",{options:$.extend({},$.fn.switchbutton.defaults,$.fn.switchbutton.parseOptions(this),_30),switchbutton:_1(this)});
}
_32.options.originalChecked=_32.options.checked;
_10(this);
_6(this);
_2c(this);
});
};
$.fn.switchbutton.methods={options:function(jq){
var _33=jq.data("switchbutton");
return $.extend(_33.options,{value:_33.switchbutton.find(".switchbutton-value").val()});
},resize:function(jq,_34){
return jq.each(function(){
_6(this,_34);
});
},enable:function(jq){
return jq.each(function(){
_21(this,false);
});
},disable:function(jq){
return jq.each(function(){
_21(this,true);
});
},readonly:function(jq,_35){
return jq.each(function(){
_17(this,_35);
});
},check:function(jq){
return jq.each(function(){
_f(this,true);
});
},uncheck:function(jq){
return jq.each(function(){
_f(this,false);
});
},clear:function(jq){
return jq.each(function(){
_f(this,false);
});
},reset:function(jq){
return jq.each(function(){
var _36=$(this).switchbutton("options");
_f(this,_36.originalChecked);
});
},setValue:function(jq,_37){
return jq.each(function(){
$(this).val(_37);
$.data(this,"switchbutton").switchbutton.find(".switchbutton-value").val(_37);
});
}};
$.fn.switchbutton.parseOptions=function(_38){
var t=$(_38);
return $.extend({},$.parser.parseOptions(_38,["onText","offText","handleText",{handleWidth:"number",reversed:"boolean"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
};
$.fn.switchbutton.defaults={handleWidth:"auto",width:60,height:26,checked:false,disabled:false,readonly:false,reversed:false,onText:"ON",offText:"OFF",handleText:"",value:"on",onChange:function(_39){
}};
})(jQuery);
+704
View File
@@ -0,0 +1,704 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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.tabPosition=="left"||_4.tabPosition=="right"||!_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");
var _a=_5.outerHeight();
if(_4.plain){
_a-=_a-_5.height();
}
_6._outerHeight(_a);
var _b=_1(_5.find("ul.tabs"));
var _c=_5.width()-_6._outerWidth();
if(_b>_c){
_7.add(_8).show()._outerHeight(_a);
if(_4.toolPosition=="left"){
_6.css({left:_7.outerWidth(),right:""});
_9.css({marginLeft:_7.outerWidth()+_6._outerWidth(),marginRight:_8._outerWidth(),width:_c-_7.outerWidth()-_8.outerWidth()});
}else{
_6.css({left:"",right:_8.outerWidth()});
_9.css({marginLeft:_7.outerWidth(),marginRight:_8.outerWidth()+_6._outerWidth(),width:_c-_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:_c});
}else{
_6.css({left:"",right:0});
_9.css({marginLeft:0,marginRight:_6._outerWidth(),width:_c});
}
}
};
function _d(_e){
var _f=$.data(_e,"tabs").options;
var _10=$(_e).children("div.tabs-header");
if(_f.tools){
if(typeof _f.tools=="string"){
$(_f.tools).addClass("tabs-tool").appendTo(_10);
$(_f.tools).show();
}else{
_10.children("div.tabs-tool").remove();
var _11=$("<div class=\"tabs-tool\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"height:100%\"><tr></tr></table></div>").appendTo(_10);
var tr=_11.find("tr");
for(var i=0;i<_f.tools.length;i++){
var td=$("<td></td>").appendTo(tr);
var _12=$("<a href=\"javascript:void(0);\"></a>").appendTo(td);
_12[0].onclick=eval(_f.tools[i].handler||function(){
});
_12.linkbutton($.extend({},_f.tools[i],{plain:true}));
}
}
}else{
_10.children("div.tabs-tool").remove();
}
};
function _13(_14,_15){
var _16=$.data(_14,"tabs");
var _17=_16.options;
var cc=$(_14);
if(!_17.doSize){
return;
}
if(_15){
$.extend(_17,{width:_15.width,height:_15.height});
}
cc._size(_17);
var _18=cc.children("div.tabs-header");
var _19=cc.children("div.tabs-panels");
var _1a=_18.find("div.tabs-wrap");
var ul=_1a.find(".tabs");
ul.children("li").removeClass("tabs-first tabs-last");
ul.children("li:first").addClass("tabs-first");
ul.children("li:last").addClass("tabs-last");
if(_17.tabPosition=="left"||_17.tabPosition=="right"){
_18._outerWidth(_17.showHeader?_17.headerWidth:0);
_19._outerWidth(cc.width()-_18.outerWidth());
_18.add(_19)._size("height",isNaN(parseInt(_17.height))?"":cc.height());
_1a._outerWidth(_18.width());
ul._outerWidth(_1a.width()).css("height","");
}else{
_18.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)").css("display",_17.showHeader?"block":"none");
_18._outerWidth(cc.width()).css("height","");
if(_17.showHeader){
_18.css("background-color","");
_1a.css("height","");
}else{
_18.css("background-color","transparent");
_18._outerHeight(0);
_1a._outerHeight(0);
}
ul._outerHeight(_17.tabHeight).css("width","");
ul._outerHeight(ul.outerHeight()-ul.height()-1+_17.tabHeight).css("width","");
_19._size("height",isNaN(parseInt(_17.height))?"":(cc.height()-_18.outerHeight()));
_19._size("width",cc.width());
}
if(_16.tabs.length){
var d1=ul.outerWidth(true)-ul.width();
var li=ul.children("li:first");
var d2=li.outerWidth(true)-li.width();
var _1b=_18.width()-_18.children(".tabs-tool:not(.tabs-tool-hidden)")._outerWidth();
var _1c=Math.floor((_1b-d1-d2*_16.tabs.length)/_16.tabs.length);
$.map(_16.tabs,function(p){
_1d(p,(_17.justified&&$.inArray(_17.tabPosition,["top","bottom"])>=0)?_1c:undefined);
});
if(_17.justified&&$.inArray(_17.tabPosition,["top","bottom"])>=0){
var _1e=_1b-d1-_1(ul);
_1d(_16.tabs[_16.tabs.length-1],_1c+_1e);
}
}
_2(_14);
function _1d(p,_1f){
var _20=p.panel("options");
var p_t=_20.tab.find("a.tabs-inner");
var _1f=_1f?_1f:(parseInt(_20.tabWidth||_17.tabWidth||undefined));
if(_1f){
p_t._outerWidth(_1f);
}else{
p_t.css("width","");
}
p_t._outerHeight(_17.tabHeight);
p_t.css("lineHeight",p_t.height()+"px");
p_t.find(".easyui-fluid:visible").triggerHandler("_resize");
};
};
function _21(_22){
var _23=$.data(_22,"tabs").options;
var tab=_24(_22);
if(tab){
var _25=$(_22).children("div.tabs-panels");
var _26=_23.width=="auto"?"auto":_25.width();
var _27=_23.height=="auto"?"auto":_25.height();
tab.panel("resize",{width:_26,height:_27});
}
};
function _28(_29){
var _2a=$.data(_29,"tabs").tabs;
var cc=$(_29).addClass("tabs-container");
var _2b=$("<div class=\"tabs-panels\"></div>").insertBefore(cc);
cc.children("div").each(function(){
_2b[0].appendChild(this);
});
cc[0].appendChild(_2b[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(_29);
cc.children("div.tabs-panels").children("div").each(function(i){
var _2c=$.extend({},$.parser.parseOptions(this),{disabled:($(this).attr("disabled")?true:undefined),selected:($(this).attr("selected")?true:undefined)});
_3c(_29,_2c,$(this));
});
cc.children("div.tabs-header").find(".tabs-scroller-left, .tabs-scroller-right").hover(function(){
$(this).addClass("tabs-scroller-over");
},function(){
$(this).removeClass("tabs-scroller-over");
});
cc.bind("_resize",function(e,_2d){
if($(this).hasClass("easyui-fluid")||_2d){
_13(_29);
_21(_29);
}
return false;
});
};
function _2e(_2f){
var _30=$.data(_2f,"tabs");
var _31=_30.options;
$(_2f).children("div.tabs-header").unbind().bind("click",function(e){
if($(e.target).hasClass("tabs-scroller-left")){
$(_2f).tabs("scrollBy",-_31.scrollIncrement);
}else{
if($(e.target).hasClass("tabs-scroller-right")){
$(_2f).tabs("scrollBy",_31.scrollIncrement);
}else{
var li=$(e.target).closest("li");
if(li.hasClass("tabs-disabled")){
return false;
}
var a=$(e.target).closest("a.tabs-close");
if(a.length){
_5a(_2f,_32(li));
}else{
if(li.length){
var _33=_32(li);
var _34=_30.tabs[_33].panel("options");
if(_34.collapsible){
_34.closed?_50(_2f,_33):_75(_2f,_33);
}else{
_50(_2f,_33);
}
}
}
return false;
}
}
}).bind("contextmenu",function(e){
var li=$(e.target).closest("li");
if(li.hasClass("tabs-disabled")){
return;
}
if(li.length){
_31.onContextMenu.call(_2f,e,li.find("span.tabs-title").html(),_32(li));
}
});
function _32(li){
var _35=0;
li.parent().children("li").each(function(i){
if(li[0]==this){
_35=i;
return false;
}
});
return _35;
};
};
function _36(_37){
var _38=$.data(_37,"tabs").options;
var _39=$(_37).children("div.tabs-header");
var _3a=$(_37).children("div.tabs-panels");
_39.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right");
_3a.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right");
if(_38.tabPosition=="top"){
_39.insertBefore(_3a);
}else{
if(_38.tabPosition=="bottom"){
_39.insertAfter(_3a);
_39.addClass("tabs-header-bottom");
_3a.addClass("tabs-panels-top");
}else{
if(_38.tabPosition=="left"){
_39.addClass("tabs-header-left");
_3a.addClass("tabs-panels-right");
}else{
if(_38.tabPosition=="right"){
_39.addClass("tabs-header-right");
_3a.addClass("tabs-panels-left");
}
}
}
}
if(_38.plain==true){
_39.addClass("tabs-header-plain");
}else{
_39.removeClass("tabs-header-plain");
}
_39.removeClass("tabs-header-narrow").addClass(_38.narrow?"tabs-header-narrow":"");
var _3b=_39.find(".tabs");
_3b.removeClass("tabs-pill").addClass(_38.pill?"tabs-pill":"");
_3b.removeClass("tabs-narrow").addClass(_38.narrow?"tabs-narrow":"");
_3b.removeClass("tabs-justified").addClass(_38.justified?"tabs-justified":"");
if(_38.border==true){
_39.removeClass("tabs-header-noborder");
_3a.removeClass("tabs-panels-noborder");
}else{
_39.addClass("tabs-header-noborder");
_3a.addClass("tabs-panels-noborder");
}
_38.doSize=true;
};
function _3c(_3d,_3e,pp){
_3e=_3e||{};
var _3f=$.data(_3d,"tabs");
var _40=_3f.tabs;
if(_3e.index==undefined||_3e.index>_40.length){
_3e.index=_40.length;
}
if(_3e.index<0){
_3e.index=0;
}
var ul=$(_3d).children("div.tabs-header").find("ul.tabs");
var _41=$(_3d).children("div.tabs-panels");
var tab=$("<li>"+"<a href=\"javascript:void(0)\" class=\"tabs-inner\">"+"<span class=\"tabs-title\"></span>"+"<span class=\"tabs-icon\"></span>"+"</a>"+"</li>");
if(!pp){
pp=$("<div></div>");
}
if(_3e.index>=_40.length){
tab.appendTo(ul);
pp.appendTo(_41);
_40.push(pp);
}else{
tab.insertBefore(ul.children("li:eq("+_3e.index+")"));
pp.insertBefore(_41.children("div.panel:eq("+_3e.index+")"));
_40.splice(_3e.index,0,pp);
}
pp.panel($.extend({},_3e,{tab:tab,border:false,noheader:true,closed:true,doSize:false,iconCls:(_3e.icon?_3e.icon:undefined),onLoad:function(){
if(_3e.onLoad){
_3e.onLoad.call(this,arguments);
}
_3f.options.onLoad.call(_3d,$(this));
},onBeforeOpen:function(){
if(_3e.onBeforeOpen){
if(_3e.onBeforeOpen.call(this)==false){
return false;
}
}
var p=$(_3d).tabs("getSelected");
if(p){
if(p[0]!=this){
$(_3d).tabs("unselect",_4a(_3d,p));
p=$(_3d).tabs("getSelected");
if(p){
return false;
}
}else{
_21(_3d);
return false;
}
}
var _42=$(this).panel("options");
_42.tab.addClass("tabs-selected");
var _43=$(_3d).find(">div.tabs-header>div.tabs-wrap");
var _44=_42.tab.position().left;
var _45=_44+_42.tab.outerWidth();
if(_44<0||_45>_43.width()){
var _46=_44-(_43.width()-_42.tab.width())/2;
$(_3d).tabs("scrollBy",_46);
}else{
$(_3d).tabs("scrollBy",0);
}
var _47=$(this).panel("panel");
_47.css("display","block");
_21(_3d);
_47.css("display","none");
},onOpen:function(){
if(_3e.onOpen){
_3e.onOpen.call(this);
}
var _48=$(this).panel("options");
_3f.selectHis.push(_48.title);
_3f.options.onSelect.call(_3d,_48.title,_4a(_3d,this));
},onBeforeClose:function(){
if(_3e.onBeforeClose){
if(_3e.onBeforeClose.call(this)==false){
return false;
}
}
$(this).panel("options").tab.removeClass("tabs-selected");
},onClose:function(){
if(_3e.onClose){
_3e.onClose.call(this);
}
var _49=$(this).panel("options");
_3f.options.onUnselect.call(_3d,_49.title,_4a(_3d,this));
}}));
$(_3d).tabs("update",{tab:pp,options:pp.panel("options"),type:"header"});
};
function _4b(_4c,_4d){
var _4e=$.data(_4c,"tabs");
var _4f=_4e.options;
if(_4d.selected==undefined){
_4d.selected=true;
}
_3c(_4c,_4d);
_4f.onAdd.call(_4c,_4d.title,_4d.index);
if(_4d.selected){
_50(_4c,_4d.index);
}
};
function _51(_52,_53){
_53.type=_53.type||"all";
var _54=$.data(_52,"tabs").selectHis;
var pp=_53.tab;
var _55=pp.panel("options");
var _56=_55.title;
$.extend(_55,_53.options,{iconCls:(_53.options.icon?_53.options.icon:undefined)});
if(_53.type=="all"||_53.type=="body"){
pp.panel();
}
if(_53.type=="all"||_53.type=="header"){
var tab=_55.tab;
if(_55.header){
tab.find(".tabs-inner").html($(_55.header));
}else{
var _57=tab.find("span.tabs-title");
var _58=tab.find("span.tabs-icon");
_57.html(_55.title);
_58.attr("class","tabs-icon");
tab.find("a.tabs-close").remove();
if(_55.closable){
_57.addClass("tabs-closable");
$("<a href=\"javascript:void(0)\" class=\"tabs-close\"></a>").appendTo(tab);
}else{
_57.removeClass("tabs-closable");
}
if(_55.iconCls){
_57.addClass("tabs-with-icon");
_58.addClass(_55.iconCls);
}else{
_57.removeClass("tabs-with-icon");
}
if(_55.tools){
var _59=tab.find("span.tabs-p-tool");
if(!_59.length){
var _59=$("<span class=\"tabs-p-tool\"></span>").insertAfter(tab.find("a.tabs-inner"));
}
if($.isArray(_55.tools)){
_59.empty();
for(var i=0;i<_55.tools.length;i++){
var t=$("<a href=\"javascript:void(0)\"></a>").appendTo(_59);
t.addClass(_55.tools[i].iconCls);
if(_55.tools[i].handler){
t.bind("click",{handler:_55.tools[i].handler},function(e){
if($(this).parents("li").hasClass("tabs-disabled")){
return;
}
e.data.handler.call(this);
});
}
}
}else{
$(_55.tools).children().appendTo(_59);
}
var pr=_59.children().length*12;
if(_55.closable){
pr+=8;
}else{
pr-=3;
_59.css("right","5px");
}
_57.css("padding-right",pr+"px");
}else{
tab.find("span.tabs-p-tool").remove();
_57.css("padding-right","");
}
}
if(_56!=_55.title){
for(var i=0;i<_54.length;i++){
if(_54[i]==_56){
_54[i]=_55.title;
}
}
}
}
if(_55.disabled){
_55.tab.addClass("tabs-disabled");
}else{
_55.tab.removeClass("tabs-disabled");
}
_13(_52);
$.data(_52,"tabs").options.onUpdate.call(_52,_55.title,_4a(_52,pp));
};
function _5a(_5b,_5c){
var _5d=$.data(_5b,"tabs").options;
var _5e=$.data(_5b,"tabs").tabs;
var _5f=$.data(_5b,"tabs").selectHis;
if(!_60(_5b,_5c)){
return;
}
var tab=_61(_5b,_5c);
var _62=tab.panel("options").title;
var _63=_4a(_5b,tab);
if(_5d.onBeforeClose.call(_5b,_62,_63)==false){
return;
}
var tab=_61(_5b,_5c,true);
tab.panel("options").tab.remove();
tab.panel("destroy");
_5d.onClose.call(_5b,_62,_63);
_13(_5b);
for(var i=0;i<_5f.length;i++){
if(_5f[i]==_62){
_5f.splice(i,1);
i--;
}
}
var _64=_5f.pop();
if(_64){
_50(_5b,_64);
}else{
if(_5e.length){
_50(_5b,0);
}
}
};
function _61(_65,_66,_67){
var _68=$.data(_65,"tabs").tabs;
if(typeof _66=="number"){
if(_66<0||_66>=_68.length){
return null;
}else{
var tab=_68[_66];
if(_67){
_68.splice(_66,1);
}
return tab;
}
}
for(var i=0;i<_68.length;i++){
var tab=_68[i];
if(tab.panel("options").title==_66){
if(_67){
_68.splice(i,1);
}
return tab;
}
}
return null;
};
function _4a(_69,tab){
var _6a=$.data(_69,"tabs").tabs;
for(var i=0;i<_6a.length;i++){
if(_6a[i][0]==$(tab)[0]){
return i;
}
}
return -1;
};
function _24(_6b){
var _6c=$.data(_6b,"tabs").tabs;
for(var i=0;i<_6c.length;i++){
var tab=_6c[i];
if(tab.panel("options").tab.hasClass("tabs-selected")){
return tab;
}
}
return null;
};
function _6d(_6e){
var _6f=$.data(_6e,"tabs");
var _70=_6f.tabs;
for(var i=0;i<_70.length;i++){
var _71=_70[i].panel("options");
if(_71.selected&&!_71.disabled){
_50(_6e,i);
return;
}
}
_50(_6e,_6f.options.selected);
};
function _50(_72,_73){
var p=_61(_72,_73);
if(p&&!p.is(":visible")){
_74(_72);
if(!p.panel("options").disabled){
p.panel("open");
}
}
};
function _75(_76,_77){
var p=_61(_76,_77);
if(p&&p.is(":visible")){
_74(_76);
p.panel("close");
}
};
function _74(_78){
$(_78).children("div.tabs-panels").each(function(){
$(this).stop(true,true);
});
};
function _60(_79,_7a){
return _61(_79,_7a)!=null;
};
function _7b(_7c,_7d){
var _7e=$.data(_7c,"tabs").options;
_7e.showHeader=_7d;
$(_7c).tabs("resize");
};
function _7f(_80,_81){
var _82=$(_80).find(">.tabs-header>.tabs-tool");
if(_81){
_82.removeClass("tabs-tool-hidden").show();
}else{
_82.addClass("tabs-tool-hidden").hide();
}
$(_80).tabs("resize").tabs("scrollBy",0);
};
$.fn.tabs=function(_83,_84){
if(typeof _83=="string"){
return $.fn.tabs.methods[_83](this,_84);
}
_83=_83||{};
return this.each(function(){
var _85=$.data(this,"tabs");
if(_85){
$.extend(_85.options,_83);
}else{
$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_83),tabs:[],selectHis:[]});
_28(this);
}
_d(this);
_36(this);
_13(this);
_2e(this);
_6d(this);
});
};
$.fn.tabs.methods={options:function(jq){
var cc=jq[0];
var _86=$.data(cc,"tabs").options;
var s=_24(cc);
_86.selected=s?_4a(cc,s):-1;
return _86;
},tabs:function(jq){
return $.data(jq[0],"tabs").tabs;
},resize:function(jq,_87){
return jq.each(function(){
_13(this,_87);
_21(this);
});
},add:function(jq,_88){
return jq.each(function(){
_4b(this,_88);
});
},close:function(jq,_89){
return jq.each(function(){
_5a(this,_89);
});
},getTab:function(jq,_8a){
return _61(jq[0],_8a);
},getTabIndex:function(jq,tab){
return _4a(jq[0],tab);
},getSelected:function(jq){
return _24(jq[0]);
},select:function(jq,_8b){
return jq.each(function(){
_50(this,_8b);
});
},unselect:function(jq,_8c){
return jq.each(function(){
_75(this,_8c);
});
},exists:function(jq,_8d){
return _60(jq[0],_8d);
},update:function(jq,_8e){
return jq.each(function(){
_51(this,_8e);
});
},enableTab:function(jq,_8f){
return jq.each(function(){
var _90=$(this).tabs("getTab",_8f).panel("options");
_90.tab.removeClass("tabs-disabled");
_90.disabled=false;
});
},disableTab:function(jq,_91){
return jq.each(function(){
var _92=$(this).tabs("getTab",_91).panel("options");
_92.tab.addClass("tabs-disabled");
_92.disabled=true;
});
},showHeader:function(jq){
return jq.each(function(){
_7b(this,true);
});
},hideHeader:function(jq){
return jq.each(function(){
_7b(this,false);
});
},showTool:function(jq){
return jq.each(function(){
_7f(this,true);
});
},hideTool:function(jq){
return jq.each(function(){
_7f(this,false);
});
},scrollBy:function(jq,_93){
return jq.each(function(){
var _94=$(this).tabs("options");
var _95=$(this).find(">div.tabs-header>div.tabs-wrap");
var pos=Math.min(_95._scrollLeft()+_93,_96());
_95.animate({scrollLeft:pos},_94.scrollDuration);
function _96(){
var w=0;
var ul=_95.children("ul");
ul.children("li").each(function(){
w+=$(this).outerWidth(true);
});
return w-_95.width()+(ul.outerWidth()-ul.width());
};
});
}};
$.fn.tabs.parseOptions=function(_97){
return $.extend({},$.parser.parseOptions(_97,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean"},{headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number"},{showHeader:"boolean",justified:"boolean",narrow:"boolean",pill:"boolean"}]));
};
$.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:27,selected:0,showHeader:true,plain:false,fit:false,border:true,justified:false,narrow:false,pill:false,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_98){
},onSelect:function(_99,_9a){
},onUnselect:function(_9b,_9c){
},onBeforeClose:function(_9d,_9e){
},onClose:function(_9f,_a0){
},onAdd:function(_a1,_a2){
},onUpdate:function(_a3,_a4){
},onContextMenu:function(e,_a5,_a6){
}};
})(jQuery);
+396
View File
@@ -0,0 +1,396 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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("textbox-f").hide();
var _3=$("<span class=\"textbox\">"+"<input class=\"textbox-text\" autocomplete=\"off\">"+"<input type=\"hidden\" class=\"textbox-value\">"+"</span>").insertAfter(_2);
var _4=$(_2).attr("name");
if(_4){
_3.find("input.textbox-value").attr("name",_4);
$(_2).removeAttr("name").attr("textboxName",_4);
}
return _3;
};
function _5(_6){
var _7=$.data(_6,"textbox");
var _8=_7.options;
var tb=_7.textbox;
tb.find(".textbox-text").remove();
if(_8.multiline){
$("<textarea class=\"textbox-text\" autocomplete=\"off\"></textarea>").prependTo(tb);
}else{
$("<input type=\""+_8.type+"\" class=\"textbox-text\" autocomplete=\"off\">").prependTo(tb);
}
tb.find(".textbox-addon").remove();
var bb=_8.icons?$.extend(true,[],_8.icons):[];
if(_8.iconCls){
bb.push({iconCls:_8.iconCls,disabled:true});
}
if(bb.length){
var bc=$("<span class=\"textbox-addon\"></span>").prependTo(tb);
bc.addClass("textbox-addon-"+_8.iconAlign);
for(var i=0;i<bb.length;i++){
bc.append("<a href=\"javascript:void(0)\" class=\"textbox-icon "+bb[i].iconCls+"\" icon-index=\""+i+"\" tabindex=\"-1\"></a>");
}
}
tb.find(".textbox-button").remove();
if(_8.buttonText||_8.buttonIcon){
var _9=$("<a href=\"javascript:void(0)\" class=\"textbox-button\"></a>").prependTo(tb);
_9.addClass("textbox-button-"+_8.buttonAlign).linkbutton({text:_8.buttonText,iconCls:_8.buttonIcon});
}
_a(_6,_8.disabled);
_b(_6,_8.readonly);
};
function _c(_d){
var tb=$.data(_d,"textbox").textbox;
tb.find(".textbox-text").validatebox("destroy");
tb.remove();
$(_d).remove();
};
function _e(_f,_10){
var _11=$.data(_f,"textbox");
var _12=_11.options;
var tb=_11.textbox;
var _13=tb.parent();
if(_10){
_12.width=_10;
}
if(isNaN(parseInt(_12.width))){
var c=$(_f).clone();
c.css("visibility","hidden");
c.insertAfter(_f);
_12.width=c.outerWidth();
c.remove();
}
var _14=tb.is(":visible");
if(!_14){
tb.appendTo("body");
}
var _15=tb.find(".textbox-text");
var btn=tb.find(".textbox-button");
var _16=tb.find(".textbox-addon");
var _17=_16.find(".textbox-icon");
tb._size(_12,_13);
btn.linkbutton("resize",{height:tb.height()});
btn.css({left:(_12.buttonAlign=="left"?0:""),right:(_12.buttonAlign=="right"?0:"")});
_16.css({left:(_12.iconAlign=="left"?(_12.buttonAlign=="left"?btn._outerWidth():0):""),right:(_12.iconAlign=="right"?(_12.buttonAlign=="right"?btn._outerWidth():0):"")});
_17.css({width:_12.iconWidth+"px",height:tb.height()+"px"});
_15.css({paddingLeft:(_f.style.paddingLeft||""),paddingRight:(_f.style.paddingRight||""),marginLeft:_18("left"),marginRight:_18("right")});
if(_12.multiline){
_15.css({paddingTop:(_f.style.paddingTop||""),paddingBottom:(_f.style.paddingBottom||"")});
_15._outerHeight(tb.height());
}else{
var _19=Math.floor((tb.height()-_15.height())/2);
_15.css({paddingTop:_19+"px",paddingBottom:_19+"px"});
}
_15._outerWidth(tb.width()-_17.length*_12.iconWidth-btn._outerWidth());
if(!_14){
tb.insertAfter(_f);
}
_12.onResize.call(_f,_12.width,_12.height);
function _18(_1a){
return (_12.iconAlign==_1a?_16._outerWidth():0)+(_12.buttonAlign==_1a?btn._outerWidth():0);
};
};
function _1b(_1c){
var _1d=$(_1c).textbox("options");
var _1e=$(_1c).textbox("textbox");
_1e.validatebox($.extend({},_1d,{deltaX:$(_1c).textbox("getTipX"),onBeforeValidate:function(){
var box=$(this);
if(!box.is(":focus")){
_1d.oldInputValue=box.val();
box.val(_1d.value);
}
},onValidate:function(_1f){
var box=$(this);
if(_1d.oldInputValue!=undefined){
box.val(_1d.oldInputValue);
_1d.oldInputValue=undefined;
}
var tb=box.parent();
if(_1f){
tb.removeClass("textbox-invalid");
}else{
tb.addClass("textbox-invalid");
}
}}));
};
function _20(_21){
var _22=$.data(_21,"textbox");
var _23=_22.options;
var tb=_22.textbox;
var _24=tb.find(".textbox-text");
_24.attr("placeholder",_23.prompt);
_24.unbind(".textbox");
if(!_23.disabled&&!_23.readonly){
_24.bind("blur.textbox",function(e){
if(!tb.hasClass("textbox-focused")){
return;
}
_23.value=$(this).val();
if(_23.value==""){
$(this).val(_23.prompt).addClass("textbox-prompt");
}else{
$(this).removeClass("textbox-prompt");
}
tb.removeClass("textbox-focused");
}).bind("focus.textbox",function(e){
if(tb.hasClass("textbox-focused")){
return;
}
if($(this).val()!=_23.value){
$(this).val(_23.value);
}
$(this).removeClass("textbox-prompt");
tb.addClass("textbox-focused");
});
for(var _25 in _23.inputEvents){
_24.bind(_25+".textbox",{target:_21},_23.inputEvents[_25]);
}
}
var _26=tb.find(".textbox-addon");
_26.unbind().bind("click",{target:_21},function(e){
var _27=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)");
if(_27.length){
var _28=parseInt(_27.attr("icon-index"));
var _29=_23.icons[_28];
if(_29&&_29.handler){
_29.handler.call(_27[0],e);
_23.onClickIcon.call(_21,_28);
}
}
});
_26.find(".textbox-icon").each(function(_2a){
var _2b=_23.icons[_2a];
var _2c=$(this);
if(!_2b||_2b.disabled||_23.disabled||_23.readonly){
_2c.addClass("textbox-icon-disabled");
}else{
_2c.removeClass("textbox-icon-disabled");
}
});
var btn=tb.find(".textbox-button");
btn.unbind(".textbox").bind("click.textbox",function(){
if(!btn.linkbutton("options").disabled){
_23.onClickButton.call(_21);
}
});
btn.linkbutton((_23.disabled||_23.readonly)?"disable":"enable");
tb.unbind(".textbox").bind("_resize.textbox",function(e,_2d){
if($(this).hasClass("easyui-fluid")||_2d){
_e(_21);
}
return false;
});
};
function _a(_2e,_2f){
var _30=$.data(_2e,"textbox");
var _31=_30.options;
var tb=_30.textbox;
if(_2f){
_31.disabled=true;
$(_2e).attr("disabled","disabled");
tb.addClass("textbox-disabled");
tb.find(".textbox-text,.textbox-value").attr("disabled","disabled");
}else{
_31.disabled=false;
tb.removeClass("textbox-disabled");
$(_2e).removeAttr("disabled");
tb.find(".textbox-text,.textbox-value").removeAttr("disabled");
}
};
function _b(_32,_33){
var _34=$.data(_32,"textbox");
var _35=_34.options;
_35.readonly=_33==undefined?true:_33;
_34.textbox.removeClass("textbox-readonly").addClass(_35.readonly?"textbox-readonly":"");
var _36=_34.textbox.find(".textbox-text");
_36.removeAttr("readonly");
if(_35.readonly||!_35.editable){
_36.attr("readonly","readonly");
}
};
$.fn.textbox=function(_37,_38){
if(typeof _37=="string"){
var _39=$.fn.textbox.methods[_37];
if(_39){
return _39(this,_38);
}else{
return this.each(function(){
var _3a=$(this).textbox("textbox");
_3a.validatebox(_37,_38);
});
}
}
_37=_37||{};
return this.each(function(){
var _3b=$.data(this,"textbox");
if(_3b){
$.extend(_3b.options,_37);
if(_37.value!=undefined){
_3b.options.originalValue=_37.value;
}
}else{
_3b=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_37),textbox:_1(this)});
_3b.options.originalValue=_3b.options.value;
}
_5(this);
_20(this);
_e(this);
_1b(this);
$(this).textbox("initValue",_3b.options.value);
});
};
$.fn.textbox.methods={options:function(jq){
return $.data(jq[0],"textbox").options;
},cloneFrom:function(jq,_3c){
return jq.each(function(){
var t=$(this);
if(t.data("textbox")){
return;
}
if(!$(_3c).data("textbox")){
$(_3c).textbox();
}
var _3d=t.attr("name")||"";
t.addClass("textbox-f").hide();
t.removeAttr("name").attr("textboxName",_3d);
var _3e=$(_3c).next().clone().insertAfter(t);
_3e.find("input.textbox-value").attr("name",_3d);
$.data(this,"textbox",{options:$.extend(true,{},$(_3c).textbox("options")),textbox:_3e});
var _3f=$(_3c).textbox("button");
if(_3f.length){
t.textbox("button").linkbutton($.extend(true,{},_3f.linkbutton("options")));
}
_20(this);
_1b(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");
},destroy:function(jq){
return jq.each(function(){
_c(this);
});
},resize:function(jq,_40){
return jq.each(function(){
_e(this,_40);
});
},disable:function(jq){
return jq.each(function(){
_a(this,true);
_20(this);
});
},enable:function(jq){
return jq.each(function(){
_a(this,false);
_20(this);
});
},readonly:function(jq,_41){
return jq.each(function(){
_b(this,_41);
_20(this);
});
},isValid:function(jq){
return jq.textbox("textbox").validatebox("isValid");
},clear:function(jq){
return jq.each(function(){
$(this).textbox("setValue","");
});
},setText:function(jq,_42){
return jq.each(function(){
var _43=$(this).textbox("options");
var _44=$(this).textbox("textbox");
_42=_42==undefined?"":String(_42);
if($(this).textbox("getText")!=_42){
_44.val(_42);
}
_43.value=_42;
if(!_44.is(":focus")){
if(_42){
_44.removeClass("textbox-prompt");
}else{
_44.val(_43.prompt).addClass("textbox-prompt");
}
}
$(this).textbox("validate");
});
},initValue:function(jq,_45){
return jq.each(function(){
var _46=$.data(this,"textbox");
_46.options.value="";
$(this).textbox("setText",_45);
_46.textbox.find(".textbox-value").val(_45);
$(this).val(_45);
});
},setValue:function(jq,_47){
return jq.each(function(){
var _48=$.data(this,"textbox").options;
var _49=$(this).textbox("getValue");
$(this).textbox("initValue",_47);
if(_49!=_47){
_48.onChange.call(this,_47,_49);
$(this).closest("form").trigger("_change",[this]);
}
});
},getText:function(jq){
var _4a=jq.textbox("textbox");
if(_4a.is(":focus")){
return _4a.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 _4b=$(this).textbox("options");
$(this).textbox("setValue",_4b.originalValue);
});
},getIcon:function(jq,_4c){
return jq.data("textbox").textbox.find(".textbox-icon:eq("+_4c+")");
},getTipX:function(jq){
var _4d=jq.data("textbox");
var _4e=_4d.options;
var tb=_4d.textbox;
var _4f=tb.find(".textbox-text");
var _50=tb.find(".textbox-addon")._outerWidth();
var _51=tb.find(".textbox-button")._outerWidth();
if(_4e.tipPosition=="right"){
return (_4e.iconAlign=="right"?_50:0)+(_4e.buttonAlign=="right"?_51:0)+1;
}else{
if(_4e.tipPosition=="left"){
return (_4e.iconAlign=="left"?-_50:0)+(_4e.buttonAlign=="left"?-_51:0)-1;
}else{
return _50/2*(_4e.iconAlign=="right"?1:-1);
}
}
}};
$.fn.textbox.parseOptions=function(_52){
var t=$(_52);
return $.extend({},$.fn.validatebox.parseOptions(_52),$.parser.parseOptions(_52,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign",{multiline:"boolean",editable:"boolean",iconWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
};
$.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{width:"auto",height:22,prompt:"",value:"",type:"text",multiline:false,editable:true,disabled:false,readonly:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:18,buttonText:"",buttonIcon:null,buttonAlign:"right",inputEvents:{blur:function(e){
var t=$(e.data.target);
var _53=t.textbox("options");
t.textbox("setValue",_53.value);
},keydown:function(e){
if(e.keyCode==13){
var t=$(e.data.target);
t.textbox("setValue",t.textbox("getText"));
}
}},onChange:function(_54,_55){
},onResize:function(_56,_57){
},onClickButton:function(){
},onClickIcon:function(_58){
}});
})(jQuery);
+176
View File
@@ -0,0 +1,176 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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=0;
if(typeof _2.selectionStart=="number"){
_3=_2.selectionStart;
}else{
if(_2.createTextRange){
var _4=_2.createTextRange();
var s=document.selection.createRange();
s.setEndPoint("StartToStart",_4);
_3=s.text.length;
}
}
return _3;
};
function _5(_6,_7,_8){
if(_6.setSelectionRange){
_6.setSelectionRange(_7,_8);
}else{
if(_6.createTextRange){
var _9=_6.createTextRange();
_9.collapse();
_9.moveEnd("character",_8);
_9.moveStart("character",_7);
_9.select();
}
}
};
function _a(_b){
var _c=$.data(_b,"timespinner").options;
$(_b).addClass("timespinner-f").spinner(_c);
var _d=_c.formatter.call(_b,_c.parser.call(_b,_c.value));
$(_b).timespinner("initValue",_d);
};
function _e(e){
var _f=e.data.target;
var _10=$.data(_f,"timespinner").options;
var _11=_1(this);
for(var i=0;i<_10.selections.length;i++){
var _12=_10.selections[i];
if(_11>=_12[0]&&_11<=_12[1]){
_13(_f,i);
return;
}
}
};
function _13(_14,_15){
var _16=$.data(_14,"timespinner").options;
if(_15!=undefined){
_16.highlight=_15;
}
var _17=_16.selections[_16.highlight];
if(_17){
var tb=$(_14).timespinner("textbox");
_5(tb[0],_17[0],_17[1]);
tb.focus();
}
};
function _18(_19,_1a){
var _1b=$.data(_19,"timespinner").options;
var _1a=_1b.parser.call(_19,_1a);
var _1c=_1b.formatter.call(_19,_1a);
$(_19).spinner("setValue",_1c);
};
function _1d(_1e,_1f){
var _20=$.data(_1e,"timespinner").options;
var s=$(_1e).timespinner("getValue");
var _21=_20.selections[_20.highlight];
var s1=s.substring(0,_21[0]);
var s2=s.substring(_21[0],_21[1]);
var s3=s.substring(_21[1]);
var v=s1+((parseInt(s2,10)||0)+_20.increment*(_1f?-1:1))+s3;
$(_1e).timespinner("setValue",v);
_13(_1e);
};
$.fn.timespinner=function(_22,_23){
if(typeof _22=="string"){
var _24=$.fn.timespinner.methods[_22];
if(_24){
return _24(this,_23);
}else{
return this.spinner(_22,_23);
}
}
_22=_22||{};
return this.each(function(){
var _25=$.data(this,"timespinner");
if(_25){
$.extend(_25.options,_22);
}else{
$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_22)});
}
_a(this);
});
};
$.fn.timespinner.methods={options:function(jq){
var _26=jq.data("spinner")?jq.spinner("options"):{};
return $.extend($.data(jq[0],"timespinner").options,{width:_26.width,value:_26.value,originalValue:_26.originalValue,disabled:_26.disabled,readonly:_26.readonly});
},setValue:function(jq,_27){
return jq.each(function(){
_18(this,_27);
});
},getHours:function(jq){
var _28=$.data(jq[0],"timespinner").options;
var vv=jq.timespinner("getValue").split(_28.separator);
return parseInt(vv[0],10);
},getMinutes:function(jq){
var _29=$.data(jq[0],"timespinner").options;
var vv=jq.timespinner("getValue").split(_29.separator);
return parseInt(vv[1],10);
},getSeconds:function(jq){
var _2a=$.data(jq[0],"timespinner").options;
var vv=jq.timespinner("getValue").split(_2a.separator);
return parseInt(vv[2],10)||0;
}};
$.fn.timespinner.parseOptions=function(_2b){
return $.extend({},$.fn.spinner.parseOptions(_2b),$.parser.parseOptions(_2b,["separator",{showSeconds:"boolean",highlight:"number"}]));
};
$.fn.timespinner.defaults=$.extend({},$.fn.spinner.defaults,{inputEvents:$.extend({},$.fn.spinner.defaults.inputEvents,{click:function(e){
_e.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(_2c){
if(!_2c){
return "";
}
var _2d=$(this).timespinner("options");
var tt=[_2e(_2c.getHours()),_2e(_2c.getMinutes())];
if(_2d.showSeconds){
tt.push(_2e(_2c.getSeconds()));
}
return tt.join(_2d.separator);
function _2e(_2f){
return (_2f<10?"0":"")+_2f;
};
},parser:function(s){
var _30=$(this).timespinner("options");
var _31=_32(s);
if(_31){
var min=_32(_30.min);
var max=_32(_30.max);
if(min&&min>_31){
_31=min;
}
if(max&&max<_31){
_31=max;
}
}
return _31;
function _32(s){
if(!s){
return null;
}
var tt=s.split(_30.separator);
return new Date(1900,0,0,parseInt(tt[0],10)||0,parseInt(tt[1],10)||0,parseInt(tt[2],10)||0);
};
},selections:[[0,2],[3,5],[6,8]],separator:":",showSeconds:false,highlight:0,spin:function(_33){
_1d(this,_33);
}});
})(jQuery);
+232
View File
@@ -0,0 +1,232 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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;
if(_c.trackMouse){
t=$();
_12=_c.trackMouseX+_c.deltaX;
top=_c.trackMouseY+_c.deltaY;
}else{
var t=$(_a);
_12=t.offset().left+_c.deltaX;
top=t.offset().top+_c.deltaY;
}
switch(_c.position){
case "right":
_12+=t._outerWidth()+12+(_c.trackMouse?12:0);
top-=(_d._outerHeight()-t._outerHeight())/2;
break;
case "left":
_12-=_d._outerWidth()+12+(_c.trackMouse?12:0);
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 _13(_14,e){
var _15=$.data(_14,"tooltip");
var _16=_15.options;
var tip=_15.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");
_15.tip=tip;
_17(_14);
}
_6(_14);
_15.showTimer=setTimeout(function(){
$(_14).tooltip("reposition");
tip.show();
_16.onShow.call(_14,e);
var _18=tip.children(".tooltip-arrow-outer");
var _19=tip.children(".tooltip-arrow");
var bc="border-"+_16.position+"-color";
_18.add(_19).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""});
_18.css(bc,tip.css(bc));
_19.css(bc,tip.css("backgroundColor"));
},_16.showDelay);
};
function _1a(_1b,e){
var _1c=$.data(_1b,"tooltip");
if(_1c&&_1c.tip){
_6(_1b);
_1c.hideTimer=setTimeout(function(){
_1c.tip.hide();
_1c.options.onHide.call(_1b,e);
},_1c.options.hideDelay);
}
};
function _17(_1d,_1e){
var _1f=$.data(_1d,"tooltip");
var _20=_1f.options;
if(_1e){
_20.content=_1e;
}
if(!_1f.tip){
return;
}
var cc=typeof _20.content=="function"?_20.content.call(_1d):_20.content;
_1f.tip.children(".tooltip-content").html(cc);
_20.onUpdate.call(_1d,cc);
};
function _21(_22){
var _23=$.data(_22,"tooltip");
if(_23){
_6(_22);
var _24=_23.options;
if(_23.tip){
_23.tip.remove();
}
if(_24._title){
$(_22).attr("title",_24._title);
}
$.removeData(_22,"tooltip");
$(_22).unbind(".tooltip").removeClass("tooltip-f");
_24.onDestroy.call(_22);
}
};
$.fn.tooltip=function(_25,_26){
if(typeof _25=="string"){
return $.fn.tooltip.methods[_25](this,_26);
}
_25=_25||{};
return this.each(function(){
var _27=$.data(this,"tooltip");
if(_27){
$.extend(_27.options,_25);
}else{
$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_25)});
_1(this);
}
_3(this);
_17(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(){
_13(this,e);
});
},hide:function(jq,e){
return jq.each(function(){
_1a(this,e);
});
},update:function(jq,_28){
return jq.each(function(){
_17(this,_28);
});
},reposition:function(jq){
return jq.each(function(){
_9(this);
});
},destroy:function(jq){
return jq.each(function(){
_21(this);
});
}};
$.fn.tooltip.parseOptions=function(_29){
var t=$(_29);
var _2a=$.extend({},$.parser.parseOptions(_29,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")});
t.attr("title","");
if(!_2a.content){
_2a.content=_2a._title;
}
return _2a;
};
$.fn.tooltip.defaults={position:"bottom",content:null,trackMouse:false,deltaX:0,deltaY:0,showEvent:"mouseenter",hideEvent:"mouseleave",showDelay:200,hideDelay:100,onShow:function(e){
},onHide:function(e){
},onUpdate:function(_2b){
},onPosition:function(_2c,top){
},onDestroy:function(){
}};
})(jQuery);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+255
View File
@@ -0,0 +1,255 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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.timer){
clearTimeout(_5.timer);
}
$(_4).tooltip("destroy");
$(_4).unbind();
$(_4).remove();
};
function _6(_7){
var _8=$.data(_7,"validatebox").options;
var _9=$(_7);
_9.unbind(".validatebox");
if(_8.novalidate||_9.is(":disabled")){
return;
}
for(var _a in _8.events){
$(_7).bind(_a+".validatebox",{target:_7},_8.events[_a]);
}
};
function _b(e){
var _c=e.data.target;
var _d=$.data(_c,"validatebox");
var _e=$(_c);
if($(_c).attr("readonly")){
return;
}
_d.validating=true;
_d.value=undefined;
(function(){
if(_d.validating){
if(_d.value!=_e.val()){
_d.value=_e.val();
if(_d.timer){
clearTimeout(_d.timer);
}
_d.timer=setTimeout(function(){
$(_c).validatebox("validate");
},_d.options.delay);
}else{
_f(_c);
}
setTimeout(arguments.callee,200);
}
})();
};
function _10(e){
var _11=e.data.target;
var _12=$.data(_11,"validatebox");
if(_12.timer){
clearTimeout(_12.timer);
_12.timer=undefined;
}
_12.validating=false;
_13(_11);
};
function _14(e){
var _15=e.data.target;
if($(_15).hasClass("validatebox-invalid")){
_16(_15);
}
};
function _17(e){
var _18=e.data.target;
var _19=$.data(_18,"validatebox");
if(!_19.validating){
_13(_18);
}
};
function _16(_1a){
var _1b=$.data(_1a,"validatebox");
var _1c=_1b.options;
$(_1a).tooltip($.extend({},_1c.tipOptions,{content:_1b.message,position:_1c.tipPosition,deltaX:_1c.deltaX})).tooltip("show");
_1b.tip=true;
};
function _f(_1d){
var _1e=$.data(_1d,"validatebox");
if(_1e&&_1e.tip){
$(_1d).tooltip("reposition");
}
};
function _13(_1f){
var _20=$.data(_1f,"validatebox");
_20.tip=false;
$(_1f).tooltip("hide");
};
function _21(_22){
var _23=$.data(_22,"validatebox");
var _24=_23.options;
var box=$(_22);
_24.onBeforeValidate.call(_22);
var _25=_26();
_24.onValidate.call(_22,_25);
return _25;
function _27(msg){
_23.message=msg;
};
function _28(_29,_2a){
var _2b=box.val();
var _2c=/([a-zA-Z_]+)(.*)/.exec(_29);
var _2d=_24.rules[_2c[1]];
if(_2d&&_2b){
var _2e=_2a||_24.validParams||eval(_2c[2]);
if(!_2d["validator"].call(_22,_2b,_2e)){
box.addClass("validatebox-invalid");
var _2f=_2d["message"];
if(_2e){
for(var i=0;i<_2e.length;i++){
_2f=_2f.replace(new RegExp("\\{"+i+"\\}","g"),_2e[i]);
}
}
_27(_24.invalidMessage||_2f);
if(_23.validating){
_16(_22);
}
return false;
}
}
return true;
};
function _26(){
box.removeClass("validatebox-invalid");
_13(_22);
if(_24.novalidate||box.is(":disabled")){
return true;
}
if(_24.required){
if(box.val()==""){
box.addClass("validatebox-invalid");
_27(_24.missingMessage);
if(_23.validating){
_16(_22);
}
return false;
}
}
if(_24.validType){
if($.isArray(_24.validType)){
for(var i=0;i<_24.validType.length;i++){
if(!_28(_24.validType[i])){
return false;
}
}
}else{
if(typeof _24.validType=="string"){
if(!_28(_24.validType)){
return false;
}
}else{
for(var _30 in _24.validType){
var _31=_24.validType[_30];
if(!_28(_30,_31)){
return false;
}
}
}
}
}
return true;
};
};
function _32(_33,_34){
var _35=$.data(_33,"validatebox").options;
if(_34!=undefined){
_35.novalidate=_34;
}
if(_35.novalidate){
$(_33).removeClass("validatebox-invalid");
_13(_33);
}
_21(_33);
_6(_33);
};
$.fn.validatebox=function(_36,_37){
if(typeof _36=="string"){
return $.fn.validatebox.methods[_36](this,_37);
}
_36=_36||{};
return this.each(function(){
var _38=$.data(this,"validatebox");
if(_38){
$.extend(_38.options,_36);
}else{
_1(this);
$.data(this,"validatebox",{options:$.extend({},$.fn.validatebox.defaults,$.fn.validatebox.parseOptions(this),_36)});
}
_32(this);
_21(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(){
_21(this);
});
},isValid:function(jq){
return _21(jq[0]);
},enableValidation:function(jq){
return jq.each(function(){
_32(this,false);
});
},disableValidation:function(jq){
return jq.each(function(){
_32(this,true);
});
}};
$.fn.validatebox.parseOptions=function(_39){
var t=$(_39);
return $.extend({},$.parser.parseOptions(_39,["validType","missingMessage","invalidMessage","tipPosition",{delay:"number",deltaX:"number"}]),{required:(t.attr("required")?true:undefined),novalidate:(t.attr("novalidate")!=undefined?true:undefined)});
};
$.fn.validatebox.defaults={required:false,validType:null,validParams:null,delay:200,missingMessage:"This field is required.",invalidMessage:null,tipPosition:"right",deltaX:0,novalidate:false,events:{focus:_b,blur:_10,mouseenter:_14,mouseleave:_17,click:function(e){
var t=$(e.data.target);
if(!t.is(":focus")){
t.trigger("focus");
}
}},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(_3a){
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(_3a);
},message:"Please enter a valid email address."},url:{validator:function(_3b){
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(_3b);
},message:"Please enter a valid URL."},length:{validator:function(_3c,_3d){
var len=$.trim(_3c).length;
return len>=_3d[0]&&len<=_3d[1];
},message:"Please enter a value between {0} and {1}."},remote:{validator:function(_3e,_3f){
var _40={};
_40[_3f[1]]=_3e;
var _41=$.ajax({url:_3f[0],dataType:"json",data:_40,async:false,cache:false,type:"post"}).responseText;
return _41=="true";
},message:"Please fix this field."}},onBeforeValidate:function(){
},onValidate:function(_42){
}};
})(jQuery);
+258
View File
@@ -0,0 +1,258 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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{
_8.left=Math.ceil(($(window)._outerWidth()-_9)/2+$(document).scrollLeft());
}
if(_7){
_1(_6);
}
};
function _b(_c,_d){
var _e=$.data(_c,"window").options;
var pp=$(_c).window("panel");
var _f=pp._outerHeight();
if(_e.inline){
var _10=pp.parent();
_e.top=Math.ceil((_10.height()-_f)/2+_10.scrollTop());
}else{
_e.top=Math.ceil(($(window)._outerHeight()-_f)/2+$(document).scrollTop());
}
if(_d){
_1(_c);
}
};
function _11(_12){
var _13=$.data(_12,"window");
var _14=_13.options;
var win=$(_12).panel($.extend({},_13.options,{border:false,doSize:true,closed:true,cls:"window",headerCls:"window-header",bodyCls:"window-body "+(_14.noheader?"window-body-noheader":""),onBeforeDestroy:function(){
if(_14.onBeforeDestroy.call(_12)==false){
return false;
}
if(_13.shadow){
_13.shadow.remove();
}
if(_13.mask){
_13.mask.remove();
}
},onClose:function(){
if(_13.shadow){
_13.shadow.hide();
}
if(_13.mask){
_13.mask.hide();
}
_14.onClose.call(_12);
},onOpen:function(){
if(_13.mask){
_13.mask.css($.extend({display:"block",zIndex:$.fn.window.defaults.zIndex++},$.fn.window.getMaskSize(_12)));
}
if(_13.shadow){
_13.shadow.css({display:"block",zIndex:$.fn.window.defaults.zIndex++,left:_14.left,top:_14.top,width:_13.window._outerWidth(),height:_13.window._outerHeight()});
}
_13.window.css("z-index",$.fn.window.defaults.zIndex++);
_14.onOpen.call(_12);
},onResize:function(_15,_16){
var _17=$(this).panel("options");
$.extend(_14,{width:_17.width,height:_17.height,left:_17.left,top:_17.top});
if(_13.shadow){
_13.shadow.css({left:_14.left,top:_14.top,width:_13.window._outerWidth(),height:_13.window._outerHeight()});
}
_14.onResize.call(_12,_15,_16);
},onMinimize:function(){
if(_13.shadow){
_13.shadow.hide();
}
if(_13.mask){
_13.mask.hide();
}
_13.options.onMinimize.call(_12);
},onBeforeCollapse:function(){
if(_14.onBeforeCollapse.call(_12)==false){
return false;
}
if(_13.shadow){
_13.shadow.hide();
}
},onExpand:function(){
if(_13.shadow){
_13.shadow.show();
}
_14.onExpand.call(_12);
}}));
_13.window=win.panel("panel");
if(_13.mask){
_13.mask.remove();
}
if(_14.modal){
_13.mask=$("<div class=\"window-mask\" style=\"display:none\"></div>").insertAfter(_13.window);
}
if(_13.shadow){
_13.shadow.remove();
}
if(_14.shadow){
_13.shadow=$("<div class=\"window-shadow\" style=\"display:none\"></div>").insertAfter(_13.window);
}
var _18=_14.closed;
if(_14.left==null){
_5(_12);
}
if(_14.top==null){
_b(_12);
}
_1(_12);
if(!_18){
win.window("open");
}
};
function _19(_1a){
var _1b=$.data(_1a,"window");
_1b.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_1b.options.draggable==false,onStartDrag:function(e){
if(_1b.mask){
_1b.mask.css("z-index",$.fn.window.defaults.zIndex++);
}
if(_1b.shadow){
_1b.shadow.css("z-index",$.fn.window.defaults.zIndex++);
}
_1b.window.css("z-index",$.fn.window.defaults.zIndex++);
if(!_1b.proxy){
_1b.proxy=$("<div class=\"window-proxy\"></div>").insertAfter(_1b.window);
}
_1b.proxy.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top});
_1b.proxy._outerWidth(_1b.window._outerWidth());
_1b.proxy._outerHeight(_1b.window._outerHeight());
setTimeout(function(){
if(_1b.proxy){
_1b.proxy.show();
}
},500);
},onDrag:function(e){
_1b.proxy.css({display:"block",left:e.data.left,top:e.data.top});
return false;
},onStopDrag:function(e){
_1b.options.left=e.data.left;
_1b.options.top=e.data.top;
$(_1a).window("move");
_1b.proxy.remove();
_1b.proxy=null;
}});
_1b.window.resizable({disabled:_1b.options.resizable==false,onStartResize:function(e){
if(_1b.pmask){
_1b.pmask.remove();
}
_1b.pmask=$("<div class=\"window-proxy-mask\"></div>").insertAfter(_1b.window);
_1b.pmask.css({zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_1b.window._outerWidth(),height:_1b.window._outerHeight()});
if(_1b.proxy){
_1b.proxy.remove();
}
_1b.proxy=$("<div class=\"window-proxy\"></div>").insertAfter(_1b.window);
_1b.proxy.css({zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top});
_1b.proxy._outerWidth(e.data.width)._outerHeight(e.data.height);
},onResize:function(e){
_1b.proxy.css({left:e.data.left,top:e.data.top});
_1b.proxy._outerWidth(e.data.width);
_1b.proxy._outerHeight(e.data.height);
return false;
},onStopResize:function(e){
$(_1a).window("resize",e.data);
_1b.pmask.remove();
_1b.pmask=null;
_1b.proxy.remove();
_1b.proxy=null;
}});
};
$(window).resize(function(){
$("body>div.window-mask").css({width:$(window)._outerWidth(),height:$(window)._outerHeight()});
setTimeout(function(){
$("body>div.window-mask").css($.fn.window.getMaskSize());
},50);
});
$.fn.window=function(_1c,_1d){
if(typeof _1c=="string"){
var _1e=$.fn.window.methods[_1c];
if(_1e){
return _1e(this,_1d);
}else{
return this.panel(_1c,_1d);
}
}
_1c=_1c||{};
return this.each(function(){
var _1f=$.data(this,"window");
if(_1f){
$.extend(_1f.options,_1c);
}else{
_1f=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_1c)});
if(!_1f.options.inline){
document.body.appendChild(this);
}
}
_11(this);
_19(this);
});
};
$.fn.window.methods={options:function(jq){
var _20=jq.panel("options");
var _21=$.data(jq[0],"window").options;
return $.extend(_21,{closed:_20.closed,collapsed:_20.collapsed,minimized:_20.minimized,maximized:_20.maximized});
},window:function(jq){
return $.data(jq[0],"window").window;
},move:function(jq,_22){
return jq.each(function(){
_1(this,_22);
});
},hcenter:function(jq){
return jq.each(function(){
_5(this,true);
});
},vcenter:function(jq){
return jq.each(function(){
_b(this,true);
});
},center:function(jq){
return jq.each(function(){
_5(this);
_b(this);
_1(this);
});
}};
$.fn.window.getMaskSize=function(_23){
var _24=$(_23).data("window");
var _25=(_24&&_24.options.inline);
return {width:(_25?"100%":$(document).width()),height:(_25?"100%":$(document).height())};
};
$.fn.window.parseOptions=function(_26){
return $.extend({},$.fn.panel.parseOptions(_26),$.parser.parseOptions(_26,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}]));
};
$.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false});
})(jQuery);
+4
View File
@@ -0,0 +1,4 @@
Current Version: 1.4.4
======================
This software is allowed to use under freeware license or you need to buy commercial license for better support or other purpose.
Please contact us at info@jeasyui.com
+426
View File
@@ -0,0 +1,426 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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']
},
filebox:{
js:'jquery.filebox.js',
css:'filebox.css',
dependencies:['textbox']
},
combo:{
js:'jquery.combo.js',
css:'combo.css',
dependencies:['panel','textbox']
},
combobox:{
js:'jquery.combobox.js',
css:'combobox.css',
dependencies:['combo']
},
combotree:{
js:'jquery.combotree.js',
dependencies:['combo','tree']
},
combogrid:{
js:'jquery.combogrid.js',
dependencies:['combo','datagrid']
},
validatebox:{
js:'jquery.validatebox.js',
css:'validatebox.css',
dependencies:['tooltip']
},
numberbox:{
js:'jquery.numberbox.js',
dependencies:['textbox']
},
searchbox:{
js:'jquery.searchbox.js',
css:'searchbox.css',
dependencies:['menubutton','textbox']
},
spinner:{
js:'jquery.spinner.js',
css:'spinner.css',
dependencies:['textbox']
},
numberspinner:{
js:'jquery.numberspinner.js',
dependencies:['spinner','numberbox']
},
timespinner:{
js:'jquery.timespinner.js',
dependencies:['spinner']
},
tree:{
js:'jquery.tree.js',
css:'tree.css',
dependencies:['draggable','droppable']
},
datebox:{
js:'jquery.datebox.js',
css:'datebox.css',
dependencies:['calendar','combo']
},
datetimebox:{
js:'jquery.datetimebox.js',
dependencies:['datebox','timespinner']
},
slider:{
js:'jquery.slider.js',
dependencies:['draggable']
},
parser:{
js:'jquery.parser.js'
},
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]);
}
}
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){
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();
});
});
}
})();
+413
View File
@@ -0,0 +1,413 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* 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;
}
}
/**
* 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'
}, 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(){
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}
}
var header = $(this).panel('header');
header.removeClass('accordion-header-selected');
header.find('.accordion-collapse').addClass('accordion-expand');
},
onCollapse: function(){
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:void(0)"></a>').addClass('accordion-collapse accordion-expand').appendTo(tool);
t.bind('click', function(){
togglePanel(pp);
return false;
});
pp.panel('options').collapsible ? t.show() : t.hide();
header.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;
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',
{fit:'boolean',border:'boolean',animate:'boolean',multiple:'boolean',selected:'number'}
]));
};
$.fn.accordion.defaults = {
width: 'auto',
height: 'auto',
fit: false,
border: true,
animate: true,
multiple: false,
selected: 0,
onSelect: function(title, index){},
onUnselect: function(title, index){},
onAdd: function(title, index){},
onBeforeRemove: function(title, index){},
onRemove: function(title, index){}
};
})(jQuery);
+438
View File
@@ -0,0 +1,438 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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"></input></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 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 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 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 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 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 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 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 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>');
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 + '">');
for(var j=0; j<week.length; j++){
var day = week[j];
var s = day[0]+','+day[1]+','+day[2];
var dvalue = new 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(){
if (!date){
var now = new Date();
$(this).calendar({
year: now.getFullYear(),
month: now.getMonth()+1,
current: date
});
return;
}
var opts = $(this).calendar('options');
if (opts.validator.call(this, date)){
var 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, [
{firstDay:'number',fit:'boolean',border:'boolean'}
]));
};
$.fn.calendar.defaults = {
width:180,
height:180,
fit:false,
border:true,
firstDay:0,
weeks:['S','M','T','W','T','F','S'],
months:['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
year:new Date().getFullYear(),
month:new Date().getMonth()+1,
current:(function(){
var d = new Date();
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
})(),
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);
+566
View File
@@ -0,0 +1,566 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* Dependencies:
* combo
*
*/
(function($){
var COMBOBOX_SERNO = 0;
function getRowIndex(target, value){
var state = $.data(target, 'combobox');
var opts = state.options;
var data = state.data;
for(var i=0; i<data.length; i++){
if (data[i][opts.valueField] == value){
return i;
}
}
return -1;
}
/**
* 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);
}
}
}
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);
// item = panel.children('div.combobox-item:visible:' + (dir=='next'?'first':'last'));
} else {
if (dir == 'next'){
item = item.nextAll(firstSelector);
// item = item.nextAll('div.combobox-item:visible:first');
if (!item.length){
item = panel.children(firstSelector);
// item = panel.children('div.combobox-item:visible:first');
}
} else {
item = item.prevAll(firstSelector);
// item = item.prevAll('div.combobox-item:visible:first');
if (!item.length){
item = panel.children(lastSelector);
// item = panel.children('div.combobox-item:visible:last');
}
}
}
if (item.length){
item.addClass('combobox-item-hover');
var row = opts.finder.getRow(target, item);
if (row){
scrollTo(target, row[opts.valueField]);
if (opts.selectOnNavigation){
select(target, row[opts.valueField]);
}
}
}
}
/**
* select the specified value
*/
function select(target, value){
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);
opts.onSelect.call(target, opts.finder.getRow(target, value));
}
}
/**
* 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);
opts.onUnselect.call(target, opts.finder.getRow(target, value));
}
}
/**
* 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)}
panel.find('div.combobox-item-selected').removeClass('combobox-item-selected');
var vv = [], ss = [];
for(var i=0; i<values.length; i++){
var v = values[i];
var s = v;
opts.finder.getEl(target, v).addClass('combobox-item-selected');
var row = opts.finder.getRow(target, v);
if (row){
s = row[opts.textField];
}
vv.push(v);
ss.push(s);
}
if (!remainText){
$(target).combo('setText', ss.join(opts.separator));
}
$(target).combo('setValues', vv);
}
/**
* 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);
state.groups = [];
data = state.data;
var selected = $(target).combobox('getValues');
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(g);
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 {
group = undefined;
}
var cls = 'combobox-item' + (row.disabled ? ' combobox-item-disabled' : '') + (g ? ' combobox-gitem' : '');
dd.push('<div id="' + (state.itemIdPrefix+'_'+i) + '" class="' + cls + '">');
dd.push(opts.formatter ? opts.formatter.call(target, row) : s);
dd.push('</div>');
// if (item['selected']){
// (function(){
// for(var i=0; i<selected.length; i++){
// if (v == selected[i]) return;
// }
// selected.push(v);
// })();
// }
if (row['selected'] && $.inArray(v, selected) == -1){
selected.push(v);
}
}
$(target).combo('panel').html(dd.join(''));
if (opts.multiple){
setValues(target, selected, remainText);
} else {
setValues(target, selected.length ? [selected[selected.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 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('div.combobox-item-selected,div.combobox-item-hover').removeClass('combobox-item-selected combobox-item-hover');
panel.find('div.combobox-item,div.combobox-group').hide();
var data = state.data;
var vv = [];
$.map(qq, function(q){
q = $.trim(q);
var value = q;
var group = undefined;
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;
item.addClass('combobox-item-selected');
opts.onSelect.call(target, row);
}
if (opts.groupField && group != g){
$('#'+state.groupIdPrefix+'_'+$.inArray(g, state.groups)).show();
group = g;
}
}
}
vv.push(value);
});
_setValues(vv);
}
function _setValues(vv){
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){
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;
COMBOBOX_SERNO++;
state.itemIdPrefix = '_easyui_combobox_i' + COMBOBOX_SERNO;
state.groupIdPrefix = '_easyui_combobox_g' + COMBOBOX_SERNO;
$(target).addClass('combobox-f');
$(target).combo($.extend({}, opts, {
onShowPanel: function(){
$(target).combo('panel').find('div.combobox-item:hidden,div.combobox-group:hidden').show();
scrollTo(target, $(target).combobox('getValue'));
opts.onShowPanel.call(target);
}
}));
$(target).combo('panel').unbind().bind('mouseover', function(e){
$(this).children('div.combobox-item-hover').removeClass('combobox-item-hover');
var item = $(e.target).closest('div.combobox-item');
if (!item.hasClass('combobox-item-disabled')){
item.addClass('combobox-item-hover');
}
e.stopPropagation();
}).bind('mouseout', function(e){
$(e.target).closest('div.combobox-item').removeClass('combobox-item-hover');
e.stopPropagation();
}).bind('click', function(e){
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}
var value = row[opts.valueField];
if (opts.multiple){
if (item.hasClass('combobox-item-selected')){
unselect(target, value);
} else {
select(target, value);
}
} else {
select(target, value);
$(target).combo('hidePanel');
}
e.stopPropagation();
});
}
$.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
});
},
getData: function(jq){
return $.data(jq[0], 'combobox').data;
},
setValues: function(jq, values){
return jq.each(function(){
setValues(this, values);
});
},
setValue: function(jq, value){
return jq.each(function(){
setValues(this, [value]);
});
},
clear: function(jq){
return jq.each(function(){
$(this).combo('clear');
var panel = $(this).combo('panel');
panel.find('div.combobox-item-selected').removeClass('combobox-item-selected');
});
},
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);
});
}
};
$.fn.combobox.parseOptions = function(target){
var t = $(target);
return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target,[
'valueField','textField','groupField','mode','method','url'
]));
};
$.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['selected'] = t.is(':selected');
row['disabled'] = t.is(':disabled');
if (group){
opts.groupField = opts.groupField || 'group';
row[opts.groupField] = group;
}
data.push(row);
}
};
$.fn.combobox.defaults = $.extend({}, $.fn.combo.defaults, {
valueField: 'value',
textField: 'text',
groupField: null,
groupFormatter: function(group){return group;},
mode: 'local', // or 'remote'
method: 'post',
url: null,
data: null,
queryParams: {},
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)}
},
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);
},
getRow:function(target, p){
var state = $.data(target, 'combobox');
var index = (p instanceof jQuery) ? p.attr('id').substr(state.itemIdPrefix.length+1) : getRowIndex(target, p);
return state.data[parseInt(index)];
}
},
onBeforeLoad: function(param){},
onLoadSuccess: function(){},
onLoadError: function(){},
onSelect: function(record){},
onUnselect: function(record){}
});
})(jQuery);
+285
View File
@@ -0,0 +1,285 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* 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');
setValue(target, opts.formatter.call(target, date));
$(target).combo('hidePanel');
opts.onSelect.call(target, date);
}
});
}
$(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:void(0)"></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){
value = opts.formatter.call(this, opts.parser.call(this, value));
}
$(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);
});
}
};
$.fn.datebox.parseOptions = function(target){
return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target, ['sharedCalendar']));
};
$.fn.datebox.defaults = $.extend({}, $.fn.combo.defaults, {
panelWidth:180,
panelHeight:'auto',
sharedCalendar:null,
keyHandler: {
up:function(e){},
down:function(e){},
left: function(e){},
right: function(e){},
enter:function(e){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 now = new Date();
$(target).datebox('calendar').calendar({
year:now.getFullYear(),
month:now.getMonth()+1,
current:new Date(now.getFullYear(), now.getMonth(), now.getDate())
});
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){
if (!s) return new Date();
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 Date(y,m-1,d);
} else {
return new Date();
}
},
onSelect:function(date){}
});
})(jQuery);
+395
View File
@@ -0,0 +1,395 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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').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;
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).trigger('_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,
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){},
onStopDrag: function(e){}
};
$.fn.draggable.isDragging = false;
})(jQuery);
+81
View File
@@ -0,0 +1,81 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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);
+387
View File
@@ -0,0 +1,387 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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 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(data);
setTimeout(function(){
f.unbind();
f.remove();
}, 100);
}
}
/**
* 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 cc = $(target).find('[switchbuttonName="'+name+'"]');
if (cc.length){
cc.switchbutton('uncheck');
cc.each(function(){
if (_isChecked($(this).switchbutton('options').value, val)){
$(this).switchbutton('check');
}
});
return true;
}
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(){
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 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]('clear');
}
}
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){
options.onChange.call(this, t);
}).bind('change.form', function(e){
var t = e.target;
if (!$(t).hasClass('textbox-text')){
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);
});
}
};
$.fn.form.parseOptions = function(target){
var t = $(target);
return $.extend({}, $.parser.parseOptions(target, [{ajax:'boolean'}]), {
url: (t.attr('action') ? t.attr('action') : undefined)
});
};
$.fn.form.defaults = {
fieldTypes: ['combobox','combotree','combogrid','datetimebox','datebox','combo',
'datetimespinner','timespinner','numberspinner','spinner',
'slider','searchbox','numberbox','textbox','switchbutton'],
novalidate: false,
ajax: true,
url: null,
queryParams: {},
onSubmit: function(param){return $(this).form('validate');},
success: function(data){},
onBeforeLoad: function(param){},
onLoadSuccess: function(data){},
onLoadError: function(){},
onChange: function(target){}
};
})(jQuery);
+242
View File
@@ -0,0 +1,242 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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">&nbsp;</span>').appendTo(inner);
}
if (opts.iconCls){
$('<span class="l-btn-icon">&nbsp;</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;
});
// if (opts.toggle && !opts.disabled){
// t.bind('click.linkbutton', function(){
// if (opts.selected){
// $(this).linkbutton('unselect');
// } else {
// $(this).linkbutton('select');
// }
// });
// }
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:void(0)');
}
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;
}
}
}
$.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).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);
+637
View File
@@ -0,0 +1,637 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(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(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.insertAfter(target);
submenu.appendTo('body');
this.submenu = submenu; // point to the sub menu
var mm = splitMenu(submenu);
menus = menus.concat(mm);
}
});
}
return menus;
}
function createMenu(menu){
var wh = $.parser.parseOptions(menu[0], ['width','height']);
menu[0].originalHeight = wh.height || 0;
if (menu.hasClass('menu-content')){
menu[0].originalWidth = wh.width || menu._outerWidth();
} else {
menu[0].originalWidth = wh.width || 0;
menu.children('div').each(function(){
var item = $(this);
var itemOpts = $.extend({}, $.parser.parseOptions(this,['name','iconCls','href',{separator:'boolean'}]), {
disabled: (item.attr('disabled') ? true : undefined)
});
if (itemOpts.separator){
item.addClass('menu-sep');
}
if (!item.hasClass('menu-sep')){
item[0].itemName = itemOpts.name || '';
item[0].itemHref = itemOpts.href || '';
var text = item.addClass('menu-item').html();
item.empty().append($('<div class="menu-text"></div>').html(text));
if (itemOpts.iconCls){
$('<div class="menu-icon"></div>').addClass(itemOpts.iconCls).appendTo(item);
}
if (itemOpts.disabled){
setDisabled(target, item[0], true);
}
if (item[0].submenu){
$('<div class="menu-rightarrow"></div>').appendTo(item); // has sub menu
}
bindMenuItemEvent(target, item);
}
});
$('<div class="menu-line"></div>').prependTo(menu);
}
setMenuSize(target, menu);
if (!menu.hasClass('menu-inline')){
menu.hide();
}
bindMenuEvent(target, menu);
}
}
function setMenuSize(target, menu){
var opts = $.data(target, 'menu').options;
var style = menu.attr('style') || '';
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 width = menu[0].originalWidth || 'auto';
if (isNaN(parseInt(width))){
width = 0;
menu.find('div.menu-text').each(function(){
if (width < $(this)._outerWidth()){
width = $(this)._outerWidth();
}
});
width += 40;
}
var autoHeight = menu.outerHeight();
var height = menu[0].originalHeight || 'auto';
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._size({
fit: (menu[0]==target?opts.fit:false),
width: width,
minWidth: opts.minWidth,
height: height
});
menu.css('overflow', menu.outerHeight() < autoHeight ? 'auto' : 'hidden');
menu.children('div.menu-line')._outerHeight(autoHeight-2);
}
/**
* bind menu event
*/
function bindMenuEvent(target, menu){
if (menu.hasClass('menu-inline')){return}
var state = $.data(target, 'menu');
menu.unbind('.menu').bind('mouseenter.menu', function(){
if (state.timer){
clearTimeout(state.timer);
state.timer = null;
}
}).bind('mouseleave.menu', function(){
if (state.options.hideOnUnhover){
state.timer = setTimeout(function(){
hideAll(target, $(target).hasClass('menu-inline'));
}, state.options.duration);
}
});
}
/**
* bind menu item event
*/
function bindMenuItemEvent(target, item){
if (!item.hasClass('menu-item')){return}
item.unbind('.menu');
item.bind('click.menu', function(){
if ($(this).hasClass('menu-item-disabled')){
return;
}
// only the sub menu clicked can hide all menus
if (!this.submenu){
hideAll(target, $(target).hasClass('menu-inline'));
var href = this.itemHref;
if (href){
location.href = href;
}
}
$(this).trigger('mouseenter');
var item = $(target).menu('getItem', this);
$.data(target, 'menu').options.onClick.call(target, item);
}).bind('mouseenter.menu', function(e){
// hide other menu
item.siblings().each(function(){
if (this.submenu){
hideMenu(this.submenu);
}
$(this).removeClass('menu-active');
});
// show this menu
item.addClass('menu-active');
if ($(this).hasClass('menu-item-disabled')){
item.addClass('menu-active-disabled');
return;
}
var submenu = item[0].submenu;
if (submenu){
$(target).menu('show', {
menu: submenu,
parent: item
});
}
}).bind('mouseleave.menu', function(e){
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');
}
});
}
/**
* 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){
var left,top;
param = param || {};
var menu = $(param.menu || target);
$(target).menu('resize', menu[0]);
if (menu.hasClass('menu-top')){
var opts = $.data(target, 'menu').options;
$.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({left:left,top: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')){
$.data(menu[0], 'menu').options.onShow.call(menu[0]);
}
});
}
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, text){
var result = null;
var tmp = $('<div></div>');
function find(menu){
menu.children('div.menu-item').each(function(){
var item = $(target).menu('getItem', this);
var s = tmp.empty().html(item.text).text();
if (text == $.trim(s)) {
result = item;
} else if (this.submenu && !result){
find(this.submenu);
}
});
}
find($(target));
tmp.remove();
return result;
}
function setDisabled(target, itemEl, disabled){
var t = $(itemEl);
if (!t.hasClass('menu-item')){return}
if (disabled){
t.addClass('menu-item-disabled');
if (itemEl.onclick){
itemEl.onclick1 = itemEl.onclick;
itemEl.onclick = null;
}
} else {
t.removeClass('menu-item-disabled');
if (itemEl.onclick1){
itemEl.onclick = itemEl.onclick1;
itemEl.onclick1 = null;
}
}
}
function appendItem(target, param){
var opts = $.data(target, 'menu').options;
var menu = $(target);
if (param.parent){
if (!param.parent.submenu){
var submenu = $('<div class="menu"><div class="menu-line"></div></div>').appendTo('body');
submenu.hide();
param.parent.submenu = submenu;
$('<div class="menu-rightarrow"></div>').appendTo(param.parent);
}
menu = param.parent.submenu;
}
if (param.separator){
var item = $('<div class="menu-sep"></div>').appendTo(menu);
} else {
var item = $('<div class="menu-item"></div>').appendTo(menu);
$('<div class="menu-text"></div>').html(param.text).appendTo(item);
}
if (param.iconCls) $('<div class="menu-icon"></div>').addClass(param.iconCls).appendTo(item);
if (param.id) item.attr('id', param.id);
if (param.name){item[0].itemName = param.name}
if (param.href){item[0].itemHref = param.href}
if (param.onclick){
if (typeof param.onclick == 'string'){
item.attr('onclick', param.onclick);
} else {
item[0].onclick = eval(param.onclick);
}
}
if (param.handler){item[0].onclick = eval(param.handler)}
if (param.disabled){setDisabled(target, item[0], true)}
bindMenuItemEvent(target, item);
bindMenuEvent(target, menu);
setMenuSize(target, menu);
}
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();
}
var menu = $(itemEl).parent();
removeit(itemEl);
setMenuSize(target, menu);
}
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(){
$(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(){
$(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 t = $(itemEl);
var item = {
target: itemEl,
id: t.attr('id'),
text: $.trim(t.children('div.menu-text').html()),
disabled: t.hasClass('menu-item-disabled'),
// href: t.attr('href'),
// name: t.attr('name'),
name: itemEl.itemName,
href: itemEl.itemHref,
onclick: itemEl.onclick
}
var icon = t.children('div.menu-icon');
if (icon.length){
var cc = [];
var aa = icon.attr('class').split(' ');
for(var i=0; i<aa.length; i++){
if (aa[i] != 'menu-icon'){
cc.push(aa[i]);
}
}
item.iconCls = cc.join(' ');
}
return item;
},
findItem: function(jq, text){
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));
});
}
};
$.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: 120,
itemHeight: 22,
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,
onShow: function(){},
onHide: function(){},
onClick: function(item){}
};
})(jQuery);
+359
View File
@@ -0,0 +1,359 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(function($){
$.parser = {
auto: true,
onComplete: function(context){},
plugins:['draggable','droppable','resizable','pagination','tooltip',
'linkbutton','menu','menubutton','splitbutton','switchbutton','progressbar',
'tree','textbox','filebox','combo','combobox','combotree','combogrid','numberbox','validatebox','searchbox',
'spinner','numberspinner','timespinner','datetimespinner','calendar','datebox','datetimebox','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[name]();
} 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[name]();
}
$.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 = parseInt(v.substr(0, v.length-1));
if (property.toLowerCase().indexOf('width') >= 0){
v = Math.floor((parent.width()-delta) * v / 100.0);
} else {
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) || 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;
}
};
$(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();
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._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
View File
@@ -0,0 +1,107 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* 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);
+420
View File
@@ -0,0 +1,420 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* 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 table = [];
table.push('<div class="datagrid-group" group-index=' + groupIndex + '>');
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">&nbsp;</span>');
table.push('</span>');
}
if (!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('');
},
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;}' +
'.datagrid-group-title,.datagrid-group-expander{display:inline-block;vertical-align:bottom;height:100%;line-height:'+opts.groupHeight+'px;padding:0 4px;}' +
'.datagrid-group-expander{width:'+opts.expanderWidth+'px;text-align:center;padding:0}' +
'.datagrid-row-expander{margin:'+Math.floor((opts.groupHeight-16)/2)+'px 0;display:inline-block;width:16px;height:16px;cursor:pointer}' +
'</style>'
);
}
}
}
});
$.extend($.fn.datagrid.methods, {
groups:function(jq){
return jq.datagrid('options').view.groups;
},
expandGroup:function(jq, groupIndex){
return jq.each(function(){
var view = $.data(this, 'datagrid').dc.view;
var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group');
var expander = group.find('span.datagrid-row-expander');
if (expander.hasClass('datagrid-row-expand')){
expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse');
group.next('table').show();
}
$(this).datagrid('fixRowHeight');
});
},
collapseGroup:function(jq, groupIndex){
return jq.each(function(){
var view = $.data(this, 'datagrid').dc.view;
var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group');
var expander = group.find('span.datagrid-row-expander');
if (expander.hasClass('datagrid-row-collapse')){
expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand');
group.next('table').hide();
}
$(this).datagrid('fixRowHeight');
});
}
});
$.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.body2.children('div.datagrid-group[group-index=' + groupIndex + ']').find('span.datagrid-group-title');
span.html(opts.groupFormatter.call(target, group.value, group.rows));
},
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.refreshGroupTitle(target, groupIndex);
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);
}
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:21,
expanderWidth:16,
singleSelect:true,
remoteSort:false,
fitColumns:true,
loadMsg:'',
frozenColumns:[[
{field:'f',width:16,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',
groupFormatter:function(fvalue,rows){return fvalue}
});
})(jQuery);
+247
View File
@@ -0,0 +1,247 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
*/
(function($){
// var isResizing = false;
$.fn.resizable = function(options, param){
if (typeof options == 'string'){
return $.fn.resizable.methods[options](this, param);
}
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;
// resizeData.width = resizeData.startWidth - e.pageX + resizeData.startX;
// if (resizeData.width >= options.minWidth && resizeData.width <= options.maxWidth) {
// resizeData.left = resizeData.startLeft + e.pageX - resizeData.startX;
// }
}
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;
// resizeData.height = resizeData.startHeight - e.pageY + resizeData.startY;
// if (resizeData.height >= options.minHeight && resizeData.height <= options.maxHeight) {
// resizeData.top = resizeData.startTop + e.pageY - resizeData.startY;
// }
}
}
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)}
// t._outerWidth(resizeData.width)._outerHeight(resizeData.height);
}
function doDown(e){
// isResizing = true;
$.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){
// isResizing = false;
$.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','');
// $('body').css('cursor','auto');
return false;
}
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;
}
// bind mouse event using namespace resizable
$(this).bind('mousemove.resizable', {target:this}, function(e){
// if (isResizing) return;
if ($.fn.resizable.isResizing){return}
var dir = getDirection(e);
if (dir == '') {
$(e.data.target).css('cursor', '');
} else {
$(e.data.target).css('cursor', dir + '-resize');
}
}).bind('mouseleave.resizable', {target:this}, function(e){
$(e.data.target).css('cursor', '');
}).bind('mousedown.resizable', {target:this}, function(e){
var dir = 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');
});
// get the resize direction
function getDirection(e) {
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(',');
for(var i=0; i<handles.length; i++) {
var handle = handles[i].replace(/(^\s*)|(\s*$)/g, '');
if (handle == 'all' || handle == dir) {
return dir;
}
}
return '';
}
});
};
$.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);
+443
View File
@@ -0,0 +1,443 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* Dependencies:
* draggable
*
*/
(function($){
function init(target){
var slider = $('<div class="slider">' +
'<div class="slider-inner">' +
'<a href="javascript:void(0)" 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:void(0)" class="slider-handle"></a>' +
'<span class="slider-tip"></span>'
);
if (opts.range){
inner.append(
'<a href="javascript:void(0)" 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 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;
}
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.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.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');
}
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');
return (value-opts.min)/(opts.max-opts.min)*size;
},
toValue:function(pos, size){
var opts = $(this).slider('options');
return opts.min + (opts.max-opts.min)*(pos/size);
}
},
onChange: function(value, oldValue){},
onSlideStart: function(value){},
onSlideEnd: function(value){},
onComplete: function(value){}
};
})(jQuery);
+884
View File
@@ -0,0 +1,884 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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 - jQuery EasyUI
*
* 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.tabPosition == 'left' || opts.tabPosition == 'right' || !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');
// 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:void(0);"></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('a.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.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('a.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:void(0)" class="tabs-inner">' +
'<span class="tabs-title"></span>' +
'<span class="tabs-icon"></span>' +
'</a>' +
'</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.call(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');
state.selectHis.push(popts.title);
state.options.onSelect.call(container, popts.title, getTabIndex(container, this));
},
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('a.tabs-close').remove();
if (opts.closable){
s_title.addClass('tabs-closable');
$('<a href="javascript:void(0)" class="tabs-close"></a>').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('a.tabs-inner'));
}
if ($.isArray(opts.tools)){
p_tool.empty();
for(var i=0; i<opts.tools.length; i++){
var t = $('<a href="javascript:void(0)"></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;
} 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 opts = $.data(container, 'tabs').options;
var tabs = $.data(container, 'tabs').tabs;
var selectHis = $.data(container, 'tabs').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
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;
if (typeof which == 'number'){
if (which < 0 || which >= tabs.length){
return null;
} else {
var tab = tabs[which];
if (removeit) {
tabs.splice(which, 1);
}
return tab;
}
}
for(var i=0; i<tabs.length; i++){
var tab = tabs[i];
if (tab.panel('options').title == which){
if (removeit){
tabs.splice(i, 1);
}
return tab;
}
}
return null;
}
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
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
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);
+374
View File
@@ -0,0 +1,374 @@
/**
* jQuery EasyUI 1.4.4
*
* Copyright (c) 2009-2015 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
*
*/
/**
* window - jQuery EasyUI
*
* Dependencies:
* panel
* draggable
* resizable
*
*/
(function($){
function moveWindow(target, param){
var state = $.data(target, 'window');
if (param){
if (param.left != null) state.options.left = param.left;
if (param.top != null) state.options.top = param.top;
}
$(target).panel('move', state.options);
if (state.shadow){
state.shadow.css({
left: state.options.left,
top: state.options.top
});
}
}
/**
* center the window only horizontally
*/
function hcenter(target, tomove){
var opts = $.data(target, 'window').options;
var pp = $(target).window('panel');
var width = pp._outerWidth();
if (opts.inline){
var parent = pp.parent();
opts.left = Math.ceil((parent.width() - width) / 2 + parent.scrollLeft());
} else {
opts.left = Math.ceil(($(window)._outerWidth() - width) / 2 + $(document).scrollLeft());
}
if (tomove){moveWindow(target);}
}
/**
* center the window only vertically
*/
function vcenter(target, tomove){
var opts = $.data(target, 'window').options;
var pp = $(target).window('panel');
var height = pp._outerHeight();
if (opts.inline){
var parent = pp.parent();
opts.top = Math.ceil((parent.height() - height) / 2 + parent.scrollTop());
} else {
opts.top = Math.ceil(($(window)._outerHeight() - height) / 2 + $(document).scrollTop());
}
if (tomove){moveWindow(target);}
}
function create(target){
var state = $.data(target, 'window');
var opts = state.options;
var win = $(target).panel($.extend({}, state.options, {
border: false,
doSize: true, // size the panel, the property undefined in window component
closed: true, // close the panel
cls: 'window',
headerCls: 'window-header',
bodyCls: 'window-body ' + (opts.noheader ? 'window-body-noheader' : ''),
onBeforeDestroy: function(){
if (opts.onBeforeDestroy.call(target) == false){return false;}
if (state.shadow){state.shadow.remove();}
if (state.mask){state.mask.remove();}
},
onClose: function(){
if (state.shadow){state.shadow.hide();}
if (state.mask){state.mask.hide();}
opts.onClose.call(target);
},
onOpen: function(){
if (state.mask){
state.mask.css($.extend({
display:'block',
zIndex: $.fn.window.defaults.zIndex++
}, $.fn.window.getMaskSize(target)));
}
if (state.shadow){
state.shadow.css({
display:'block',
zIndex: $.fn.window.defaults.zIndex++,
left: opts.left,
top: opts.top,
width: state.window._outerWidth(),
height: state.window._outerHeight()
});
}
state.window.css('z-index', $.fn.window.defaults.zIndex++);
opts.onOpen.call(target);
},
onResize: function(width, height){
var popts = $(this).panel('options');
$.extend(opts, {
width: popts.width,
height: popts.height,
left: popts.left,
top: popts.top
});
if (state.shadow){
state.shadow.css({
left: opts.left,
top: opts.top,
width: state.window._outerWidth(),
height: state.window._outerHeight()
});
}
opts.onResize.call(target, width, height);
},
onMinimize: function(){
if (state.shadow){state.shadow.hide();}
if (state.mask){state.mask.hide();}
state.options.onMinimize.call(target);
},
onBeforeCollapse: function(){
if (opts.onBeforeCollapse.call(target) == false){return false;}
if (state.shadow){state.shadow.hide();}
},
onExpand: function(){
if (state.shadow){state.shadow.show();}
opts.onExpand.call(target);
}
}));
state.window = win.panel('panel');
// create mask
if (state.mask){state.mask.remove();}
if (opts.modal){
state.mask = $('<div class="window-mask" style="display:none"></div>').insertAfter(state.window);
}
// create shadow
if (state.shadow){state.shadow.remove();}
if (opts.shadow){
state.shadow = $('<div class="window-shadow" style="display:none"></div>').insertAfter(state.window);
}
// center and open the window
var closed = opts.closed;
if (opts.left == null){hcenter(target);}
if (opts.top == null){vcenter(target);}
moveWindow(target);
if (!closed){win.window('open');}
}
/**
* set window drag and resize property
*/
function setProperties(target){
var state = $.data(target, 'window');
state.window.draggable({
handle: '>div.panel-header>div.panel-title',
disabled: state.options.draggable == false,
onStartDrag: function(e){
if (state.mask) state.mask.css('z-index', $.fn.window.defaults.zIndex++);
if (state.shadow) state.shadow.css('z-index', $.fn.window.defaults.zIndex++);
state.window.css('z-index', $.fn.window.defaults.zIndex++);
if (!state.proxy){
state.proxy = $('<div class="window-proxy"></div>').insertAfter(state.window);
}
state.proxy.css({
display:'none',
zIndex: $.fn.window.defaults.zIndex++,
left: e.data.left,
top: e.data.top
});
state.proxy._outerWidth(state.window._outerWidth());
state.proxy._outerHeight(state.window._outerHeight());
setTimeout(function(){
if (state.proxy) state.proxy.show();
}, 500);
},
onDrag: function(e){
state.proxy.css({
display:'block',
left: e.data.left,
top: e.data.top
});
return false;
},
onStopDrag: function(e){
state.options.left = e.data.left;
state.options.top = e.data.top;
$(target).window('move');
state.proxy.remove();
state.proxy = null;
}
});
state.window.resizable({
disabled: state.options.resizable == false,
onStartResize:function(e){
if (state.pmask){state.pmask.remove();}
state.pmask = $('<div class="window-proxy-mask"></div>').insertAfter(state.window);
state.pmask.css({
zIndex: $.fn.window.defaults.zIndex++,
left: e.data.left,
top: e.data.top,
width: state.window._outerWidth(),
height: state.window._outerHeight()
});
if (state.proxy){state.proxy.remove();}
state.proxy = $('<div class="window-proxy"></div>').insertAfter(state.window);
state.proxy.css({
zIndex: $.fn.window.defaults.zIndex++,
left: e.data.left,
top: e.data.top
});
state.proxy._outerWidth(e.data.width)._outerHeight(e.data.height);
},
onResize: function(e){
state.proxy.css({
left: e.data.left,
top: e.data.top
});
state.proxy._outerWidth(e.data.width);
state.proxy._outerHeight(e.data.height);
return false;
},
onStopResize: function(e){
$(target).window('resize', e.data);
state.pmask.remove();
state.pmask = null;
state.proxy.remove();
state.proxy = null;
}
});
}
// function getPageArea() {
// if (document.compatMode == 'BackCompat') {
// return {
// width: Math.max(document.body.scrollWidth, document.body.clientWidth),
// height: Math.max(document.body.scrollHeight, document.body.clientHeight)
// }
// } else {
// return {
// width: Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth),
// height: Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight)
// }
// }
// }
// when window resize, reset the width and height of the window's mask
$(window).resize(function(){
$('body>div.window-mask').css({
width: $(window)._outerWidth(),
height: $(window)._outerHeight()
});
setTimeout(function(){
$('body>div.window-mask').css($.fn.window.getMaskSize());
}, 50);
});
$.fn.window = function(options, param){
if (typeof options == 'string'){
var method = $.fn.window.methods[options];
if (method){
return method(this, param);
} else {
return this.panel(options, param);
}
}
options = options || {};
return this.each(function(){
var state = $.data(this, 'window');
if (state){
$.extend(state.options, options);
} else {
state = $.data(this, 'window', {
options: $.extend({}, $.fn.window.defaults, $.fn.window.parseOptions(this), options)
});
if (!state.options.inline){
document.body.appendChild(this);
}
}
create(this);
setProperties(this);
});
};
$.fn.window.methods = {
options: function(jq){
var popts = jq.panel('options');
var wopts = $.data(jq[0], 'window').options;
return $.extend(wopts, {
closed: popts.closed,
collapsed: popts.collapsed,
minimized: popts.minimized,
maximized: popts.maximized
});
},
window: function(jq){
return $.data(jq[0], 'window').window;
},
move: function(jq, param){
return jq.each(function(){
moveWindow(this, param);
});
},
hcenter: function(jq){
return jq.each(function(){
hcenter(this, true);
});
},
vcenter: function(jq){
return jq.each(function(){
vcenter(this, true);
});
},
center: function(jq){
return jq.each(function(){
hcenter(this);
vcenter(this);
moveWindow(this);
});
}
};
$.fn.window.getMaskSize = function(target){
var state = $(target).data('window');
var inline = (state && state.options.inline);
return {
width: (inline ? '100%' : $(document).width()),
height: (inline ? '100%' : $(document).height())
};
};
$.fn.window.parseOptions = function(target){
return $.extend({}, $.fn.panel.parseOptions(target), $.parser.parseOptions(target, [
{draggable:'boolean',resizable:'boolean',shadow:'boolean',modal:'boolean',inline:'boolean'}
]));
};
// Inherited from $.fn.panel.defaults
$.fn.window.defaults = $.extend({}, $.fn.panel.defaults, {
zIndex: 9000,
draggable: true,
resizable: true,
shadow: true,
modal: false,
inline: false, // true to stay inside its parent, false to go on top of all elements
// window's property which difference from panel
title: 'New Window',
collapsible: true,
minimizable: true,
maximizable: true,
closable: true,
closed: false
});
})(jQuery);
+41
View File
@@ -0,0 +1,41 @@
.accordion {
overflow: hidden;
border-width: 1px;
border-style: solid;
}
.accordion .accordion-header {
border-width: 0 0 1px;
cursor: pointer;
}
.accordion .accordion-body {
border-width: 0 0 1px;
}
.accordion-noborder {
border-width: 0;
}
.accordion-noborder .accordion-header {
border-width: 0 0 1px;
}
.accordion-noborder .accordion-body {
border-width: 0 0 1px;
}
.accordion-collapse {
background: url('images/accordion_arrows.png') no-repeat 0 0;
}
.accordion-expand {
background: url('images/accordion_arrows.png') no-repeat -16px 0;
}
.accordion {
background: #666;
border-color: #000;
}
.accordion .accordion-header {
background: #3d3d3d;
filter: none;
}
.accordion .accordion-header-selected {
background: #0052A3;
}
.accordion .accordion-header-selected .panel-title {
color: #fff;
}

Some files were not shown because too many files have changed in this diff Show More