From 1e478a53788faf0cb4848a5a649d374ac940df6d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 10 Oct 2016 10:46:19 +1300 Subject: [PATCH 1/8] Consistently set 'id' in FormSchema The URL to request the schema representation is the unique identifier. We can't default to $request->getURL() since that's different for form submissions. The schema.schema_url key is redundant, since the identifier is already contained on the top level 'id' key. Keeping schema_url in a schema itself makes it less portable, particularly once we transition into generic schemas which are not reliant on a particular record context (that's only contained in the schema_url) This also fixes the issue of form schemas not refreshing after submit, e.g. when form fields are added or removed. --- Forms/Schema/FormSchema.php | 1 - admin/client/src/state/schema/SchemaReducer.js | 3 +-- .../src/state/schema/tests/SchemaReducer-test.js | 9 ++++++--- admin/code/CampaignAdmin.php | 8 ++++---- admin/code/LeftAndMain.php | 14 +++++++++----- tests/forms/FormSchemaTest.php | 2 -- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Forms/Schema/FormSchema.php b/Forms/Schema/FormSchema.php index f8335d86b..79b5d67f3 100644 --- a/Forms/Schema/FormSchema.php +++ b/Forms/Schema/FormSchema.php @@ -26,7 +26,6 @@ class FormSchema { 'id' => $form->FormName(), 'action' => $form->FormAction(), 'method' => $form->FormMethod(), - 'schema_url' => $schemaLink, 'attributes' => $form->getAttributes(), 'data' => [], 'fields' => [], diff --git a/admin/client/src/state/schema/SchemaReducer.js b/admin/client/src/state/schema/SchemaReducer.js index 14f5803bf..50e72ee27 100644 --- a/admin/client/src/state/schema/SchemaReducer.js +++ b/admin/client/src/state/schema/SchemaReducer.js @@ -7,8 +7,7 @@ export default function schemaReducer(state = initialState, action = null) { switch (action.type) { case ACTION_TYPES.SET_SCHEMA: { - const id = action.payload.schema.schema_url; - return deepFreeze(Object.assign({}, state, { [id]: action.payload })); + return deepFreeze(Object.assign({}, state, { [action.payload.id]: action.payload })); } default: diff --git a/admin/client/src/state/schema/tests/SchemaReducer-test.js b/admin/client/src/state/schema/tests/SchemaReducer-test.js index fb512c6f4..61b39379b 100644 --- a/admin/client/src/state/schema/tests/SchemaReducer-test.js +++ b/admin/client/src/state/schema/tests/SchemaReducer-test.js @@ -11,14 +11,17 @@ describe('schemaReducer', () => { describe('SET_SCHEMA', () => { it('should create a new form', () => { const initialState = { }; - const serverResponse = { id: 'TestForm', schema_url: 'URL' }; + const schema = { + id: 'MySchema', + schema: { id: 'TestForm' }, + }; const nextState = schemaReducer(initialState, { type: ACTION_TYPES.SET_SCHEMA, - payload: { schema: serverResponse }, + payload: schema, }); - expect(nextState.URL.schema.id).toBe('TestForm'); + expect(nextState.MySchema).toBe(schema); }); }); }); diff --git a/admin/code/CampaignAdmin.php b/admin/code/CampaignAdmin.php index 27c2fb013..168a848b0 100644 --- a/admin/code/CampaignAdmin.php +++ b/admin/code/CampaignAdmin.php @@ -98,13 +98,12 @@ class CampaignAdmin extends LeftAndMain implements PermissionProvider { $adminURL = Convert::raw2js(AdminRootController::admin_url()); $json = <<setValidationResponseCallback(function() use ($form) { - return $this->getSchemaResponse($form); + $form->setValidationResponseCallback(function() use ($form, $record) { + $schemaId = Controller::join_links($this->Link('schema/DetailEditForm'), $record->exists() ? $record->ID : ''); + return $this->getSchemaResponse($form, $schemaId); }); return $form; diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 2912cd546..56d5f0065 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -333,12 +333,13 @@ class LeftAndMain extends Controller implements PermissionProvider { * schema if X-Formschema-Request header is set. * * @param Form $form + * @param String $id Optional, will default to the current request URL * @return HTTPResponse */ - protected function getSchemaResponse($form) { + protected function getSchemaResponse($form, $id = null) { $request = $this->getRequest(); if($request->getHeader('X-Formschema-Request')) { - $data = $this->getSchemaForForm($form); + $data = $this->getSchemaForForm($form, $id); $response = new HTTPResponse(Convert::raw2json($data)); $response->addHeader('Content-Type', 'application/json'); @@ -355,10 +356,12 @@ class LeftAndMain extends Controller implements PermissionProvider { * based on the request data. * * @param Form $form + * @param String $id Optional, will default to the current request URL * @return array */ - protected function getSchemaForForm(Form $form) { + protected function getSchemaForForm(Form $form, $id = null) { $request = $this->getRequest(); + $id = $id ? $id : $request->getURL(); $return = null; // Valid values for the "X-Formschema-Request" header are "schema" and "state". @@ -373,7 +376,7 @@ class LeftAndMain extends Controller implements PermissionProvider { $schemaParts = ['schema']; } - $return = ['id' => $form->FormName()]; + $return = ['id' => $id]; if (in_array('schema', $schemaParts)) { $schemaLink = $this->getSchemaLinkForForm($form); @@ -1302,10 +1305,11 @@ class LeftAndMain extends Controller implements PermissionProvider { $message = _t('LeftAndMain.SAVEDUP', 'Saved.'); if($request->getHeader('X-Formschema-Request')) { + $schemaId = Controller::join_links($this->Link('schema/DetailEditForm'), $id); // Ensure that newly created records have all their data loaded back into the form. $form->loadDataFrom($record); $form->setMessage($message, 'good'); - $data = $this->getSchemaForForm($form); + $data = $this->getSchemaForForm($form, $schemaId); $response = new HTTPResponse(Convert::raw2json($data)); $response->addHeader('Content-Type', 'application/json'); } else { diff --git a/tests/forms/FormSchemaTest.php b/tests/forms/FormSchemaTest.php index b1f3367d6..b3550235b 100644 --- a/tests/forms/FormSchemaTest.php +++ b/tests/forms/FormSchemaTest.php @@ -20,7 +20,6 @@ class FormSchemaTest extends SapphireTest { 'id' => 'Form_TestForm', 'action' => 'Controller/TestForm', 'method' => 'POST', - 'schema_url' => 'admin/mysection/schema', 'attributes' => [ 'id' => 'Form_TestForm', 'action' => 'Controller/TestForm', @@ -171,7 +170,6 @@ class FormSchemaTest extends SapphireTest { 'id' => 'Form_TestForm', 'action' => 'Controller/TestForm', 'method' => 'POST', - 'schema_url' => 'admin/mysection/schema', 'attributes' => [ 'id' => 'Form_TestForm', 'action' => 'Controller/TestForm', From 5f81122ad3537047fca5d4cb633ed4134b057b84 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 12 Oct 2016 13:54:19 +1300 Subject: [PATCH 2/8] Removed misdocumented 'data' prop --- admin/client/src/components/Form/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/admin/client/src/components/Form/README.md b/admin/client/src/components/Form/README.md index 0817aa7ca..7cea0889a 100644 --- a/admin/client/src/components/Form/README.md +++ b/admin/client/src/components/Form/README.md @@ -20,7 +20,6 @@ attributes = { ``` * `componentWillUnmount` (func): Optional function which will be called in the component's 'native' `componentWillUnmount` method. This can be used to tidy up Redux state that's no longer required. - * `data` (object) (required): Extra data that helps define this field uniquely. * `fields` (required): A list of field objects to display in the form. These objects should be transformed to Components using the `this.props.mapFieldsToComponents` method. * `mapFieldsToComponents` (required): A function that maps each schema field (`this.props.fields`) to the component responsibe for render it. * `handleSubmit` (func): Called then the form is submitted. From 5b31a405935e7603177da1b8ef46d30952468dce Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 12 Oct 2016 14:47:14 +1300 Subject: [PATCH 3/8] Use redux-form instead of custom actions/reducers (fixes #5524) - Removed custom form reducers in favour of redux-form (updateField(), addForm(), etc) - Storing 'state' in schema reducer to avoid a separate forms reducer tree (no longer needed for other use cases). This means 'state' is only the "initial state", any form edits will be handled by redux-form internally in the 'reduxForm' reducer namespace - Removed componentWillUnmount() from
since there's no more reducer state to clean up (removed formReducer.js), and redux-form handles that internally - Removed isFetching state from since there's now a props.submitting coming from redux-form - Improved passing of "clicked button" (submittingAction), using component state rather than reducer and passing it into action handlers (no need for components to inspect it any other way) - Hacky duplication of this.submittingAction and this.state.submittingAction to avoid re-render of *during* a submission (see https://github.com/erikras/redux-form/issues/1944) - Inlined handleSubmit() XHR (rather than using a redux action). There's other ways for form consumers to listen to form evens (e.g. onSubmitSuccess passed through into reduxForm()). - Adapting checkbox/radio fields to redux-forms Need to send onChange event with values rather than the original event, see http://redux-form.com/6.1.1/docs/api/Field.md/#-input-onchange-eventorvalue-function- - Using reduxForm() within render() causes DOM to get thrown away, and has weird side effects like https://github.com/erikras/redux-form/issues/1944. See https://github.com/erikras/redux-form/issues/603#issuecomment-176397728 - Refactored as a separate container component which connects to redux and redux-form. This keeps the component dependency free and easy to test. It'll also be an advantage if we switch to a GraphQL backed component, in which case the async loading routines will look very different from the current implementation - Refactoring out the redux-form dependency from FormBuilder to make it more testable (through baseFormComponent and baseFieldComponent) - Passing through 'form' to allow custom identifiers (which is important because currently the schema "id" contains the record identifier, making the form identifier non-deterministic - which means you can't use it with the redux-form selector API) --- admin/client/src/boot/index.js | 6 +- admin/client/src/bundles/bundle.js | 1 + admin/client/src/bundles/vendor.js | 1 + .../CheckboxSetField/CheckboxSetField.js | 2 +- .../tests/CheckboxSetField-test.js | 6 +- admin/client/src/components/Form/Form.js | 25 +- admin/client/src/components/Form/README.md | 7 +- .../src/components/FormAction/FormAction.js | 1 + .../src/components/FormBuilder/FormBuilder.js | 547 +++++++----------- .../src/components/FormBuilder/README.md | 93 ++- .../FormBuilder/tests/FormBuilder-test.js | 151 +++-- .../FormBuilderModal/FormBuilderModal.js | 16 +- .../OptionsetField/OptionsetField.js | 2 +- .../tests/OptionsetField-test.js | 3 +- .../containers/CampaignAdmin/CampaignAdmin.js | 24 +- .../FormBuilderLoader/FormBuilderLoader.js | 106 ++++ .../containers/FormBuilderLoader/README.md | 12 + .../src/containers/ReduxForm/ReduxForm.js | 6 - .../client/src/state/form/FormActionTypes.js | 9 - admin/client/src/state/form/FormActions.js | 96 --- admin/client/src/state/form/FormReducer.js | 78 --- admin/client/src/state/form/README.md | 24 - .../src/state/form/tests/FormsReducer-test.js | 233 -------- .../client/src/state/schema/SchemaActions.js | 2 + npm-shrinkwrap.json | 70 +++ package.json | 4 +- webpack.config.js | 2 + 27 files changed, 635 insertions(+), 892 deletions(-) create mode 100644 admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js create mode 100644 admin/client/src/containers/FormBuilderLoader/README.md delete mode 100644 admin/client/src/containers/ReduxForm/ReduxForm.js delete mode 100644 admin/client/src/state/form/FormActionTypes.js delete mode 100644 admin/client/src/state/form/FormActions.js delete mode 100644 admin/client/src/state/form/FormReducer.js delete mode 100644 admin/client/src/state/form/README.md delete mode 100644 admin/client/src/state/form/tests/FormsReducer-test.js diff --git a/admin/client/src/boot/index.js b/admin/client/src/boot/index.js index 2e80c78af..50f54f143 100644 --- a/admin/client/src/boot/index.js +++ b/admin/client/src/boot/index.js @@ -1,16 +1,16 @@ import BootRoutes from './BootRoutes'; import { combineReducers, createStore, applyMiddleware, compose } from 'redux'; import thunkMiddleware from 'redux-thunk'; +import { reducer as ReduxFormReducer } from 'redux-form'; +import { routerReducer } from 'react-router-redux'; import Config from 'lib/Config'; import reducerRegister from 'lib/ReducerRegister'; import * as configActions from 'state/config/ConfigActions'; import ConfigReducer from 'state/config/ConfigReducer'; -import FormReducer from 'state/form/FormReducer'; import SchemaReducer from 'state/schema/SchemaReducer'; import RecordsReducer from 'state/records/RecordsReducer'; import CampaignReducer from 'state/campaign/CampaignReducer'; import BreadcrumbsReducer from 'state/breadcrumbs/BreadcrumbsReducer'; -import { routerReducer } from 'react-router-redux'; import bootInjector from 'boot/BootInjector'; // Sections @@ -19,7 +19,7 @@ import CampaignAdmin from 'containers/CampaignAdmin/controller'; function appBoot() { reducerRegister.add('config', ConfigReducer); - reducerRegister.add('form', FormReducer); + reducerRegister.add('form', ReduxFormReducer); reducerRegister.add('schemas', SchemaReducer); reducerRegister.add('records', RecordsReducer); reducerRegister.add('campaign', CampaignReducer); diff --git a/admin/client/src/bundles/bundle.js b/admin/client/src/bundles/bundle.js index f5074a8e3..3d0a6e1c2 100644 --- a/admin/client/src/bundles/bundle.js +++ b/admin/client/src/bundles/bundle.js @@ -5,6 +5,7 @@ require('expose?Form!components/Form/Form'); require('expose?FormConstants!components/Form/FormConstants'); require('expose?FormAction!components/FormAction/FormAction'); require('expose?FormBuilder!components/FormBuilder/FormBuilder'); +require('expose?FormBuilderLoader!containers/FormBuilderLoader/FormBuilderLoader'); require('expose?FormBuilderModal!components/FormBuilderModal/FormBuilderModal'); require('expose?GridField!components/GridField/GridField'); require('expose?GridFieldCell!components/GridField/GridFieldCell'); diff --git a/admin/client/src/bundles/vendor.js b/admin/client/src/bundles/vendor.js index 5eb9dec4e..63757ae94 100644 --- a/admin/client/src/bundles/vendor.js +++ b/admin/client/src/bundles/vendor.js @@ -17,6 +17,7 @@ require('expose?Tether!tether'); require('expose?ReactDom!react-dom'); require('expose?Redux!redux'); require('expose?ReactRedux!react-redux'); +require('expose?ReduxForm!redux-form'); require('expose?ReduxThunk!redux-thunk'); require('expose?ReactRouter!react-router'); require('expose?ReactRouterRedux!react-router-redux'); diff --git a/admin/client/src/components/CheckboxSetField/CheckboxSetField.js b/admin/client/src/components/CheckboxSetField/CheckboxSetField.js index 742e9c95e..586115235 100644 --- a/admin/client/src/components/CheckboxSetField/CheckboxSetField.js +++ b/admin/client/src/components/CheckboxSetField/CheckboxSetField.js @@ -65,7 +65,7 @@ class CheckboxSetField extends SilverStripeComponent { }) .map((item) => `${item.value}`); - this.props.onChange(event, { id: this.props.id, value: newValue }); + this.props.onChange(newValue); } } diff --git a/admin/client/src/components/CheckboxSetField/tests/CheckboxSetField-test.js b/admin/client/src/components/CheckboxSetField/tests/CheckboxSetField-test.js index 6dfbaa28e..c755af770 100644 --- a/admin/client/src/components/CheckboxSetField/tests/CheckboxSetField-test.js +++ b/admin/client/src/components/CheckboxSetField/tests/CheckboxSetField-test.js @@ -90,8 +90,7 @@ describe('CheckboxSetField', () => { checkboxSetField.handleChange(event, { id: 'checkbox-two', value: 1 }); expect(checkboxSetField.props.onChange).toBeCalledWith( - event, - { id: 'checkbox', value: ['one', 'two', 'four'] } + ['one', 'two', 'four'] ); }); @@ -101,8 +100,7 @@ describe('CheckboxSetField', () => { checkboxSetField.handleChange(event, { id: 'checkbox-one', value: 0 }); expect(checkboxSetField.props.onChange).toBeCalledWith( - event, - { id: 'checkbox', value: ['four'] } + ['four'] ); }); }); diff --git a/admin/client/src/components/Form/Form.js b/admin/client/src/components/Form/Form.js index 26f110df6..c605c1d3d 100644 --- a/admin/client/src/components/Form/Form.js +++ b/admin/client/src/components/Form/Form.js @@ -8,21 +8,15 @@ class Form extends SilverStripeComponent { this.handleSubmit = this.handleSubmit.bind(this); } - - componentWillUnmount() { - if (typeof this.props.componentWillUnmount === 'undefined') { - return; - } - - this.props.componentWillUnmount(this.props.formId); - } - render() { - const defaultFormProps = { - className: 'form', - onSubmit: this.handleSubmit, - }; - const formProps = Object.assign({}, defaultFormProps, this.props.attributes); + const formProps = Object.assign( + {}, + { + className: 'form', + onSubmit: this.handleSubmit, + }, + this.props.attributes + ); const fields = this.props.mapFieldsToComponents(this.props.fields); const actions = this.props.mapActionsToComponents(this.props.actions); @@ -62,10 +56,7 @@ Form.propTypes = { id: React.PropTypes.string, method: React.PropTypes.string.isRequired, }), - componentWillUnmount: React.PropTypes.func, - data: React.PropTypes.array, fields: React.PropTypes.array.isRequired, - formId: React.PropTypes.string.isRequired, handleSubmit: React.PropTypes.func, mapActionsToComponents: React.PropTypes.func.isRequired, mapFieldsToComponents: React.PropTypes.func.isRequired, diff --git a/admin/client/src/components/Form/README.md b/admin/client/src/components/Form/README.md index 7cea0889a..1789c415d 100644 --- a/admin/client/src/components/Form/README.md +++ b/admin/client/src/components/Form/README.md @@ -1,8 +1,8 @@ # Form Component -The FormComponent is used to render forms in SilverStripe. The only time you should need to use `FormComponent` directly is when you're composing custom layouts. Forms can be automatically generated from a schema using the `FormBuilder` component. - -This component should be moved to Framework when dependency injection is implemented. +The `Form` component is used to render forms in SilverStripe. +The only time you should need to use `FormComponent` directly is when you're composing custom layouts. +Forms can be automatically generated from a schema using the `FormBuilder` component. ## Properties @@ -19,7 +19,6 @@ attributes = { } ``` - * `componentWillUnmount` (func): Optional function which will be called in the component's 'native' `componentWillUnmount` method. This can be used to tidy up Redux state that's no longer required. * `fields` (required): A list of field objects to display in the form. These objects should be transformed to Components using the `this.props.mapFieldsToComponents` method. * `mapFieldsToComponents` (required): A function that maps each schema field (`this.props.fields`) to the component responsibe for render it. * `handleSubmit` (func): Called then the form is submitted. diff --git a/admin/client/src/components/FormAction/FormAction.js b/admin/client/src/components/FormAction/FormAction.js index 3ee5b36a8..e1f38aa0b 100644 --- a/admin/client/src/components/FormAction/FormAction.js +++ b/admin/client/src/components/FormAction/FormAction.js @@ -28,6 +28,7 @@ class FormAction extends SilverStripeComponent { typeof this.props.attributes === 'undefined' ? {} : this.props.attributes, { id: this.props.id, + name: this.props.name, className: this.getButtonClasses(), disabled: this.props.disabled, onClick: this.handleClick, diff --git a/admin/client/src/components/FormBuilder/FormBuilder.js b/admin/client/src/components/FormBuilder/FormBuilder.js index 32cd90f75..264028cc9 100644 --- a/admin/client/src/components/FormBuilder/FormBuilder.js +++ b/admin/client/src/components/FormBuilder/FormBuilder.js @@ -1,197 +1,45 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import { bindActionCreators } from 'redux'; -import * as formActions from 'state/form/FormActions'; -import * as schemaActions from 'state/schema/SchemaActions'; +import React, { PropTypes } from 'react'; import SilverStripeComponent from 'lib/SilverStripeComponent'; -import Form from 'components/Form/Form'; -import fetch from 'isomorphic-fetch'; import backend from 'lib/Backend'; import injector from 'lib/Injector'; import merge from 'merge'; -import es6promise from 'es6-promise'; -es6promise.polyfill(); - -export class FormBuilderComponent extends SilverStripeComponent { +class FormBuilder extends SilverStripeComponent { constructor(props) { super(props); - this.formSchemaPromise = null; - this.state = { isFetching: false }; - + const schemaStructure = props.schema.schema; + this.state = { submittingAction: null }; + this.submitApi = backend.createEndpointFetcher({ + url: schemaStructure.attributes.action, + method: schemaStructure.attributes.method, + }); this.mapActionsToComponents = this.mapActionsToComponents.bind(this); this.mapFieldsToComponents = this.mapFieldsToComponents.bind(this); - this.handleFieldUpdate = this.handleFieldUpdate.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.handleAction = this.handleAction.bind(this); - this.removeForm = this.removeForm.bind(this); - this.getFormId = this.getFormId.bind(this); - this.getFormSchema = this.getFormSchema.bind(this); this.findField = this.findField.bind(this); - } - - /** - * Get the schema for this form - * - * @returns {array} - */ - getFormSchema() { - return this.props.schemas[this.props.schemaUrl]; - } - - /** - * Gets the ID for this form - * - * @returns {String} - */ - getFormId() { - const schema = this.getFormSchema(); - if (schema) { - return schema.id; - } - return null; - } - - componentDidMount() { - this.fetch(); - } - - componentDidUpdate(prevProps) { - if (this.props.schemaUrl !== prevProps.schemaUrl) { - this.fetch(); - } - } - - /** - * Fetches data used to generate a form. This can be form schema and or form state data. - * When the response comes back the data is saved to state. - * - * @param {Boolean} schema If form schema data should be returned in the response. - * @param {Boolean} state If form state data should be returned in the response. - * - * @return {Object} Promise from the AJAX request. - */ - fetch(schema = true, state = true) { - const headerValues = []; - - if (this.state.isFetching === true) { - return this.formSchemaPromise; - } - - if (schema === true) { - headerValues.push('schema'); - } - - if (state === true) { - headerValues.push('state'); - } - - this.formSchemaPromise = fetch(this.props.schemaUrl, { - headers: { 'X-FormSchema-Request': headerValues.join() }, - credentials: 'same-origin', - }) - .then(response => response.json()) - .then(json => { - const formSchema = Object.assign({}, { id: json.id, schema: json.schema }); - const formState = Object.assign({}, json.state); - - // TODO See "Enable once ..." below - // this.setState({ isFetching: false }); - - if (typeof formSchema.id !== 'undefined') { - const defaultData = { - SecurityID: this.props.config.SecurityID, - }; - - this.submitApi = (...args) => { - const endPoint = backend.createEndpointFetcher({ - url: formSchema.schema.attributes.action, - method: formSchema.schema.attributes.method, - defaultData, - }); - - // Ensure that schema changes are handled prior to updating state - return endPoint(...args) - .then((response) => { - if (response.schema) { - const newSchema = Object.assign({}, { id: response.id, schema: response.schema }); - this.props.schemaActions.setSchema(newSchema); - } - return response; - }); - }; - - this.props.schemaActions.setSchema(formSchema); - } - - if (typeof formState.id !== 'undefined') { - this.props.formActions.addForm(formState); - } - }); - - // TODO Enable once is initialised via page.js route callbacks - // At the moment, it's running an Entwine onadd() rule which ends up - // rendering the index view, and only then calling route.start() to - // match the detail view (admin/campaigns/set/:id/show). - // This causes the form builder to be unmounted during a fetch() call. - // this.setState({ isFetching: true }); - - return this.formSchemaPromise; - } - - /** - * Update handler passed down to each form field as a prop. - * Form fields call this method when their state changes. - * - * You can pass an optional callback as the third param. This can be used to - * implement custom behaviour. For example you can use `createFn` hook from - * your controller context like this. - * - * controller.js - * ... - * detailEditFormCreateFn(Component, props) { - * const extendedProps = Object.assign({}, props, { - * handleFieldUpdate: (event, updates) => { - * props.handleFieldUpdate(event, updates, (formId, updateFieldAction) => { - * const customUpdates = Object.assign({}, updates, { - * value: someCustomParsing(updates.value), - * }; - * - * updateFieldAction(formId, customUpdates); - * }); - * }, - * }); - * - * return ; - * } - * ... - * - * @param {object} event - Change event from the form field component. - * @param {object} updates - Values to set in state. - * @param {string} updates.id - Field ID. Required to identify the field in the store. - * @param {function} [fn] - Optional function for custom behaviour. See example in description. - */ - handleFieldUpdate(event, updates, fn) { - if (typeof fn === 'function') { - fn(this.getFormId(), this.props.formActions.updateField); - } else { - this.props.formActions.updateField(this.getFormId(), updates); - } + this.buildComponent = this.buildComponent.bind(this); } /** * When the action is clicked on, records which action was clicked on * This can allow for preventing the submit action, such as a custom action for the button * - * @param event - * @param submitAction + * @param {Event} event */ - handleAction(event, submitAction) { - this.props.formActions.setSubmitAction(this.getFormId(), submitAction); + handleAction(event) { + // Custom handlers if (typeof this.props.handleAction === 'function') { - this.props.handleAction(event, submitAction, this.getFieldValues()); + this.props.handleAction(event, this.getFieldValues()); + } + + const name = event.currentTarget.name; + + // Allow custom handlers to cancel event + if (!event.isPropagationStopped()) { + this.setState({ submittingAction: name }); } } @@ -199,48 +47,45 @@ export class FormBuilderComponent extends SilverStripeComponent { * Form submission handler passed to the Form Component as a prop. * Provides a hook for controllers to access for state and provide custom functionality. * - * For example: - * - * controller.js - * ``` - * constructor(props) { - * super(props); - * this.handleSubmit = this.handleSubmit.bind(this); - * } - * - * handleSubmit(event, fieldValues, submitFn) { - * event.preventDefault(); - * - * // Apply custom validation. - * if (!this.validate(fieldValues)) { - * return; - * } - * - * submitFn(); - * } - * - * render() { - * return - * } - * ``` - * - * @param {Object} event + * @param {Object} data Processed and validated data from redux-form + * (originally retrieved through getFieldValues()) * @return {Promise|null} */ - handleSubmit(event) { - const fieldValues = this.getFieldValues(); + handleSubmit(data) { + // Add form action data (or default to first action, same as browser behaviour) + const action = this.state.submittingAction + ? this.state.submittingAction + : this.props.schema.schema.actions[0].name; - const submitFn = () => this.props.formActions.submitForm( - this.submitApi, - this.getFormId(), - fieldValues - ); + const dataWithAction = Object.assign({}, data, { + [action]: 1, + }); + const headers = { + 'X-Formschema-Request': 'state,schema', + 'X-Requested-With': 'XMLHttpRequest', + }; - if (typeof this.props.handleSubmit !== 'undefined') { - return this.props.handleSubmit(event, fieldValues, submitFn); + const resetSubmittingFn = () => { + this.setState({ submittingAction: null }); + }; + + const submitFn = (customData) => + this.submitApi(customData || dataWithAction, headers) + .then(formSchema => { + resetSubmittingFn(); + return formSchema; + }) + .catch((reason) => { + // TODO Generic CMS error reporting + // TODO Handle validation errors + resetSubmittingFn(); + return reason; + }); + + if (typeof this.props.handleSubmit === 'function') { + return this.props.handleSubmit(dataWithAction, action, submitFn); } - event.preventDefault(); return submitFn(); } @@ -250,35 +95,31 @@ export class FormBuilderComponent extends SilverStripeComponent { * @returns {Object} */ getFieldValues() { - const schema = this.props.schemas[this.props.schemaUrl]; // using state is more efficient and has the same fields, fallback to nested schema - const fields = (schema.state) - ? schema.state.fields - : schema.schema.fields; + const schema = this.props.schema.schema; + const state = this.props.schema.state; - // Set action - const action = this.getSubmitAction(); - const values = {}; - if (action) { - values[action] = 1; + if (!state) { + return {}; } - // Reduce all other fields - return this.props.form[this.getFormId()].fields + return state.fields .reduce((prev, curr) => { - const match = this.findField(fields, curr.id); + const match = this.findField(schema.fields, curr.id); + if (!match) { return prev; } + // Skip non-data fields + if (match.type === 'Structural' || match.readOnly === true) { + return prev; + } + return Object.assign({}, prev, { [match.name]: curr.value, }); - }, values); - } - - getSubmitAction() { - return this.props.form[this.getFormId()].submitAction; + }, {}); } /** @@ -309,39 +150,42 @@ export class FormBuilderComponent extends SilverStripeComponent { /** * Common functionality for building a Field or Action from schema. * - * @param field - * @param extraProps + * @param {Object} props Props which every form field receives. Leave it up to the + * schema and component to determine which props are required. * @returns {*} */ - buildComponent(field, extraProps = {}) { - const Component = field.component !== null - ? injector.getComponentByName(field.component) - : injector.getComponentByDataType(field.type); + buildComponent(props) { + let componentProps = props; + // 'component' key is renamed to 'schemaComponent' in normalize*() methods + const SchemaComponent = componentProps.schemaComponent !== null + ? injector.getComponentByName(componentProps.schemaComponent) + : injector.getComponentByDataType(componentProps.type); - if (Component === null) { + if (SchemaComponent === null) { return null; - } else if (field.component !== null && Component === undefined) { - throw Error(`Component not found in injector: ${field.component}`); + } else if (componentProps.schemaComponent !== null && SchemaComponent === undefined) { + throw Error(`Component not found in injector: ${componentProps.schemaComponent}`); } - // Props which every form field receives. - // Leave it up to the schema and component to determine - // which props are required. - const props = Object.assign({}, field, extraProps); - // if no value, it is better to unset it - if (props.value === null) { - delete props.value; + if (componentProps.value === null) { + delete componentProps.value; } + // Inline `input` props into main field props + // (each component can pick and choose the props required for it's + // See http://redux-form.com/6.0.5/docs/api/Field.md/#input-props + componentProps = Object.assign({}, componentProps, componentProps.input); + delete componentProps.input; + // Provides container components a place to hook in // and apply customisations to scaffolded components. const createFn = this.props.createFn; if (typeof createFn === 'function') { - return createFn(Component, props); + return createFn(SchemaComponent, componentProps); } - return ; + return ; } /** @@ -353,16 +197,25 @@ export class FormBuilderComponent extends SilverStripeComponent { * @return {Array} */ mapFieldsToComponents(fields) { + const FieldComponent = this.props.baseFieldComponent; return fields.map((field) => { - // Events - const extraProps = { onChange: this.handleFieldUpdate }; + let props = field; - // Build child nodes if (field.children) { - extraProps.children = this.mapFieldsToComponents(field.children); + props = Object.assign( + {}, + field, + { children: this.mapFieldsToComponents(field.children) } + ); } - return this.buildComponent(field, extraProps); + // Don't wrap structural or readonly fields, since they don't need connected fields. + // The redux-form connected fields also messed up react-bootstrap's tab handling. + if (field.type === 'Structural' || field.readOnly === true) { + return this.buildComponent(props); + } + + return ; }); } @@ -373,23 +226,21 @@ export class FormBuilderComponent extends SilverStripeComponent { * @return {Array} */ mapActionsToComponents(actions) { - const form = this.props.form[this.getFormId()]; - return actions.map((action) => { - const loading = (form && form.submitting && form.submitAction === action.name); - // Events - const extraProps = { - handleClick: this.handleAction, - loading, - disabled: loading || action.disabled, - }; + const props = Object.assign({}, action); - // Build child nodes if (action.children) { - extraProps.children = this.mapActionsToComponents(action.children); + props.children = this.mapActionsToComponents(action.children); + } else { + props.handleClick = this.handleAction; + + // Reset through componentWillReceiveProps() + if (this.state.submittingAction === action.name) { + props.loading = true; + } } - return this.buildComponent(action, extraProps); + return this.buildComponent(props); }); } @@ -416,32 +267,54 @@ export class FormBuilderComponent extends SilverStripeComponent { }); } + /** - * Cleans up Redux state used by the form when the Form component is unmonuted. + * If there is structural and state data available merge those data for each field. + * Otherwise just use the structural data. Ensure that keys don't conflict + * with redux-form expectations. * - * @param {string} formId - ID of the form to clean up. + * @param {array} fields + * @param {Object} state Optional + * @return {array} */ - removeForm(formId) { - this.props.formActions.removeForm(formId); + normalizeFields(fields, state) { + return fields.map((field) => { + const fieldState = (state && state.fields) + ? state.fields.find((item) => item.id === field.id) + : {}; + + const data = merge.recursive( + true, + this.mergeFieldData(field, fieldState), + // Overlap with redux-form prop handling : createFieldProps filters out the 'component' key + { schemaComponent: field.component } + ); + + if (field.children) { + data.children = this.normalizeFields(field.children, state); + } + + return data; + }); } /** - * If there is structural and state data availabe merge those data for each field. - * Otherwise just use the structural data. + * Ensure that keys don't conflict with redux-form expectations. + * + * @param {array} actions + * @return {array} */ - getFieldData(formFields, formState) { - if (!formFields || !formState || !formState.fields) { - return formFields; - } + normalizeActions(actions) { + return actions.map((action) => { + const data = merge.recursive( + true, + action, + // Overlap with redux-form prop handling : createFieldProps filters out the 'component' key + { schemaComponent: action.component } + ); - return formFields.map((field) => { - const state = formState.fields.find((item) => item.id === field.id); - const data = this.mergeFieldData(field, state); - - if (field.children) { - return Object.assign({}, data, { - children: this.getFieldData(field.children, formState), - }); + if (action.children) { + data.children = this.normalizeActions(action.children); } return data; @@ -449,73 +322,89 @@ export class FormBuilderComponent extends SilverStripeComponent { } render() { - const formId = this.getFormId(); - if (!formId) { - return null; - } - const formSchema = this.getFormSchema(); - const formState = this.props.form[formId]; - - // If the response from fetching the initial data - // hasn't come back yet, don't render anything. - if (!formSchema || !formSchema.schema) { - return null; - } + const schema = this.props.schema.schema; + const state = this.props.schema.state; + const BaseFormComponent = this.props.baseFormComponent; // Map form schema to React component attribute names, // which requires renaming some of them (by unsetting the original keys) - const attributes = Object.assign({}, formSchema.schema.attributes, { - className: formSchema.schema.attributes.class, - encType: formSchema.schema.attributes.enctype, + const attributes = Object.assign({}, schema.attributes, { + className: schema.attributes.class, + encType: schema.attributes.enctype, }); - // these two still cause silent errors delete attributes.class; delete attributes.enctype; - const fieldData = this.getFieldData(formSchema.schema.fields, formState); - const actionData = this.getFieldData(formSchema.schema.actions, formState); + const { + asyncValidate, + onSubmitFail, + onSubmitSuccess, + shouldAsyncValidate, + touchOnBlur, + touchOnChange, + persistentSubmitErrors, + validate, + form, + } = this.props; - const formProps = { - actions: actionData, + const props = { + form, // required as redux-form identifier + fields: this.normalizeFields(schema.fields, state), + actions: this.normalizeActions(schema.actions), attributes, - componentWillUnmount: this.removeForm, - data: formSchema.schema.data, - fields: fieldData, - formId, - handleSubmit: this.handleSubmit, + data: schema.data, + initialValues: this.getFieldValues(), + onSubmit: this.handleSubmit, mapActionsToComponents: this.mapActionsToComponents, mapFieldsToComponents: this.mapFieldsToComponents, + asyncValidate, + onSubmitFail, + onSubmitSuccess, + shouldAsyncValidate, + touchOnBlur, + touchOnChange, + persistentSubmitErrors, + validate, }; - return ; + return ; } } -FormBuilderComponent.propTypes = { - config: React.PropTypes.object, - createFn: React.PropTypes.func, - form: React.PropTypes.object.isRequired, - formActions: React.PropTypes.object.isRequired, - handleSubmit: React.PropTypes.func, - handleAction: React.PropTypes.func, - schemas: React.PropTypes.object.isRequired, - schemaActions: React.PropTypes.object.isRequired, - schemaUrl: React.PropTypes.string.isRequired, +const schemaPropType = PropTypes.shape({ + id: PropTypes.string.isRequired, + schema: PropTypes.shape({ + attributes: PropTypes.shape({ + class: PropTypes.string, + enctype: PropTypes.string, + }), + fields: PropTypes.array.isRequired, + }).isRequired, + state: PropTypes.shape({ + fields: PropTypes.array, + }), +}); + +const basePropTypes = { + createFn: PropTypes.func, + handleSubmit: PropTypes.func, + handleAction: PropTypes.func, + asyncValidate: PropTypes.func, + onSubmitFail: PropTypes.func, + onSubmitSuccess: PropTypes.func, + shouldAsyncValidate: PropTypes.func, + touchOnBlur: PropTypes.bool, + touchOnChange: PropTypes.bool, + persistentSubmitErrors: PropTypes.bool, + validate: PropTypes.func, + baseFormComponent: PropTypes.func.isRequired, + baseFieldComponent: PropTypes.func.isRequired, }; -function mapStateToProps(state) { - return { - config: state.config, - form: state.form, - schemas: state.schemas, - }; -} +FormBuilder.propTypes = Object.assign({}, basePropTypes, { + form: PropTypes.string.isRequired, + schema: schemaPropType.isRequired, +}); -function mapDispatchToProps(dispatch) { - return { - formActions: bindActionCreators(formActions, dispatch), - schemaActions: bindActionCreators(schemaActions, dispatch), - }; -} - -export default connect(mapStateToProps, mapDispatchToProps)(FormBuilderComponent); +export { basePropTypes, schemaPropType }; +export default FormBuilder; diff --git a/admin/client/src/components/FormBuilder/README.md b/admin/client/src/components/FormBuilder/README.md index 2b78eb841..c8fe175ea 100644 --- a/admin/client/src/components/FormBuilder/README.md +++ b/admin/client/src/components/FormBuilder/README.md @@ -1,15 +1,90 @@ # FormBuilder Component -Used to generate forms, made up of field components and actions, from FormFieldSchema data. +Used to generate forms, made up of field components and actions, from form schema data. -This component will be moved to Framweork or CMS when dependency injection is implemented. +Forms are usually rendered through [redux-form](http://redux-form.com/), +although this can be controlled through the `baseFormComponent` +and `baseFieldComponent` props. + +If you want to load the schema from a server via XHR, use the +[FormBuilderLoader](../../containers/FormBuilderLoader/README.md] instead. ## Properties - * `createFn` (function): Gives container components a chance to access a form component before it's constructed. Use this as an opportunity to pass a custom click handler to to a field for example. - * `schemaUrl` (string): The schema URL where the form will be scaffolded from e.g. '/admin/pages/schema/1'. - * `handleSubmit` (function): Event handler passed to the Form Component as a prop. Parameters received are: - * `event` (Event): The submit event, it is strongly recommended to call `preventDefault()` - * `fieldValues` (object): An object containing the field values captured by the Submit handler - * `submitFn` (function): A callback for when the submission was successful, if submission fails, this function should not be called. (e.g. validation error) - * `handleAction` (function): Event handler when a form action is clicked on, allows preventing submit and know which action was clicked on. + * `form` (string): Form identifier (useful to reference this form through redux selectors) + * `baseFormComponent` (function): A React component to render the form + * `baseFieldComponent` (function): A React component to render each field. Should be a HOC which receives + the actual field builder through a `component` prop. + * `schema` (object): A form schema (see "Schema Structure" below) + * `createFn` (function): Gives container components a chance to access a form component before it's constructed. + Use this as an opportunity to pass a custom click handler to to a field for example. + * `handleSubmit` (function): Event handler passed to the Form Component as a prop. + Should return a promise (usually the result of the `submitFn` argument). Parameters received are: + * `data` (object): An object containing the field values captured by the submit handler + * `action` (string): The name of the button clicked to perform this action. + Defaults to first button when form is submitted by pressing the "enter" key. + * `submitFn` (function): A callback for when the submission was successful, if submission fails, + this function should not be called. (e.g. validation error). Pass in your modified `data` + to influence the data being sent through. + * `handleAction` (function): Event handler when a form action is clicked on, allows preventing submit and know which action was clicked on. Arguments: + * `event` (function) Allows cancellation of the submission through `event.stopPropagation()`. + The action can be identified via `event.currentTarget.name`. + * `data` (object): Validated and processed field values, ready for submission + * `asyncValidate` (function): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `onSubmitFail` (function): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `onSubmitSuccess` (function): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `shouldAsyncValidate` (function): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `touchOnBlur` (bool): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `touchOnChange` (bool): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `persistentSubmitErrors` (bool): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + * `validate` (function): See [redux-form](http://redux-form.com/6.0.5/docs/api/ReduxForm.md/) + +## Schema Structure + +The `schema` prop expects a particular structure, containing the form structure +in a `schema` key, and the form values in a `state` key. +See [RFC: FormField React Integration API](https://github.com/silverstripe/silverstripe-framework/issues/4938) for details. + +## Example + +```js +import { Field as ReduxFormField, reduxForm } from 'redux-form'; +class MyComponent extends Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + } + handleSubmit(data, action, submitFn) { + // You can implement custom submission handling and data processing here. + // Ensure to always return a promise if you want execution to continue. + if (!this.myCheck(data)) { + return; + } + return submitFn(); + } + render() { + const props = { + form: 'MyForm', + schema: { /* ... */ }, + baseFormComponent: reduxForm()(Form), + baseFieldComponent: ReduxFormField, + handleSubmit: this.handleSubmit + }; + return + } +} +``` + +With the default implementation of [redux-form](http://http://redux-form.com) +(passed in through `baseFormComponent` and `baseFieldComponent`), +the submission process works as follows: + + 1. `` passes it's `handleSubmit` to `reduxForm()` as an `onSubmit` prop + 1. `reduxForm()` passes it's own `handleSubmit` to `` + 1. `` sets `` + 1. `` calls `reduxForm()` own `handleSubmit()`, which does normalisation and validation + 1. `reduxForm()` calls its `onSubmit` prop, which is set to `` `handleSubmit()` + 1. `` either submits the form, or calls it's own overloaded `handleSubmit()` prop + +See [handleSubmit](http://redux-form.com/6.0.5/docs/api/Props.md#-handlesubmit-eventorsubmit-function-) +in the redux-form docs for more details. diff --git a/admin/client/src/components/FormBuilder/tests/FormBuilder-test.js b/admin/client/src/components/FormBuilder/tests/FormBuilder-test.js index 10177fd93..1407c047b 100644 --- a/admin/client/src/components/FormBuilder/tests/FormBuilder-test.js +++ b/admin/client/src/components/FormBuilder/tests/FormBuilder-test.js @@ -3,23 +3,39 @@ jest.unmock('merge'); jest.unmock('lib/SilverStripeComponent'); jest.unmock('../FormBuilder'); +jest.unmock('redux-form'); -import { FormBuilderComponent } from '../FormBuilder'; +const React = require('react'); +import ReactTestUtils from 'react-addons-test-utils'; +import FormBuilder from '../FormBuilder'; + +describe('FormBuilder', () => { + const baseProps = { + form: 'MyForm', + baseFormComponent: () => , + baseFieldComponent: (props) => { + // eslint-disable-next-line react/prop-types + const Component = props.component; + return ; + }, + schema: { + id: 'MyForm', + schema: { + attributes: {}, + fields: [], + actions: [], + }, + state: { + fields: [], + }, + }, + }; -describe('FormBuilderComponent', () => { describe('mergeFieldData()', () => { let formBuilder = null; beforeEach(() => { - const props = { - form: {}, - formActions: {}, - schemas: {}, - schemaActions: {}, - schemaUrl: 'admin/assets/schema/1', - }; - - formBuilder = new FormBuilderComponent(props); + formBuilder = new FormBuilder(baseProps); }); it('should deep merge properties on the originalobject', () => { @@ -57,40 +73,22 @@ describe('FormBuilderComponent', () => { describe('getFieldValues()', () => { let formBuilder = null; let fieldValues = null; - let props = null; + const props = Object.assign({}, baseProps); it('should retrieve field values based on schema', () => { - props = { - form: { - MyForm: { - submitAction: 'action_save', - fields: [ - { id: 'fieldOne', value: 'valOne' }, - { id: 'fieldTwo', value: null }, - { id: 'notInSchema', value: 'invalid' }, - ], - }, - }, - formActions: {}, - schemas: { - 'admin/assets/schema/1': { - id: 'MyForm', - schema: { - fields: [ - { id: 'fieldOne', name: 'fieldOne' }, - { id: 'fieldTwo', name: 'fieldTwo' }, - ], - }, - }, - }, - schemaActions: {}, - schemaUrl: 'admin/assets/schema/1', - }; - formBuilder = new FormBuilderComponent(props); + props.schema.schema.fields = [ + { id: 'fieldOne', name: 'fieldOne' }, + { id: 'fieldTwo', name: 'fieldTwo' }, + ]; + props.schema.state.fields = [ + { id: 'fieldOne', value: 'valOne' }, + { id: 'fieldTwo', value: null }, + { id: 'notInSchema', value: 'invalid' }, + ]; + formBuilder = new FormBuilder(baseProps); fieldValues = formBuilder.getFieldValues(); expect(fieldValues).toEqual({ - action_save: 1, fieldOne: 'valOne', fieldTwo: null, }); @@ -100,23 +98,9 @@ describe('FormBuilderComponent', () => { describe('findField()', () => { let formBuilder = null; let fields = null; - const props = { - form: { - myForm: {}, - formActions: {}, - schemas: { - 'admin/assets/schema/1': { - id: 'myForm', - schema: {}, - }, - }, - schemaActions: {}, - schemaUrl: 'admin/assets/schema/1', - }, - }; beforeEach(() => { - formBuilder = new FormBuilderComponent(props); + formBuilder = new FormBuilder(baseProps); }); it('should retrieve the field in the shallow fields list', () => { @@ -152,4 +136,61 @@ describe('FormBuilderComponent', () => { expect(field.id).toBe('fieldTwoThree'); }); }); + + describe('handleSubmit', () => { + let formBuilder = null; + const props = baseProps; + + beforeEach(() => { + formBuilder = ReactTestUtils.renderIntoDocument(); + + props.schema.schema.fields = [ + { id: 'fieldOne', name: 'fieldOne' }, + { id: 'fieldTwo', name: 'fieldTwo' }, + ]; + props.schema.schema.actions = [ + { id: 'actionOne', name: 'actionOne' }, + { id: 'actionTwo', name: 'actionTwo' }, + ]; + props.schema.state.fields = [ + { id: 'fieldOne', value: 'valOne' }, + { id: 'fieldTwo', value: null }, + { id: 'notInSchema', value: 'invalid' }, + ]; + }); + + it('should include submitted action from schema', () => { + formBuilder.setState({ submittingAction: 'actionTwo' }); + + const submitApiMock = jest.genMockFunction(); + submitApiMock.mockImplementation(() => Promise.resolve({})); + formBuilder.submitApi = submitApiMock; + + formBuilder.handleSubmit(formBuilder.getFieldValues()); + + expect(formBuilder.submitApi.mock.calls[0][0]).toEqual( + { + fieldOne: 'valOne', + fieldTwo: null, + actionTwo: 1, + } + ); + }); + + it('should default to first button when none is specified', () => { + const submitApiMock = jest.genMockFunction(); + submitApiMock.mockImplementation(() => Promise.resolve({})); + formBuilder.submitApi = submitApiMock; + + formBuilder.handleSubmit(formBuilder.getFieldValues()); + + expect(formBuilder.submitApi.mock.calls[0][0]).toEqual( + { + fieldOne: 'valOne', + fieldTwo: null, + actionOne: 1, + } + ); + }); + }); }); diff --git a/admin/client/src/components/FormBuilderModal/FormBuilderModal.js b/admin/client/src/components/FormBuilderModal/FormBuilderModal.js index 7c7f16359..4a7d4427b 100644 --- a/admin/client/src/components/FormBuilderModal/FormBuilderModal.js +++ b/admin/client/src/components/FormBuilderModal/FormBuilderModal.js @@ -1,7 +1,7 @@ import React from 'react'; import { Modal } from 'react-bootstrap-ss'; import SilverStripeComponent from 'lib/SilverStripeComponent'; -import FormBuilder from 'components/FormBuilder/FormBuilder'; +import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader'; class FormBuilderModal extends SilverStripeComponent { constructor(props) { @@ -19,7 +19,7 @@ class FormBuilderModal extends SilverStripeComponent { */ getForm() { return ( - this.getItemKey(item, index) === field.id); - this.props.onChange(event, { id: this.props.id, value: `${sourceItem.value}` }); + this.props.onChange(sourceItem.value); } } } diff --git a/admin/client/src/components/OptionsetField/tests/OptionsetField-test.js b/admin/client/src/components/OptionsetField/tests/OptionsetField-test.js index aaef665f3..26b997772 100644 --- a/admin/client/src/components/OptionsetField/tests/OptionsetField-test.js +++ b/admin/client/src/components/OptionsetField/tests/OptionsetField-test.js @@ -47,8 +47,7 @@ describe('OptionsetField', () => { setField.handleChange(event, { id: 'set-one', value: 1 }); expect(setField.props.onChange).toBeCalledWith( - event, - { id: 'set', value: 'one' } + 'one' ); }); }); diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js index 1a1294daf..6ddc7aa38 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js @@ -9,7 +9,7 @@ import SilverStripeComponent from 'lib/SilverStripeComponent'; import FormAction from 'components/FormAction/FormAction'; import i18n from 'i18n'; import Toolbar from 'components/Toolbar/Toolbar'; -import FormBuilder from 'components/FormBuilder/FormBuilder'; +import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader'; import CampaignAdminList from './CampaignAdminList'; class CampaignAdmin extends SilverStripeComponent { @@ -56,7 +56,7 @@ class CampaignAdmin extends SilverStripeComponent { // NOOP - Lazy loaded in CampaignAdminList.js break; case 'edit': - // @todo - Lazy load in FormBuilder / GridField + // @todo - Lazy load in FormBuilderLoader / GridField breadcrumbs.push({ text: i18n._t('Campaigns.EDIT_CAMPAIGN', 'Editing Campaign'), href: this.getActionRoute(id, view), @@ -137,7 +137,7 @@ class CampaignAdmin extends SilverStripeComponent {
- +
@@ -184,7 +184,7 @@ class CampaignAdmin extends SilverStripeComponent {
- +
); @@ -210,7 +210,7 @@ class CampaignAdmin extends SilverStripeComponent {
- +
); @@ -218,10 +218,10 @@ class CampaignAdmin extends SilverStripeComponent { /** * Hook to allow customisation of components being constructed - * by the Campaign DetailEdit FormBuilder. + * by the Campaign DetailEdit FormBuilderLoader. * * @param {Object} Component - Component constructor. - * @param {Object} props - Props passed from FormBuilder. + * @param {Object} props - Props passed from FormBuilderLoader. * * @return {Object} - Instanciated React component */ @@ -245,10 +245,10 @@ class CampaignAdmin extends SilverStripeComponent { /** * Hook to allow customisation of components being constructed - * by the Campaign creation FormBuilder. + * by the Campaign creation FormBuilderLoader. * * @param {Object} Component - Component constructor. - * @param {Object} props - Props passed from FormBuilder. + * @param {Object} props - Props passed from FormBuilderLoader. * * @return {Object} - Instanciated React component */ @@ -272,10 +272,10 @@ class CampaignAdmin extends SilverStripeComponent { /** * Hook to allow customisation of components being constructed - * by the Campaign list FormBuilder. + * by the Campaign list FormBuilderLoader. * * @param object Component - Component constructor. - * @param object props - Props passed from FormBuilder. + * @param object props - Props passed from FormBuilderLoader. * * @return object - Instanciated React component */ @@ -283,7 +283,7 @@ class CampaignAdmin extends SilverStripeComponent { const sectionUrl = this.props.sectionConfig.url; const typeUrlParam = 'set'; - if (props.component === 'GridField') { + if (props.schemaComponent === 'GridField') { const extendedProps = Object.assign({}, props, { data: Object.assign({}, props.data, { handleDrillDown: (event, record) => { diff --git a/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js b/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js new file mode 100644 index 000000000..a3ba92825 --- /dev/null +++ b/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js @@ -0,0 +1,106 @@ +import React, { PropTypes, Component } from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; +import fetch from 'isomorphic-fetch'; +import { Field as ReduxFormField, reduxForm } from 'redux-form'; +import * as schemaActions from 'state/schema/SchemaActions'; +import Form from 'components/Form/Form'; +import FormBuilder, { basePropTypes, schemaPropType } from 'components/FormBuilder/FormBuilder'; + +import es6promise from 'es6-promise'; +es6promise.polyfill(); + +class FormBuilderLoader extends Component { + + constructor(props) { + super(props); + + this.handleSubmitSuccess = this.handleSubmitSuccess.bind(this); + } + + componentDidMount() { + this.fetch(); + } + + componentDidUpdate(prevProps) { + if (this.props.schemaUrl !== prevProps.schemaUrl) { + this.fetch(); + } + } + + handleSubmitSuccess(result) { + this.props.schemaActions.setSchema(result); + + if (this.props.onSubmitSuccess) { + this.props.onSubmitSuccess(result); + } + } + + /** + * Fetches data used to generate a form. This can be form schema and or form state data. + * When the response comes back the data is saved to state. + * + * @param {Boolean} schema If form schema data should be returned in the response. + * @param {Boolean} state If form state data should be returned in the response. + * @return {Object} Promise from the AJAX request. + */ + fetch(schema = true, state = true) { + const headerValues = []; + + if (schema === true) { + headerValues.push('schema'); + } + + if (state === true) { + headerValues.push('state'); + } + + return fetch(this.props.schemaUrl, { + headers: { 'X-FormSchema-Request': headerValues.join() }, + credentials: 'same-origin', + }) + .then(response => response.json()) + .then(formSchema => { + if (typeof formSchema.id !== 'undefined') { + this.props.schemaActions.setSchema(formSchema); + } + }); + } + + render() { + // If the response from fetching the initial data + // hasn't come back yet, don't render anything. + if (!this.props.schema) { + return null; + } + + const props = Object.assign({}, this.props, { + onSubmitSuccess: this.handleSubmitSuccess, + }); + return ; + } +} + +FormBuilderLoader.propTypes = Object.assign({}, basePropTypes, { + schemaActions: PropTypes.object.isRequired, + schemaUrl: PropTypes.string.isRequired, + schema: schemaPropType, + form: PropTypes.string, +}); +FormBuilderLoader.defaultProps = { + // Perform this *outside* of render() to avoid re-rendering of the whole DOM structure + // every time render() is triggered. + baseFormComponent: reduxForm()(Form), + baseFieldComponent: ReduxFormField, +}; + +export default connect( + (state, ownProps) => { + const schema = state.schemas[ownProps.schemaUrl]; + const form = schema ? schema.id : null; + return { schema, form }; + }, + (dispatch) => ({ + schemaActions: bindActionCreators(schemaActions, dispatch), + }) +)(FormBuilderLoader); diff --git a/admin/client/src/containers/FormBuilderLoader/README.md b/admin/client/src/containers/FormBuilderLoader/README.md new file mode 100644 index 000000000..4af90beb9 --- /dev/null +++ b/admin/client/src/containers/FormBuilderLoader/README.md @@ -0,0 +1,12 @@ +# FormBuilderLoader Component + +Used to retrieve a schema for FormBuilder to generate forms made up of field components and actions. +Wraps a [FormBuilder](../../components/FormBuilder/README.md] component with async loading logic, +and stores the loaded schemas in a Redux store. + +## Properties + + * `schemaUrl` (string): The schema URL where the form will be scaffolded from e.g. '/admin/pages/schema/1'. + * `schemaActions` (object): A `setSchema()` function to interact with the redux store. + +See [FormBuilder](../../components/FormBuilder/README.md] for more properties. diff --git a/admin/client/src/containers/ReduxForm/ReduxForm.js b/admin/client/src/containers/ReduxForm/ReduxForm.js deleted file mode 100644 index e9dbd478a..000000000 --- a/admin/client/src/containers/ReduxForm/ReduxForm.js +++ /dev/null @@ -1,6 +0,0 @@ -import { reduxForm } from 'redux-form'; -import Form from 'components/Form/Form'; - -export default reduxForm({ - // configured at runtime -})(Form); diff --git a/admin/client/src/state/form/FormActionTypes.js b/admin/client/src/state/form/FormActionTypes.js deleted file mode 100644 index ea8ea710a..000000000 --- a/admin/client/src/state/form/FormActionTypes.js +++ /dev/null @@ -1,9 +0,0 @@ -export const ACTION_TYPES = { - ADD_FORM: 'ADD_FORM', - REMOVE_FORM: 'REMOVE_FORM', - SUBMIT_FORM_FAILURE: 'SUBMIT_FORM_FAILURE', - SUBMIT_FORM_REQUEST: 'SUBMIT_FORM_REQUEST', - SUBMIT_FORM_SUCCESS: 'SUBMIT_FORM_SUCCESS', - UPDATE_FIELD: 'UPDATE_FIELD', - SET_SUBMIT_ACTION: 'SET_SUBMIT_ACTION', -}; diff --git a/admin/client/src/state/form/FormActions.js b/admin/client/src/state/form/FormActions.js deleted file mode 100644 index f903963be..000000000 --- a/admin/client/src/state/form/FormActions.js +++ /dev/null @@ -1,96 +0,0 @@ -import { ACTION_TYPES } from './FormActionTypes'; - -/** - * Removes a form from state. - * This action should be called when a Redux managed Form component unmounts. - * - * @param {string} formId - ID of the form you want to remove. - * @return {function} - */ -export function removeForm(formId) { - return (dispatch) => { - dispatch({ - type: ACTION_TYPES.REMOVE_FORM, - payload: { formId }, - }); - }; -} - -/** - * Sets one or more values on an existing form field. - * - * @param {string} formId - Id of the form where the field lives. - * @param {object} updates - The values to update on the field. - * @param {string} updates.id - Field ID. - * @return {function} - */ -export function updateField(formId, updates) { - return (dispatch) => { - dispatch({ - type: ACTION_TYPES.UPDATE_FIELD, - payload: { formId, updates }, - }); - }; -} - -/** - * Adds a form to the store. - * - * @param {object} formState - * @param {string} formState.id - The ID the form will be keyed as in state. - * @return {function} - */ -export function addForm(formState) { - return (dispatch) => { - dispatch({ - type: ACTION_TYPES.ADD_FORM, - payload: { formState }, - }); - }; -} - -/** - * Submits a form and handles the response. - * - * @param {Function} submitApi - * @param {String} formId - */ -export function submitForm(submitApi, formId, fieldValues) { - return (dispatch) => { - const headers = { - 'X-Formschema-Request': 'schema,state', - 'X-Requested-With': 'XMLHttpRequest', - }; - dispatch({ - type: ACTION_TYPES.SUBMIT_FORM_REQUEST, - payload: { formId }, - }); - - return submitApi(Object.assign({ ID: formId }, fieldValues), headers) - .then((response) => { - dispatch({ - type: ACTION_TYPES.SUBMIT_FORM_SUCCESS, - payload: { response }, - }); - return response; - }) - .catch((error) => { - throw error.response.text().then((errorText) => { - dispatch({ - type: ACTION_TYPES.SUBMIT_FORM_FAILURE, - payload: { formId, error: errorText }, - }); - return errorText; - }); - }); - }; -} - -export function setSubmitAction(formId, submitAction) { - return (dispatch) => { - dispatch({ - type: ACTION_TYPES.SET_SUBMIT_ACTION, - payload: { formId, submitAction }, - }); - }; -} diff --git a/admin/client/src/state/form/FormReducer.js b/admin/client/src/state/form/FormReducer.js deleted file mode 100644 index bc74bea0c..000000000 --- a/admin/client/src/state/form/FormReducer.js +++ /dev/null @@ -1,78 +0,0 @@ -import deepFreeze from 'deep-freeze-strict'; -import { ACTION_TYPES } from './FormActionTypes'; - -const initialState = deepFreeze({}); - -function formReducer(state = initialState, action) { - const updateForm = (formId, data) => Object.assign({}, - state, { - [formId]: Object.assign({}, - state[formId], - data - ), - }); - - switch (action.type) { - - case ACTION_TYPES.SUBMIT_FORM_REQUEST: - return deepFreeze(updateForm(action.payload.formId, { - error: false, - submitting: true, - })); - - case ACTION_TYPES.REMOVE_FORM: - return deepFreeze(Object.keys(state).reduce((previous, current) => { - if (current === action.payload.formId) { - return previous; - } - return Object.assign({}, previous, { - [current]: state[current], - }); - }, {})); - - case ACTION_TYPES.ADD_FORM: - return deepFreeze(Object.assign({}, state, { - [action.payload.formState.id]: { - fields: action.payload.formState.fields, - error: false, - submitting: false, - }, - })); - - case ACTION_TYPES.UPDATE_FIELD: - return deepFreeze(updateForm(action.payload.formId, { - fields: state[action.payload.formId].fields.map((field) => { - if (field.id === action.payload.updates.id) { - return Object.assign({}, field, action.payload.updates); - } - return field; - }), - })); - - case ACTION_TYPES.SUBMIT_FORM_SUCCESS: - return deepFreeze(updateForm(action.payload.response.id, { - fields: action.payload.response.state.fields, - error: false, - messages: action.payload.response.state.messages, - submitting: false, - })); - - case ACTION_TYPES.SUBMIT_FORM_FAILURE: - return deepFreeze(updateForm(action.payload.formId, { - error: true, - messages: action.payload.error, - submitting: false, - })); - - case ACTION_TYPES.SET_SUBMIT_ACTION: - return deepFreeze(updateForm(action.payload.formId, { - submitAction: action.payload.submitAction, - })); - - default: - return state; - - } -} - -export default formReducer; diff --git a/admin/client/src/state/form/README.md b/admin/client/src/state/form/README.md deleted file mode 100644 index 03448d5d8..000000000 --- a/admin/client/src/state/form/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# form - -This state key holds form and form field data. Forms built using the `FormBuilder` component -have their state stored in child keys of `form` (keyed by form ID) automatically. - -```js -{ - form: { - DetailEditForm: { - fields: [ - { - data: [], - id: "Form_DetailEditForm_Name", - messages: [], - valid: true, - value: "My Campaign" - } - ] - } - } -} -``` - -Forms built using `FormBuilder` will tidy up their state when unmounted. diff --git a/admin/client/src/state/form/tests/FormsReducer-test.js b/admin/client/src/state/form/tests/FormsReducer-test.js deleted file mode 100644 index 1d2f8f7a6..000000000 --- a/admin/client/src/state/form/tests/FormsReducer-test.js +++ /dev/null @@ -1,233 +0,0 @@ -/* global jest, describe, expect, it, beforeEach */ - -jest.unmock('deep-freeze-strict'); -jest.unmock('../FormReducer'); -jest.unmock('../FormActionTypes'); - -import deepFreeze from 'deep-freeze-strict'; -import { ACTION_TYPES } from '../FormActionTypes'; -import formReducer from '../FormReducer'; - -describe('formReducer', () => { - describe('ADD_FORM', () => { - const initialState = deepFreeze({ - DetailEditForm: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - submitting: false, - }, - }); - - it('should add a form', () => { - const payload = { - formState: { - fields: [ - { - data: [], - id: 'Form_EditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - id: 'EditForm', - messages: [], - }, - }; - - const nextState = formReducer(initialState, { - type: ACTION_TYPES.ADD_FORM, - payload, - }); - - expect(nextState.DetailEditForm).toBeDefined(); - expect(nextState.EditForm).toBeDefined(); - expect(nextState.EditForm.fields).toBeDefined(); - expect(nextState.EditForm.fields[0].data).toBeDefined(); - expect(nextState.EditForm.fields[0].id).toBe('Form_EditForm_Name'); - expect(nextState.EditForm.fields[0].messages).toBeDefined(); - expect(nextState.EditForm.fields[0].valid).toBe(true); - expect(nextState.EditForm.fields[0].value).toBe('Test'); - expect(nextState.EditForm.submitting).toBe(false); - }); - }); - - describe('REMOVE_FORM', () => { - const initialState = deepFreeze({ - DetailEditForm: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - }, - EditForm: { - fields: [ - { - data: [], - id: 'Form_EditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - }, - }); - - it('should remove the form', () => { - const nextState = formReducer(initialState, { - type: ACTION_TYPES.REMOVE_FORM, - payload: { formId: 'DetailEditForm' }, - }); - - expect(nextState.DetailEditForm).toBeUndefined(); - expect(nextState.EditForm).toBeDefined(); - }); - }); - - describe('UPDATE_FIELD', () => { - const initialState = deepFreeze({ - DetailEditForm: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - }, - }); - - it('should update properties of a form field', () => { - const nextState = formReducer(initialState, { - type: ACTION_TYPES.UPDATE_FIELD, - payload: { - formId: 'DetailEditForm', - updates: { - id: 'Form_DetailEditForm_Name', - value: 'Updated', - }, - }, - }); - - expect(nextState.DetailEditForm.fields[0].value).toBe('Updated'); - }); - }); - - describe('SUBMIT_FORM_SUCCESS', () => { - const initialState = deepFreeze({ - DetailEditForm: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - submitting: true, - }, - }); - - it('should add top level form messages', () => { - const nextState = formReducer(initialState, { - type: ACTION_TYPES.SUBMIT_FORM_SUCCESS, - payload: { - id: 'DetailEditForm', - response: { - id: 'DetailEditForm', - state: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - messages: [ - { - type: 'good', - value: 'Saved.', - }, - ], - }, - }, - }, - }); - - expect(nextState.DetailEditForm.messages).toBeDefined(); - expect(nextState.DetailEditForm.messages.length).toBe(1); - expect(nextState.DetailEditForm.messages[0].type).toBe('good'); - expect(nextState.DetailEditForm.messages[0].value).toBe('Saved.'); - expect(nextState.DetailEditForm.submitting).toBe(false); - }); - }); - - describe('SUBMIT_FORM_REQUEST', () => { - it('should set submitting to true', () => { - const initialState = deepFreeze({ - DetailEditForm: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - submitting: false, - }, - }); - - const nextState = formReducer(initialState, { - type: ACTION_TYPES.SUBMIT_FORM_REQUEST, - payload: { formId: 'DetailEditForm' }, - }); - - expect(nextState.DetailEditForm.submitting).toBe(true); - }); - }); - - describe('SUBMIT_FORM_FAILURE', () => { - it('should set submitting to false', () => { - const initialState = deepFreeze({ - DetailEditForm: { - fields: [ - { - data: [], - id: 'Form_DetailEditForm_Name', - messages: [], - valid: true, - value: 'Test', - }, - ], - submitting: true, - }, - }); - - const nextState = formReducer(initialState, { - type: ACTION_TYPES.SUBMIT_FORM_FAILURE, - payload: { formId: 'DetailEditForm' }, - }); - - expect(nextState.DetailEditForm.submitting).toBe(false); - }); - }); -}); diff --git a/admin/client/src/state/schema/SchemaActions.js b/admin/client/src/state/schema/SchemaActions.js index c07541ddf..4d5b8a42a 100644 --- a/admin/client/src/state/schema/SchemaActions.js +++ b/admin/client/src/state/schema/SchemaActions.js @@ -2,6 +2,8 @@ import ACTION_TYPES from './SchemaActionTypes'; /** * Sets the schema being used to generate the current form layout. + * Note that the `state` key just determines the initial form field values, + * and is overruled by redux-form behaviour (stored in separate reducer key) * * @param string schema - JSON schema for the layout. */ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 74fe38d4c..8f573fbaf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -8388,6 +8388,76 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/redux/-/redux-3.0.5.tgz" }, + "redux-form": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/redux-form/-/redux-form-6.0.5.tgz", + "dependencies": { + "array-findindex-polyfill": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/array-findindex-polyfill/-/array-findindex-polyfill-0.1.0.tgz" + }, + "es6-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-3.1.0.tgz" + }, + "hoist-non-react-statics": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz" + }, + "invariant": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz", + "dependencies": { + "loose-envify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.2.0.tgz", + "dependencies": { + "js-tokens": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" + } + } + } + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz" + }, + "lodash": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.0.tgz" + }, + "lodash-es": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.16.0.tgz" + }, + "shallowequal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-0.2.2.tgz", + "dependencies": { + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "dependencies": { + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz" + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz" + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" + } + } + } + } + } + } + }, "redux-logger": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/redux-logger/-/redux-logger-2.6.1.tgz" diff --git a/package.json b/package.json index 439bc6d7b..d15a12ef2 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "react-router": "^2.4.1", "react-router-redux": "^4.0.5", "redux": "https://registry.npmjs.org/redux/-/redux-3.0.5.tgz", + "redux-form": "^6.0.2", "redux-thunk": "^2.1.0", "tether": "^1.3.2", "url": "^0.11.0" @@ -104,7 +105,8 @@ "mocksPattern": "mocks", "unmockedModulePathPatterns": [ "/node_modules/react", - "/node_modules/qs" + "/node_modules/qs", + "/node_modules/redux-form" ], "bail": true, "testRunner": "/node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js" diff --git a/webpack.config.js b/webpack.config.js index b45ec6c19..36e50d68b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -68,6 +68,7 @@ const config = [ 'components/FormBuilderModal/FormBuilderModal': 'FormBuilderModal', 'components/GridField/GridField': 'GridField', 'components/Toolbar/Toolbar': 'Toolbar', + 'containers/FormBuilderLoader/FormBuilderLoader': 'FormBuilderLoader', 'deep-freeze-strict': 'DeepFreezeStrict', i18n: 'i18n', jQuery: 'jQuery', @@ -85,6 +86,7 @@ const config = [ 'react-router': 'ReactRouter', 'react-addons-css-transition-group': 'ReactAddonsCssTransitionGroup', react: 'React', + 'redux-form': 'ReduxForm', 'redux-thunk': 'ReduxThunk', redux: 'Redux', config: 'Config', From 84c0df3db0578ea726314733c3b91ae0080f98d8 Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Mon, 17 Oct 2016 13:00:25 +1300 Subject: [PATCH 4/8] Fix double forward slash link in campaign admin --- .../client/src/containers/CampaignAdmin/CampaignAdminList.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js b/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js index 1f5909c7b..919e0de00 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js @@ -133,9 +133,10 @@ class CampaignAdminList extends SilverStripeComponent { // Set body const pagesLink = [ - this.props.config.baseUrl, + this.props.config.absoluteBaseUrl, this.props.config.sections['SilverStripe\\CMS\\Controllers\\CMSPagesController'].url, - ].join('/'); + ].join(''); + const body = accordionBlocks.length ? ({accordionBlocks}) : ( From 54a4cef863beac064484f9bcbec516924e6acfc2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 20 Oct 2016 21:04:41 +1300 Subject: [PATCH 5/8] Consistently use 'value' for FormField schemas LiteralField (data.content) was inconsistent with HTMLReadonlyField (value), which made the frontend components harder to handle. See https://github.com/silverstripe/silverstripe-framework/pull/6172#discussion_r83561757 for contex --- Forms/LiteralField.php | 3 +-- Forms/ReadonlyField.php | 8 ++++---- admin/client/src/components/LiteralField/LiteralField.js | 9 ++------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Forms/LiteralField.php b/Forms/LiteralField.php index b53763691..64d618922 100644 --- a/Forms/LiteralField.php +++ b/Forms/LiteralField.php @@ -122,8 +122,7 @@ class LiteralField extends DatalessField { */ public function getSchemaStateDefaults() { $state = parent::getSchemaStateDefaults(); - - $state['data']['content'] = $this->FieldHolder(); + $state['value'] = $this->FieldHolder(); return $state; } diff --git a/Forms/ReadonlyField.php b/Forms/ReadonlyField.php index bbf5a9d7e..f9b3b5ffa 100644 --- a/Forms/ReadonlyField.php +++ b/Forms/ReadonlyField.php @@ -62,10 +62,10 @@ class ReadonlyField extends FormField { } public function getSchemaStateDefaults() { - $values = parent::getSchemaStateDefaults(); - // Suppress `('none')` from appearing in react as a literal - $values['value'] = $this->dataValue(); - return $values; + $state = parent::getSchemaStateDefaults(); + $state['value'] = $this->dataValue(); + + return $state; } diff --git a/admin/client/src/components/LiteralField/LiteralField.js b/admin/client/src/components/LiteralField/LiteralField.js index 464b86231..4cf615ded 100644 --- a/admin/client/src/components/LiteralField/LiteralField.js +++ b/admin/client/src/components/LiteralField/LiteralField.js @@ -8,7 +8,7 @@ class LiteralField extends SilverStripeComponent { * @returns {object} innerHtml */ getContent() { - return { __html: this.props.data.content }; + return { __html: this.props.value }; } /** @@ -41,12 +41,7 @@ LiteralField.propTypes = { id: React.PropTypes.string, name: React.PropTypes.string.isRequired, extraClass: React.PropTypes.string, - data: React.PropTypes.oneOfType([ - React.PropTypes.array, - React.PropTypes.shape({ - content: React.PropTypes.string.isRequired, - }), - ]).isRequired, + value: React.PropTypes.string, }; LiteralField.defaultProps = { From 3a690d8084ef687bffcb7912752c4d55a79bb977 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 20 Oct 2016 21:30:12 +1300 Subject: [PATCH 6/8] Moved promise polyfill into boot logic It's not specific to one single component --- admin/client/src/boot/index.js | 3 +++ .../src/containers/FormBuilderLoader/FormBuilderLoader.js | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/client/src/boot/index.js b/admin/client/src/boot/index.js index 50f54f143..9e3c9f630 100644 --- a/admin/client/src/boot/index.js +++ b/admin/client/src/boot/index.js @@ -17,6 +17,9 @@ import bootInjector from 'boot/BootInjector'; // eslint-disable-next-line no-unused-vars import CampaignAdmin from 'containers/CampaignAdmin/controller'; +import es6promise from 'es6-promise'; +es6promise.polyfill(); + function appBoot() { reducerRegister.add('config', ConfigReducer); reducerRegister.add('form', ReduxFormReducer); diff --git a/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js b/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js index a3ba92825..043781d42 100644 --- a/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js +++ b/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js @@ -7,9 +7,6 @@ import * as schemaActions from 'state/schema/SchemaActions'; import Form from 'components/Form/Form'; import FormBuilder, { basePropTypes, schemaPropType } from 'components/FormBuilder/FormBuilder'; -import es6promise from 'es6-promise'; -es6promise.polyfill(); - class FormBuilderLoader extends Component { constructor(props) { From aa47845a6cd346321d2498be7232e025f05a8938 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 20 Oct 2016 21:44:11 +1300 Subject: [PATCH 7/8] Updated dist files --- admin/client/dist/js/bundle.js | 1055 ++- admin/client/dist/js/vendor.js | 11269 +++++++++++++++++-------------- 2 files changed, 6606 insertions(+), 5718 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index c990dbc13..660c20823 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -1,6 +1,6 @@ webpackJsonp([5],[function(e,t,n){"use strict" -n(2),n(5),n(18),n(21),n(23),n(25),n(35),n(39),n(49),n(50),n(51),n(52),n(53),n(54),n(56),n(60),n(62),n(65),n(68),n(70),n(72),n(74),n(75),n(84),n(85),n(86),n(88),n(89),n(90),n(91),n(92),n(93),n(95),n(96), -n(97),n(98),n(99),n(100),n(101),n(104),n(106),n(107),n(108),n(109),n(113),n(114),n(115),n(116),n(117),n(114),n(109),n(120),n(121),n(123),n(124)},,function(e,t,n){(function(t){e.exports=t.SilverStripeComponent=n(3) +n(2),n(5),n(18),n(21),n(23),n(25),n(29),n(37),n(41),n(51),n(52),n(53),n(54),n(55),n(56),n(58),n(62),n(64),n(67),n(70),n(72),n(74),n(76),n(77),n(86),n(87),n(88),n(90),n(91),n(92),n(93),n(94),n(95),n(97), +n(98),n(99),n(100),n(101),n(102),n(103),n(106),n(108),n(109),n(110),n(111),n(115),n(116),n(117),n(118),n(119),n(116),n(111),n(122),n(123),n(125),n(126)},,function(e,t,n){(function(t){e.exports=t.SilverStripeComponent=n(3) }).call(t,function(){return this}())},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") @@ -10,11 +10,11 @@ return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("funct e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{ value:!0}) var s=function(){function e(e,t){for(var n=0;n-1?t:e}function c(e,t){t=t||{} +return g.indexOf(t)>-1?t:e}function d(e,t){t=t||{} var n=t.body -if(c.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read") +if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read") this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e -if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=d(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null, +if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=c(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null, ("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests") this._initBody(n)}function f(e){var t=new FormData return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ") @@ -107,24 +107,24 @@ return this.forEach(function(t,n){e.push(n)}),i(e)},r.prototype.values=function( return this.forEach(function(t){e.push(t)}),i(e)},r.prototype.entries=function(){var e=[] return this.forEach(function(t,n){e.push([n,t])}),i(e)},m.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries) var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"] -c.prototype.clone=function(){return new c(this)},u.call(c.prototype),u.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers), +d.prototype.clone=function(){return new d(this)},u.call(d.prototype),u.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers), url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""}) return e.type="error",e} var v=[301,302,303,307,308] h.redirect=function(e,t){if(v.indexOf(t)===-1)throw new RangeError("Invalid status code") -return new h(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=c,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0 +return new h(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=d,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0 }var o -o=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t) +o=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t) var a=new XMLHttpRequest a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:p(a),url:r()},t="response"in a?a.response:a.responseText n(new h(t,e))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0), "responseType"in a&&m.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this) },function(e,t,n){var i;(function(t,r){!function(t,n){e.exports=n()}(this,function(){"use strict" -function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function o(e){return"function"==typeof e}function a(e){K=e}function s(e){Y=e}function l(){return function(){return t.nextTick(p)}} -function u(){return function(){Q(p)}}function d(){var e=0,t=new ee(p),n=document.createTextNode("") -return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function c(){var e=new MessageChannel +function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function o(e){return"function"==typeof e}function a(e){K=e}function s(e){J=e}function l(){return function(){return t.nextTick(p)}} +function u(){return function(){Q(p)}}function c(){var e=0,t=new ee(p),n=document.createTextNode("") +return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function d(){var e=new MessageChannel return e.port1.onmessage=p,function(){return e.port2.postMessage(0)}}function f(){var e=setTimeout return function(){return e(p,1)}}function p(){for(var e=0;e=0&&n.parseArrays&&a<=n.arrayLimit?(r=[],r[a]=d(e,t,n)):r[o]=d(e,t,n)}return r},l=function c(e,t,n){if(e){var i=n.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,o=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,l=o.exec(i),u=[] +!isNaN(a)&&i!==o&&String(a)===o&&a>=0&&n.parseArrays&&a<=n.arrayLimit?(r=[],r[a]=c(e,t,n)):r[o]=c(e,t,n)}return r},l=function d(e,t,n){if(e){var i=n.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,o=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,l=o.exec(i),u=[] if(l[1]){if(!n.plainObjects&&r.call(Object.prototype,l[1])&&!n.allowPrototypes)return -u.push(l[1])}for(var d=0;null!==(l=a.exec(i))&&d-1})?null:"action_save"===this.props.name||e.find(function(e){return"ss-ui-action-constructive"===e})?"primary":"secondary"}},{key:"getIcon",value:function f(){ -return this.props.icon||this.props.data.icon||null}},{key:"getLoadingIcon",value:function p(){return this.props.loading?d["default"].createElement("div",{className:"btn__loading-icon"},d["default"].createElement("span",{ -className:"btn__circle btn__circle--1"}),d["default"].createElement("span",{className:"btn__circle btn__circle--2"}),d["default"].createElement("span",{className:"btn__circle btn__circle--3"})):null}},{ +return this.props.icon||this.props.data.icon||null}},{key:"getLoadingIcon",value:function p(){return this.props.loading?c["default"].createElement("div",{className:"btn__loading-icon"},c["default"].createElement("span",{ +className:"btn__circle btn__circle--1"}),c["default"].createElement("span",{className:"btn__circle btn__circle--2"}),c["default"].createElement("span",{className:"btn__circle btn__circle--3"})):null}},{ key:"handleClick",value:function h(e){"function"==typeof this.props.handleClick&&this.props.handleClick(e,this.props.name||this.props.id)}}]),t}(f["default"]) -p.propTypes={id:d["default"].PropTypes.string,name:d["default"].PropTypes.string,handleClick:d["default"].PropTypes.func,title:d["default"].PropTypes.string,type:d["default"].PropTypes.string,loading:d["default"].PropTypes.bool, -icon:d["default"].PropTypes.string,disabled:d["default"].PropTypes.bool,data:d["default"].PropTypes.oneOfType([d["default"].PropTypes.array,d["default"].PropTypes.shape({buttonStyle:d["default"].PropTypes.string -})]),extraClass:d["default"].PropTypes.string,attributes:d["default"].PropTypes.object},p.defaultProps={title:"",icon:"",extraClass:"",attributes:{},data:{},disabled:!1},t["default"]=p},function(e,t,n){ +p.propTypes={id:c["default"].PropTypes.string,name:c["default"].PropTypes.string,handleClick:c["default"].PropTypes.func,title:c["default"].PropTypes.string,type:c["default"].PropTypes.string,loading:c["default"].PropTypes.bool, +icon:c["default"].PropTypes.string,disabled:c["default"].PropTypes.bool,data:c["default"].PropTypes.oneOfType([c["default"].PropTypes.array,c["default"].PropTypes.shape({buttonStyle:c["default"].PropTypes.string +})]),extraClass:c["default"].PropTypes.string,attributes:c["default"].PropTypes.object},p.defaultProps={title:"",icon:"",extraClass:"",attributes:{},data:{},disabled:!1},t["default"]=p},function(e,t,n){ (function(t){e.exports=t.FormBuilder=n(26)}).call(t,function(){return this}())},function(e,t,n){"use strict" -function i(e){if(e&&e.__esModule)return e -var t={} -if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]) -return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){ -if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") -return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t) -e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return{config:e.config, -form:e.form,schemas:e.schemas}}function d(e){return{formActions:(0,g.bindActionCreators)(y,e),schemaActions:(0,g.bindActionCreators)(_,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.FormBuilderComponent=void 0 +function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function") - -var c=Object.assign||function(e){for(var t=1;t1}},{key:"handleChange",value:function c(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{ +}):s(e,{componentClass:"input",type:this.props.type})),e}},{key:"isMultiline",value:function u(){return this.props.data&&this.props.data.rows>1}},{key:"handleChange",value:function d(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{ id:this.props.id,value:e.target.value})}}]),t}(f["default"]) -g.propTypes={extraClass:d["default"].PropTypes.string,id:d["default"].PropTypes.string,name:d["default"].PropTypes.string.isRequired,onChange:d["default"].PropTypes.func,value:d["default"].PropTypes.oneOfType([d["default"].PropTypes.string,d["default"].PropTypes.number]), -readOnly:d["default"].PropTypes.bool,disabled:d["default"].PropTypes.bool,placeholder:d["default"].PropTypes.string,type:d["default"].PropTypes.string},g.defaultProps={value:"",extraClass:"",className:"", +g.propTypes={extraClass:c["default"].PropTypes.string,id:c["default"].PropTypes.string,name:c["default"].PropTypes.string.isRequired,onChange:c["default"].PropTypes.func,value:c["default"].PropTypes.oneOfType([c["default"].PropTypes.string,c["default"].PropTypes.number]), +readOnly:c["default"].PropTypes.bool,disabled:c["default"].PropTypes.bool,placeholder:c["default"].PropTypes.string,type:c["default"].PropTypes.string},g.defaultProps={value:"",extraClass:"",className:"", type:"text"},t.TextField=g,t["default"]=(0,h["default"])(g)},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called") @@ -629,16 +626,16 @@ e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,wri function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return a(n,t),l(n,[{key:"getDescription",value:function i(){return null===this.props.description?null:(0, m["default"])("div",this.props.description,{className:"form__field-description"})}},{key:"getLeftTitle",value:function s(){var e=null!==this.props.leftTitle?this.props.leftTitle:this.props.title return!e||this.props.hideLabels?null:(0,m["default"])(p.ControlLabel,e,{className:"form__field-label"})}},{key:"getRightTitle",value:function u(){return!this.props.rightTitle||this.props.hideLabels?null:(0, -m["default"])(p.ControlLabel,this.props.rightTitle,{className:"form__field-label"})}},{key:"getHolderProps",value:function c(){var e=["field",this.props.extraClass] +m["default"])(p.ControlLabel,this.props.rightTitle,{className:"form__field-label"})}},{key:"getHolderProps",value:function d(){var e=["field",this.props.extraClass] return this.props.readOnly&&e.push("readonly"),{bsClass:this.props.bsClass,bsSize:this.props.bsSize,validationState:this.props.validationState,className:e.join(" "),controlId:this.props.id,id:this.props.holderId -}}},{key:"render",value:function f(){return d["default"].createElement(p.FormGroup,this.getHolderProps(),this.getLeftTitle(),d["default"].createElement("div",{className:"form__field-holder"},d["default"].createElement(e,this.props)),this.getRightTitle(),this.getDescription()) +}}},{key:"render",value:function f(){return c["default"].createElement(p.FormGroup,this.getHolderProps(),this.getLeftTitle(),c["default"].createElement("div",{className:"form__field-holder"},c["default"].createElement(e,this.props)),this.getRightTitle(),this.getDescription()) }}]),n}(f["default"]) -return t.propTypes={leftTitle:d["default"].PropTypes.any,rightTitle:d["default"].PropTypes.any,title:d["default"].PropTypes.any,extraClass:d["default"].PropTypes.string,holderId:d["default"].PropTypes.string, -id:d["default"].PropTypes.string,description:d["default"].PropTypes.any,hideLabels:d["default"].PropTypes.bool},t.defaultProps={className:"",extraClass:"",leftTitle:null,rightTitle:null},t.defaultProps={ +return t.propTypes={leftTitle:c["default"].PropTypes.any,rightTitle:c["default"].PropTypes.any,title:c["default"].PropTypes.any,extraClass:c["default"].PropTypes.string,holderId:c["default"].PropTypes.string, +id:c["default"].PropTypes.string,description:c["default"].PropTypes.any,hideLabels:c["default"].PropTypes.bool},t.defaultProps={className:"",extraClass:"",leftTitle:null,rightTitle:null},t.defaultProps={ className:"",extraClass:""},t}Object.defineProperty(t,"__esModule",{value:!0}) var l=function(){function e(e,t){for(var n=0;n=0?n[a]=r:n.unshift(r)}},{key:"findChildRoute",value:function s(e){var t=this.childRoutes return e&&e.forEach(function(e){var n=t.find(function(t){return t.path===e}) if(!n)throw new Error("Parent path "+e+" could not be found.") -t=n.childRoutes}),t}},{key:"getRootRoute",value:function l(){return this.rootRoute}},{key:"getChildRoutes",value:function u(){return this.childRoutes}},{key:"remove",value:function d(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=this.findChildRoute(t),i=n.findIndex(function(t){ +t=n.childRoutes}),t}},{key:"getRootRoute",value:function l(){return this.rootRoute}},{key:"getChildRoutes",value:function u(){return this.childRoutes}},{key:"remove",value:function c(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=this.findChildRoute(t),i=n.findIndex(function(t){ return t.path===e}) return i<0?null:n.splice(i,1)[0]}}]),e}() -window.ss=window.ss||{},window.ss.routeRegister=window.ss.routeRegister||new o,t["default"]=window.ss.routeRegister},function(e,t,n){(function(t){e.exports=t.Injector=n(34)}).call(t,function(){return this +window.ss=window.ss||{},window.ss.routeRegister=window.ss.routeRegister||new o,t["default"]=window.ss.routeRegister},function(e,t,n){(function(t){e.exports=t.Injector=n(28)}).call(t,function(){return this -}())},function(e,t,n){(function(t){e.exports=t.Router=n(76)}).call(t,function(){return this}())},function(e,t,n){"use strict" -function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=d["default"].getAbsoluteBase(),n=f["default"].resolve(t,e) -return 0!==n.indexOf(t)?n:n.substring(t.length-1)}function o(e){return function(t,n,i,r){return e(d["default"].resolveURLToBase(t),n,i,r)}}function a(e){var t=new d["default"].Route(e) -return t.match(d["default"].current,{})}function s(){return d["default"].absoluteBaseURL}function l(e){d["default"].absoluteBaseURL=e +}())},function(e,t,n){(function(t){e.exports=t.Router=n(78)}).call(t,function(){return this}())},function(e,t,n){"use strict" +function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=c["default"].getAbsoluteBase(),n=f["default"].resolve(t,e) +return 0!==n.indexOf(t)?n:n.substring(t.length-1)}function o(e){return function(t,n,i,r){return e(c["default"].resolveURLToBase(t),n,i,r)}}function a(e){var t=new c["default"].Route(e) +return t.match(c["default"].current,{})}function s(){return c["default"].absoluteBaseURL}function l(e){c["default"].absoluteBaseURL=e var t=document.createElement("a") t.href=e var n=t.pathname -n=n.replace(/\/$/,""),n.match(/^[^\/]/)&&(n="/"+n),d["default"].base(n)}Object.defineProperty(t,"__esModule",{value:!0}) -var u=n(77),d=i(u),c=n(78),f=i(c) -d["default"].oldshow||(d["default"].oldshow=d["default"].show),d["default"].setAbsoluteBase=l.bind(d["default"]),d["default"].getAbsoluteBase=s.bind(d["default"]),d["default"].resolveURLToBase=r.bind(d["default"]), -d["default"].show=o(d["default"].oldshow),d["default"].routeAppliesToCurrentLocation=a,window.ss=window.ss||{},window.ss.router=window.ss.router||d["default"],t["default"]=window.ss.router},function(e,t){ +n=n.replace(/\/$/,""),n.match(/^[^\/]/)&&(n="/"+n),c["default"].base(n)}Object.defineProperty(t,"__esModule",{value:!0}) +var u=n(79),c=i(u),d=n(80),f=i(d) +c["default"].oldshow||(c["default"].oldshow=c["default"].show),c["default"].setAbsoluteBase=l.bind(c["default"]),c["default"].getAbsoluteBase=s.bind(c["default"]),c["default"].resolveURLToBase=r.bind(c["default"]), +c["default"].show=o(c["default"].oldshow),c["default"].routeAppliesToCurrentLocation=a,window.ss=window.ss||{},window.ss.router=window.ss.router||c["default"],t["default"]=window.ss.router},function(e,t){ e.exports=Page},function(e,t,n){"use strict" function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null @@ -740,16 +737,16 @@ function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null, var r=new i return r.parse(e,t,n),r}function o(e){return u.isString(e)&&(e=r(e)),e instanceof i?e.format():i.prototype.format.call(e)}function a(e,t){return r(e,!1,!0).resolve(t)}function s(e,t){return e?r(e,!1,!0).resolveObject(t):t -}var l=n(79),u=n(80) +}var l=n(81),u=n(82) t.parse=r,t.resolve=a,t.resolveObject=s,t.format=o,t.Url=i -var d=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],h=["{","}","|","\\","^","`"].concat(p),m=["'"].concat(h),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],y=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={ -javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},T={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=n(81) +var c=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],h=["{","}","|","\\","^","`"].concat(p),m=["'"].concat(h),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],b=255,y=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={ +javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},T={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=n(83) i.prototype.parse=function(e,t,n){if(!u.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e) var i=e.indexOf("?"),r=i!==-1&&i127?"x":A[M] -if(!D.match(b)){var U=I.slice(0,S),L=I.slice(S+1),B=A.match(_) +if(!R)for(var I=this.hostname.split(/\./),S=0,A=I.length;S127?"x":F[M] +if(!D.match(y)){var U=I.slice(0,S),L=I.slice(S+1),B=F.match(w) B&&(U.push(B[1]),L.unshift(B[2])),L.length&&(s="/"+L.join(".")+s),this.hostname=U.join(".") -break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=l.toASCII(this.hostname)) +break}}}this.hostname.length>b?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=l.toASCII(this.hostname)) var H=this.port?":"+this.port:"",$=this.hostname||"" -this.host=$+H,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!w[h])for(var S=0,F=m.length;S0)&&n.host.split("@") P&&(n.auth=P.shift(),n.host=n.hostname=P.shift())}return n.search=e.search,n.query=e.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(), -n}if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n -for(var O=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===O||".."===O)||""===O,k=0,j=w.length;j>=0;j--)O=w[j],"."===O?w.splice(j,1):".."===O?(w.splice(j,1),k++):k&&(w.splice(j,1),k--) -if(!b&&!_)for(;k--;k)w.unshift("..") -!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("") -var x=""===w[0]||w[0]&&"/"===w[0].charAt(0) -if(E){n.hostname=n.host=x?"":w.length?w.shift():"" +n}if(!_.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n +for(var O=_.slice(-1)[0],S=(n.host||e.host||_.length>1)&&("."===O||".."===O)||""===O,k=0,j=_.length;j>=0;j--)O=_[j],"."===O?_.splice(j,1):".."===O?(_.splice(j,1),k++):k&&(_.splice(j,1),k--) +if(!y&&!w)for(;k--;k)_.unshift("..") +!y||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),S&&"/"!==_.join("/").substr(-1)&&_.push("") +var x=""===_[0]||_[0]&&"/"===_[0].charAt(0) +if(E){n.hostname=n.host=x?"":_.length?_.shift():"" var P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@") -P&&(n.auth=P.shift(),n.host=n.hostname=P.shift())}return b=b||n.host&&w.length,b&&!x&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")), -n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=c.exec(e) -t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var i;(function(e,r){!function(o){function a(e){throw RangeError(A[e])}function s(e,t){ +P&&(n.auth=P.shift(),n.host=n.hostname=P.shift())}return y=y||n.host&&_.length,y&&!x&&_.unshift(""),_.length?n.pathname=_.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")), +n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=d.exec(e) +t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var i;(function(e,r){!function(o){function a(e){throw RangeError(F[e])}function s(e,t){ for(var n=e.length,i=[];n--;)i[n]=t(e[n]) return i}function l(e,t){var n=e.split("@"),i="" -n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(F,".") +n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(A,".") var r=e.split("."),o=s(r,t).join(".") return i+o}function u(e){for(var t=[],n=0,i=e.length,r,o;n=55296&&r<=56319&&n65535&&(e-=65536,t+=N(e>>>10&1023|55296),e=56320|1023&e),t+=N(e)}).join("")}function c(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:T}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,n){ +return t}function c(e){return s(e,function(e){var t="" +return e>65535&&(e-=65536,t+=N(e>>>10&1023|55296),e=56320|1023&e),t+=N(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:T}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,n){ var i=0 for(e=n?M(e/S):e>>1,e+=M(e/t);e>D*P>>1;i+=T)e=M(e/D) -return M(i+(D+1)*e/(e+O))}function h(e){var t=[],n=e.length,i,r=0,o=j,s=k,l,u,f,h,m,g,v,y,b +return M(i+(D+1)*e/(e+O))}function h(e){var t=[],n=e.length,i,r=0,o=j,s=k,l,u,f,h,m,g,v,b,y for(l=e.lastIndexOf(x),l<0&&(l=0),u=0;u=128&&a("not-basic"),t.push(e.charCodeAt(u)) -for(f=l>0?l+1:0;f=n&&a("invalid-input"),v=c(e.charCodeAt(f++)),(v>=T||v>M((C-r)/m))&&a("overflow"),r+=v*m,y=g<=s?E:g>=s+P?P:g-s,!(vM(C/b)&&a("overflow"),m*=b -i=t.length+1,s=p(r-h,i,0==h),M(r/i)>C-o&&a("overflow"),o+=M(r/i),r%=i,t.splice(r++,0,o)}return d(t)}function m(e){var t,n,i,r,o,s,l,d,c,h,m,g=[],v,y,b,_ +for(f=l>0?l+1:0;f=n&&a("invalid-input"),v=d(e.charCodeAt(f++)),(v>=T||v>M((C-r)/m))&&a("overflow"),r+=v*m,b=g<=s?E:g>=s+P?P:g-s,!(vM(C/y)&&a("overflow"),m*=y +i=t.length+1,s=p(r-h,i,0==h),M(r/i)>C-o&&a("overflow"),o+=M(r/i),r%=i,t.splice(r++,0,o)}return c(t)}function m(e){var t,n,i,r,o,s,l,c,d,h,m,g=[],v,b,y,w for(e=u(e),v=e.length,t=j,n=0,o=k,s=0;s=t&&mM((C-n)/y)&&a("overflow"),n+=(l-t)*y,t=l,s=0;sC&&a("overflow"),m==t){for(d=n,c=T;h=c<=o?E:c>=o+P?P:c-o,!(dM((C-n)/b)&&a("overflow"),n+=(l-t)*b,t=l,s=0;sC&&a("overflow"),m==t){for(c=n,d=T;h=d<=o?E:d>=o+P?P:d-o,!(c= 0x80 (not a basic code point)", +})}var b="object"==typeof t&&t&&!t.nodeType&&t,y="object"==typeof e&&e&&!e.nodeType&&e,w="object"==typeof r&&r +w.global!==w&&w.window!==w&&w.self!==w||(o=w) +var _,C=2147483647,T=36,E=1,P=26,O=38,S=700,k=72,j=128,x="-",R=/^xn--/,I=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)", "invalid-input":"Invalid input"},D=T-E,M=Math.floor,N=String.fromCharCode,U -w={version:"1.3.2",ucs2:{decode:u,encode:d},decode:h,encode:m,toASCII:v,toUnicode:g},i=function(){return w}.call(t,n,t,e),!(void 0!==i&&(e.exports=i))}(this)}).call(t,n(17)(e),function(){return this}()) +_={version:"1.3.2",ucs2:{decode:u,encode:c},decode:h,encode:m,toASCII:v,toUnicode:g},i=function(){return _}.call(t,n,t,e),!(void 0!==i&&(e.exports=i))}(this)}).call(t,n(17)(e),function(){return this}()) },function(e,t){"use strict" e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){ "use strict" -t.decode=t.parse=n(82),t.encode=t.stringify=n(83)},function(e,t){"use strict" +t.decode=t.parse=n(84),t.encode=t.stringify=n(85)},function(e,t){"use strict" function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,i,r){t=t||"&",i=i||"=" var o={} if("string"!=typeof e||0===e.length)return o @@ -850,8 +847,8 @@ var s=1e3 r&&"number"==typeof r.maxKeys&&(s=r.maxKeys) var l=e.length s>0&&l>s&&(l=s) -for(var u=0;u=0?(f=d.substr(0,c),p=d.substr(c+1)):(f=d,p=""),h=decodeURIComponent(f),m=decodeURIComponent(p),n(o,h)?Array.isArray(o[h])?o[h].push(m):o[h]=[o[h],m]:o[h]=m}return o}},function(e,t){"use strict" +for(var u=0;u=0?(f=c.substr(0,d),p=c.substr(d+1)):(f=c,p=""),h=decodeURIComponent(f),m=decodeURIComponent(p),n(o,h)?Array.isArray(o[h])?o[h].push(m):o[h]=[o[h],m]:o[h]=m}return o}},function(e,t){"use strict" var n=function(e){switch(typeof e){case"string":return e case"boolean":return e?"true":"false" case"number":return isFinite(e)?e:"" @@ -870,10 +867,10 @@ return this.lang&&this.lang[this.getLocale()]&&this.lang[this.getLocale()][e]?th }},{key:"addDictionary",value:function a(e,t){"undefined"==typeof this.lang[e]&&(this.lang[e]={}) for(var n in t)this.lang[e][n]=t[n]}},{key:"getDictionary",value:function s(e){return this.lang[e]}},{key:"stripStr",value:function l(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}},{key:"stripStrML", value:function u(e){for(var t=e.split("\n"),n=0;n1?t-1:0),i=1;i1?t-1:0),i=1;i') t.bind("load",function(n){"about:blank"!=(0,r["default"])(this).attr("src")&&(t.addClass("loaded").show(),e._resizeIframe(),e.uiDialog.removeClass("loading"))}).hide(),this.options.dialogExtraClass&&this.uiDialog.addClass(this.options.dialogExtraClass), -this.element.append(t),this.options.iframeUrl&&this.element.css("overflow","hidden")},open:function c(){r["default"].ui.dialog.prototype.open.call(this) +this.element.append(t),this.options.iframeUrl&&this.element.css("overflow","hidden")},open:function d(){r["default"].ui.dialog.prototype.open.call(this) var e=this,t=this.element.children("iframe") !this.options.iframeUrl||t.hasClass("loaded")&&!this.options.reloadOnOpen||(t.hide(),t.attr("src",this.options.iframeUrl),this.uiDialog.addClass("loading")),(0,r["default"])(window).bind("resize.ssdialog",function(){ e._resizeIframe()})},close:function f(){r["default"].ui.dialog.prototype.close.call(this),this.uiDialog.unbind("resize.ssdialog"),(0,r["default"])(window).unbind("resize.ssdialog")},_resizeIframe:function p(){ @@ -952,7 +949,7 @@ o.find("*").add(o).disableSelection()},destroy:function m(){this.element.unbind( function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e },_jQuery=__webpack_require__(1),_jQuery2=_interopRequireDefault(_jQuery) -__webpack_require__(86) +__webpack_require__(88) var windowWidth,windowHeight _jQuery2["default"].noConflict(),window.ss=window.ss||{},window.ss.debounce=function(e,t,n){var i,r,o,a=function s(){i=null,n||e.apply(r,o)} return function(){var s=n&&!i @@ -981,7 +978,7 @@ void this._super())},onwindowresize:function r(){this.redraw()},"from .cms-panel var t=this.getLayoutOptions(),n=!1 for(var i in e)t[i]!==e[i]&&(t[i]=e[i],n=!0) n&&this.redraw()},clearViewMode:function l(){this.removeClass("cms-container--split-mode"),this.removeClass("cms-container--preview-mode"),this.removeClass("cms-container--content-mode")},splitViewMode:function u(){ -this.updateLayoutOptions({mode:"split"})},contentViewMode:function d(){this.updateLayoutOptions({mode:"content"})},previewMode:function c(){this.updateLayoutOptions({mode:"preview"})},RedrawSuppression:!1, +this.updateLayoutOptions({mode:"split"})},contentViewMode:function c(){this.updateLayoutOptions({mode:"content"})},previewMode:function d(){this.updateLayoutOptions({mode:"preview"})},RedrawSuppression:!1, redraw:function f(){if(!this.getRedrawSuppression()){window.debug&&console.log("redraw",this.attr("class"),this.get(0)) var e=this.setProperMode() e||(this.find(".cms-panel-layout").redraw(),this.find(".cms-content-fields[data-layout-type]").redraw(),this.find(".cms-edit-form[data-layout-type]").redraw(),this.find(".cms-preview").redraw(),this.find(".cms-content").redraw()) @@ -1009,7 +1006,7 @@ var a=e.serializeArray() return a.push({name:$(t).attr("name"),value:"1"}),a.push({name:"BackURL",value:document.URL.replace(/\/$/,"")}),this.saveTabState(),jQuery.ajax(jQuery.extend({headers:{"X-Pjax":"CurrentForm,Breadcrumbs" },url:e.attr("action"),data:a,type:"POST",complete:function s(){$(t).removeClass("loading")},success:function l(t,i,o){e.removeClass("changed"),n&&n(t,i,o) var s=r.handleAjaxResponse(t,i,o) -s&&s.filter("form").trigger("aftersubmitform",{status:i,xhr:o,formData:a})}},i)),!1},LastState:null,PauseState:!1,handleStateChange:function y(e){var t=arguments.length<=1||void 0===arguments[1]?window.history.state:arguments[1] +s&&s.filter("form").trigger("aftersubmitform",{status:i,xhr:o,formData:a})}},i)),!1},LastState:null,PauseState:!1,handleStateChange:function b(e){var t=arguments.length<=1||void 0===arguments[1]?window.history.state:arguments[1] if(!this.getPauseState()){this.getStateChangeXHR()&&this.getStateChangeXHR().abort() @@ -1018,15 +1015,15 @@ if(this.setStateChangeCount(this.getStateChangeCount()+1),!this.checkCanNavigate return this.setPauseState(!0),s&&s.path?window.ss.router.show(s.path):window.ss.router.back(),void this.setPauseState(!1)}if(this.setLastState(t),a.length
'),this._super()},onunmatch:function M(){this.find(".cms-content-loading-overlay,.cms-content-loading-spinner").remove(), this._super()}}),$('.cms input[type="submit"], .cms button, .cms input[type="reset"], .cms .ss-ui-button').entwine({onadd:function N(){this.addClass("ss-ui-button"),this.data("button")||this.button(),this._super() @@ -1098,8 +1095,8 @@ this.contents().filter(function(){return 3==this.nodeType&&!/\S/.test(this.nodeV return t.showcalendar?(t.showOn="button",t.locale&&$.datepicker.regional[t.locale]&&(t=$.extend(t,$.datepicker.regional[t.locale],{})),this.prop("disabled")||this.prop("readonly")||$(this).datepicker(t), void this._super()):void this._super()},onunmatch:function X(){this._super()}}),$(".cms .field.dropdown select, .cms .field select[multiple], .form__fieldgroup-item select.dropdown").entwine({onmatch:function Q(){ return this.is(".no-chosen")?void this._super():(this.data("placeholder")||this.data("placeholder"," "),this.removeClass("has-chosen").chosen("destroy"),this.siblings(".chosen-container").remove(),applyChosen(this), -void this._super())},onunmatch:function K(){this._super()}}),$(".cms-panel-layout").entwine({redraw:function Y(){window.debug&&console.log("redraw",this.attr("class"),this.get(0))}}),$(".cms .grid-field").entwine({ -showDetailView:function J(e){var t=window.location.search.replace(/^\?/,"") +void this._super())},onunmatch:function K(){this._super()}}),$(".cms-panel-layout").entwine({redraw:function J(){window.debug&&console.log("redraw",this.attr("class"),this.get(0))}}),$(".cms .grid-field").entwine({ +showDetailView:function Y(e){var t=window.location.search.replace(/^\?/,"") t&&(e=$.path.addSearchParams(e,t)),$(".cms-container").loadPanel(e)}}),$(".cms-search-form").entwine({onsubmit:function Z(e){var t,n t=this.find(":input:not(:submit)").filter(function(){var e=$.grep($(this).fieldValue(),function(e){return e}) return e.length}),n=this.attr("action"),t.length&&(n=$.path.addSearchParams(n,t.serialize().replace("+","%20"))) @@ -1124,8 +1121,8 @@ $(t.newTab).closest("li").hasClass("readonly")?n.fadeOut():n.show()}}),this.trig e&&$(this).attr("href",document.location.href.replace(/#.*/,"")+e[0])}})}}),$("#filters-button").entwine({onmatch:function le(){this._super(),this.data("collapsed",!0),this.data("animating",!1)},onunmatch:function ue(){ -this._super()},showHide:function de(){var e=this,t=$(".cms-content-filters").first(),n=this.data("collapsed") -n?(this.addClass("active"),t.css("display","block")):(this.removeClass("active"),t.css("display","")),e.data("collapsed",!n)},onclick:function ce(){this.showHide()}})}) +this._super()},showHide:function ce(){var e=this,t=$(".cms-content-filters").first(),n=this.data("collapsed") +n?(this.addClass("active"),t.css("display","block")):(this.removeClass("active"),t.css("display","")),e.data("collapsed",!n)},onclick:function de(){this.showHide()}})}) var statusMessage=function e(t,n){t=jQuery("
").text(t).html(),jQuery.noticeAdd({text:t,type:n,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}}).call(exports,__webpack_require__(1))},function(e,t,n){ "use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) @@ -1139,9 +1136,9 @@ o=function a(t){var n,r n=e(t.target).closest(".ss-ui-action-tabset .ui-tabs-panel"),e(t.target).closest(i).length||n.length||(i.tabs("option","active",!1),r=e(".cms-container").find("iframe"),r.each(function(t,n){e(n).contents().off("click.ss-ui-action-tabset",o) }),e(document).off("click.ss-ui-action-tabset",o))},e(document).on("click.ss-ui-action-tabset",o),r.length>0&&r.each(function(t,n){e(n).contents().on("click.ss-ui-action-tabset",o)})},riseUp:function a(t,n){ -var i,r,o,a,s,l,u,d,c +var i,r,o,a,s,l,u,c,d return i=e(this).find(".ui-tabs-panel").outerHeight(),r=e(this).find(".ui-tabs-nav").outerHeight(),o=e(window).height()+e(document).scrollTop()-r,a=e(this).find(".ui-tabs-nav").offset().top,s=n.newPanel, -l=n.newTab,a+i>=o&&a-i>0?(this.addClass("rise-up"),null!==l.position()&&(u=-s.outerHeight(),d=s.parents(".toolbar--south"),d&&(c=l.offset().top-d.offset().top,u-=c),e(s).css("top",u+"px"))):(this.removeClass("rise-up"), +l=n.newTab,a+i>=o&&a-i>0?(this.addClass("rise-up"),null!==l.position()&&(u=-s.outerHeight(),c=s.parents(".toolbar--south"),c&&(d=l.offset().top-c.offset().top,u-=d),e(s).css("top",u+"px"))):(this.removeClass("rise-up"), null!==l.position()&&e(s).css("bottom","100%")),!1}}),e(".cms-content-actions .ss-tabset.ss-ui-action-tabset").entwine({ontabsbeforeactivate:function s(t,n){this._super(t,n),e(n.newPanel).length>0&&e(n.newPanel).css("left",n.newTab.position().left+"px") }}),e(".cms-actions-row.ss-tabset.ss-ui-action-tabset").entwine({ontabsbeforeactivate:function l(t,n){this._super(t,n),e(this).closest(".ss-ui-action-tabset").removeClass("tabset-open tabset-open-last") @@ -1149,9 +1146,9 @@ null!==l.position()&&e(s).css("bottom","100%")),!1}}),e(".cms-content-actions .s }}),e(".cms-content-fields .ss-tabset.ss-ui-action-tabset").entwine({ontabsbeforeactivate:function u(t,n){this._super(t,n),e(n.newPanel).length>0&&(e(n.newTab).hasClass("last")?(e(n.newPanel).css({left:"auto", right:"0px"}),e(n.newPanel).parent().addClass("tabset-open-last")):(e(n.newPanel).css("left",n.newTab.position().left+"px"),e(n.newTab).hasClass("first")&&(e(n.newPanel).css("left","0px"),e(n.newPanel).parent().addClass("tabset-open")))) -}}),e(".cms-tree-view-sidebar .cms-actions-row.ss-tabset.ss-ui-action-tabset").entwine({"from .ui-tabs-nav li":{onhover:function d(t){e(t.target).parent().find("li .active").removeClass("active"),e(t.target).find("a").addClass("active") +}}),e(".cms-tree-view-sidebar .cms-actions-row.ss-tabset.ss-ui-action-tabset").entwine({"from .ui-tabs-nav li":{onhover:function c(t){e(t.target).parent().find("li .active").removeClass("active"),e(t.target).find("a").addClass("active") -}},ontabsbeforeactivate:function c(t,n){this._super(t,n),e(n.newPanel).css({left:"auto",right:"auto"}),e(n.newPanel).length>0&&e(n.newPanel).parent().addClass("tabset-open")}})})},function(e,t,n){"use strict" +}},ontabsbeforeactivate:function d(t,n){this._super(t,n),e(n.newPanel).css({left:"auto",right:"auto"}),e(n.newPanel).length>0&&e(n.newPanel).parent().addClass("tabset-open")}})})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) @@ -1171,7 +1168,7 @@ t||(this.trigger("beforetoggle.sspanel",e),this.trigger(e?"beforeexpand":"before r.length&&(this.find(".cms-panel-content")[e?"show":"hide"](),this.find(".cms-panel-content-collapsed")[e?"hide":"show"]()),n!==!1&&this.setPersistedCollapsedState(!e),this.trigger("toggle",e),this.trigger(e?"expand":"collapse") },expandPanel:function l(e){(e||this.hasClass("collapsed"))&&this.togglePanel(!0)},collapsePanel:function u(e){!e&&this.hasClass("collapsed")||this.togglePanel(!1)}}),e(".cms-panel.collapsed .cms-panel-toggle").entwine({ -onclick:function d(e){this.expandPanel(),e.preventDefault()}}),e(".cms-panel *").entwine({getPanel:function c(){return this.parents(".cms-panel:first")}}),e(".cms-panel .toggle-expand").entwine({onclick:function f(e){ +onclick:function c(e){this.expandPanel(),e.preventDefault()}}),e(".cms-panel *").entwine({getPanel:function d(){return this.parents(".cms-panel:first")}}),e(".cms-panel .toggle-expand").entwine({onclick:function f(e){ e.preventDefault(),e.stopPropagation(),this.getPanel().expandPanel(),this._super(e)}}),e(".cms-panel .toggle-collapse").entwine({onclick:function p(e){e.preventDefault(),e.stopPropagation(),this.getPanel().collapsePanel(), this._super(e)}}),e(".cms-content-tools.collapsed").entwine({onclick:function h(e){this.expandPanel(),this._super(e)}})})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) @@ -1186,17 +1183,17 @@ i.inst.hide_checkboxes()}).bind("before.jstree",function(t,i){if("start_drag"==i if(e.inArray(i.func,["check_node","uncheck_node"])){var r=e(i.args[0]).parents("li:first"),o=r.find("li:not(.disabled)") if(r.hasClass("disabled")&&0==o)return t.stopImmediatePropagation(),!1}}).bind("move_node.jstree",function(t,i){if(!n.getIsUpdatingTree()){var r=i.rslt.o,o=i.rslt.np,a=i.inst._get_parent(r),s=e(o).data("id")||0,l=e(r).data("id"),u=e.map(e(r).siblings().andSelf(),function(t){ return e(t).data("id")}) -e.ajax({url:e.path.addSearchParams(n.data("urlSavetreenode"),n.data("extraParams")),type:"POST",data:{ID:l,ParentID:s,SiblingIDs:u},success:function d(){e(".cms-edit-form :input[name=ID]").val()==l&&e(".cms-edit-form :input[name=ParentID]").val(s), -n.updateNodesFromServer([l])},statusCode:{403:function c(){e.jstree.rollback(i.rlbk)}}})}}).bind("select_node.jstree check_node.jstree uncheck_node.jstree",function(t,n){e(document).triggerHandler(t,n) +e.ajax({url:e.path.addSearchParams(n.data("urlSavetreenode"),n.data("extraParams")),type:"POST",data:{ID:l,ParentID:s,SiblingIDs:u},success:function c(){e(".cms-edit-form :input[name=ID]").val()==l&&e(".cms-edit-form :input[name=ParentID]").val(s), +n.updateNodesFromServer([l])},statusCode:{403:function d(){e.jstree.rollback(i.rlbk)}}})}}).bind("select_node.jstree check_node.jstree uncheck_node.jstree",function(t,n){e(document).triggerHandler(t,n) })}},onremove:function n(){this.jstree("destroy"),this._super()},"from .cms-container":{onafterstatechange:function i(e){this.updateFromEditForm()}},"from .cms-container form":{onaftersubmitform:function r(t){ var n=e(".cms-edit-form :input[name=ID]").val() this.updateNodesFromServer([n])}},getTreeConfig:function o(){var t=this -return{core:{initially_open:["record-0"],animation:0,html_titles:!0},html_data:{},ui:{select_limit:1,initially_select:[this.find(".current").attr("id")]},crrm:{move:{check_move:function n(i){var r=e(i.o),o=e(i.np),a=i.ot.get_container()[0]==i.np[0],s=r.getClassname(),l=o.getClassname(),u=t.getHints(),d=[],c=l?l:"Root",f=u&&"undefined"!=typeof u[c]?u[c]:null +return{core:{initially_open:["record-0"],animation:0,html_titles:!0},html_data:{},ui:{select_limit:1,initially_select:[this.find(".current").attr("id")]},crrm:{move:{check_move:function n(i){var r=e(i.o),o=e(i.np),a=i.ot.get_container()[0]==i.np[0],s=r.getClassname(),l=o.getClassname(),u=t.getHints(),c=[],d=l?l:"Root",f=u&&"undefined"!=typeof u[d]?u[d]:null -f&&r.attr("class").match(/VirtualPage-([^\s]*)/)&&(s=RegExp.$1),f&&(d="undefined"!=typeof f.disallowedChildren?f.disallowedChildren:[]) -var p=!(0===r.data("id")||r.hasClass("status-archived")||a&&"inside"!=i.p||o.hasClass("nochildren")||d.length&&e.inArray(s,d)!=-1) +f&&r.attr("class").match(/VirtualPage-([^\s]*)/)&&(s=RegExp.$1),f&&(c="undefined"!=typeof f.disallowedChildren?f.disallowedChildren:[]) +var p=!(0===r.data("id")||r.hasClass("status-archived")||a&&"inside"!=i.p||o.hasClass("nochildren")||c.length&&e.inArray(s,c)!=-1) return p}}},dnd:{drop_target:!1,drag_target:!1},checkbox:{two_state:!0},themes:{theme:"apple",url:e("body").data("frameworkpath")+"/thirdparty/jstree/themes/apple/style.css"},plugins:["html_data","ui","dnd","crrm","themes","checkbox"] }},search:function a(e,t){e?this.data("searchparams",e):this.removeData("searchparams"),this.jstree("refresh",-1,t)},getNodeByID:function s(e){return this.find("*[data-id="+e+"]")},createNode:function l(t,n,i){ var r=this,o=void 0!==n.ParentID&&r.getNodeByID(n.ParentID),a=e(t),s={data:""} @@ -1207,10 +1204,10 @@ e.attr(r.name,r.value)}e.addClass(t).html(a.html()),i(e)})},updateNode:function e.each(["id","style","class","data-pagetype"],function(e,n){t.attr(n,o.attr(n))}) var u=t.children("ul").detach() -t.html(o.html()).append(u),a&&a.length?this.jstree("move_node",t,a,"before"):s&&s.length?this.jstree("move_node",t,s,"after"):this.jstree("move_node",t,l.length?l:-1)},updateFromEditForm:function d(){var t,n=e(".cms-edit-form :input[name=ID]").val() +t.html(o.html()).append(u),a&&a.length?this.jstree("move_node",t,a,"before"):s&&s.length?this.jstree("move_node",t,s,"after"):this.jstree("move_node",t,l.length?l:-1)},updateFromEditForm:function c(){var t,n=e(".cms-edit-form :input[name=ID]").val() -n?(t=this.getNodeByID(n),t.length?(this.jstree("deselect_all"),this.jstree("select_node",t)):this.updateNodesFromServer([n])):this.jstree("deselect_all")},updateNodesFromServer:function c(t){if(!this.getIsUpdatingTree()&&this.getIsLoaded()){ +n?(t=this.getNodeByID(n),t.length?(this.jstree("deselect_all"),this.jstree("select_node",t)):this.updateNodesFromServer([n])):this.jstree("deselect_all")},updateNodesFromServer:function d(t){if(!this.getIsUpdatingTree()&&this.getIsLoaded()){ var n=this,i,r=!1 this.setIsUpdatingTree(!0),n.jstree("save_selected") var o=function a(e){n.getNodeByID(e.data("id")).not(e).remove(),n.jstree("deselect_all"),n.jstree("select_node",e)} @@ -1237,7 +1234,7 @@ l&&"#"!=l?(l=l.split("?")[0],t.jstree("deselect_all"),t.jstree("uncheck_all"),e. s.loadPanel(l)):t.removeForm()}})}}),e(".cms-content .cms-content-fields").entwine({redraw:function r(){window.debug&&console.log("redraw",this.attr("class"),this.get(0))}}),e(".cms-content .cms-content-header, .cms-content .cms-content-actions").entwine({ redraw:function o(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.height("auto"),this.height(this.innerHeight()-this.css("padding-top")-this.css("padding-bottom"))}})})},function(e,t,n){ (function(e){"use strict" -function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i),o=n(94),a=t(o) +function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i),o=n(96),a=t(o) window.onbeforeunload=function(e){var t=(0,r["default"])(".cms-edit-form") if(t.trigger("beforesubmitform"),t.is(".changed")&&!t.is(".discardchanges"))return a["default"]._t("LeftAndMain.CONFIRMUNSAVEDSHORT")},r["default"].entwine("ss",function(e){e(".cms-edit-form").entwine({ PlaceholderHtml:"",ChangeTrackerOptions:{ignoreFieldSelector:".no-change-track, .ss-upload :input, .cms-navigator :input"},ValidationErrorShown:!1,onadd:function t(){var e=this @@ -1251,10 +1248,10 @@ var n=t.closest(".ss-tabset") n.length||(n=t.closest(".cms-tabset")),n.length?n.tabs("option","active",t.index(".tab")):this.getValidationErrorShown()||(this.setValidationErrorShown(!0),s(ss.i18n._t("ModelAdmin.VALIDATIONERROR","Validation Error"))) }}},onremove:function i(){this.changetracker("destroy"),this._super()},onmatch:function r(){this._super()},onunmatch:function o(){this._super()},redraw:function l(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)), -this.add(this.find(".cms-tabset")).redrawTabs(),this.find(".cms-content-header").redraw()},_setupChangeTracker:function u(){this.changetracker(this.getChangeTrackerOptions())},confirmUnsavedChanges:function d(){ +this.add(this.find(".cms-tabset")).redrawTabs(),this.find(".cms-content-header").redraw()},_setupChangeTracker:function u(){this.changetracker(this.getChangeTrackerOptions())},confirmUnsavedChanges:function c(){ if(this.trigger("beforesubmitform"),!this.is(".changed")||this.is(".discardchanges"))return!0 var e=confirm(a["default"]._t("LeftAndMain.CONFIRMUNSAVED")) -return e&&this.addClass("discardchanges"),e},onsubmit:function c(e,t){if("_blank"!=this.prop("target"))return t&&this.closest(".cms-container").submitForm(this,t),!1},validate:function f(){var e=!0 +return e&&this.addClass("discardchanges"),e},onsubmit:function d(e,t){if("_blank"!=this.prop("target"))return t&&this.closest(".cms-container").submitForm(this,t),!1},validate:function f(){var e=!0 return this.trigger("validate",{isValid:e}),e},"from .htmleditor":{oneditorinit:function p(t){var n=this,i=e(t.target).closest(".field.htmleditor"),r=i.find("textarea.htmleditor").getEditor().getInstance() @@ -1262,16 +1259,16 @@ r.onClick.add(function(e){n.saveFieldFocus(i.attr("id"))})}},"from .cms-edit-for }},"from .cms-edit-form .treedropdown *":{onfocusin:function g(t){var n=e(t.target).closest(".field.treedropdown") this.saveFieldFocus(n.attr("id"))}},"from .cms-edit-form .dropdown .chosen-container a":{onfocusin:function v(t){var n=e(t.target).closest(".field.dropdown") -this.saveFieldFocus(n.attr("id"))}},"from .cms-container":{ontabstaterestored:function y(e){this.restoreFieldFocus()}},saveFieldFocus:function b(t){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){ +this.saveFieldFocus(n.attr("id"))}},"from .cms-container":{ontabstaterestored:function b(e){this.restoreFieldFocus()}},saveFieldFocus:function y(t){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){ var n=e(this).attr("id"),i=[] if(i.push({id:n,selected:t}),i)try{window.sessionStorage.setItem(n,JSON.stringify(i))}catch(r){if(r.code===DOMException.QUOTA_EXCEEDED_ERR&&0===window.sessionStorage.length)return -throw r}}},restoreFieldFocus:function _(){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){var t=this,n="undefined"!=typeof window.sessionStorage&&window.sessionStorage,i=n?window.sessionStorage.getItem(this.attr("id")):null,r=!!i&&JSON.parse(i),o,a=0!==this.find(".ss-tabset").length,s,l,u,d +throw r}}},restoreFieldFocus:function w(){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){var t=this,n="undefined"!=typeof window.sessionStorage&&window.sessionStorage,i=n?window.sessionStorage.getItem(this.attr("id")):null,r=!!i&&JSON.parse(i),o,a=0!==this.find(".ss-tabset").length,s,l,u,c if(n&&r.length>0){if(e.each(r,function(n,i){t.is("#"+i.id)&&(o=e("#"+i.selected))}),e(o).length<1)return void this.focusFirstInput() if(s=e(o).closest(".ss-tabset").find(".ui-tabs-nav .ui-tabs-active .ui-tabs-anchor").attr("id"),l="tab-"+e(o).closest(".ss-tabset .ui-tabs-panel").attr("id"),a&&l!==s)return -u=e(o).closest(".togglecomposite"),u.length>0&&u.accordion("activate",u.find(".ui-accordion-header")),d=e(o).position().top,e(o).is(":visible")||(o="#"+e(o).closest(".field").attr("id"),d=e(o).position().top), -e(o).focus(),d>e(window).height()/2&&t.find(".cms-content-fields").scrollTop(d)}else this.focusFirstInput()}},focusFirstInput:function w(){this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(":visible:first").focus() +u=e(o).closest(".togglecomposite"),u.length>0&&u.accordion("activate",u.find(".ui-accordion-header")),c=e(o).position().top,e(o).is(":visible")||(o="#"+e(o).closest(".field").attr("id"),c=e(o).position().top), +e(o).focus(),c>e(window).height()/2&&t.find(".cms-content-fields").scrollTop(c)}else this.focusFirstInput()}},focusFirstInput:function _(){this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(":visible:first").focus() }}),e(".cms-edit-form .btn-toolbar input.action[type=submit], .cms-edit-form .btn-toolbar button.action").entwine({onclick:function C(e){return this.is(":disabled")?(e.preventDefault(),!1):this._super(e)===!1||e.defaultPrevented||e.isDefaultPrevented()?void 0:(this.parents("form").trigger("submit",[this]), e.preventDefault(),!1)}}),e(".cms-edit-form .btn-toolbar input.action[type=submit].ss-ui-action-cancel, .cms-edit-form .btn-toolbar button.action.ss-ui-action-cancel").entwine({onclick:function T(e){window.history.length>1?window.history.back():this.parents("form").trigger("submit",[this]), @@ -1293,9 +1290,9 @@ return t=void 0===n?r:n!==r&&i?n:r},onadd:function s(){var t=this setTimeout(function(){t.togglePanel(!t.getEvaluatedCollapsedState(),!1,!1)},0),e(window).on("ajaxComplete",function(e){setTimeout(function(){t.togglePanel(!t.getEvaluatedCollapsedState(),!1,!1)},0)}),this._super() }}),e(".cms-menu-list").entwine({onmatch:function l(){var e=this -this.find("li.current").select(),this.updateItems(),this._super()},onunmatch:function u(){this._super()},updateMenuFromResponse:function d(e){var t=e.getResponseHeader("X-Controller") +this.find("li.current").select(),this.updateItems(),this._super()},onunmatch:function u(){this._super()},updateMenuFromResponse:function c(e){var t=e.getResponseHeader("X-Controller") if(t){var n=this.find("li#Menu-"+t.replace(/\\/g,"-").replace(/[^a-zA-Z0-9\-_:.]+/,"")) -n.hasClass("current")||n.select()}this.updateItems()},"from .cms-container":{onafterstatechange:function c(e,t){this.updateMenuFromResponse(t.xhr)},onaftersubmitform:function f(e,t){this.updateMenuFromResponse(t.xhr) +n.hasClass("current")||n.select()}this.updateItems()},"from .cms-container":{onafterstatechange:function d(e,t){this.updateMenuFromResponse(t.xhr)},onaftersubmitform:function f(e,t){this.updateMenuFromResponse(t.xhr) }},"from .cms-edit-form":{onrelodeditform:function p(e,t){this.updateMenuFromResponse(t.xmlhttp)}},getContainingPanel:function h(){return this.closest(".cms-panel")},fromContainingPanel:{ontoggle:function m(t){ this.toggleClass("collapsed",e(t.target).hasClass("collapsed")),e(".cms-container").trigger("windowresize"),this.hasClass("collapsed")&&this.find("li.children.opened").removeClass("opened"),this.hasClass("collapsed")||e(".toggle-children.opened").closest("li").addClass("opened") @@ -1307,11 +1304,11 @@ n&&this.find("li").each(function(){e.isFunction(e(this).setRecordID)&&e(this).se if(n.children("ul").first().hasClass("collapsed-flyout"))if(t){if(!n.children("ul").first().children("li").first().hasClass("clone")){var i=n.clone() i.addClass("clone").css({}),i.children("ul").first().remove(),i.find("span").not(".text").remove(),i.find("a").first().unbind("click"),n.children("ul").prepend(i)}e(".collapsed-flyout").show(),n.addClass("opened"), n.children("ul").find("li").fadeIn("fast")}else i&&i.remove(),e(".collapsed-flyout").hide(),n.removeClass("opened"),n.find("toggle-children").removeClass("opened"),n.children("ul").find("li").hide()}}), -e(".cms-menu-list li").hoverIntent(function(){e(this).toggleFlyout(!0)},function(){e(this).toggleFlyout(!1)}),e(".cms-menu-list .toggle").entwine({onclick:function y(t){t.preventDefault(),e(this).toogleFlyout(!0) +e(".cms-menu-list li").hoverIntent(function(){e(this).toggleFlyout(!0)},function(){e(this).toggleFlyout(!1)}),e(".cms-menu-list .toggle").entwine({onclick:function b(t){t.preventDefault(),e(this).toogleFlyout(!0) -}}),e(".cms-menu-list li").entwine({onmatch:function b(){this.find("ul").length&&this.find("a:first").append(''),this._super() +}}),e(".cms-menu-list li").entwine({onmatch:function y(){this.find("ul").length&&this.find("a:first").append(''),this._super() -},onunmatch:function _(){this._super()},toggle:function w(){this[this.hasClass("opened")?"close":"open"]()},open:function C(){var e=this.getMenuItem() +},onunmatch:function w(){this._super()},toggle:function _(){this[this.hasClass("opened")?"close":"open"]()},open:function C(){var e=this.getMenuItem() e&&e.open(),this.find("li.clone")&&this.find("li.clone").remove(),this.addClass("opened").find("ul").show(),this.find(".toggle-children").addClass("opened")},close:function T(){this.removeClass("opened").find("ul").hide(), this.find(".toggle-children").removeClass("opened")},select:function E(){var e=this.getMenuItem() if(this.addClass("current").open(),this.siblings().removeClass("current").close(),this.siblings().find("li").removeClass("current"),e){var t=e.siblings() @@ -1328,11 +1325,11 @@ return t.toggle(),!1}}),e(".cms .profile-link").entwine({onclick:function j(){re onadd:function x(){var t=!!e(".cms-menu").getPersistedStickyState() this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function R(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function I(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto") -},onclick:function F(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n +},onclick:function A(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n void 0===t?e.setPersistedCollapsedState(e.hasClass("collapsed")):void 0!==t&&i===!1&&e.clearPersistedCollapsedState(),e.setPersistedStickyState(i),this.toggleCSS(i),this.toggleIndicator(i),this._super() }})})},function(e,t,n){"use strict" -function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(94),s=i(a) +function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(96),s=i(a) o["default"].entwine("ss.preview",function(e){e(".cms-preview").entwine({AllowedStates:["StageLink","LiveLink","ArchiveLink"],CurrentStateName:null,CurrentSizeName:"auto",IsPreviewEnabled:!1,DefaultMode:"split", Sizes:{auto:{width:"100%",height:"100%"},mobile:{width:"335px",height:"568px"},mobileLandscape:{width:"583px",height:"320px"},tablet:{width:"783px",height:"1024px"},tabletLandscape:{width:"1039px",height:"768px" },desktop:{width:"1024px",height:"800px"}},changeState:function t(n,i){var r=this,o=this._getNavigatorStates() @@ -1354,8 +1351,8 @@ return i&&this.find(".preview-size-selector").changeVisibleSize(this.getCurrentS },loadState:function a(e){if(this._supportsLocalStorage())return window.localStorage.getItem("cms-preview-state-"+e)},disablePreview:function l(){return this.setPendingURL(null),this._loadUrl("about:blank"), this._block(),this.changeMode("content",!1),this.setIsPreviewEnabled(!1),this},enablePreview:function u(){return this.getIsPreviewEnabled()||(this.setIsPreviewEnabled(!0),e.browser.msie&&e.browser.version.slice(0,3)<=7?this.changeMode("content"):this.changeMode(this.getDefaultMode(),!1)), -this},getOrAppendFontFixStyleElement:function d(){var t=e("#FontFixStyleElement") -return t.length||(t=e('').appendTo("head")),t},onadd:function c(){var t=this,n=this.find("iframe") +this},getOrAppendFontFixStyleElement:function c(){var t=e("#FontFixStyleElement") +return t.length||(t=e('').appendTo("head")),t},onadd:function d(){var t=this,n=this.find("iframe") n.addClass("center"),n.bind("load",function(){t._adjustIframeForPreview(),t._loadCurrentPage(),e(this).removeClass("loading")}),e.browser.msie&&8===parseInt(e.browser.version,10)&&n.bind("readystatechange",function(e){ @@ -1365,11 +1362,11 @@ try{return(t=window.localStorage).setItem(e,e),n=t.getItem(e)==e,t.removeItem(e) this.changeMode("content",!1)},onenable:function h(){var t=e(".preview-mode-selector") t.removeClass("split-disabled"),t.find(".disabled-tooltip").hide()},ondisable:function m(){var t=e(".preview-mode-selector") t.addClass("split-disabled"),t.find(".disabled-tooltip").show()},_block:function g(){return this.find(".preview-note").show(),this.find(".cms-preview-overlay").show(),this},_unblock:function v(){return this.find(".preview-note").hide(), -this.find(".cms-preview-overlay").hide(),this},_initialiseFromContent:function y(){var t,n +this.find(".cms-preview-overlay").hide(),this},_initialiseFromContent:function b(){var t,n return e(".cms-previewable").length?(t=this.loadState("mode"),n=this.loadState("size"),this._moveNavigator(),t&&"content"==t||(this.enablePreview(),this._loadCurrentState()),this.redraw(),t&&this.changeMode(t), -n&&this.changeSize(n)):this.disablePreview(),this},"from .cms-container":{onafterstatechange:function b(e,t){t.xhr.getResponseHeader("X-ControllerURL")||this._initialiseFromContent()}},PendingURL:null, -oncolumnvisibilitychanged:function _(){var e=this.getPendingURL() -e&&!this.is(".column-hidden")&&(this.setPendingURL(null),this._loadUrl(e),this._unblock())},"from .cms-container .cms-edit-form":{onaftersubmitform:function w(){this._initialiseFromContent()}},_loadUrl:function C(e){ +n&&this.changeSize(n)):this.disablePreview(),this},"from .cms-container":{onafterstatechange:function y(e,t){t.xhr.getResponseHeader("X-ControllerURL")||this._initialiseFromContent()}},PendingURL:null, +oncolumnvisibilitychanged:function w(){var e=this.getPendingURL() +e&&!this.is(".column-hidden")&&(this.setPendingURL(null),this._loadUrl(e),this._unblock())},"from .cms-container .cms-edit-form":{onaftersubmitform:function _(){this._initialiseFromContent()}},_loadUrl:function C(e){ return this.find("iframe").addClass("loading").attr("src",e),this},_getNavigatorStates:function T(){var t=e.map(this.getAllowedStates(),function(t){var n=e(".cms-preview-states .state-name[data-name="+t+"]") @@ -1398,8 +1395,8 @@ this.addClass("active").siblings().removeClass("active"),e(".cms-preview").chang }}),e(".preview-mode-selector select").entwine({onchange:function I(t){this._super(t),t.preventDefault() var n=e(this).val() -e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function F(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), -this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function A(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function D(t){ +e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function A(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), +this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function F(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function D(t){ t.preventDefault() var n=e(this).val() e(".cms-preview").changeSize(n)}}),e(".preview-selector select.preview-dropdown").entwine({"onchosen:ready":function M(){this._super(),this._addIcon()},_addIcon:function N(){var e=this.find(":selected"),t=e.attr("data-icon"),n=this.parent().find(".chosen-container a.chosen-single"),i=n.attr("data-icon") @@ -1408,7 +1405,7 @@ e(".cms-preview").changeSize(n)}}),e(".preview-selector select.preview-dropdown" return"undefined"!=typeof i&&n.removeClass(i),n.addClass(t),n.attr("data-icon",t),this}}),e(".preview-mode-selector .chosen-drop li:last-child").entwine({onmatch:function U(){e(".preview-mode-selector").hasClass("split-disabled")?this.parent().append('
'):this.parent().append('') }}),e(".preview-device-outer").entwine({onclick:function L(){this.toggleClass("rotate")}})})},function(e,t,n){(function(e){"use strict" -function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i),o=n(94),a=t(o) +function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i),o=n(96),a=t(o) r["default"].entwine("ss.tree",function(t){t("#Form_BatchActionsForm").entwine({Actions:[],getTree:function n(){return t(".cms-tree")},fromTree:{oncheck_node:function i(e,t){this.serializeFromTree()},onuncheck_node:function r(e,t){ this.serializeFromTree()}},onmatch:function o(){var e=this e.getTree().bind("load_node.jstree",function(t,n){e.refreshSelected()})},onunmatch:function s(){var e=this @@ -1424,17 +1421,17 @@ return!!t&&e}),this.register(ss.config.adminUrl+"pages/batchactions/restore",fun num:e.length})) return!!t&&e}),this.register(ss.config.adminUrl+"pages/batchactions/deletefromlive",function(e){var t=confirm(a["default"].inject(a["default"]._t("CMSMAIN.BATCH_DELETELIVE_PROMPT","You have {num} page(s) selected.\n\nDo you really want to delete these pages from live?"),{ num:e.length})) -return!!t&&e})},onadd:function u(){this.registerDefault(),this._super()},register:function d(e,t){this.trigger("register",{type:e,callback:t}) +return!!t&&e})},onadd:function u(){this.registerDefault(),this._super()},register:function c(e,t){this.trigger("register",{type:e,callback:t}) var n=this.getActions() -n[e]=t,this.setActions(n)},unregister:function c(e){this.trigger("unregister",{type:e}) +n[e]=t,this.setActions(n)},unregister:function d(e){this.trigger("unregister",{type:e}) var t=this.getActions() t[e]&&delete t[e],this.setActions(t)},refreshSelected:function f(n){var i=this,r=this.getTree(),o=this.getIDs(),a=[],s=t(".cms-content-batchactions-button"),l=this.find(":input[name=Action]").val() null==n&&(n=r) for(var u in o)t(t(r).getNodeByID(u)).addClass("selected").attr("selected","selected") if(!l||l==-1||!s.hasClass("active"))return void t(n).find("li").each(function(){t(this).setEnabled(!0)}) t(n).find("li").each(function(){a.push(t(this).data("id")),t(this).addClass("treeloading").setEnabled(!1)}) -var d=t.path.parseUrl(l),c=d.hrefNoSearch+"/applicablepages/" -c=t.path.addSearchParams(c,d.search),c=t.path.addSearchParams(c,{csvIDs:a.join(",")}),e.getJSON(c,function(r){e(n).find("li").each(function(){t(this).removeClass("treeloading") +var c=t.path.parseUrl(l),d=c.hrefNoSearch+"/applicablepages/" +d=t.path.addSearchParams(d,c.search),d=t.path.addSearchParams(d,{csvIDs:a.join(",")}),e.getJSON(d,function(r){e(n).find("li").each(function(){t(this).removeClass("treeloading") var e=t(this).data("id") 0==e||t.inArray(e,r)>=0?t(this).setEnabled(!0):(t(this).removeClass("selected").setEnabled(!1),t(this).prop("selected",!1))}),i.serializeFromTree()})},serializeFromTree:function p(){var e=this.getTree(),t=e.getSelectedIDs() @@ -1446,20 +1443,20 @@ var l=this.find(":input[name=Action]").val() if(s[l]&&(r=this.getActions()[l].apply(this,[r])),!r||!r.length)return n.preventDefault(),!1 this.setIDs(r),o.find("li").removeClass("failed") var u=this.find(":submit:first") -return u.addClass("loading"),e.ajax({url:l,type:"POST",data:this.serializeArray(),complete:function d(e,t){u.removeClass("loading"),o.jstree("refresh",-1),i.setIDs([]),i.find(":input[name=Action]").val("").change() +return u.addClass("loading"),e.ajax({url:l,type:"POST",data:this.serializeArray(),complete:function c(e,t){u.removeClass("loading"),o.jstree("refresh",-1),i.setIDs([]),i.find(":input[name=Action]").val("").change() var n=e.getResponseHeader("X-Status") -n&&statusMessage(decodeURIComponent(n),"success"==t?"good":"bad")},success:function c(e,n){var i,r +n&&statusMessage(decodeURIComponent(n),"success"==t?"good":"bad")},success:function d(e,n){var i,r if(e.modified){var a=[] for(i in e.modified)r=o.getNodeByID(i),o.jstree("set_text",r,e.modified[i].TreeTitle),a.push(r) t(a).effect("highlight")}if(e.deleted)for(i in e.deleted)r=o.getNodeByID(i),r.length&&o.jstree("delete_node",r) if(e.error)for(i in e.error)r=o.getNodeByID(i),t(r).addClass("failed")},dataType:"json"}),n.preventDefault(),!1}}),t(".cms-content-batchactions-button").entwine({onmatch:function v(){this._super(),this.updateTree() -},onunmatch:function y(){this._super()},onclick:function b(e){this.updateTree()},updateTree:function _(){var e=t(".cms-tree"),n=t("#Form_BatchActionsForm") +},onunmatch:function b(){this._super()},onclick:function y(e){this.updateTree()},updateTree:function w(){var e=t(".cms-tree"),n=t("#Form_BatchActionsForm") this._super(),this.data("active")?(e.addClass("multiple"),e.removeClass("draggable"),n.serializeFromTree()):(e.removeClass("multiple"),e.addClass("draggable")),t("#Form_BatchActionsForm").refreshSelected() -}}),t("#Form_BatchActionsForm select[name=Action]").entwine({onchange:function w(e){var n=t(e.target.form),i=n.find(":submit"),r=t(e.target).val() +}}),t("#Form_BatchActionsForm select[name=Action]").entwine({onchange:function _(e){var n=t(e.target.form),i=n.find(":submit"),r=t(e.target).val() r&&r!=-1?i.removeAttr("disabled").button("refresh"):i.attr("disabled","disabled").button("refresh"),t("#Form_BatchActionsForm").refreshSelected(),this.trigger("chosen:updated"),this._super(e)}})})}).call(t,n(1)) },function(e,t,n){"use strict" @@ -1478,18 +1475,18 @@ this.addClass("description-toggle-enabled"),n.on("click",function(){i[e?"hide":" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) o["default"].entwine("ss",function(e){e(".TreeDropdownField").entwine({"from .cms-container form":{onaftersubmitform:function t(e){this.find(".tree-holder").empty(),this._super()}}})})},function(e,t,n){ "use strict" -function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(94),s=i(a),l=n(4),u=i(l),d=n(102),c=i(d),f=n(27),p=n(103),h=i(p) +function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(96),s=i(a),l=n(4),u=i(l),c=n(104),d=i(c),f=n(31),p=n(105),h=i(p) o["default"].entwine("ss",function(e){e(".cms-content-actions .add-to-campaign-action,#add-to-campaign__action").entwine({onclick:function t(){var t=e("#add-to-campaign__dialog-wrapper") return t.length||(t=e('
'),e("body").append(t)),t.open(),!1}}),e("#add-to-campaign__dialog-wrapper").entwine({open:function n(){this._renderModal()},close:function i(){ -this._clearModal()},_renderModal:function r(){var t=this,n=function l(){return t._clearModal()},i=function d(){return t._handleSubmitModal.apply(t,arguments)},r=e("form.cms-edit-form :input[name=ID]").val(),o=window.ss.store,a=o.getState().config.sections["SilverStripe\\CMS\\Controllers\\CMSPageEditController"],s=a.form.AddToCampaignForm.schemaUrl+"/"+r +this._clearModal()},_renderModal:function r(){var t=this,n=function l(){return t._clearModal()},i=function c(){return t._handleSubmitModal.apply(t,arguments)},r=e("form.cms-edit-form :input[name=ID]").val(),o=window.ss.store,a=o.getState().config.sections["SilverStripe\\CMS\\Controllers\\CMSPageEditController"],s=a.form.AddToCampaignForm.schemaUrl+"/"+r -c["default"].render(u["default"].createElement(f.Provider,{store:o},u["default"].createElement(h["default"],{show:!0,handleSubmit:i,handleHide:n,schemaUrl:s,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error", -responseClassGood:"modal__response modal__response--good"})),this[0])},_clearModal:function o(){c["default"].unmountComponentAtNode(this[0])},_handleSubmitModal:function a(e,t,n){return e.preventDefault(), +d["default"].render(u["default"].createElement(f.Provider,{store:o},u["default"].createElement(h["default"],{show:!0,handleSubmit:i,handleHide:n,schemaUrl:s,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error", +responseClassGood:"modal__response modal__response--good"})),this[0])},_clearModal:function o(){d["default"].unmountComponentAtNode(this[0])},_handleSubmitModal:function a(e,t,n){return e.preventDefault(), t.Campaign?n():(alert(s["default"]._t("AddToCampaigns.ErrorCampaignNotSelected","There was no campaign selected to be added to")),null)}})})},,function(e,t){e.exports=FormBuilderModal},function(e,t,n){ "use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) -n(88),n(105) +n(90),n(107) var a=function s(e){var t=(0,o["default"])((0,o["default"])(this).contents()).find(".message") if(t&&t.html()){var n=(0,o["default"])(window.parent.document).find("#Form_EditForm_Members").get(0) n&&n.refresh() @@ -1517,7 +1514,7 @@ e(this).prop("checked","checked")}):t.each(function(){e(this).prop("checked",e(t })}})})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) -n(88),o["default"].entwine("ss",function(e){e(".cms-content-tools #Form_SearchForm").entwine({onsubmit:function t(e){this.trigger("beforeSubmit")}}),e(".importSpec").entwine({onmatch:function n(){this.find("div.details").hide(), +n(90),o["default"].entwine("ss",function(e){e(".cms-content-tools #Form_SearchForm").entwine({onsubmit:function t(e){this.trigger("beforeSubmit")}}),e(".importSpec").entwine({onmatch:function n(){this.find("div.details").hide(), this.find("a.detailsLink").click(function(){return e("#"+e(this).attr("href").replace(/.*#/,"")).slideToggle(),!1}),this._super()},onunmatch:function i(){this._super()}})})},function(e,t,n){"use strict" @@ -1525,19 +1522,19 @@ function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r);(0,o["def },onunmatch:function s(){this._super()},onfileuploadadd:function l(e){this.find(".ss-uploadfield-editandorganize").show()},onfileuploadstart:function u(e){this.find(".ss-uploadfield-editandorganize").show() -}}),(0,o["default"])(".ss-uploadfield-view-allowed-extensions .toggle").entwine({onclick:function d(e){var t=this.closest(".ss-uploadfield-view-allowed-extensions"),n=this.closest(".ui-tabs-panel").height()+20 +}}),(0,o["default"])(".ss-uploadfield-view-allowed-extensions .toggle").entwine({onclick:function c(e){var t=this.closest(".ss-uploadfield-view-allowed-extensions"),n=this.closest(".ui-tabs-panel").height()+20 t.toggleClass("active"),t.find(".toggle-content").css("minHeight",n)}})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r);(0,o["default"])(document).on("click",".confirmedpassword .showOnClick a",function(){var e=(0,o["default"])(".showOnClickContainer",(0, o["default"])(this).parent()) return e.toggle("fast",function(){e.find('input[type="hidden"]').val(e.is(":visible")?1:0)}),!1})},function(e,t,n){"use strict" -function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(94),s=i(a) -window.tmpl=n(110),n(111),n(112),o["default"].widget("blueimpUIX.fileupload",o["default"].blueimpUI.fileupload,{_initTemplates:function l(){this.options.templateContainer=document.createElement(this._files.prop("nodeName")), +function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(96),s=i(a) +window.tmpl=n(112),n(113),n(114),o["default"].widget("blueimpUIX.fileupload",o["default"].blueimpUI.fileupload,{_initTemplates:function l(){this.options.templateContainer=document.createElement(this._files.prop("nodeName")), this.options.uploadTemplate=window.tmpl(this.options.uploadTemplateName),this.options.downloadTemplate=window.tmpl(this.options.downloadTemplateName)},_enableFileInputButton:function u(){o["default"].blueimpUI.fileupload.prototype._enableFileInputButton.call(this), -this.element.find(".ss-uploadfield-addfile").show()},_disableFileInputButton:function d(){o["default"].blueimpUI.fileupload.prototype._disableFileInputButton.call(this),this.element.find(".ss-uploadfield-addfile").hide() +this.element.find(".ss-uploadfield-addfile").show()},_disableFileInputButton:function c(){o["default"].blueimpUI.fileupload.prototype._disableFileInputButton.call(this),this.element.find(".ss-uploadfield-addfile").hide() -},_onAdd:function c(e,t){var n=o["default"].blueimpUI.fileupload.prototype._onAdd.call(this,e,t),i=this._files.find(".ss-uploadfield-item").slice(t.files.length*-1).first(),r="+="+(i.position().top-parseInt(i.css("marginTop"),10)||0-parseInt(i.css("borderTopWidth"),10)||0) +},_onAdd:function d(e,t){var n=o["default"].blueimpUI.fileupload.prototype._onAdd.call(this,e,t),i=this._files.find(".ss-uploadfield-item").slice(t.files.length*-1).first(),r="+="+(i.position().top-parseInt(i.css("marginTop"),10)||0-parseInt(i.css("borderTopWidth"),10)||0) i.offsetParent().animate({scrollTop:r},1e3) @@ -1591,8 +1588,8 @@ a.children().hide(),a.append(o),e.ajax({type:"POST",url:r.urlAttach,data:{ids:t} files:t,options:i.fileupload("option"),replaceFileID:n})}})}}),e("div.ss-upload *").entwine({getUploadField:function o(){return this.parents("div.ss-upload:first")}}),e("div.ss-upload .ss-uploadfield-files .ss-uploadfield-item").entwine({ onadd:function a(){this._super(),this.closest(".ss-upload").find(".ss-uploadfield-addfile").addClass("borderTop")},onremove:function l(){e(".ss-uploadfield-files:not(:has(.ss-uploadfield-item))").closest(".ss-upload").find(".ss-uploadfield-addfile").removeClass("borderTop"), this._super()}}),e("div.ss-upload .ss-uploadfield-startall").entwine({onclick:function u(e){return this.closest(".ss-upload").find(".ss-uploadfield-item-start button").click(),e.preventDefault(),!1}}), -e("div.ss-upload .ss-uploadfield-item-cancelfailed").entwine({onclick:function d(e){return this.closest(".ss-uploadfield-item").remove(),e.preventDefault(),!1}}),e("div.ss-upload .ss-uploadfield-item-remove:not(.ui-state-disabled), .ss-uploadfield-item-delete:not(.ui-state-disabled)").entwine({ -onclick:function c(e){var t=this.closest("div.ss-upload"),n=t.getConfig("changeDetection"),i=t.data("fileupload"),r=this.closest(".ss-uploadfield-item"),o="" +e("div.ss-upload .ss-uploadfield-item-cancelfailed").entwine({onclick:function c(e){return this.closest(".ss-uploadfield-item").remove(),e.preventDefault(),!1}}),e("div.ss-upload .ss-uploadfield-item-remove:not(.ui-state-disabled), .ss-uploadfield-item-delete:not(.ui-state-disabled)").entwine({ +onclick:function d(e){var t=this.closest("div.ss-upload"),n=t.getConfig("changeDetection"),i=t.data("fileupload"),r=this.closest(".ss-uploadfield-item"),o="" return this.is(".ss-uploadfield-item-delete")?confirm(s["default"]._t("UploadField.ConfirmDelete"))&&(n.changeDetection&&this.closest("form").trigger("dirty"),i&&i._trigger("destroy",e,{context:r,url:this.data("href"), type:"get",dataType:i.options.dataType})):(n.changeDetection&&this.closest("form").trigger("dirty"),i&&i._trigger("destroy",e,{context:r})),e.preventDefault(),!1}}),e("div.ss-upload .ss-uploadfield-item-edit-all").entwine({ onclick:function f(t){return e(this).hasClass("opened")?(e(".ss-uploadfield-item .ss-uploadfield-item-edit .toggle-details-icon.opened").each(function(t){e(this).closest(".ss-uploadfield-item-edit").click() @@ -1643,22 +1640,22 @@ t.length&&t.removeClass("selected") var n=e.nextAll("li.selected") n.length&&n.removeClass("selected"),(0,o["default"])(this).focus()})})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) -n(87),o["default"].fn.extend({ssDatepicker:function a(e){return(0,o["default"])(this).each(function(){if(!((0,o["default"])(this).prop("disabled")||(0,o["default"])(this).prop("readonly")||(0,o["default"])(this).data("datepicker"))){ +n(89),o["default"].fn.extend({ssDatepicker:function a(e){return(0,o["default"])(this).each(function(){if(!((0,o["default"])(this).prop("disabled")||(0,o["default"])(this).prop("readonly")||(0,o["default"])(this).data("datepicker"))){ (0,o["default"])(this).siblings("button").addClass("ui-icon ui-icon-calendar") var t=(0,o["default"])(this).closest(".field.date"),n=o["default"].extend(e||{},(0,o["default"])(this).data(),(0,o["default"])(this).data("jqueryuiconfig"),{}) n.showcalendar&&(n.locale&&o["default"].datepicker.regional[n.locale]&&(n=o["default"].extend(n,o["default"].datepicker.regional[n.locale],{})),n.min&&(n.minDate=o["default"].datepicker.parseDate("yy-mm-dd",n.min)), n.max&&(n.maxDate=o["default"].datepicker.parseDate("yy-mm-dd",n.max)),n.dateFormat=n.jquerydateformat,(0,o["default"])(this).datepicker(n))}})}}),(0,o["default"])(document).on("click",".field.date input.text,input.text.date",function(){ (0,o["default"])(this).ssDatepicker(),(0,o["default"])(this).data("datepicker")&&(0,o["default"])(this).datepicker("show")})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) -n(87),o["default"].entwine("ss",function(e){e(".ss-toggle").entwine({onadd:function t(){this._super(),this.accordion({heightStyle:"content",collapsible:!0,active:!this.hasClass("ss-toggle-start-closed")&&0 +n(89),o["default"].entwine("ss",function(e){e(".ss-toggle").entwine({onadd:function t(){this._super(),this.accordion({heightStyle:"content",collapsible:!0,active:!this.hasClass("ss-toggle-start-closed")&&0 })},onremove:function n(){this.data("accordion")&&this.accordion("destroy"),this._super()},getTabSet:function i(){return this.closest(".ss-tabset")},fromTabSet:{ontabsshow:function r(){this.accordion("resize") }}})})},function(e,t,n){(function(e){"use strict" function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i) r["default"].entwine("ss",function(t){t(".memberdatetimeoptionset").entwine({onmatch:function n(){this.find(".toggle-content").hide(),this._super()}}),t(".memberdatetimeoptionset .toggle").entwine({onclick:function i(t){ return e(this).closest(".form__field-description").parent().find(".toggle-content").toggle(),!1}})})}).call(t,n(1))},function(e,t,n){(function(e){"use strict" -function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i),o=n(94),a=t(o) -n(118),n(119),r["default"].entwine("ss",function(t){var n,i +function t(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=t(i),o=n(96),a=t(o) +n(120),n(121),r["default"].entwine("ss",function(t){var n,i t(window).bind("resize.treedropdownfield",function(){var e=function a(){t(".TreeDropdownField").closePanel()} if(t.browser.msie&&parseInt(t.browser.version,10)<9){var r=t(window).width(),o=t(window).height() r==n&&o==i||(n=r,i=o,e())}else e()}) @@ -1670,12 +1667,12 @@ t(".TreeDropdownField").entwine({CurrentXhr:null,onadd:function l(){this.append( var e=r.openLink e&&this.find("treedropdownfield-toggle-panel-link a").attr("title",e),this.data("title")&&this.setTitle(this.data("title")),this.getPanel().hide(),this._super()},getPanel:function u(){return this.find(".treedropdownfield-panel") -},openPanel:function d(){t(".TreeDropdownField").closePanel(),t("body").bind("click",o) +},openPanel:function c(){t(".TreeDropdownField").closePanel(),t("body").bind("click",o) var e=this.getPanel(),n=this.find(".tree-holder") e.css("width",this.width()),e.show() var i=this.find(".treedropdownfield-toggle-panel-link") i.addClass("treedropdownfield-open-tree"),this.addClass("treedropdownfield-open-tree"),i.find("a").removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-n"),n.is(":empty")&&!e.hasClass("loading")?this.loadTree(null,this._riseUp):this._riseUp(), -this.trigger("panelshow")},_riseUp:function c(){var e=this,n=this.getPanel(),i=this.find(".treedropdownfield-toggle-panel-link"),r=i.innerHeight(),o,a,s +this.trigger("panelshow")},_riseUp:function d(){var e=this,n=this.getPanel(),i=this.find(".treedropdownfield-toggle-panel-link"),r=i.innerHeight(),o,a,s i.length>0&&(s=t(window).height()+t(document).scrollTop()-i.innerHeight(),a=i.offset().top,o=n.innerHeight(),a+o>s&&a-o>0?(e.addClass("treedropdownfield-with-rise"),r=-n.outerHeight()):e.removeClass("treedropdownfield-with-rise")), n.css({top:r+"px"})},closePanel:function f(){e("body").unbind("click",o) var t=this.find(".treedropdownfield-toggle-panel-link") @@ -1687,7 +1684,7 @@ if(n){var i=t.find('*[data-id="'+n+'"]'),r=i.children("a").find("span.jstree_pag r||(r=i.length>0?t.jstree("get_text",i[0]):null),r&&(e.setTitle(r),e.data("title",r)),i&&t.jstree("select_node",i)}else e.setTitle(e.data("empty-title")),e.removeData("title")} t.is(":empty")&&n?this.loadTree({forceValue:n},i):i()},setValue:function v(e){this.data("metadata",t.extend(this.data("metadata"),{id:e})),this.find(":input:hidden").val(e).trigger("valueupdated").trigger("change") -},getValue:function y(){return this.find(":input:hidden").val()},loadTree:function b(e,n){var i=this,r=this.getPanel(),o=t(r).find(".tree-holder"),e=e?t.extend({},this.getRequestParams(),e):this.getRequestParams(),a +},getValue:function b(){return this.find(":input:hidden").val()},loadTree:function y(e,n){var i=this,r=this.getPanel(),o=t(r).find(".tree-holder"),e=e?t.extend({},this.getRequestParams(),e):this.getRequestParams(),a this.getCurrentXhr()&&this.getCurrentXhr().abort(),r.addClass("loading"),a=t.ajax({url:this.data("urlTree"),data:e,complete:function s(e,t){r.removeClass("loading")},success:function l(e,r,a){o.html(e) @@ -1697,13 +1694,13 @@ var s=!0 o.jstree("destroy").bind("loaded.jstree",function(e,t){var r=i.getValue(),a=o.find('*[data-id="'+r+'"]'),l=t.inst.get_selected() r&&a!=l&&t.inst.select_node(a),s=!1,n&&n.apply(i)}).jstree(i.getTreeConfig()).bind("select_node.jstree",function(e,n){var r=n.rslt.obj,o=t(r).data("id") s||i.getValue()!=o?(i.data("metadata",t.extend({id:o},t(r).getMetaData())),i.setTitle(n.inst.get_text(r)),i.setValue(o)):(i.data("metadata",null),i.setTitle(null),i.setValue(null),n.inst.deselect_node(r)), -s||i.closePanel(),s=!1}),i.setCurrentXhr(null)}}),this.setCurrentXhr(a)},getTreeConfig:function _(){var e=this +s||i.closePanel(),s=!1}),i.setCurrentXhr(null)}}),this.setCurrentXhr(a)},getTreeConfig:function w(){var e=this return{core:{html_titles:!0,animation:0},html_data:{data:this.getPanel().find(".tree-holder").html(),ajax:{url:function n(i){var n=t.path.parseUrl(e.data("urlTree")).hrefNoSearch return n+"/"+(t(i).data("id")?t(i).data("id"):0)},data:function i(n){var i=t.query.load(e.data("urlTree")).keys,r=e.getRequestParams() return r=t.extend({},i,r,{ajax:1})}}},ui:{select_limit:1,initially_select:[this.getPanel().find(".current").attr("id")]},themes:{theme:"apple"},types:{types:{"default":{check_node:function r(e){return!e.hasClass("disabled") },uncheck_node:function o(e){return!e.hasClass("disabled")},select_node:function a(e){return!e.hasClass("disabled")},deselect_node:function s(e){return!e.hasClass("disabled")}}}},plugins:["html_data","ui","themes","types"] -}},getRequestParams:function w(){return{}}}),t(".TreeDropdownField .tree-holder li").entwine({getMetaData:function C(){var e=this.attr("class").match(/class-([^\s]*)/i),t=e?e[1]:"" +}},getRequestParams:function _(){return{}}}),t(".TreeDropdownField .tree-holder li").entwine({getMetaData:function C(){var e=this.attr("class").match(/class-([^\s]*)/i),t=e?e[1]:"" return{ClassName:t}}}),t(".TreeDropdownField *").entwine({getField:function T(){return this.parents(".TreeDropdownField:first")}}),t(".TreeDropdownField").entwine({onclick:function E(e){return this.togglePanel(), !1}}),t(".TreeDropdownField .treedropdownfield-panel").entwine({onclick:function P(e){return!1}}),t(".TreeDropdownField.searchable").entwine({onadd:function O(){this._super() var e=a["default"]._t("TreeDropdownField.ENTERTOSEARCH") @@ -1721,11 +1718,11 @@ i.setCurrentXhr(null),o.jstree("destroy").bind("loaded.jstree",function(e,r){t.e var r=n.inst.get_checked(null,!0) i.setValue(t.map(r,function(e,n){return t(e).data("id")})),i.setTitle(t.map(r,function(e,t){return n.inst.get_text(e)})),i.data("metadata",t.map(r,function(e,n){return{id:t(e).data("id"),metadata:t(e).getMetaData() }}))})}}),this.setCurrentXhr(a)},getValue:function I(){var e=this._super() -return e.split(/ *, */)},setValue:function F(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function A(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ +return e.split(/ *, */)},setValue:function A(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function F(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ onadd:function M(){this._super(),this.bind("change.TreeDropdownField",function(){t(this).getField().updateTitle()})},onremove:function N(){this._super(),this.unbind(".TreeDropdownField")}})})}).call(t,n(1)) },,,function(module,exports,__webpack_require__){"use strict" -function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}var _jQuery=__webpack_require__(1),_jQuery2=_interopRequireDefault(_jQuery),_i18n=__webpack_require__(94),_i18n2=_interopRequireDefault(_i18n),ss="undefined"!=typeof window.ss?window.ss:{} +function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}var _jQuery=__webpack_require__(1),_jQuery2=_interopRequireDefault(_jQuery),_i18n=__webpack_require__(96),_i18n2=_interopRequireDefault(_i18n),ss="undefined"!=typeof window.ss?window.ss:{} ss.editorWrappers={},ss.editorWrappers.tinyMCE=function(){var editorID @@ -1734,16 +1731,16 @@ return{init:function e(t){editorID=t,this.create()},destroy:function t(){tinymce },onopen:function i(){},onclose:function r(){},getConfig:function o(){var e="#"+editorID,t=(0,_jQuery2["default"])(e).data("config"),n=this return t.selector=e,t.setup=function(e){e.on("change",function(){n.save()})},t},save:function a(){var e=this.getInstance() e.save(),(0,_jQuery2["default"])(e.getElement()).trigger("change")},create:function s(){var e=this.getConfig() -"undefined"!=typeof e.baseURL&&(tinymce.EditorManager.baseURL=e.baseURL),tinymce.init(e)},repaint:function l(){},isDirty:function u(){return this.getInstance().isDirty()},getContent:function d(){return this.getInstance().getContent() +"undefined"!=typeof e.baseURL&&(tinymce.EditorManager.baseURL=e.baseURL),tinymce.init(e)},repaint:function l(){},isDirty:function u(){return this.getInstance().isDirty()},getContent:function c(){return this.getInstance().getContent() -},getDOM:function c(){return this.getInstance().getElement()},getContainer:function f(){return this.getInstance().getContainer()},getSelectedNode:function p(){return this.getInstance().selection.getNode() +},getDOM:function d(){return this.getInstance().getElement()},getContainer:function f(){return this.getInstance().getContainer()},getSelectedNode:function p(){return this.getInstance().selection.getNode() },selectNode:function h(e){this.getInstance().selection.select(e)},setContent:function m(e,t){this.getInstance().setContent(e,t)},insertContent:function g(e,t){this.getInstance().insertContent(e,t)},replaceContent:function v(e,t){ -this.getInstance().execCommand("mceReplaceContent",!1,e,t)},insertLink:function y(e,t){this.getInstance().execCommand("mceInsertLink",!1,e,t)},removeLink:function b(){this.getInstance().execCommand("unlink",!1) +this.getInstance().execCommand("mceReplaceContent",!1,e,t)},insertLink:function b(e,t){this.getInstance().execCommand("mceInsertLink",!1,e,t)},removeLink:function y(){this.getInstance().execCommand("unlink",!1) },cleanLink:function cleanLink(href,node){var settings=this.getConfig,cb=settings.urlconverter_callback -return cb&&(href=eval(cb+"(href, node, true);")),href.match(new RegExp("^"+tinyMCE.settings.document_base_url+"(.*)$"))&&(href=RegExp.$1),href.match(/^javascript:\s*mctmp/)&&(href=""),href},createBookmark:function _(){ -return this.getInstance().selection.getBookmark()},moveToBookmark:function w(e){this.getInstance().selection.moveToBookmark(e),this.getInstance().focus()},blur:function C(){this.getInstance().selection.collapse() +return cb&&(href=eval(cb+"(href, node, true);")),href.match(new RegExp("^"+tinyMCE.settings.document_base_url+"(.*)$"))&&(href=RegExp.$1),href.match(/^javascript:\s*mctmp/)&&(href=""),href},createBookmark:function w(){ +return this.getInstance().selection.getBookmark()},moveToBookmark:function _(e){this.getInstance().selection.moveToBookmark(e),this.getInstance().focus()},blur:function C(){this.getInstance().selection.collapse() },addUndo:function T(){this.getInstance().undoManager.add()}}},ss.editorWrappers["default"]=ss.editorWrappers.tinyMCE,_jQuery2["default"].entwine("ss",function(e){e("textarea.htmleditor").entwine({Editor:null, onadd:function t(){var e=this.data("editor")||"default",t=ss.editorWrappers[e]() @@ -1756,7 +1753,7 @@ o.length?(o.getForm().setElement(this),o.html(""),o.addClass("loading"),o.open() o.removeClass("loading")},success:function l(e){o.html(e),o.getForm().setElement(i),o.trigger("ssdialogopen")}})}}),e(".htmleditorfield-dialog").entwine({onadd:function s(){this.is(".ui-dialog-content")||this.ssdialog({ autoOpen:!0,buttons:{insert:{text:_i18n2["default"]._t("HtmlEditorField.INSERT","Insert"),"data-icon":"accept","class":"ss-ui-action-constructive media-insert",click:function t(){e(this).find("form").submit() -}}}}),this._super()},getForm:function l(){return this.find("form")},open:function u(){this.ssdialog("open")},close:function d(){this.ssdialog("close")},toggle:function c(e){this.is(":visible")?this.close():this.open() +}}}}),this._super()},getForm:function l(){return this.find("form")},open:function u(){this.ssdialog("open")},close:function c(){this.ssdialog("close")},toggle:function d(e){this.is(":visible")?this.close():this.open() },onscroll:function f(){this.animate({scrollTop:this.find("form").height()},500)}}),e("form.htmleditorfield-form").entwine({Selection:null,Bookmark:null,Element:null,setSelection:function p(t){return this._super(e(t)) @@ -1765,11 +1762,11 @@ this.getDialog().attr("title",e.text()),this._super()},onremove:function m(){thi },fromDialog:{onssdialogopen:function v(){var e=this.getEditor() this.setSelection(e.getSelectedNode()),this.setBookmark(e.createBookmark()),e.blur(),this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(":visible:enabled").eq(0).focus(),this.redraw(), -this.updateFromEditor()},onssdialogclose:function y(){var e=this.getEditor() -e.moveToBookmark(this.getBookmark()),this.setSelection(null),this.setBookmark(null),this.resetFields()}},getEditor:function b(){return this.getElement().getEditor()},modifySelection:function _(e){var t=this.getEditor() +this.updateFromEditor()},onssdialogclose:function b(){var e=this.getEditor() +e.moveToBookmark(this.getBookmark()),this.setSelection(null),this.setBookmark(null),this.resetFields()}},getEditor:function y(){return this.getElement().getEditor()},modifySelection:function w(e){var t=this.getEditor() -t.moveToBookmark(this.getBookmark()),e.call(this,t),this.setSelection(t.getSelectedNode()),this.setBookmark(t.createBookmark()),t.blur()},updateFromEditor:function w(){},redraw:function C(){},resetFields:function T(){ +t.moveToBookmark(this.getBookmark()),e.call(this,t),this.setSelection(t.getSelectedNode()),this.setBookmark(t.createBookmark()),t.blur()},updateFromEditor:function _(){},redraw:function C(){},resetFields:function T(){ this.find(".tree-holder").empty()}}),e("form.htmleditorfield-linkform").entwine({onsubmit:function E(e){return this.insertLink(),this.getDialog().close(),!1},resetFields:function P(){this._super(),this[0].reset() },redraw:function O(){this._super() @@ -1806,17 +1803,17 @@ if(o&&o.length)for(var a=0;a'+_i18n2["default"]._t("HtmlEditorField.LOOKINGFORANCHORS","Looking for anchors...")+"")),i.done(function(t){if(n.empty(),n.append(e('")), t)for(var i=0;i'+t[i]+""))}).fail(function(t){n.empty(),n.append(e('"))}),e.browser.msie&&n.hide().show() -},updateFromEditor:function A(){var e=/<\S[^><]*>/g,t,n=this.getCurrentLink() +},updateFromEditor:function F(){var e=/<\S[^><]*>/g,t,n=this.getCurrentLink() if(n)for(t in n){var i=this.find(":input[name="+t+"]"),r=n[t] "string"==typeof r&&(r=r.replace(e,"")),i.is(":checkbox")?i.prop("checked",r).change():i.is(":radio")?i.val([r]).change():"file"==t?(i=this.find(':input[name="'+t+'[Uploads][]"]'),i=i.parents(".ss-uploadfield"), function o(e,t){e.getConfig()?e.attachFiles([t]):setTimeout(function(){o(e,t)},50)}(i,r)):i.val(r).change()}},getCurrentLink:function D(){var e=this.getSelection(),t="",n="",i="",r="insert",o="",a=null @@ -1858,21 +1855,21 @@ r.replaceWith(l),n.redraw(),o.resolve(l)},error:function s(){r.remove(),o.reject e.addClass("insertingURL"),e.redraw()}}),e("form.htmleditorfield-mediaform .htmleditorfield-mediaform-heading .back-button").entwine({onclick:function X(){var e=this.closest("form") e.removeClass("insertingURL"),e.redraw()}}),e("form.htmleditorfield-mediaform .ss-gridfield-items").entwine({onselectableselected:function Q(t,n){var i=this.closest("form"),r=e(n.selected) r.is(".ss-gridfield-item")&&(i.closest("form").showFileView(r.data("id")),i.redraw(),i.parent().trigger("scroll"))},onselectableunselected:function K(t,n){var i=this.closest("form"),r=e(n.unselected) -r.is(".ss-gridfield-item")&&(i.getFileView(r.data("id")).remove(),i.redraw())}}),e("form.htmleditorfield-form.htmleditorfield-mediaform div.ss-assetuploadfield").entwine({onfileuploadstop:function Y(t){ +r.is(".ss-gridfield-item")&&(i.getFileView(r.data("id")).remove(),i.redraw())}}),e("form.htmleditorfield-form.htmleditorfield-mediaform div.ss-assetuploadfield").entwine({onfileuploadstop:function J(t){ var n=this.closest("form"),i=[] n.find("div.content-edit").find("div.ss-htmleditorfield-file").each(function(){i.push(e(this).data("id"))}) var r=e(".ss-uploadfield-files",this).children(".ss-uploadfield-item") r.each(function(){var t=e(this).data("fileid") -t&&e.inArray(t,i)==-1&&(e(this).remove(),n.showFileView(t))}),n.parent().trigger("scroll"),n.redraw()}}),e("form.htmleditorfield-form.htmleditorfield-mediaform input.remoteurl").entwine({onadd:function J(){ +t&&e.inArray(t,i)==-1&&(e(this).remove(),n.showFileView(t))}),n.parent().trigger("scroll"),n.redraw()}}),e("form.htmleditorfield-form.htmleditorfield-mediaform input.remoteurl").entwine({onadd:function Y(){ this._super(),this.validate()},onkeyup:function Z(){this.validate()},onchange:function ee(){this.validate()},getAddButton:function te(){return this.closest(".CompositeField").find("button.add-url")},validate:function ne(){ var t=this.val(),n=t return t=e.trim(t),t=t.replace(/^https?:\/\//i,""),n!==t&&this.val(t),this.getAddButton().button(t?"enable":"disable"),!!t}}),e("form.htmleditorfield-form.htmleditorfield-mediaform .add-url").entwine({ getURLField:function ie(){return this.closest(".CompositeField").find("input.remoteurl")},onclick:function re(e){var t=this.getURLField(),n=this.closest(".CompositeField"),i=this.closest("form") return t.validate()&&(n.addClass("loading"),i.showFileView("http://"+t.val()).done(function(){n.removeClass("loading"),i.parent().trigger("scroll")}),i.redraw()),!1}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file").entwine({ getAttributes:function oe(){},getExtraData:function ae(){},getHTML:function se(){return e("
").append(e("").attr({href:this.data("url")}).text(this.find(".name").text())).html()},insertHTML:function le(e){ -e.replaceContent(this.getHTML())},updateFromNode:function ue(e){},updateDimensions:function de(e,t,n){var i=this.find(":input[name=Width]"),r=this.find(":input[name=Height]"),o=i.val(),a=r.val(),s +e.replaceContent(this.getHTML())},updateFromNode:function ue(e){},updateDimensions:function ce(e,t,n){var i=this.find(":input[name=Width]"),r=this.find(":input[name=Height]"),o=i.val(),a=r.val(),s o&&a&&(e?(s=r.getOrigVal()/i.getOrigVal(),"Width"==e?(t&&o>t&&(o=t),a=Math.floor(o*s)):"Height"==e&&(n&&a>n&&(a=n),o=Math.ceil(a/s))):(t&&o>t&&(o=t),n&&a>n&&(a=n)),i.val(o),r.val(a))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.image").entwine({ -getAttributes:function ce(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() +getAttributes:function de(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() return{src:this.find(":input[name=URL]").val(),alt:this.find(":input[name=AltText]").val(),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,title:this.find(":input[name=Title]").val(),"class":this.find(":input[name=CSSClass]").val(), "data-id":this.find(":input[name=FileID]").val()}},getExtraData:function fe(){return{CaptionText:this.find(":input[name=CaptionText]").val()}},getHTML:function pe(){},insertHTML:function he(t){var n=this.closest("form"),i=n.getSelection() @@ -1886,22 +1883,22 @@ var l=s.parent(".captionImage"),u=l.find(".caption") o.CaptionText?(l.length||(l=e("
")),l.attr("class","captionImage "+r["class"]).css("width",r.width),u.length||(u=e('

').appendTo(l)),u.attr("class","caption "+r["class"]).text(o.CaptionText)):l=u=null -var d=l?l:s -a&&a.not(d).length&&a.replaceWith(d),l&&l.prepend(s),a||(t.repaint(),t.insertContent(e("
").append(d).html(),{skip_undo:1})),t.addUndo(),t.repaint()},updateFromNode:function me(e){this.find(":input[name=AltText]").val(e.attr("alt")), +var c=l?l:s +a&&a.not(c).length&&a.replaceWith(c),l&&l.prepend(s),a||(t.repaint(),t.insertContent(e("
").append(c).html(),{skip_undo:1})),t.addUndo(),t.repaint()},updateFromNode:function me(e){this.find(":input[name=AltText]").val(e.attr("alt")), this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=CSSClass]").val(e.attr("class")),this.find(":input[name=Width]").val(e.width()),this.find(":input[name=Height]").val(e.height()), this.find(":input[name=CaptionText]").val(e.siblings(".caption:first").text()),this.find(":input[name=FileID]").val(e.data("id"))}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.flash").entwine({ getAttributes:function ge(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() return{src:this.find(":input[name=URL]").val(),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,"data-fileid":this.find(":input[name=FileID]").val()}},getHTML:function ve(){var t=this.getAttributes(),n=tinyMCE.activeEditor.plugins.media.dataToImg({ type:"flash",width:t.width,height:t.height,params:{src:t.src},video:{sources:[]}}) -return e("
").append(n).html()},updateFromNode:function ye(e){}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.embed").entwine({getAttributes:function be(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() +return e("
").append(n).html()},updateFromNode:function be(e){}}),e("form.htmleditorfield-mediaform .ss-htmleditorfield-file.embed").entwine({getAttributes:function ye(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() return{src:this.find(".thumbnail-preview").attr("src"),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null,"class":this.find(":input[name=CSSClass]").val(),alt:this.find(":input[name=AltText]").val(), -title:this.find(":input[name=Title]").val(),"data-fileid":this.find(":input[name=FileID]").val()}},getExtraData:function _e(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() +title:this.find(":input[name=Title]").val(),"data-fileid":this.find(":input[name=FileID]").val()}},getExtraData:function we(){var e=this.find(":input[name=Width]").val(),t=this.find(":input[name=Height]").val() return{CaptionText:this.find(":input[name=CaptionText]").val(),Url:this.find(":input[name=URL]").val(),thumbnail:this.find(".thumbnail-preview").attr("src"),width:e?parseInt(e,10):null,height:t?parseInt(t,10):null, -cssclass:this.find(":input[name=CSSClass]").val()}},getHTML:function we(){var t,n=this.getAttributes(),i=this.getExtraData(),r=e("").attr(n).addClass("ss-htmleditorfield-file embed") +cssclass:this.find(":input[name=CSSClass]").val()}},getHTML:function _e(){var t,n=this.getAttributes(),i=this.getExtraData(),r=e("").attr(n).addClass("ss-htmleditorfield-file embed") return e.each(i,function(e,t){r.attr("data-"+e,t)}),t=i.CaptionText?e('

'+i.CaptionText+"

").prepend(r):r, e("
").append(t).html()},updateFromNode:function Ce(e){this.find(":input[name=AltText]").val(e.attr("alt")),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=Width]").val(e.width()), this.find(":input[name=Height]").val(e.height()),this.find(":input[name=Title]").val(e.attr("title")),this.find(":input[name=CSSClass]").val(e.data("cssclass")),this.find(":input[name=FileID]").val(e.data("fileid")) @@ -1922,7 +1919,7 @@ var e=this this.bind("change",function(){var t=e.closest("form").find(".grid-field") t.setState("ParentID",e.getValue()),t.reload()})}})})},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) -n(87),n(122),n(118),o["default"].entwine("ss",function(e){e(".ss-tabset").entwine({IgnoreTabState:!1,onadd:function t(){var e=window.location.hash +n(89),n(124),n(120),o["default"].entwine("ss",function(e){e(".ss-tabset").entwine({IgnoreTabState:!1,onadd:function t(){var e=window.location.hash this.redrawTabs(),""!==e&&this.openTabFromURL(e),this._super()},onremove:function n(){this.data("tabs")&&this.tabs("destroy"),this._super()},redrawTabs:function i(){this.rewriteHashlinks(),this.tabs()}, openTabFromURL:function r(t){var n e.each(this.find(".ui-tabs-anchor"),function(){if(this.href.indexOf(t)!==-1&&1===e(t).length)return n=e(this),!1}),void 0!==n&&e(document).ready("ajaxComplete",function(){n.click()})},rewriteHashlinks:function o(){ @@ -1930,21 +1927,21 @@ e(this).find("ul a").each(function(){if(e(this).attr("href")){var t=e(this).attr t&&e(this).attr("href",document.location.href.replace(/#.*/,"")+t[0])}})}}),e(".ui-tabs-active .ui-tabs-anchor").entwine({onmatch:function a(){this.addClass("nav-link active")},onunmatch:function s(){this.removeClass("active") }})})},,function(e,t,n){"use strict" -function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(94),s=i(a) -n(87),n(118),o["default"].entwine("ss",function(e){e(".grid-field").entwine({reload:function t(n,i){var r=this,o=this.closest("form"),a=this.find(":input:focus").attr("name"),l=o.find(":input").serializeArray() +function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(96),s=i(a) +n(89),n(120),o["default"].entwine("ss",function(e){e(".grid-field").entwine({reload:function t(n,i){var r=this,o=this.closest("form"),a=this.find(":input:focus").attr("name"),l=o.find(":input").serializeArray() n||(n={}),n.data||(n.data=[]),n.data=n.data.concat(l),window.location.search&&(n.data=window.location.search.replace(/^\?/,"")+"&"+e.param(n.data)),o.addClass("loading"),e.ajax(e.extend({},{headers:{"X-Pjax":"CurrentField" },type:"POST",url:this.data("url"),dataType:"html",success:function u(t){if(r.empty().append(e(t).children()),a&&r.find(':input[name="'+a+'"]').focus(),r.find(".filter-header").length){var s "show"==n.data[0].filter?(s='',r.addClass("show-filter").find(".filter-header").show()):(s='', -r.removeClass("show-filter").find(".filter-header").hide()),r.find(".sortable-header th:last").html(s)}o.removeClass("loading"),i&&i.apply(this,arguments),r.trigger("reload",r)},error:function d(e){alert(s["default"]._t("GRIDFIELD.ERRORINTRANSACTION")), +r.removeClass("show-filter").find(".filter-header").hide()),r.find(".sortable-header th:last").html(s)}o.removeClass("loading"),i&&i.apply(this,arguments),r.trigger("reload",r)},error:function c(e){alert(s["default"]._t("GRIDFIELD.ERRORINTRANSACTION")), o.removeClass("loading")}},n))},showDetailView:function n(e){window.location.href=e},getItems:function i(){return this.find(".ss-gridfield-item")},setState:function r(e,t){var n=this.getState() n[e]=t,this.find(':input[name="'+this.data("name")+'[GridState]"]').val(JSON.stringify(n))},getState:function o(){return JSON.parse(this.find(':input[name="'+this.data("name")+'[GridState]"]').val())}}), e(".grid-field *").entwine({getGridField:function a(){return this.closest(".grid-field")}}),e(".grid-field :button[name=showFilter]").entwine({onclick:function l(t){e(".filter-header").show("slow").find(":input:first").focus(), this.closest(".grid-field").addClass("show-filter"),this.parent().html(''),t.preventDefault()}}),e(".grid-field .ss-gridfield-item").entwine({onclick:function u(t){if(e(t.target).closest(".action").length)return this._super(t), !1 var n=this.find(".edit-link") -n.length&&this.getGridField().showDetailView(n.prop("href"))},onmouseover:function d(){this.find(".edit-link").length&&this.css("cursor","pointer")},onmouseout:function c(){this.css("cursor","default") +n.length&&this.getGridField().showDetailView(n.prop("href"))},onmouseover:function c(){this.find(".edit-link").length&&this.css("cursor","pointer")},onmouseout:function d(){this.css("cursor","default") }}),e(".grid-field .action:button").entwine({onclick:function f(e){var t="show" return this.button("option","disabled")?void e.preventDefault():(!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(t="hidden"),this.getGridField().reload({ @@ -1957,9 +1954,9 @@ return e.path.makeUrlAbsolute(n.data("url")+a+r,e("base").attr("href"))}}),e(".g this.toggleDisabled(),this.find('input[type="text"]').on("keyup",function(){e.toggleDisabled()})},onunmatch:function m(){this.find('input[type="text"]').off("keyup")},toggleDisabled:function g(){var e=this.find(".ss-ui-button"),t=this.find('input[type="text"]'),n=""!==t.val(),i=e.is(":disabled") ;(n&&i||!n&&!i)&&e.button("option","disabled",!i)}}),e(".grid-field .grid-field__col-compact .action.gridfield-button-delete, .cms-edit-form .btn-toolbar button.action.action-delete").entwine({onclick:function v(e){ -return confirm(s["default"]._t("TABLEFIELD.DELETECONFIRMMESSAGE"))?void this._super(e):(e.preventDefault(),!1)}}),e(".grid-field .action.gridfield-button-print").entwine({UUID:null,onmatch:function y(){ -this._super(),this.setUUID((new Date).getTime())},onunmatch:function b(){this._super()},onclick:function _(e){var t=this.actionurl() -return window.open(t),e.preventDefault(),!1}}),e(".ss-gridfield-print-iframe").entwine({onmatch:function w(){this._super(),this.hide().bind("load",function(){this.focus() +return confirm(s["default"]._t("TABLEFIELD.DELETECONFIRMMESSAGE"))?void this._super(e):(e.preventDefault(),!1)}}),e(".grid-field .action.gridfield-button-print").entwine({UUID:null,onmatch:function b(){ +this._super(),this.setUUID((new Date).getTime())},onunmatch:function y(){this._super()},onclick:function w(e){var t=this.actionurl() +return window.open(t),e.preventDefault(),!1}}),e(".ss-gridfield-print-iframe").entwine({onmatch:function _(){this._super(),this.hide().bind("load",function(){this.focus() var e=this.contentWindow||this e.print()})},onunmatch:function C(){this._super()}}),e(".grid-field .action.no-ajax").entwine({onclick:function T(e){return window.location.href=this.actionurl(),e.preventDefault(),!1}}),e(".grid-field .action-detail").entwine({ onclick:function E(){return this.getGridField().showDetailView(e(this).prop("href")),!1}}),e(".grid-field[data-selectable]").entwine({getSelectedItems:function P(){return this.find(".ss-gridfield-item.ui-selected") @@ -1982,45 +1979,45 @@ e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("s }})},select:function i(t,n){var i=e('') i.val(n.item.id),e(this).closest(".grid-field").find(".action_gridfield_relationfind").replaceWith(i) var r=e(this).closest(".grid-field").find(".action_gridfield_relationadd") -r.data("button")?r.button("enable"):r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function F(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() +r.data("button")?r.button("enable"):r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function A(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() return i.setState("GridFieldPaginator",{currentPage:n}),i.reload(),!1}}})})},function(e,t,n){"use strict" function i(e){if(e&&e.__esModule)return e var t={} if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]) -return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(){h["default"].add("config",y["default"]),h["default"].add("form",_["default"]),h["default"].add("schemas",C["default"]), -h["default"].add("records",E["default"]),h["default"].add("campaign",O["default"]),h["default"].add("breadcrumbs",k["default"]),h["default"].add("routing",j.routerReducer),R["default"].start() -var e={},t=(0,l.combineReducers)(h["default"].getAll()),n=[d["default"]],i=f["default"].get("environment"),r=f["default"].get("debugging"),o=l.applyMiddleware.apply(void 0,n),a=window.devToolsExtension +return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(){g["default"].add("config",w["default"]),g["default"].add("form",d.reducer),g["default"].add("schemas",C["default"]), +g["default"].add("records",E["default"]),g["default"].add("campaign",O["default"]),g["default"].add("breadcrumbs",k["default"]),g["default"].add("routing",f.routerReducer),x["default"].start() +var e={},t=(0,l.combineReducers)(g["default"].getAll()),n=[c["default"]],i=h["default"].get("environment"),r=h["default"].get("debugging"),o=l.applyMiddleware.apply(void 0,n),a=window.devToolsExtension "dev"===i&&r&&"function"==typeof a&&(o=(0,l.compose)(l.applyMiddleware.apply(void 0,n),a())) -var u=o(l.createStore),c=u(t,e) -c.dispatch(g.setConfig(f["default"].getAll())),window.ss=window.ss||{},window.ss.store=c -var p=new s["default"](c) -p.start(window.location.pathname)}var a=n(125),s=r(a),l=n(28),u=n(147),d=r(u),c=n(69),f=r(c),p=n(148),h=r(p),m=n(149),g=i(m),v=n(151),y=r(v),b=n(153),_=r(b),w=n(154),C=r(w),T=n(155),E=r(T),P=n(156),O=r(P),S=n(158),k=r(S),j=n(146),x=n(159),R=r(x),I=n(175),F=r(I) +var u=o(l.createStore),p=u(t,e) +p.dispatch(b.setConfig(h["default"].getAll())),window.ss=window.ss||{},window.ss.store=p +var m=new s["default"](p) +m.start(window.location.pathname)}var a=n(127),s=r(a),l=n(32),u=n(149),c=r(u),d=n(33),f=n(148),p=n(71),h=r(p),m=n(150),g=r(m),v=n(151),b=i(v),y=n(153),w=r(y),_=n(155),C=r(_),T=n(156),E=r(T),P=n(157),O=r(P),S=n(159),k=r(S),j=n(160),x=r(j),R=n(176),I=r(R),A=n(9),F=r(A) -window.onload=o},function(e,t,n){"use strict" +F["default"].polyfill(),window.onload=o},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}) var o=function(){function e(e,t){for(var n=0;n-1}).map(function(e){return""+e.value +"function"==typeof this.props.onChange&&!function(){var e=n.getValues(),i=n.props.source.filter(function(i,r){return n.getItemKey(i,r)===t.id?1===t.value:e.indexOf(""+i.value)>-1}).map(function(e){return""+e.value }) -n.props.onChange(e,{id:n.props.id,value:r})}()}},{key:"getOptionProps",value:function d(e,t){var n=this.getValues(),i=this.getItemKey(e,t) +n.props.onChange(i)}()}},{key:"getOptionProps",value:function c(e,t){var n=this.getValues(),i=this.getItemKey(e,t) return{key:i,id:i,name:this.props.name,className:this.props.itemClass,disabled:e.disabled||this.props.disabled,readOnly:this.props.readOnly,onChange:this.handleChange,value:n.indexOf(""+e.value)>-1,title:e.title, -type:"checkbox"}}},{key:"render",value:function c(){var e=this -return this.props.source?u["default"].createElement("div",null,this.props.source.map(function(t,n){return u["default"].createElement(p["default"],e.getOptionProps(t,n))})):null}}]),t}(c["default"]) +type:"checkbox"}}},{key:"render",value:function d(){var e=this +return this.props.source?u["default"].createElement("div",null,this.props.source.map(function(t,n){return u["default"].createElement(p["default"],e.getOptionProps(t,n))})):null}}]),t}(d["default"]) g.propTypes={className:u["default"].PropTypes.string,extraClass:u["default"].PropTypes.string,itemClass:u["default"].PropTypes.string,id:u["default"].PropTypes.string,name:u["default"].PropTypes.string.isRequired, source:u["default"].PropTypes.arrayOf(u["default"].PropTypes.shape({value:u["default"].PropTypes.oneOfType([u["default"].PropTypes.string,u["default"].PropTypes.number]),title:u["default"].PropTypes.any, disabled:u["default"].PropTypes.bool})),onChange:u["default"].PropTypes.func,value:u["default"].PropTypes.any,readOnly:u["default"].PropTypes.bool,disabled:u["default"].PropTypes.bool},g.defaultProps={ @@ -2183,17 +2166,17 @@ return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("funct e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{ value:!0}),t.OptionsetField=void 0 var s=function(){function e(e,t){for(var n=0;n0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0, @@ -2417,16 +2400,16 @@ var n={createFn:this.campaignAddCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0, crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(I["default"],n)))}},{key:"campaignEditCreateFn", value:function v(e,t){var n=this,i=this.props.sectionConfig.url -if("action_cancel"===t.name){var r=d({},t,{handleClick:function o(e){e.preventDefault(),n.props.router.push(i)}}) -return p["default"].createElement(e,d({key:t.id},r))}return p["default"].createElement(e,d({key:t.id},t))}},{key:"campaignAddCreateFn",value:function b(e,t){var n=this,i=this.props.sectionConfig.url -if("action_cancel"===t.name){var r=d({},t,{handleClick:function o(e){e.preventDefault(),n.props.router.push(i)}}) -return p["default"].createElement(e,d({key:t.name},r))}return p["default"].createElement(e,d({key:t.name},t))}},{key:"campaignListCreateFn",value:function _(e,t){var n=this,i=this.props.sectionConfig.url,r="set" +if("action_cancel"===t.name){var r=c({},t,{handleClick:function o(e){e.preventDefault(),n.props.router.push(i)}}) +return p["default"].createElement(e,c({key:t.id},r))}return p["default"].createElement(e,c({key:t.id},t))}},{key:"campaignAddCreateFn",value:function y(e,t){var n=this,i=this.props.sectionConfig.url +if("action_cancel"===t.name){var r=c({},t,{handleClick:function o(e){e.preventDefault(),n.props.router.push(i)}}) +return p["default"].createElement(e,c({key:t.name},r))}return p["default"].createElement(e,c({key:t.name},t))}},{key:"campaignListCreateFn",value:function w(e,t){var n=this,i=this.props.sectionConfig.url,r="set" -if("GridField"===t.component){var o=d({},t,{data:d({},t.data,{handleDrillDown:function a(e,t){n.props.router.push(i+"/"+r+"/"+t.ID+"/show")},handleEditRecord:function s(e,t){n.props.router.push(i+"/"+r+"/"+t+"/edit") +if("GridField"===t.schemaComponent){var o=c({},t,{data:c({},t.data,{handleDrillDown:function a(e,t){n.props.router.push(i+"/"+r+"/"+t.ID+"/show")},handleEditRecord:function s(e,t){n.props.router.push(i+"/"+r+"/"+t+"/edit") }})}) -return p["default"].createElement(e,d({key:o.name},o))}return p["default"].createElement(e,d({key:t.name},t))}},{key:"addCampaign",value:function w(){var e=this.getActionRoute(0,"create") +return p["default"].createElement(e,c({key:o.name},o))}return p["default"].createElement(e,c({key:t.name},t))}},{key:"addCampaign",value:function _(){var e=this.getActionRoute(0,"create") this.props.router.push(e)}},{key:"getActionRoute",value:function T(e,t){return this.props.sectionConfig.url+"/set/"+e+"/"+t}}]),t}(E["default"]) D.propTypes={breadcrumbsActions:p["default"].PropTypes.object.isRequired,campaignId:p["default"].PropTypes.string,sectionConfig:p["default"].PropTypes.object.isRequired,securityId:p["default"].PropTypes.string.isRequired, view:p["default"].PropTypes.string},t["default"]=(0,g.withRouter)((0,h.connect)(l,u)(D))},function(e,t){e.exports=BreadcrumbsActions},function(e,t){e.exports=Breadcrumb},function(e,t){e.exports=Toolbar @@ -2443,9 +2426,9 @@ e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,wri return e.records&&e.records[i]&&t.campaignId&&(n=e.records[i][parseInt(t.campaignId,10)]),{config:e.config,record:n||{},campaign:e.campaign,treeClass:i,breadcrumbs:e.breadcrumbs}}function u(e){return{breadcrumbsActions:(0, -m.bindActionCreators)(y,e),recordActions:(0,m.bindActionCreators)(_,e),campaignActions:(0,m.bindActionCreators)(C,e)}}Object.defineProperty(t,"__esModule",{value:!0}) -var d=Object.assign||function(e){for(var t=1;t1)for(var n=1;n=0)&&n(e,!r)}}),t(function(){var e=document.body,n=e.appendChild(n=document.createElement("div")) +},tabbable:function(e){var r=t.attr(e,"tabindex"),i=isNaN(r) +return(i||r>=0)&&n(e,!i)}}),t(function(){var e=document.body,n=e.appendChild(n=document.createElement("div")) n.offsetHeight,t.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===n.offsetHeight,t.support.selectstart="onselectstart"in n,e.removeChild(n).style.display="none" -}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(n,i){function r(e,n,i,r){return t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0,i&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0), -r&&(n-=parseFloat(t.css(e,"margin"+this))||0)}),n}var o="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth, +}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(n,r){function i(e,n,r,i){return t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0,r&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0), +i&&(n-=parseFloat(t.css(e,"margin"+this))||0)}),n}var o="Width"===r?["Left","Right"]:["Top","Bottom"],a=r.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth, outerHeight:t.fn.outerHeight} -t.fn["inner"+i]=function(n){return n===e?s["inner"+i].call(this):this.each(function(){t(this).css(a,r(this,n)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?s["outer"+i].call(this,e):this.each(function(){ -t(this).css(a,r(this,e,!0,n)+"px")})}}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this) +t.fn["inner"+r]=function(n){return n===e?s["inner"+r].call(this):this.each(function(){t(this).css(a,i(this,n)+"px")})},t.fn["outer"+r]=function(e,n){return"number"!=typeof e?s["outer"+r].call(this,e):this.each(function(){ +t(this).css(a,i(this,e,!0,n)+"px")})}}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this) }}(t.fn.removeData)),function(){var e=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[] t.ui.ie=!!e.length,t.ui.ie6=6===parseFloat(e[1],10)}(),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault() -})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,n,i){var r,o=t.ui[e].prototype -for(r in i)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([n,i[r]])},call:function(t,e,n){var i,r=t.plugins[e] -if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(i=0;i0||(e[i]=1,r=e[i]>0,e[i]=0,r)},isOverAxis:function(t,e,n){return t>e&&t0||(e[r]=1,i=e[r]>0,e[r]=0,i)},isOverAxis:function(t,e,n){return t>e&&t",options:{ -disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e), -this.bindings=t(),this.hoverable=t(),this.focusable=t(),i!==this&&(t.data(i,this.widgetName,this),t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy() +e?e.option(a||{})._init():t.data(this,o,new i(a,this))}),u}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{ +disabled:!1,create:null},_createWidget:function(e,r){r=t(r||this.defaultElement||this)[0],this.element=t(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e), +this.bindings=t(),this.hoverable=t(),this.focusable=t(),r!==this&&(t.data(r,this.widgetName,this),t.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy() -}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()), +}}),this.document=t(r.style?r.ownerDocument:r.document||r),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()), this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"), -this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(n,i){var r=n,o,a,s +this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(n,r){var i=n,o,a,s if(0===arguments.length)return t.widget.extend({},this.options) -if("string"==typeof n)if(r={},o=n.split("."),n=o.shift(),o.length){for(a=r[n]=t.widget.extend({},this.options[n]),s=0;s=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1, this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate), this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance },_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),function(t,e){function n(t,e,n){ -return[parseInt(t[0],10)*(h.test(t[0])?e/100:1),parseInt(t[1],10)*(h.test(t[1])?n/100:1)]}function i(e,n){return parseInt(t.css(e,n),10)||0}t.ui=t.ui||{} -var r,o=Math.max,a=Math.abs,s=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\+\-]\d+%?/,d=/^\w+/,h=/%$/,p=t.fn.position -t.position={scrollbarWidth:function(){if(r!==e)return r -var n,i,o=t("
"),a=o.children()[0] -return t("body").append(o),n=a.offsetWidth,o.css("overflow","scroll"),i=a.offsetWidth,n===i&&(i=o[0].clientWidth),o.remove(),r=n-i},getScrollInfo:function(e){var n=e.isWindow?"":e.element.css("overflow-x"),i=e.isWindow?"":e.element.css("overflow-y"),r="scroll"===n||"auto"===n&&e.width
"),a=o.children()[0] +return t("body").append(o),n=a.offsetWidth,o.css("overflow","scroll"),r=a.offsetWidth,n===r&&(r=o[0].clientWidth),o.remove(),i=n-r},getScrollInfo:function(e){var n=e.isWindow?"":e.element.css("overflow-x"),r=e.isWindow?"":e.element.css("overflow-y"),i="scroll"===n||"auto"===n&&e.width0?"right":"center",vertical:s<0?"top":r>0?"bottom":"middle"} -ho(a(r),a(s))?l.important="horizontal":l.important="vertical",e.using.call(this,t,l)}),c.offset(t.extend(T,{using:u -}))})},t.ui.position={fit:{left:function(t,e){var n=e.within,i=n.isWindow?n.scrollLeft:n.offset.left,r=n.width,a=t.left-e.collisionPosition.marginLeft,s=i-a,l=a+e.collisionWidth-r-i,u -e.collisionWidth>r?s>0&&l<=0?(u=t.left+s+e.collisionWidth-r-i,t.left+=s-u):l>0&&s<=0?t.left=i:s>l?t.left=i+r-e.collisionWidth:t.left=i:s>0?t.left+=s:l>0?t.left-=l:t.left=o(t.left-a,t.left)},top:function(t,e){ -var n=e.within,i=n.isWindow?n.scrollTop:n.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,s=i-a,l=a+e.collisionHeight-r-i,u -e.collisionHeight>r?s>0&&l<=0?(u=t.top+s+e.collisionHeight-r-i,t.top+=s-u):l>0&&s<=0?t.top=i:s>l?t.top=i+r-e.collisionHeight:t.top=i:s>0?t.top+=s:l>0?t.top-=l:t.top=o(t.top-a,t.top)}},flip:{left:function(t,e){ -var n=e.within,i=n.offset.left+n.scrollLeft,r=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,s=t.left-e.collisionPosition.marginLeft,l=s-o,u=s+e.collisionWidth-r-o,c="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0],p,f +l={marginLeft:b,marginTop:k},t.each(["left","top"],function(n,r){t.ui.position[x[n]]&&t.ui.position[x[n]][r](T,{targetWidth:f,targetHeight:h,elemWidth:d,elemHeight:p,collisionPosition:l,collisionWidth:C, +collisionHeight:j,offset:[i[0]+E[0],i[1]+E[1]],my:e.my,at:e.at,within:y,elem:c})}),t.fn.bgiframe&&c.bgiframe(),e.using&&(u=function(t){var n=m.left-T.left,r=n+f-d,i=m.top-T.top,s=i+h-p,l={target:{element:g, +left:m.left,top:m.top,width:f,height:h},element:{element:c,left:T.left,top:T.top,width:d,height:p},horizontal:r<0?"left":n>0?"right":"center",vertical:s<0?"top":i>0?"bottom":"middle"} +fo(a(i),a(s))?l.important="horizontal":l.important="vertical",e.using.call(this,t,l)}),c.offset(t.extend(T,{using:u +}))})},t.ui.position={fit:{left:function(t,e){var n=e.within,r=n.isWindow?n.scrollLeft:n.offset.left,i=n.width,a=t.left-e.collisionPosition.marginLeft,s=r-a,l=a+e.collisionWidth-i-r,u +e.collisionWidth>i?s>0&&l<=0?(u=t.left+s+e.collisionWidth-i-r,t.left+=s-u):l>0&&s<=0?t.left=r:s>l?t.left=r+i-e.collisionWidth:t.left=r:s>0?t.left+=s:l>0?t.left-=l:t.left=o(t.left-a,t.left)},top:function(t,e){ +var n=e.within,r=n.isWindow?n.scrollTop:n.offset.top,i=e.within.height,a=t.top-e.collisionPosition.marginTop,s=r-a,l=a+e.collisionHeight-i-r,u +e.collisionHeight>i?s>0&&l<=0?(u=t.top+s+e.collisionHeight-i-r,t.top+=s-u):l>0&&s<=0?t.top=r:s>l?t.top=r+i-e.collisionHeight:t.top=r:s>0?t.top+=s:l>0?t.top-=l:t.top=o(t.top-a,t.top)}},flip:{left:function(t,e){ +var n=e.within,r=n.offset.left+n.scrollLeft,i=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,s=t.left-e.collisionPosition.marginLeft,l=s-o,u=s+e.collisionWidth-i-o,c="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0],p,h -l<0?(p=t.left+c+d+h+e.collisionWidth-r-i,(p<0||p0&&(f=t.left-e.collisionPosition.marginLeft+c+d+h-o,(f>0||a(f)0&&(h=t.left-e.collisionPosition.marginLeft+c+d+f-o,(h>0||a(h)l&&(m<0||m0&&(f=t.top-e.collisionPosition.marginTop+d+h+p-o,t.top+d+h+p>u&&(f>0||a(f)l&&(m<0||m0&&(h=t.top-e.collisionPosition.marginTop+d+f+p-o,t.top+d+f+p>u&&(h>0||a(h)10&&r<11,e.innerHTML="", +var e,n,r,i,o,a=document.getElementsByTagName("body")[0],s=document.createElement("div") +e=document.createElement(a?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"}) +for(o in r)e.style[o]=r[o] +e.appendChild(s),n=a||document.documentElement,n.insertBefore(e,n.firstChild),s.style.cssText="position: absolute; left: 10.7432222px;",i=t(s).offset().left,t.support.offsetFractions=i>10&&i<11,e.innerHTML="", n.removeChild(e)}(),t.uiBackCompat!==!1&&!function(t){var n=t.fn.position -t.fn.position=function(i){if(!i||!i.offset)return n.call(this,i) -var r=i.offset.split(" "),o=i.at.split(" ") -return 1===r.length&&(r[1]=r[0]),/^\d/.test(r[0])&&(r[0]="+"+r[0]),/^\d/.test(r[1])&&(r[1]="+"+r[1]),1===o.length&&(/left|center|right/.test(o[0])?o[1]="center":(o[1]=o[0],o[0]="center")),n.call(this,t.extend(i,{ -at:o[0]+r[0]+" "+o[1]+r[1],offset:e}))}}(jQuery)}(jQuery),function(t,e){var n=0,i={},r={} -i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.9.2", +t.fn.position=function(r){if(!r||!r.offset)return n.call(this,r) +var i=r.offset.split(" "),o=r.at.split(" ") +return 1===i.length&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),1===o.length&&(/left|center|right/.test(o[0])?o[1]="center":(o[1]=o[0],o[0]="center")),n.call(this,t.extend(r,{ +at:o[0]+i[0]+" "+o[1]+i[1],offset:e}))}}(jQuery)}(jQuery),function(t,e){var n=0,r={},i={} +r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.9.2", options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null, -beforeActivate:null},_create:function(){var e=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),i=this.options -this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(i.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"), -this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),i.collapsible||i.active!==!1&&null!=i.active||(i.active=0), -i.active<0&&(i.active+=this.headers.length),this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(), -this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var i=t(this),r=i.attr("id"),o=i.next(),a=o.attr("id") -r||(r=e+"-header-"+n,i.attr("id",r)),a||(a=e+"-panel-"+n,o.attr("id",a)),i.attr("aria-controls",a),o.attr("aria-labelledby",r)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false", +beforeActivate:null},_create:function(){var e=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options +this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"), +this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),r.collapsible||r.active!==!1&&null!=r.active||(r.active=0), +r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(), +this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=t(this),i=r.attr("id"),o=r.next(),a=o.attr("id") +i||(i=e+"-header-"+n,r.attr("id",i)),a||(a=e+"-panel-"+n,o.attr("id",a)),r.attr("aria-controls",a),o.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false", tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false" -}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(i.event)},_getCreateEventData:function(){return{ +}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{ header:this.active,content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons")) @@ -200,47 +201,47 @@ this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("r /^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?void this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event), this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void("disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e))) -},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var n=t.ui.keyCode,i=this.headers.length,r=this.headers.index(e.target),o=!1 -switch(e.keyCode){case n.RIGHT:case n.DOWN:o=this.headers[(r+1)%i] +},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var n=t.ui.keyCode,r=this.headers.length,i=this.headers.index(e.target),o=!1 +switch(e.keyCode){case n.RIGHT:case n.DOWN:o=this.headers[(i+1)%r] break -case n.LEFT:case n.UP:o=this.headers[(r-1+i)%i] +case n.LEFT:case n.UP:o=this.headers[(i-1+r)%r] break case n.SPACE:case n.ENTER:this._eventHandler(e) break case n.HOME:o=this.headers[0] break -case n.END:o=this.headers[i-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus() +case n.END:o=this.headers[r-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus() -},refresh:function(){var e,n,i=this.options.heightStyle,r=this.element.parent() -"fill"===i?(t.support.minHeight||(n=r.css("overflow"),r.css("overflow","hidden")),e=r.height(),this.element.siblings(":visible").each(function(){var n=t(this),i=n.css("position") -"absolute"!==i&&"fixed"!==i&&(e-=n.outerHeight(!0))}),n&&r.css("overflow",n),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height())) +},refresh:function(){var e,n,r=this.options.heightStyle,i=this.element.parent() +"fill"===r?(t.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),e=i.height(),this.element.siblings(":visible").each(function(){var n=t(this),r=n.css("position") +"absolute"!==r&&"fixed"!==r&&(e-=n.outerHeight(!0))}),n&&i.css("overflow",n),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height())) -}).css("overflow","auto")):"auto"===i&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var n=this._findActive(e)[0] +}).css("overflow","auto")):"auto"===r&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var n=this._findActive(e)[0] n!==this.active[0]&&(n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){ var n={} -e&&(t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._on(this.headers,n))},_eventHandler:function(e){var n=this.options,i=this.active,r=t(e.currentTarget),o=r[0]===i[0],a=o&&n.collapsible,s=a?t():r.next(),l=i.next(),u={ -oldHeader:i,oldPanel:l,newHeader:a?t():r,newPanel:s} -e.preventDefault(),o&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=!a&&this.headers.index(r),this.active=o?t():r,this._toggle(u),i.removeClass("ui-accordion-header-active ui-state-active"), -n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),o||(r.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"), -n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),r.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var n=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel +e&&(t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._on(this.headers,n))},_eventHandler:function(e){var n=this.options,r=this.active,i=t(e.currentTarget),o=i[0]===r[0],a=o&&n.collapsible,s=a?t():i.next(),l=r.next(),u={ +oldHeader:r,oldPanel:l,newHeader:a?t():i,newPanel:s} +e.preventDefault(),o&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=!a&&this.headers.index(i),this.active=o?t():i,this._toggle(u),r.removeClass("ui-accordion-header-active ui-state-active"), +n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),o||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"), +n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var n=e.newPanel,r=this.prevShow.length?this.prevShow:e.oldPanel -this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=i,this.options.animate?this._animate(n,i,e):(i.hide(),n.show(),this._toggleComplete(e)),i.attr({"aria-expanded":"false","aria-hidden":"true" -}),i.prev().attr("aria-selected","false"),n.length&&i.length?i.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),n.attr({"aria-expanded":"true", -"aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var o,a,s,l=this,u=0,c=t.length&&(!e.length||t.index()",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null, -close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,n,i +close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,n,r this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"), -this._on(this.element,{keydown:function(r){if(this.element.prop("readOnly"))return e=!0,i=!0,void(n=!0) -e=!1,i=!1,n=!1 +this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly"))return e=!0,r=!0,void(n=!0) +e=!1,r=!1,n=!1 var o=t.ui.keyCode -switch(r.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",r) +switch(i.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",i) break -case o.PAGE_DOWN:e=!0,this._move("nextPage",r) +case o.PAGE_DOWN:e=!0,this._move("nextPage",i) break -case o.UP:e=!0,this._keyEvent("previous",r) +case o.UP:e=!0,this._keyEvent("previous",i) break -case o.DOWN:e=!0,this._keyEvent("next",r) +case o.DOWN:e=!0,this._keyEvent("next",i) break -case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,r.preventDefault(),this.menu.select(r)) +case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,i.preventDefault(),this.menu.select(i)) break -case o.TAB:this.menu.active&&this.menu.select(r) +case o.TAB:this.menu.active&&this.menu.select(i) break -case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(r),r.preventDefault()) +case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault()) break -default:n=!0,this._searchTimeout(r)}},keypress:function(i){if(e)return e=!1,void i.preventDefault() -if(!n){var r=t.ui.keyCode -switch(i.keyCode){case r.PAGE_UP:this._move("previousPage",i) +default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(e)return e=!1,void r.preventDefault() +if(!n){var i=t.ui.keyCode +switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r) break -case r.PAGE_DOWN:this._move("nextPage",i) +case i.PAGE_DOWN:this._move("nextPage",r) break -case r.UP:this._keyEvent("previous",i) +case i.UP:this._keyEvent("previous",r) break -case r.DOWN:this._keyEvent("next",i)}}},input:function(t){return i?(i=!1,void t.preventDefault()):void this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){ +case i.DOWN:this._keyEvent("next",r)}}},input:function(t){return r?(r=!1,void t.preventDefault()):void this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){ return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),void this._change(t))}}),this._initSource(),this.menu=t("
"+(a[0]>0&&H==a[1]-1?'
':""):""),F+=W +G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}W+=Z+""}p++,p>11&&(p=0,h++),W+=""+(u?"
"+(a[0]>0&&H==a[1]-1?'
':""):""),F+=W -}R+=F}return R+=k+($.ui.ie6&&!t.inline?'':""),t._keyEvent=!1,R},_generateMonthYearHeader:function(t,e,n,i,r,o,a,s){var l=this._get(t,"changeMonth"),u=this._get(t,"changeYear"),c=this._get(t,"showMonthAfterYear"),d='
',h="" +}R+=F}return R+=k+($.ui.ie6&&!t.inline?'':""),t._keyEvent=!1,R},_generateMonthYearHeader:function(t,e,n,r,i,o,a,s){var l=this._get(t,"changeMonth"),u=this._get(t,"changeYear"),c=this._get(t,"showMonthAfterYear"),d='
',f="" -if(o||!l)h+=''+a[e]+"" -else{var p=i&&i.getFullYear()==n,f=r&&r.getFullYear()==n -h+='"}if(c||(d+=h+(!o&&l&&u?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!u)d+=''+n+"" -else{var g=this._get(t,"yearRange").split(":"),v=(new Date).getFullYear(),y=function(t){var e=t.match(/c[+-].*/)?n+parseInt(t.substring(1),10):t.match(/[+-].*/)?v+parseInt(t,10):parseInt(t,10) -return isNaN(e)?v:e},_=y(g[0]),b=Math.max(_,y(g[1]||"")) -for(_=i?Math.max(_,i.getFullYear()):_,b=r?Math.min(b,r.getFullYear()):b,t.yearshtml+='' +for(var m=0;m<12;m++)(!p||m>=r.getMonth())&&(!h||m<=i.getMonth())&&(f+='") +f+=""}if(c||(d+=f+(!o&&l&&u?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!u)d+=''+n+"" +else{var v=this._get(t,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(t){var e=t.match(/c[+-].*/)?n+parseInt(t.substring(1),10):t.match(/[+-].*/)?g+parseInt(t,10):parseInt(t,10) +return isNaN(e)?g:e},_=y(v[0]),b=Math.max(_,y(v[1]||"")) +for(_=r?Math.max(_,r.getFullYear()):_,b=i?Math.min(b,i.getFullYear()):b,t.yearshtml+='",d+=t.yearshtml,t.yearshtml=null}return d+=this._get(t,"yearSuffix"),c&&(d+=(!o&&l&&u?"":" ")+h),d+="
"},_adjustInstDate:function(t,e,n){var i=t.drawYear+("Y"==n?e:0),r=t.drawMonth+("M"==n?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(i,r))+("D"==n?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(i,r,o))) +t.yearshtml+="",d+=t.yearshtml,t.yearshtml=null}return d+=this._get(t,"yearSuffix"),c&&(d+=(!o&&l&&u?"":" ")+f),d+="
"},_adjustInstDate:function(t,e,n){var r=t.drawYear+("Y"==n?e:0),i=t.drawMonth+("M"==n?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(r,i))+("D"==n?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(r,i,o))) -t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!=n&&"Y"!=n||this._notifyChange(t)},_restrictMinMax:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max"),r=n&&ei?i:r},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear") +return i=r&&i>r?r:i},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear") e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths") return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate() -},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,i){var r=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(n,i+(e<0?e:r[0]*r[1]),1)) -return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max") -return(!n||e.getTime()>=n.getTime())&&(!i||e.getTime()<=i.getTime())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff") +},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,r){var i=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(n,r+(e<0?e:i[0]*i[1]),1)) +return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var n=this._getMinMaxDate(t,"min"),r=this._getMinMaxDate(t,"max") +return(!n||e.getTime()>=n.getTime())&&(!r||e.getTime()<=r.getTime())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff") return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"), -monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,i){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear) -var r=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(i,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay)) -return this.formatDate(this._get(t,"dateFormat"),r,this._getFormatConfig(t))}}),$.fn.datepicker=function(t){if(!this.length)return this +monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,r){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear) +var i=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(r,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay)) +return this.formatDate(this._get(t,"dateFormat"),i,this._getFormatConfig(t))}}),$.fn.datepicker=function(t){if(!this.length)return this $.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0) var e=Array.prototype.slice.call(arguments,1) return"string"!=typeof t||"isDisabled"!=t&&"getDate"!=t&&"widget"!=t?"option"==t&&2==arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e)):this.each(function(){ "string"==typeof t?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this].concat(e)):$.datepicker._attachDatepicker(this,t)}):$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e)) -},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(t,e){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",i={ -buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},r={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0} +},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(t,e){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={ +buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0} t.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150, modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var n=t(this).css(e).offset().top n<0&&t(this).css("top",e.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),"string"!=typeof this.originalTitle&&(this.originalTitle=""), this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle -var e=this,i=this.options,r=i.title||" ",o,a,s,l,u -o=(this.uiDialog=t("
")).addClass(n+i.dialogClass).css({display:"none",outline:0,zIndex:i.zIndex}).attr("tabIndex",-1).keydown(function(n){i.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===t.ui.keyCode.ESCAPE&&(e.close(n), +var e=this,r=this.options,i=r.title||" ",o,a,s,l,u +o=(this.uiDialog=t("
")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===t.ui.keyCode.ESCAPE&&(e.close(n), n.preventDefault())}).mousedown(function(t){e.moveToTop(!1,t)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(o),a=(this.uiDialogTitlebar=t("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){ -o.focus()}).prependTo(o),s=t("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(t){t.preventDefault(),e.close(t)}).appendTo(a),(this.uiDialogTitlebarCloseText=t("")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(s), -l=t("").uniqueId().addClass("ui-dialog-title").html(r).prependTo(a),u=(this.uiDialogButtonPane=t("
")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=t("
")).addClass("ui-dialog-buttonset").appendTo(u), -o.attr({role:"dialog","aria-labelledby":l.attr("id")}),a.find("*").add(a).disableSelection(),this._hoverable(s),this._focusable(s),i.draggable&&t.fn.draggable&&this._makeDraggable(),i.resizable&&t.fn.resizable&&this._makeResizable(), -this._createButtons(i.buttons),this._isOpen=!1,t.fn.bgiframe&&o.bgiframe(),this._on(o,{keydown:function(e){if(i.modal&&e.keyCode===t.ui.keyCode.TAB){var n=t(":tabbable",o),r=n.filter(":first"),a=n.filter(":last") +o.focus()}).prependTo(o),s=t("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(t){t.preventDefault(),e.close(t)}).appendTo(a),(this.uiDialogTitlebarCloseText=t("")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(s), +l=t("").uniqueId().addClass("ui-dialog-title").html(i).prependTo(a),u=(this.uiDialogButtonPane=t("
")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=t("
")).addClass("ui-dialog-buttonset").appendTo(u), +o.attr({role:"dialog","aria-labelledby":l.attr("id")}),a.find("*").add(a).disableSelection(),this._hoverable(s),this._focusable(s),r.draggable&&t.fn.draggable&&this._makeDraggable(),r.resizable&&t.fn.resizable&&this._makeResizable(), +this._createButtons(r.buttons),this._isOpen=!1,t.fn.bgiframe&&o.bgiframe(),this._on(o,{keydown:function(e){if(r.modal&&e.keyCode===t.ui.keyCode.TAB){var n=t(":tabbable",o),i=n.filter(":first"),a=n.filter(":last") -return e.target!==a[0]||e.shiftKey?e.target===r[0]&&e.shiftKey?(a.focus(1),!1):void 0:(r.focus(1),!1)}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var t,e=this.oldPosition +return e.target!==a[0]||e.shiftKey?e.target===i[0]&&e.shiftKey?(a.focus(1),!1):void 0:(i.focus(1),!1)}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var t,e=this.oldPosition this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle), -t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(e){var n=this,i,r +t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(e){var n=this,r,i if(this._isOpen&&!1!==this._trigger("beforeClose",e))return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",e) -}):(this.uiDialog.hide(),this._trigger("close",e)),t.ui.dialog.overlay.resize(),this.options.modal&&(i=0,t(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(r=t(this).css("z-index"),isNaN(r)||(i=Math.max(i,r))) +}):(this.uiDialog.hide(),this._trigger("close",e)),t.ui.dialog.overlay.resize(),this.options.modal&&(r=0,t(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=t(this).css("z-index"),isNaN(i)||(r=Math.max(r,i))) -}),t.ui.dialog.maxZ=i),this},isOpen:function(){return this._isOpen},moveToTop:function(e,n){var i=this.options,r -return i.modal&&!e||!i.stack&&!i.modal?this._trigger("focus",n):(i.zIndex>t.ui.dialog.maxZ&&(t.ui.dialog.maxZ=i.zIndex),this.overlay&&(t.ui.dialog.maxZ+=1,t.ui.dialog.overlay.maxZ=t.ui.dialog.maxZ,this.overlay.$el.css("z-index",t.ui.dialog.overlay.maxZ)), -r={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},t.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",t.ui.dialog.maxZ),this.element.attr(r),this._trigger("focus",n),this)},open:function(){ -if(!this._isOpen){var e,n=this.options,i=this.uiDialog -return this._size(),this._position(n.position),i.show(n.show),this.overlay=n.modal?new t.ui.dialog.overlay(this):null,this.moveToTop(!0),e=this.element.find(":tabbable"),e.length||(e=this.uiDialogButtonPane.find(":tabbable"), -e.length||(e=i)),e.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this}},_createButtons:function(e){var n=this,i=!1 -this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),"object"==typeof e&&null!==e&&t.each(e,function(){return!(i=!0)}),i?(t.each(e,function(e,i){var r,o -i=t.isFunction(i)?{click:i,text:e}:i,i=t.extend({type:"button"},i),o=i.click,i.click=function(){o.apply(n.element[0],arguments)},r=t("",i).appendTo(n.uiButtonSet),t.fn.button&&r.button() +}),t.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(e,n){var r=this.options,i +return r.modal&&!e||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>t.ui.dialog.maxZ&&(t.ui.dialog.maxZ=r.zIndex),this.overlay&&(t.ui.dialog.maxZ+=1,t.ui.dialog.overlay.maxZ=t.ui.dialog.maxZ,this.overlay.$el.css("z-index",t.ui.dialog.overlay.maxZ)), +i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},t.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",t.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){ +if(!this._isOpen){var e,n=this.options,r=this.uiDialog +return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new t.ui.dialog.overlay(this):null,this.moveToTop(!0),e=this.element.find(":tabbable"),e.length||(e=this.uiDialogButtonPane.find(":tabbable"), +e.length||(e=r)),e.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this}},_createButtons:function(e){var n=this,r=!1 +this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),"object"==typeof e&&null!==e&&t.each(e,function(){return!(r=!0)}),r?(t.each(e,function(e,r){var i,o +r=t.isFunction(r)?{click:r,text:e}:r,r=t.extend({type:"button"},r),o=r.click,r.click=function(){o.apply(n.element[0],arguments)},i=t("",r).appendTo(n.uiButtonSet),t.fn.button&&i.button() }),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function e(t){return{position:t.position, -offset:t.offset}}var n=this,i=this.options -this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,r){t(this).addClass("ui-dialog-dragging"),n._trigger("dragStart",i,e(r)) +offset:t.offset}}var n=this,r=this.options +this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,i){t(this).addClass("ui-dialog-dragging"),n._trigger("dragStart",r,e(i)) -},drag:function(t,i){n._trigger("drag",t,e(i))},stop:function(r,o){i.position=[o.position.left-n.document.scrollLeft(),o.position.top-n.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),n._trigger("dragStop",r,e(o)), -t.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function i(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}n=n===e?this.options.resizable:n +},drag:function(t,r){n._trigger("drag",t,e(r))},stop:function(i,o){r.position=[o.position.left-n.document.scrollLeft(),o.position.top-n.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),n._trigger("dragStop",i,e(o)), +t.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function r(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}n=n===e?this.options.resizable:n -var r=this,o=this.options,a=this.uiDialog.css("position"),s="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw" +var i=this,o=this.options,a=this.uiDialog.css("position"),s="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw" this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:s,start:function(e,n){ -t(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",e,i(n))},resize:function(t,e){r._trigger("resize",t,i(e))},stop:function(e,n){t(this).removeClass("ui-dialog-resizing"),o.height=t(this).height(), -o.width=t(this).width(),r._trigger("resizeStop",e,i(n)),t.ui.dialog.overlay.resize()}}).css("position",a).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var t=this.options +t(this).addClass("ui-dialog-resizing"),i._trigger("resizeStart",e,r(n))},resize:function(t,e){i._trigger("resize",t,r(e))},stop:function(e,n){t(this).removeClass("ui-dialog-resizing"),o.height=t(this).height(), +o.width=t(this).width(),i._trigger("resizeStop",e,r(n)),t.ui.dialog.overlay.resize()}}).css("position",a).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var t=this.options -return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(e){var n=[],i=[0,0],r -e?(("string"==typeof e||"object"==typeof e&&"0"in e)&&(n=e.split?e.split(" "):[e[0],e[1]],1===n.length&&(n[1]=n[0]),t.each(["left","top"],function(t,e){+n[t]===n[t]&&(i[t]=n[t],n[t]=e)}),e={my:n[0]+(i[0]<0?i[0]:"+"+i[0])+" "+n[1]+(i[1]<0?i[1]:"+"+i[1]), -at:n.join(" ")}),e=t.extend({},t.ui.dialog.prototype.options.position,e)):e=t.ui.dialog.prototype.options.position,r=this.uiDialog.is(":visible"),r||this.uiDialog.show(),this.uiDialog.position(e),r||this.uiDialog.hide() +return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(e){var n=[],r=[0,0],i +e?(("string"==typeof e||"object"==typeof e&&"0"in e)&&(n=e.split?e.split(" "):[e[0],e[1]],1===n.length&&(n[1]=n[0]),t.each(["left","top"],function(t,e){+n[t]===n[t]&&(r[t]=n[t],n[t]=e)}),e={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]), +at:n.join(" ")}),e=t.extend({},t.ui.dialog.prototype.options.position,e)):e=t.ui.dialog.prototype.options.position,i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(e),i||this.uiDialog.hide() },_setOptions:function(e){var n=this,o={},a=!1 -t.each(e,function(t,e){n._setOption(t,e),t in i&&(a=!0),t in r&&(o[t]=e)}),a&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,i){var r,o,a=this.uiDialog +t.each(e,function(t,e){n._setOption(t,e),t in r&&(a=!0),t in i&&(o[t]=e)}),a&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,r){var i,o,a=this.uiDialog -switch(e){case"buttons":this._createButtons(i) +switch(e){case"buttons":this._createButtons(r) break -case"closeText":this.uiDialogTitlebarCloseText.text(""+i) +case"closeText":this.uiDialogTitlebarCloseText.text(""+r) break -case"dialogClass":a.removeClass(this.options.dialogClass).addClass(n+i) +case"dialogClass":a.removeClass(this.options.dialogClass).addClass(n+r) break -case"disabled":i?a.addClass("ui-dialog-disabled"):a.removeClass("ui-dialog-disabled") +case"disabled":r?a.addClass("ui-dialog-disabled"):a.removeClass("ui-dialog-disabled") break -case"draggable":r=a.is(":data(draggable)"),r&&!i&&a.draggable("destroy"),!r&&i&&this._makeDraggable() +case"draggable":i=a.is(":data(draggable)"),i&&!r&&a.draggable("destroy"),!i&&r&&this._makeDraggable() break -case"position":this._position(i) +case"position":this._position(r) break -case"resizable":o=a.is(":data(resizable)"),o&&!i&&a.resizable("destroy"),o&&"string"==typeof i&&a.resizable("option","handles",i),o||i===!1||this._makeResizable(i) +case"resizable":o=a.is(":data(resizable)"),o&&!r&&a.resizable("destroy"),o&&"string"==typeof r&&a.resizable("option","handles",r),o||r===!1||this._makeResizable(r) break -case"title":t(".ui-dialog-title",this.uiDialogTitlebar).html(""+(i||" "))}this._super(e,i)},_size:function(){var e,n,i,r=this.options,o=this.uiDialog.is(":visible") -this.element.show().css({width:"auto",minHeight:0,height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),n=Math.max(0,r.minHeight-e),"auto"===r.height?t.support.minHeight?this.element.css({ -minHeight:n,height:"auto"}):(this.uiDialog.show(),i=this.element.css("height","auto").height(),o||this.uiDialog.hide(),this.element.height(Math.max(i,n))):this.element.height(Math.max(r.height-e,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight()) +case"title":t(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(e,r)},_size:function(){var e,n,r,i=this.options,o=this.uiDialog.is(":visible") +this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),e=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-e),"auto"===i.height?t.support.minHeight?this.element.css({ +minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),o||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-e,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight()) }}),t.extend(t.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(t){var e=t.attr("id") return e||(this.uuid+=1,e=this.uuid),"ui-dialog-title-"+e},overlay:function(e){this.$el=t.ui.dialog.overlay.create(e)}}),t.extend(t.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:t.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(t){ return t+".dialog-overlay"}).join(" "),create:function(e){0===this.instances.length&&(setTimeout(function(){t.ui.dialog.overlay.instances.length&&t(document).bind(t.ui.dialog.overlay.events,function(e){ if(t(e.target).zIndex()").addClass("ui-widget-overlay") -return t(document).bind("keydown.dialog-overlay",function(i){var r=t.ui.dialog.overlay.instances -0!==r.length&&r[r.length-1]===n&&e.options.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===t.ui.keyCode.ESCAPE&&(e.close(i),i.preventDefault())}),n.appendTo(document.body).css({width:this.width(), -height:this.height()}),t.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(e){var n=t.inArray(e,this.instances),i=0 -n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),0===this.instances.length&&t([document,window]).unbind(".dialog-overlay"),e.height(0).width(0).remove(),t.each(this.instances,function(){i=Math.max(i,this.css("z-index")) +return t(document).bind("keydown.dialog-overlay",function(r){var i=t.ui.dialog.overlay.instances +0!==i.length&&i[i.length-1]===n&&e.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===t.ui.keyCode.ESCAPE&&(e.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(), +height:this.height()}),t.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(e){var n=t.inArray(e,this.instances),r=0 +n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),0===this.instances.length&&t([document,window]).unbind(".dialog-overlay"),e.height(0).width(0).remove(),t.each(this.instances,function(){r=Math.max(r,this.css("z-index")) -}),this.maxZ=i},height:function(){var e,n +}),this.maxZ=r},height:function(){var e,n return t.ui.ie?(e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),es[3]&&(a=s[3]+this.offset.click.top)}if(n.grid){var u=n.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY a=s&&(u-this.offset.click.tops[3])?u-this.offset.click.tops[2])?c-this.offset.click.lefts[2])?c-this.offset.click.left=0;c--){ -var d=i.snapElements[c].left,h=d+i.snapElements[c].width,p=i.snapElements[c].top,f=p+i.snapElements[c].height -if(d-o=0;c--){ +var d=r.snapElements[c].left,f=d+r.snapElements[c].width,p=r.snapElements[c].top,h=p+r.snapElements[c].height +if(d-o=c&&a<=d||s>=c&&s<=d||ad)&&(r>=l&&r<=u||o>=l&&o<=u||ru) -default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,n){var i=t.ui.ddmanager.droppables[e.options.scope]||[],r=n?n.type:null,o=(e.currentItem||e.element).find(":data(droppable)").andSelf() +return h +case"touch":return(a>=c&&a<=d||s>=c&&s<=d||ad)&&(i>=l&&i<=u||o>=l&&o<=u||iu) +default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,n){var r=t.ui.ddmanager.droppables[e.options.scope]||[],i=n?n.type:null,o=(e.currentItem||e.element).find(":data(droppable)").andSelf() -t:for(var a=0;at?0:i.maxt?0:r.max")[0],f,m=e.each -p.style.cssText="background-color:rgba(1,1,1,.5)",h.rgba=p.style.backgroundColor.indexOf("rgba")>-1,m(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),u.fn=e.extend(u.prototype,{ +}},f=u.support={},p=e("

")[0],h,m=e.each +p.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=p.style.backgroundColor.indexOf("rgba")>-1,m(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),u.fn=e.extend(u.prototype,{ parse:function(o,a,s,l){if(o===n)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=e(o).css(a),a=n) -var d=this,h=e.type(o),p=this._rgba=[] -return a!==n&&(o=[o,a,s,l],h="array"),"string"===h?this.parse(r(o)||f._default):"array"===h?(m(c.rgba.props,function(t,e){p[e.idx]=i(o[e.idx],e)}),this):"object"===h?(o instanceof u?m(c,function(t,e){o[e.cache]&&(d[e.cache]=o[e.cache].slice()) +var d=this,f=e.type(o),p=this._rgba=[] +return a!==n&&(o=[o,a,s,l],f="array"),"string"===f?this.parse(i(o)||h._default):"array"===f?(m(c.rgba.props,function(t,e){p[e.idx]=r(o[e.idx],e)}),this):"object"===f?(o instanceof u?m(c,function(t,e){o[e.cache]&&(d[e.cache]=o[e.cache].slice()) -}):m(c,function(e,n){var r=n.cache -m(n.props,function(t,e){if(!d[r]&&n.to){if("alpha"===t||null==o[t])return -d[r]=n.to(d._rgba)}d[r][e.idx]=i(o[t],e,!0)}),d[r]&&t.inArray(null,d[r].slice(0,3))<0&&(d[r][3]=1,n.from&&(d._rgba=n.from(d[r])))}),this):void 0},is:function(t){var e=u(t),n=!0,i=this -return m(c,function(t,r){var o,a=e[r.cache] -return a&&(o=i[r.cache]||r.to&&r.to(i._rgba)||[],m(r.props,function(t,e){if(null!=a[e.idx])return n=a[e.idx]===o[e.idx]})),n}),n},_space:function(){var t=[],e=this -return m(c,function(n,i){e[i.cache]&&t.push(n)}),t.pop()},transition:function(t,e){var n=u(t),r=n._space(),o=c[r],a=0===this.alpha()?u("transparent"):this,s=a[o.cache]||o.to(a._rgba),l=s.slice() -return n=n[o.cache],m(o.props,function(t,r){var o=r.idx,a=s[o],u=n[o],c=d[r.type]||{} -null!==u&&(null===a?l[o]=u:(c.mod&&(u-a>c.mod/2?a+=c.mod:a-u>c.mod/2&&(a-=c.mod)),l[o]=i((u-a)*e+a,r)))}),this[r](l)},blend:function(t){if(1===this._rgba[3])return this -var n=this._rgba.slice(),i=n.pop(),r=u(t)._rgba -return u(e.map(n,function(t,e){return(1-i)*r[e]+i*t}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(t,e){return null==t?e>2?1:0:t}) +}):m(c,function(e,n){var i=n.cache +m(n.props,function(t,e){if(!d[i]&&n.to){if("alpha"===t||null==o[t])return +d[i]=n.to(d._rgba)}d[i][e.idx]=r(o[t],e,!0)}),d[i]&&t.inArray(null,d[i].slice(0,3))<0&&(d[i][3]=1,n.from&&(d._rgba=n.from(d[i])))}),this):void 0},is:function(t){var e=u(t),n=!0,r=this +return m(c,function(t,i){var o,a=e[i.cache] +return a&&(o=r[i.cache]||i.to&&i.to(r._rgba)||[],m(i.props,function(t,e){if(null!=a[e.idx])return n=a[e.idx]===o[e.idx]})),n}),n},_space:function(){var t=[],e=this +return m(c,function(n,r){e[r.cache]&&t.push(n)}),t.pop()},transition:function(t,e){var n=u(t),i=n._space(),o=c[i],a=0===this.alpha()?u("transparent"):this,s=a[o.cache]||o.to(a._rgba),l=s.slice() +return n=n[o.cache],m(o.props,function(t,i){var o=i.idx,a=s[o],u=n[o],c=d[i.type]||{} +null!==u&&(null===a?l[o]=u:(c.mod&&(u-a>c.mod/2?a+=c.mod:a-u>c.mod/2&&(a-=c.mod)),l[o]=r((u-a)*e+a,i)))}),this[i](l)},blend:function(t){if(1===this._rgba[3])return this +var n=this._rgba.slice(),r=n.pop(),i=u(t)._rgba +return u(e.map(n,function(t,e){return(1-r)*i[e]+r*t}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(t,e){return null==t?e>2?1:0:t}) return 1===n[3]&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t}) -return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),i=n.pop() -return t&&n.push(~~(255*i)),"#"+e.map(n,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),u.fn.parse.prototype=u.fn, +return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),r=n.pop() +return t&&n.push(~~(255*r)),"#"+e.map(n,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),u.fn.parse.prototype=u.fn, c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]] -var e=t[0]/255,n=t[1]/255,i=t[2]/255,r=t[3],o=Math.max(e,n,i),a=Math.min(e,n,i),s=o-a,l=o+a,u=.5*l,c,d -return c=a===o?0:e===o?60*(n-i)/s+360:n===o?60*(i-e)/s+120:60*(e-n)/s+240,d=0===u||1===u?u:u<=.5?s/l:s/(2-l),[Math.round(c)%360,d,u,null==r?1:r]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]] +var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=t[3],o=Math.max(e,n,r),a=Math.min(e,n,r),s=o-a,l=o+a,u=.5*l,c,d +return c=a===o?0:e===o?60*(n-r)/s+360:n===o?60*(r-e)/s+120:60*(e-n)/s+240,d=0===u||1===u?u:u<=.5?s/l:s/(2-l),[Math.round(c)%360,d,u,null==i?1:i]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]] -var e=t[0]/360,n=t[1],i=t[2],r=t[3],a=i<=.5?i*(1+n):i+n-i*n,s=2*i-a -return[Math.round(255*o(s,a,e+1/3)),Math.round(255*o(s,a,e)),Math.round(255*o(s,a,e-1/3)),r]},m(c,function(t,r){var o=r.props,a=r.cache,l=r.to,c=r.from +var e=t[0]/360,n=t[1],r=t[2],i=t[3],a=r<=.5?r*(1+n):r+n-r*n,s=2*r-a +return[Math.round(255*o(s,a,e+1/3)),Math.round(255*o(s,a,e)),Math.round(255*o(s,a,e-1/3)),i]},m(c,function(t,i){var o=i.props,a=i.cache,l=i.to,c=i.from u.fn[t]=function(t){if(l&&!this[a]&&(this[a]=l(this._rgba)),t===n)return this[a].slice() -var r,s=e.type(t),d="array"===s||"object"===s?t:arguments,h=this[a].slice() +var i,s=e.type(t),d="array"===s||"object"===s?t:arguments,f=this[a].slice() return m(o,function(t,e){var n=d["object"===s?t:e.idx] -null==n&&(n=h[e.idx]),h[e.idx]=i(n,e)}),c?(r=u(c(h)),r[a]=h,r):u(h)},m(o,function(n,i){u.fn[n]||(u.fn[n]=function(r){var o=e.type(r),a="alpha"===n?this._hsla?"hsla":"rgba":t,l=this[a](),u=l[i.idx],c -return"undefined"===o?u:("function"===o&&(r=r.call(this,u),o=e.type(r)),null==r&&i.empty?this:("string"===o&&(c=s.exec(r),c&&(r=u+parseFloat(c[2])*("+"===c[1]?1:-1))),l[i.idx]=r,this[a](l)))})})}),m(a,function(t,n){ -e.cssHooks[n]={set:function(t,i){var o,a,s="" -if("string"!==e.type(i)||(o=r(i))){if(i=u(o||i),!h.rgba&&1!==i._rgba[3]){for(a="backgroundColor"===n?t.parentNode:t;(""===s||"transparent"===s)&&a&&a.style;)try{s=e.css(a,"backgroundColor"),a=a.parentNode +null==n&&(n=f[e.idx]),f[e.idx]=r(n,e)}),c?(i=u(c(f)),i[a]=f,i):u(f)},m(o,function(n,r){u.fn[n]||(u.fn[n]=function(i){var o=e.type(i),a="alpha"===n?this._hsla?"hsla":"rgba":t,l=this[a](),u=l[r.idx],c +return"undefined"===o?u:("function"===o&&(i=i.call(this,u),o=e.type(i)),null==i&&r.empty?this:("string"===o&&(c=s.exec(i),c&&(i=u+parseFloat(c[2])*("+"===c[1]?1:-1))),l[r.idx]=i,this[a](l)))})})}),m(a,function(t,n){ +e.cssHooks[n]={set:function(t,r){var o,a,s="" +if("string"!==e.type(r)||(o=i(r))){if(r=u(o||r),!f.rgba&&1!==r._rgba[3]){for(a="backgroundColor"===n?t.parentNode:t;(""===s||"transparent"===s)&&a&&a.style;)try{s=e.css(a,"backgroundColor"),a=a.parentNode -}catch(l){}i=i.blend(s&&"transparent"!==s?s:"_default")}i=i.toRgbaString()}try{t.style[n]=i}catch(c){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=u(t.elem,n),t.end=u(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos)) +}catch(l){}r=r.blend(s&&"transparent"!==s?s:"_default")}r=r.toRgbaString()}try{t.style[n]=r}catch(c){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=u(t.elem,n),t.end=u(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos)) }}),e.cssHooks.borderColor={expand:function(t){var e={} -return m(["Top","Right","Bottom","Left"],function(n,i){e["border"+i+"Color"]=t}),e}},f=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00", +return m(["Top","Right","Bottom","Left"],function(n,r){e["border"+r+"Color"]=t}),e}},h=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00", maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery), -function(){function n(){var e=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},i,r -if(e&&e.length&&e[0]&&e[e[0]])for(r=e.length;r--;)i=e[r],"string"==typeof e[i]&&(n[t.camelCase(i)]=e[i]) -else for(i in e)"string"==typeof e[i]&&(n[i]=e[i]) -return n}function i(e,n){var i={},r,a -for(r in n)a=n[r],e[r]!==a&&(o[r]||!t.fx.step[r]&&isNaN(parseFloat(a))||(i[r]=a)) -return i}var r=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1} +function(){function n(){var e=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i +if(e&&e.length&&e[0]&&e[e[0]])for(i=e.length;i--;)r=e[i],"string"==typeof e[r]&&(n[t.camelCase(r)]=e[r]) +else for(r in e)"string"==typeof e[r]&&(n[r]=e[r]) +return n}function r(e,n){var r={},i,a +for(i in n)a=n[i],e[i]!==a&&(o[i]||!t.fx.step[i]&&isNaN(parseFloat(a))||(r[i]=a)) +return r}var i=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1} t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,n){t.fx.step[n]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,n,t.end), t.setAttr=!0)}}),t.effects.animateClass=function(e,o,a,s){var l=t.speed(o,a,s) return this.queue(function(){var o=t(this),a=o.attr("class")||"",s,u=l.children?o.find("*").andSelf():o u=u.map(function(){var e=t(this) -return{el:e,start:n.call(this)}}),s=function(){t.each(r,function(t,n){e[n]&&o[n+"Class"](e[n])})},s(),u=u.map(function(){return this.end=n.call(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",a), -u=u.map(function(){var e=this,n=t.Deferred(),i=jQuery.extend({},l,{queue:!1,complete:function(){n.resolve(e)}}) -return this.el.animate(this.diff,i),n.promise()}),t.when.apply(t,u.get()).done(function(){s(),t.each(arguments,function(){var e=this.el -t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,n,i,r){return n?t.effects.animateClass.call(this,{add:e},n,i,r):this._addClass(e) +return{el:e,start:n.call(this)}}),s=function(){t.each(i,function(t,n){e[n]&&o[n+"Class"](e[n])})},s(),u=u.map(function(){return this.end=n.call(this.el[0]),this.diff=r(this.start,this.end),this}),o.attr("class",a), +u=u.map(function(){var e=this,n=t.Deferred(),r=jQuery.extend({},l,{queue:!1,complete:function(){n.resolve(e)}}) +return this.el.animate(this.diff,r),n.promise()}),t.when.apply(t,u.get()).done(function(){s(),t.each(arguments,function(){var e=this.el +t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,n,r,i){return n?t.effects.animateClass.call(this,{add:e},n,r,i):this._addClass(e) -},_removeClass:t.fn.removeClass,removeClass:function(e,n,i,r){return n?t.effects.animateClass.call(this,{remove:e},n,i,r):this._removeClass(e)},_toggleClass:t.fn.toggleClass,toggleClass:function(n,i,r,o,a){ -return"boolean"==typeof i||i===e?r?t.effects.animateClass.call(this,i?{add:n}:{remove:n},r,o,a):this._toggleClass(n,i):t.effects.animateClass.call(this,{toggle:n},i,r,o)},switchClass:function(e,n,i,r,o){ -return t.effects.animateClass.call(this,{add:n,remove:e},i,r,o)}})}(),function(){function r(e,n,i,r){return t.isPlainObject(e)&&(n=e,e=e.effect),e={effect:e},null==n&&(n={}),t.isFunction(n)&&(r=n,i=null, -n={}),("number"==typeof n||t.fx.speeds[n])&&(r=i,i=n,n={}),t.isFunction(i)&&(r=i,i=null),n&&t.extend(e,n),i=i||n.duration,e.duration=t.fx.off?0:"number"==typeof i?i:i in t.fx.speeds?t.fx.speeds[i]:t.fx.speeds._default, -e.complete=r||n.complete,e}function o(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||"string"==typeof e&&!t.effects.effect[e]&&(!n||!t.effects[e])}t.extend(t.effects,{version:"1.9.2",save:function(t,e){ -for(var n=0;n

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0 -}),r={width:e.width(),height:e.height()},o=document.activeElement -try{o.id}catch(a){o=document.body}return e.wrap(i),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),i=e.parent(),"static"===e.css("position")?(i.css({position:"relative"}),e.css({position:"relative"})):(t.extend(n,{ -position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,i){n[i]=e.css(i),isNaN(parseInt(n[i],10))&&(n[i]="auto")}),e.css({position:"relative",top:0,left:0, -right:"auto",bottom:"auto"})),e.css(r),i.css(n).show()},removeWrapper:function(e){var n=document.activeElement -return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===n||t.contains(e[0],n))&&t(n).focus()),e},setTransition:function(e,n,i,r){return r=r||{},t.each(n,function(t,n){var o=e.cssUnit(n) +default:r=t[1]/e.width}return{x:r,y:n}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent() +var n={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},r=t("
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0 +}),i={width:e.width(),height:e.height()},o=document.activeElement +try{o.id}catch(a){o=document.body}return e.wrap(r),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),r=e.parent(),"static"===e.css("position")?(r.css({position:"relative"}),e.css({position:"relative"})):(t.extend(n,{ +position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,r){n[r]=e.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),e.css({position:"relative",top:0,left:0, +right:"auto",bottom:"auto"})),e.css(i),r.css(n).show()},removeWrapper:function(e){var n=document.activeElement +return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===n||t.contains(e[0],n))&&t(n).focus()),e},setTransition:function(e,n,r,i){return i=i||{},t.each(n,function(t,n){var o=e.cssUnit(n) -o[0]>0&&(r[n]=o[0]*i+o[1])}),r}}),t.fn.extend({effect:function(){function e(e){function n(){t.isFunction(o)&&o.call(r[0]),t.isFunction(e)&&e()}var r=t(this),o=i.complete,a=i.mode;(r.is(":hidden")?"hide"===a:"show"===a)?n():s.call(r[0],i,n) +o[0]>0&&(i[n]=o[0]*r+o[1])}),i}}),t.fn.extend({effect:function(){function e(e){function n(){t.isFunction(o)&&o.call(i[0]),t.isFunction(e)&&e()}var i=t(this),o=r.complete,a=r.mode;(i.is(":hidden")?"hide"===a:"show"===a)?n():s.call(i[0],r,n) -}var i=r.apply(this,arguments),o=i.mode,a=i.queue,s=t.effects.effect[i.effect],l=!s&&n&&t.effects[i.effect] -return t.fx.off||!s&&!l?o?this[o](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):s?a===!1?this.each(e):this.queue(a||"fx",e):l.call(this,{options:i,duration:i.duration, -callback:i.complete,mode:i.mode})},_show:t.fn.show,show:function(t){if(o(t))return this._show.apply(this,arguments) -var e=r.apply(this,arguments) +}var r=i.apply(this,arguments),o=r.mode,a=r.queue,s=t.effects.effect[r.effect],l=!s&&n&&t.effects[r.effect] +return t.fx.off||!s&&!l?o?this[o](r.duration,r.complete):this.each(function(){r.complete&&r.complete.call(this)}):s?a===!1?this.each(e):this.queue(a||"fx",e):l.call(this,{options:r,duration:r.duration, +callback:r.complete,mode:r.mode})},_show:t.fn.show,show:function(t){if(o(t))return this._show.apply(this,arguments) +var e=i.apply(this,arguments) return e.mode="show",this.effect.call(this,e)},_hide:t.fn.hide,hide:function(t){if(o(t))return this._hide.apply(this,arguments) -var e=r.apply(this,arguments) +var e=i.apply(this,arguments) return e.mode="hide",this.effect.call(this,e)},__toggle:t.fn.toggle,toggle:function(e){if(o(e)||"boolean"==typeof e||t.isFunction(e))return this.__toggle.apply(this,arguments) -var n=r.apply(this,arguments) -return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(e){var n=this.css(e),i=[] -return t.each(["em","px","%","pt"],function(t,e){n.indexOf(e)>0&&(i=[parseFloat(n),e])}),i}})}(),function(){var e={} +var n=i.apply(this,arguments) +return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(e){var n=this.css(e),r=[] +return t.each(["em","px","%","pt"],function(t,e){n.indexOf(e)>0&&(r=[parseFloat(n),e])}),r}})}(),function(){var e={} t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,n){e[n]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t) },Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;); return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,n){t.easing["easeIn"+e]=n,t.easing["easeOut"+e]=function(t){return 1-n(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?n(2*t)/2:1-n(t*-2+2)/2 -}})}()}(jQuery),function(t,e){var n=/up|down|vertical/,i=/up|left|vertical|horizontal/ -t.effects.effect.blind=function(e,r){var o=t(this),a=["position","top","bottom","left","right","height","width"],s=t.effects.setMode(o,e.mode||"hide"),l=e.direction||"up",u=n.test(l),c=u?"height":"width",d=u?"top":"left",h=i.test(l),p={},f="show"===s,m,g,v +}})}()}(jQuery),function(t,e){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/ +t.effects.effect.blind=function(e,i){var o=t(this),a=["position","top","bottom","left","right","height","width"],s=t.effects.setMode(o,e.mode||"hide"),l=e.direction||"up",u=n.test(l),c=u?"height":"width",d=u?"top":"left",f=r.test(l),p={},h="show"===s,m,v,g -o.parent().is(".ui-effects-wrapper")?t.effects.save(o.parent(),a):t.effects.save(o,a),o.show(),m=t.effects.createWrapper(o).css({overflow:"hidden"}),g=m[c](),v=parseFloat(m.css(d))||0,p[c]=f?g:0,h||(o.css(u?"bottom":"right",0).css(u?"top":"left","auto").css({ -position:"absolute"}),p[d]=f?v:g+v),f&&(m.css(c,0),h||m.css(d,v+g)),m.animate(p,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===s&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o), -r()}})}}(jQuery),function(t,e){t.effects.effect.bounce=function(e,n){var i=t(this),r=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(i,e.mode||"effect"),a="hide"===o,s="show"===o,l=e.direction||"up",u=e.distance,c=e.times||5,d=2*c+(s||a?1:0),h=e.duration/d,p=e.easing,f="up"===l||"down"===l?"top":"left",m="up"===l||"left"===l,g,v,y,_=i.queue(),b=_.length +o.parent().is(".ui-effects-wrapper")?t.effects.save(o.parent(),a):t.effects.save(o,a),o.show(),m=t.effects.createWrapper(o).css({overflow:"hidden"}),v=m[c](),g=parseFloat(m.css(d))||0,p[c]=h?v:0,f||(o.css(u?"bottom":"right",0).css(u?"top":"left","auto").css({ +position:"absolute"}),p[d]=h?g:v+g),h&&(m.css(c,0),f||m.css(d,g+v)),m.animate(p,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===s&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o), +i()}})}}(jQuery),function(t,e){t.effects.effect.bounce=function(e,n){var r=t(this),i=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(r,e.mode||"effect"),a="hide"===o,s="show"===o,l=e.direction||"up",u=e.distance,c=e.times||5,d=2*c+(s||a?1:0),f=e.duration/d,p=e.easing,h="up"===l||"down"===l?"top":"left",m="up"===l||"left"===l,v,g,y,_=r.queue(),b=_.length -for((s||a)&&r.push("opacity"),t.effects.save(i,r),i.show(),t.effects.createWrapper(i),u||(u=i["top"===f?"outerHeight":"outerWidth"]()/3),s&&(y={opacity:1},y[f]=0,i.css("opacity",0).css(f,m?2*-u:2*u).animate(y,h,p)), -a&&(u/=Math.pow(2,c-1)),y={},y[f]=0,g=0;g1&&_.splice.apply(_,[1,0].concat(_.splice(b,d+1))),i.dequeue() +for((s||a)&&i.push("opacity"),t.effects.save(r,i),r.show(),t.effects.createWrapper(r),u||(u=r["top"===h?"outerHeight":"outerWidth"]()/3),s&&(y={opacity:1},y[h]=0,r.css("opacity",0).css(h,m?2*-u:2*u).animate(y,f,p)), +a&&(u/=Math.pow(2,c-1)),y={},y[h]=0,v=0;v1&&_.splice.apply(_,[1,0].concat(_.splice(b,d+1))),r.dequeue() -}}(jQuery),function(t,e){t.effects.effect.clip=function(e,n){var i=t(this),r=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(i,e.mode||"hide"),a="show"===o,s=e.direction||"vertical",l="vertical"===s,u=l?"height":"width",c=l?"top":"left",d={},h,p,f +}}(jQuery),function(t,e){t.effects.effect.clip=function(e,n){var r=t(this),i=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(r,e.mode||"hide"),a="show"===o,s=e.direction||"vertical",l="vertical"===s,u=l?"height":"width",c=l?"top":"left",d={},f,p,h -t.effects.save(i,r),i.show(),h=t.effects.createWrapper(i).css({overflow:"hidden"}),p="IMG"===i[0].tagName?h:i,f=p[u](),a&&(p.css(u,0),p.css(c,f/2)),d[u]=a?f:0,d[c]=a?0:f/2,p.animate(d,{queue:!1,duration:e.duration, -easing:e.easing,complete:function(){a||i.hide(),t.effects.restore(i,r),t.effects.removeWrapper(i),n()}})}}(jQuery),function(t,e){t.effects.effect.drop=function(e,n){var i=t(this),r=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(i,e.mode||"hide"),a="show"===o,s=e.direction||"left",l="up"===s||"down"===s?"top":"left",u="up"===s||"left"===s?"pos":"neg",c={ +t.effects.save(r,i),r.show(),f=t.effects.createWrapper(r).css({overflow:"hidden"}),p="IMG"===r[0].tagName?f:r,h=p[u](),a&&(p.css(u,0),p.css(c,h/2)),d[u]=a?h:0,d[c]=a?0:h/2,p.animate(d,{queue:!1,duration:e.duration, +easing:e.easing,complete:function(){a||r.hide(),t.effects.restore(r,i),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.drop=function(e,n){var r=t(this),i=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(r,e.mode||"hide"),a="show"===o,s=e.direction||"left",l="up"===s||"down"===s?"top":"left",u="up"===s||"left"===s?"pos":"neg",c={ opacity:a?1:0},d -t.effects.save(i,r),i.show(),t.effects.createWrapper(i),d=e.distance||i["top"===l?"outerHeight":"outerWidth"](!0)/2,a&&i.css("opacity",0).css(l,"pos"===u?-d:d),c[l]=(a?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+d, -i.animate(c,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(),t.effects.restore(i,r),t.effects.removeWrapper(i),n()}})}}(jQuery),function(t,e){t.effects.effect.explode=function(e,n){ -function i(){p.push(this),p.length===o*a&&r()}function r(){s.css({visibility:"visible"}),t(p).remove(),u||s.hide(),n()}var o=e.pieces?Math.round(Math.sqrt(e.pieces)):3,a=o,s=t(this),l=t.effects.setMode(s,e.mode||"hide"),u="show"===l,c=s.show().css("visibility","hidden").offset(),d=Math.ceil(s.outerWidth()/a),h=Math.ceil(s.outerHeight()/o),p=[],f,m,g,v,y,_ +t.effects.save(r,i),r.show(),t.effects.createWrapper(r),d=e.distance||r["top"===l?"outerHeight":"outerWidth"](!0)/2,a&&r.css("opacity",0).css(l,"pos"===u?-d:d),c[l]=(a?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+d, +r.animate(c,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&r.hide(),t.effects.restore(r,i),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.explode=function(e,n){ +function r(){p.push(this),p.length===o*a&&i()}function i(){s.css({visibility:"visible"}),t(p).remove(),u||s.hide(),n()}var o=e.pieces?Math.round(Math.sqrt(e.pieces)):3,a=o,s=t(this),l=t.effects.setMode(s,e.mode||"hide"),u="show"===l,c=s.show().css("visibility","hidden").offset(),d=Math.ceil(s.outerWidth()/a),f=Math.ceil(s.outerHeight()/o),p=[],h,m,v,g,y,_ -for(f=0;f
").css({position:"absolute",visibility:"visible",left:-m*d,top:-f*h}).parent().addClass("ui-effects-explode").css({ -position:"absolute",overflow:"hidden",width:d,height:h,left:g+(u?y*d:0),top:v+(u?_*h:0),opacity:u?0:1}).animate({left:g+(u?0:y*d),top:v+(u?0:_*h),opacity:u?1:0},e.duration||500,e.easing,i)}}(jQuery),function(t,e){ -t.effects.effect.fade=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"toggle") -i.animate({opacity:r},{queue:!1,duration:e.duration,easing:e.easing,complete:n})}}(jQuery),function(t,e){t.effects.effect.fold=function(e,n){var i=t(this),r=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(i,e.mode||"hide"),a="show"===o,s="hide"===o,l=e.size||15,u=/([0-9]+)%/.exec(l),c=!!e.horizFirst,d=a!==c,h=d?["width","height"]:["height","width"],p=e.duration/2,f,m,g={},v={} +for(h=0;h
").css({position:"absolute",visibility:"visible",left:-m*d,top:-h*f}).parent().addClass("ui-effects-explode").css({ +position:"absolute",overflow:"hidden",width:d,height:f,left:v+(u?y*d:0),top:g+(u?_*f:0),opacity:u?0:1}).animate({left:v+(u?0:y*d),top:g+(u?0:_*f),opacity:u?1:0},e.duration||500,e.easing,r)}}(jQuery),function(t,e){ +t.effects.effect.fade=function(e,n){var r=t(this),i=t.effects.setMode(r,e.mode||"toggle") +r.animate({opacity:i},{queue:!1,duration:e.duration,easing:e.easing,complete:n})}}(jQuery),function(t,e){t.effects.effect.fold=function(e,n){var r=t(this),i=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(r,e.mode||"hide"),a="show"===o,s="hide"===o,l=e.size||15,u=/([0-9]+)%/.exec(l),c=!!e.horizFirst,d=a!==c,f=d?["width","height"]:["height","width"],p=e.duration/2,h,m,v={},g={} -t.effects.save(i,r),i.show(),f=t.effects.createWrapper(i).css({overflow:"hidden"}),m=d?[f.width(),f.height()]:[f.height(),f.width()],u&&(l=parseInt(u[1],10)/100*m[s?0:1]),a&&f.css(c?{height:0,width:l}:{ -height:l,width:0}),g[h[0]]=a?m[0]:l,v[h[1]]=a?m[1]:0,f.animate(g,p,e.easing).animate(v,p,e.easing,function(){s&&i.hide(),t.effects.restore(i,r),t.effects.removeWrapper(i),n()})}}(jQuery),function(t,e){ -t.effects.effect.highlight=function(e,n){var i=t(this),r=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(i,e.mode||"show"),a={backgroundColor:i.css("backgroundColor")} -"hide"===o&&(a.opacity=0),t.effects.save(i,r),i.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(), -t.effects.restore(i,r),n()}})}}(jQuery),function(t,e){t.effects.effect.pulsate=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"show"),o="show"===r,a="hide"===r,s=o||"hide"===r,l=2*(e.times||5)+(s?1:0),u=e.duration/l,c=0,d=i.queue(),h=d.length,p +t.effects.save(r,i),r.show(),h=t.effects.createWrapper(r).css({overflow:"hidden"}),m=d?[h.width(),h.height()]:[h.height(),h.width()],u&&(l=parseInt(u[1],10)/100*m[s?0:1]),a&&h.css(c?{height:0,width:l}:{ +height:l,width:0}),v[f[0]]=a?m[0]:l,g[f[1]]=a?m[1]:0,h.animate(v,p,e.easing).animate(g,p,e.easing,function(){s&&r.hide(),t.effects.restore(r,i),t.effects.removeWrapper(r),n()})}}(jQuery),function(t,e){ +t.effects.effect.highlight=function(e,n){var r=t(this),i=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(r,e.mode||"show"),a={backgroundColor:r.css("backgroundColor")} +"hide"===o&&(a.opacity=0),t.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&r.hide(), +t.effects.restore(r,i),n()}})}}(jQuery),function(t,e){t.effects.effect.pulsate=function(e,n){var r=t(this),i=t.effects.setMode(r,e.mode||"show"),o="show"===i,a="hide"===i,s=o||"hide"===i,l=2*(e.times||5)+(s?1:0),u=e.duration/l,c=0,d=r.queue(),f=d.length,p -for(!o&&i.is(":visible")||(i.css("opacity",0).show(),c=1),p=1;p1&&d.splice.apply(d,[1,0].concat(d.splice(h,l+1))),i.dequeue()}}(jQuery),function(t,e){t.effects.effect.puff=function(e,n){var i=t(this),r=t.effects.setMode(i,e.mode||"hide"),o="hide"===r,a=parseInt(e.percent,10)||150,s=a/100,l={ -height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()} -t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:r,complete:n,percent:o?a:100,from:o?l:{height:l.height*s,width:l.width*s,outerHeight:l.outerHeight*s,outerWidth:l.outerWidth*s}}),i.effect(e)},t.effects.effect.scale=function(e,n){ -var i=t(this),r=t.extend(!0,{},e),o=t.effects.setMode(i,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),s=e.direction||"both",l=e.origin,u={height:i.height(), -width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()},c={y:"horizontal"!==s?a/100:1,x:"vertical"!==s?a/100:1} -r.effect="size",r.queue=!1,r.complete=n,"effect"!==o&&(r.origin=l||["middle","center"],r.restore=!0),r.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:u),r.to={height:u.height*c.y, -width:u.width*c.x,outerHeight:u.outerHeight*c.y,outerWidth:u.outerWidth*c.x},r.fade&&("show"===o&&(r.from.opacity=0,r.to.opacity=1),"hide"===o&&(r.from.opacity=1,r.to.opacity=0)),i.effect(r)},t.effects.effect.size=function(e,n){ -var i,r,o,a=t(this),s=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],u=["width","height","overflow"],c=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(a,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=a.css("position"),y=f?s:l,_={ +for(!o&&r.is(":visible")||(r.css("opacity",0).show(),c=1),p=1;p1&&d.splice.apply(d,[1,0].concat(d.splice(f,l+1))),r.dequeue()}}(jQuery),function(t,e){t.effects.effect.puff=function(e,n){var r=t(this),i=t.effects.setMode(r,e.mode||"hide"),o="hide"===i,a=parseInt(e.percent,10)||150,s=a/100,l={ +height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()} +t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:o?a:100,from:o?l:{height:l.height*s,width:l.width*s,outerHeight:l.outerHeight*s,outerWidth:l.outerWidth*s}}),r.effect(e)},t.effects.effect.scale=function(e,n){ +var r=t(this),i=t.extend(!0,{},e),o=t.effects.setMode(r,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),s=e.direction||"both",l=e.origin,u={height:r.height(), +width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},c={y:"horizontal"!==s?a/100:1,x:"vertical"!==s?a/100:1} +i.effect="size",i.queue=!1,i.complete=n,"effect"!==o&&(i.origin=l||["middle","center"],i.restore=!0),i.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:u),i.to={height:u.height*c.y, +width:u.width*c.x,outerHeight:u.outerHeight*c.y,outerWidth:u.outerWidth*c.x},i.fade&&("show"===o&&(i.from.opacity=0,i.to.opacity=1),"hide"===o&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},t.effects.effect.size=function(e,n){ +var r,i,o,a=t(this),s=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],u=["width","height","overflow"],c=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(a,e.mode||"effect"),h=e.restore||"effect"!==p,m=e.scale||"both",v=e.origin||["middle","center"],g=a.css("position"),y=h?s:l,_={ height:0,width:0,outerHeight:0,outerWidth:0} -"show"===p&&a.show(),i={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===p?(a.from=e.to||_,a.to=e.from||i):(a.from=e.from||("show"===p?_:i), -a.to=e.to||("hide"===p?_:i)),o={from:{y:a.from.height/i.height,x:a.from.width/i.width},to:{y:a.to.height/i.height,x:a.to.width/i.width}},"box"!==m&&"both"!==m||(o.from.y!==o.to.y&&(y=y.concat(d),a.from=t.effects.setTransition(a,d,o.from.y,a.from), -a.to=t.effects.setTransition(a,d,o.to.y,a.to)),o.from.x!==o.to.x&&(y=y.concat(h),a.from=t.effects.setTransition(a,h,o.from.x,a.from),a.to=t.effects.setTransition(a,h,o.to.x,a.to))),"content"!==m&&"both"!==m||o.from.y!==o.to.y&&(y=y.concat(c).concat(u), -a.from=t.effects.setTransition(a,c,o.from.y,a.from),a.to=t.effects.setTransition(a,c,o.to.y,a.to)),t.effects.save(a,y),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),g&&(r=t.effects.getBaseline(g,i), -a.from.top=(i.outerHeight-a.outerHeight())*r.y,a.from.left=(i.outerWidth-a.outerWidth())*r.x,a.to.top=(i.outerHeight-a.to.outerHeight)*r.y,a.to.left=(i.outerWidth-a.to.outerWidth)*r.x),a.css(a.from),"content"!==m&&"both"!==m||(d=d.concat(["marginTop","marginBottom"]).concat(c), -h=h.concat(["marginLeft","marginRight"]),u=s.concat(d).concat(h),a.find("*[width]").each(function(){var n=t(this),i={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth() +"show"===p&&a.show(),r={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===p?(a.from=e.to||_,a.to=e.from||r):(a.from=e.from||("show"===p?_:r), +a.to=e.to||("hide"===p?_:r)),o={from:{y:a.from.height/r.height,x:a.from.width/r.width},to:{y:a.to.height/r.height,x:a.to.width/r.width}},"box"!==m&&"both"!==m||(o.from.y!==o.to.y&&(y=y.concat(d),a.from=t.effects.setTransition(a,d,o.from.y,a.from), +a.to=t.effects.setTransition(a,d,o.to.y,a.to)),o.from.x!==o.to.x&&(y=y.concat(f),a.from=t.effects.setTransition(a,f,o.from.x,a.from),a.to=t.effects.setTransition(a,f,o.to.x,a.to))),"content"!==m&&"both"!==m||o.from.y!==o.to.y&&(y=y.concat(c).concat(u), +a.from=t.effects.setTransition(a,c,o.from.y,a.from),a.to=t.effects.setTransition(a,c,o.to.y,a.to)),t.effects.save(a,y),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),v&&(i=t.effects.getBaseline(v,r), +a.from.top=(r.outerHeight-a.outerHeight())*i.y,a.from.left=(r.outerWidth-a.outerWidth())*i.x,a.to.top=(r.outerHeight-a.to.outerHeight)*i.y,a.to.left=(r.outerWidth-a.to.outerWidth)*i.x),a.css(a.from),"content"!==m&&"both"!==m||(d=d.concat(["marginTop","marginBottom"]).concat(c), +f=f.concat(["marginLeft","marginRight"]),u=s.concat(d).concat(f),a.find("*[width]").each(function(){var n=t(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth() } -f&&t.effects.save(n,u),n.from={height:i.height*o.from.y,width:i.width*o.from.x,outerHeight:i.outerHeight*o.from.y,outerWidth:i.outerWidth*o.from.x},n.to={height:i.height*o.to.y,width:i.width*o.to.x,outerHeight:i.height*o.to.y, -outerWidth:i.width*o.to.x},o.from.y!==o.to.y&&(n.from=t.effects.setTransition(n,d,o.from.y,n.from),n.to=t.effects.setTransition(n,d,o.to.y,n.to)),o.from.x!==o.to.x&&(n.from=t.effects.setTransition(n,h,o.from.x,n.from), -n.to=t.effects.setTransition(n,h,o.to.x,n.to)),n.css(n.from),n.animate(n.to,e.duration,e.easing,function(){f&&t.effects.restore(n,u)})})),a.animate(a.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){ -0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===p&&a.hide(),t.effects.restore(a,y),f||("static"===v?a.css({position:"relative",top:a.to.top,left:a.to.left}):t.each(["top","left"],function(t,e){ -a.css(e,function(e,n){var i=parseInt(n,10),r=t?a.to.left:a.to.top -return"auto"===n?r+"px":i+r+"px"})})),t.effects.removeWrapper(a),n()}})}}(jQuery),function(t,e){t.effects.effect.shake=function(e,n){var i=t(this),r=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(i,e.mode||"effect"),a=e.direction||"left",s=e.distance||20,l=e.times||3,u=2*l+1,c=Math.round(e.duration/u),d="up"===a||"down"===a?"top":"left",h="up"===a||"left"===a,p={},f={},m={},g,v=i.queue(),y=v.length +h&&t.effects.save(n,u),n.from={height:r.height*o.from.y,width:r.width*o.from.x,outerHeight:r.outerHeight*o.from.y,outerWidth:r.outerWidth*o.from.x},n.to={height:r.height*o.to.y,width:r.width*o.to.x,outerHeight:r.height*o.to.y, +outerWidth:r.width*o.to.x},o.from.y!==o.to.y&&(n.from=t.effects.setTransition(n,d,o.from.y,n.from),n.to=t.effects.setTransition(n,d,o.to.y,n.to)),o.from.x!==o.to.x&&(n.from=t.effects.setTransition(n,f,o.from.x,n.from), +n.to=t.effects.setTransition(n,f,o.to.x,n.to)),n.css(n.from),n.animate(n.to,e.duration,e.easing,function(){h&&t.effects.restore(n,u)})})),a.animate(a.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){ +0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===p&&a.hide(),t.effects.restore(a,y),h||("static"===g?a.css({position:"relative",top:a.to.top,left:a.to.left}):t.each(["top","left"],function(t,e){ +a.css(e,function(e,n){var r=parseInt(n,10),i=t?a.to.left:a.to.top +return"auto"===n?i+"px":r+i+"px"})})),t.effects.removeWrapper(a),n()}})}}(jQuery),function(t,e){t.effects.effect.shake=function(e,n){var r=t(this),i=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(r,e.mode||"effect"),a=e.direction||"left",s=e.distance||20,l=e.times||3,u=2*l+1,c=Math.round(e.duration/u),d="up"===a||"down"===a?"top":"left",f="up"===a||"left"===a,p={},h={},m={},v,g=r.queue(),y=g.length -for(t.effects.save(i,r),i.show(),t.effects.createWrapper(i),p[d]=(h?"-=":"+=")+s,f[d]=(h?"+=":"-=")+2*s,m[d]=(h?"-=":"+=")+2*s,i.animate(p,c,e.easing),g=1;g1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),i.dequeue() +r.animate(h,c,e.easing).animate(p,c/2,e.easing).queue(function(){"hide"===o&&r.hide(),t.effects.restore(r,i),t.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,u+1))),r.dequeue() -}}(jQuery),function(t,e){t.effects.effect.slide=function(e,n){var i=t(this),r=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(i,e.mode||"show"),a="show"===o,s=e.direction||"left",l="up"===s||"down"===s?"top":"left",u="up"===s||"left"===s,c,d={} +}}(jQuery),function(t,e){t.effects.effect.slide=function(e,n){var r=t(this),i=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(r,e.mode||"show"),a="show"===o,s=e.direction||"left",l="up"===s||"down"===s?"top":"left",u="up"===s||"left"===s,c,d={} -t.effects.save(i,r),i.show(),c=e.distance||i["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(i).css({overflow:"hidden"}),a&&i.css(l,u?isNaN(c)?"-"+c:-c:c),d[l]=(a?u?"+=":"-=":u?"-=":"+=")+c, -i.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(),t.effects.restore(i,r),t.effects.removeWrapper(i),n()}})}}(jQuery),function(t,e){t.effects.effect.transfer=function(e,n){ -var i=t(this),r=t(e.to),o="fixed"===r.css("position"),a=t("body"),s=o?a.scrollTop():0,l=o?a.scrollLeft():0,u=r.offset(),c={top:u.top-s,left:u.left-l,height:r.innerHeight(),width:r.innerWidth()},d=i.offset(),h=t('
').appendTo(document.body).addClass(e.className).css({ -top:d.top-s,left:d.left-l,height:i.innerHeight(),width:i.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){h.remove(),n()})}}(jQuery),function(t,e){var n=!1 +t.effects.save(r,i),r.show(),c=e.distance||r["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(r).css({overflow:"hidden"}),a&&r.css(l,u?isNaN(c)?"-"+c:-c:c),d[l]=(a?u?"+=":"-=":u?"-=":"+=")+c, +r.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&r.hide(),t.effects.restore(r,i),t.effects.removeWrapper(r),n()}})}}(jQuery),function(t,e){t.effects.effect.transfer=function(e,n){ +var r=t(this),i=t(e.to),o="fixed"===i.css("position"),a=t("body"),s=o?a.scrollTop():0,l=o?a.scrollLeft():0,u=i.offset(),c={top:u.top-s,left:u.left-l,height:i.innerHeight(),width:i.innerWidth()},d=r.offset(),f=t('
').appendTo(document.body).addClass(e.className).css({ +top:d.top-s,left:d.left-l,height:r.innerHeight(),width:r.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){f.remove(),n()})}}(jQuery),function(t,e){var n=!1 t.widget("ui.menu",{version:"1.9.2",defaultElement:"
    ",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null },_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({ role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"), -this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item") +this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var r=t(e.target).closest(".ui-menu-item") -!n&&i.not(".ui-state-disabled").length&&(n=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer))) +!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(e),r.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer))) },"mouseenter .ui-menu-item":function(e){var n=t(e.currentTarget) n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.children(".ui-menu-item").eq(0) @@ -1207,7 +1208,7 @@ this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role" var e=t(this) e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&") -}var i,r,o,a,s,l=!0 +}var r,i,o,a,s,l=!0 switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e) break case t.ui.keyCode.PAGE_DOWN:this.nextPage(e) @@ -1228,42 +1229,42 @@ case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e) break case t.ui.keyCode.ESCAPE:this.collapse(e) break -default:l=!1,r=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===r?a=!0:o=r+o,s=new RegExp("^"+n(o),"i"),i=this.activeMenu.children(".ui-menu-item").filter(function(){ -return s.test(t(this).children("a").text())}),i=a&&i.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):i,i.length||(o=String.fromCharCode(e.keyCode),s=new RegExp("^"+n(o),"i"),i=this.activeMenu.children(".ui-menu-item").filter(function(){ -return s.test(t(this).children("a").text())})),i.length?(this.focus(e,i),i.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter +default:l=!1,i=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===i?a=!0:o=i+o,s=new RegExp("^"+n(o),"i"),r=this.activeMenu.children(".ui-menu-item").filter(function(){ +return s.test(t(this).children("a").text())}),r=a&&r.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):r,r.length||(o=String.fromCharCode(e.keyCode),s=new RegExp("^"+n(o),"i"),r=this.activeMenu.children(".ui-menu-item").filter(function(){ +return s.test(t(this).children("a").text())})),r.length?(this.focus(e,r),r.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter -}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n=this.options.icons.submenu,i=this.element.find(this.options.menus) +}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n=this.options.icons.submenu,r=this.element.find(this.options.menus) -i.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev("a"),r=t("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0) +r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),r=e.prev("a"),i=t("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0) -i.attr("aria-haspopup","true").prepend(r),e.attr("aria-labelledby",i.attr("id"))}),e=i.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({ +r.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",r.attr("id"))}),e=r.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({ tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-—–\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"), -this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(t,e){var n,i -this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")), +this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(t,e){var n,r +this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")), this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=e.children(".ui-menu"), -n.length&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,r,o,a,s -this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,r=e.offset().top-this.activeMenu.offset().top-n-i,o=this.activeMenu.scrollTop(), -a=this.activeMenu.height(),s=e.height(),r<0?this.activeMenu.scrollTop(o+r):r+s>a&&this.activeMenu.scrollTop(o+r-a+s))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"), +n.length&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,r,i,o,a,s +this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,i=e.offset().top-this.activeMenu.offset().top-n-r,o=this.activeMenu.scrollTop(), +a=this.activeMenu.height(),s=e.height(),i<0?this.activeMenu.scrollTop(o+i):i+s>a&&this.activeMenu.scrollTop(o+i-a+s))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"), this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t) },this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position) clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){ -clearTimeout(this.timer),this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu")) -i.length||(i=this.element),this._close(i),this.blur(e),this.activeMenu=i},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active") +clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu")) +r.length||(r=this.element),this._close(r),this.blur(e),this.activeMenu=r},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active") },collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element) e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first() e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length -},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i -this.active&&(i="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),i&&i.length&&this.active||(i=this.activeMenu.children(".ui-menu-item")[e]()), -this.focus(n,i)},nextPage:function(e){var n,i,r -return this.active?void(this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,r=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i-r<0 +},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var r +this.active&&(r="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.children(".ui-menu-item")[e]()), +this.focus(n,r)},nextPage:function(e){var n,r,i +return this.active?void(this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-r-i<0 -}),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var n,i,r -return this.active?void(this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,r=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i+r>0 +}),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var n,r,i +return this.active?void(this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-r+i>0 }),this.focus(e,n)):this.focus(e,this.activeMenu.children(".ui-menu-item").first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()
') +for(var i=0;i
') s.css({zIndex:n.zIndex}),"se"==o&&s.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[o]=".ui-resizable-"+o,this.element.append(s)}}this._renderAxis=function(e){e=e||this.element for(var n in this.handles){if(this.handles[n].constructor==String&&(this.handles[n]=t(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){ -var i=t(this.handles[n],this.element),r=0 -r=/sw|ne|nw|se|n|s/.test(n)?i.outerHeight():i.outerWidth() +var r=t(this.handles[n],this.element),i=0 +i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth() var o=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("") -e.css(o,r),this._proportionallyResize()}t(this.handles[n]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){ +e.css(o,i),this._proportionallyResize()}t(this.handles[n]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){ if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i) e.axis=t&&t[1]?t[1]:"se"}}),n.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){n.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show()) @@ -1308,18 +1309,18 @@ if(this.elementIsWrapper){e(this.element) var n=this.element this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle), e(this.originalElement),this},_mouseCapture:function(e){var n=!1 -for(var i in this.handles)t(this.handles[i])[0]==e.target&&(n=!0) -return!this.options.disabled&&n},_mouseStart:function(e){var i=this.options,r=this.element.position(),o=this.element -this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(o.is(".ui-draggable")||/absolute/.test(o.css("position")))&&o.css({position:"absolute",top:r.top,left:r.left +for(var r in this.handles)t(this.handles[r])[0]==e.target&&(n=!0) +return!this.options.disabled&&n},_mouseStart:function(e){var r=this.options,i=this.element.position(),o=this.element +this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(o.is(".ui-draggable")||/absolute/.test(o.css("position")))&&o.css({position:"absolute",top:i.top,left:i.left }),this._renderProxy() var a=n(this.helper.css("left")),s=n(this.helper.css("top")) -i.containment&&(a+=t(i.containment).scrollLeft()||0,s+=t(i.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:a,top:s},this.size=this._helper?{width:o.outerWidth(),height:o.outerHeight() +r.containment&&(a+=t(r.containment).scrollLeft()||0,s+=t(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:a,top:s},this.size=this._helper?{width:o.outerWidth(),height:o.outerHeight() }:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:a,top:s},this.sizeDiff={ -width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof i.aspectRatio?i.aspectRatio:this.originalSize.width/this.originalSize.height||1 +width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1 var l=t(".ui-resizable-"+this.axis).css("cursor") -return t("body").css("cursor","auto"==l?this.axis+"-resize":l),o.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(t){var e=this.helper,n=this.options,i={},r=this,o=this.originalMousePosition,a=this.axis,s=t.pageX-o.left||0,l=t.pageY-o.top||0,u=this._change[a] +return t("body").css("cursor","auto"==l?this.axis+"-resize":l),o.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(t){var e=this.helper,n=this.options,r={},i=this,o=this.originalMousePosition,a=this.axis,s=t.pageX-o.left||0,l=t.pageY-o.top||0,u=this._change[a] if(!u)return!1 @@ -1327,94 +1328,94 @@ var c=u.apply(this,[t,s,l]) return this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(c=this._updateRatio(c,t)),c=this._respectSize(c,t),this._propagate("resize",t),e.css({top:this.position.top+"px",left:this.position.left+"px", width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(c),this._trigger("resize",t,this.ui()), !1},_mouseStop:function(e){this.resizing=!1 -var n=this.options,i=this -if(this._helper){var r=this._proportionallyResizeElements,o=r.length&&/textarea/i.test(r[0].nodeName),a=o&&t.ui.hasScroll(r[0],"left")?0:i.sizeDiff.height,s=o?0:i.sizeDiff.width,l={width:i.helper.width()-s, -height:i.helper.height()-a},u=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null -n.animate||this.element.css(t.extend(l,{top:c,left:u})),i.helper.height(i.size.height),i.helper.width(i.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"), -this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e=this.options,n,r,o,a,s -s={minWidth:i(e.minWidth)?e.minWidth:0,maxWidth:i(e.maxWidth)?e.maxWidth:1/0,minHeight:i(e.minHeight)?e.minHeight:0,maxHeight:i(e.maxHeight)?e.maxHeight:1/0},(this._aspectRatio||t)&&(n=s.minHeight*this.aspectRatio, -o=s.minWidth/this.aspectRatio,r=s.maxHeight*this.aspectRatio,a=s.maxWidth/this.aspectRatio,n>s.minWidth&&(s.minWidth=n),o>s.minHeight&&(s.minHeight=o),rs.minWidth&&(s.minWidth=n),o>s.minHeight&&(s.minHeight=o),it.width,c=i(t.height)&&r.minHeight&&r.minHeight>t.height +this.offset=this.helper.offset(),r(t.left)&&(this.position.left=t.left),r(t.top)&&(this.position.top=t.top),r(t.height)&&(this.size.height=t.height),r(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){ +var n=this.options,i=this.position,o=this.size,a=this.axis +return r(t.height)?t.width=t.height*this.aspectRatio:r(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==a&&(t.left=i.left+(o.width-t.width),t.top=null),"nw"==a&&(t.top=i.top+(o.height-t.height),t.left=i.left+(o.width-t.width)), +t},_respectSize:function(t,e){var n=this.helper,i=this._vBoundaries,o=this._aspectRatio||e.shiftKey,a=this.axis,s=r(t.width)&&i.maxWidth&&i.maxWidtht.width,c=r(t.height)&&i.minHeight&&i.minHeight>t.height -u&&(t.width=r.minWidth),c&&(t.height=r.minHeight),s&&(t.width=r.maxWidth),l&&(t.height=r.maxHeight) -var d=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(a),f=/nw|ne|n/.test(a) -u&&p&&(t.left=d-r.minWidth),s&&p&&(t.left=d-r.maxWidth),c&&f&&(t.top=h-r.minHeight),l&&f&&(t.top=h-r.maxHeight) +u&&(t.width=i.minWidth),c&&(t.height=i.minHeight),s&&(t.width=i.maxWidth),l&&(t.height=i.maxHeight) +var d=this.originalPosition.left+this.originalSize.width,f=this.position.top+this.size.height,p=/sw|nw|w/.test(a),h=/nw|ne|n/.test(a) +u&&p&&(t.left=d-i.minWidth),s&&p&&(t.left=d-i.maxWidth),c&&h&&(t.top=f-i.minHeight),l&&h&&(t.top=f-i.maxHeight) var m=!t.width&&!t.height return m&&!t.left&&t.top?t.top=null:m&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){var e=this.options -if(this._proportionallyResizeElements.length)for(var n=this.helper||this.element,i=0;i
') -var i=t.ui.ie6?1:0,r=t.ui.ie6?2:-1 -this.helper.addClass(this._helper).css({width:this.element.outerWidth()+r,height:this.element.outerHeight()+r,position:"absolute",left:this.elementOffset.left-i+"px",top:this.elementOffset.top-i+"px",zIndex:++n.zIndex -}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,n){return{width:this.originalSize.width+e}},w:function(t,e,n){var i=this.options,r=this.originalSize,o=this.originalPosition +var r=t.ui.ie6?1:0,i=t.ui.ie6?2:-1 +this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex +}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,n){return{width:this.originalSize.width+e}},w:function(t,e,n){var r=this.options,i=this.originalSize,o=this.originalPosition -return{left:o.left+e,width:r.width-e}},n:function(t,e,n){var i=this.options,r=this.originalSize,o=this.originalPosition -return{top:o.top+n,height:r.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i])) +return{left:o.left+e,width:i.width-e}},n:function(t,e,n){var r=this.options,i=this.originalSize,o=this.originalPosition +return{top:o.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,r){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,r])) -},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i])) +},sw:function(e,n,r){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,r]))},ne:function(e,n,r){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,r])) -},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!=e&&this._trigger(e,n,this.ui()) +},nw:function(e,n,r){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,r]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!=e&&this._trigger(e,n,this.ui()) },plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition -}}}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=function(e){t(e).each(function(){var e=t(this) +}}}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,n){var r=t(this).data("resizable"),i=r.options,o=function(e){t(e).each(function(){var e=t(this) e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})} -"object"!=typeof r.alsoResize||r.alsoResize.parentNode?o(r.alsoResize):r.alsoResize.length?(r.alsoResize=r.alsoResize[0],o(r.alsoResize)):t.each(r.alsoResize,function(t){o(t)})},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.originalSize,a=i.originalPosition,s={ -height:i.size.height-o.height||0,width:i.size.width-o.width||0,top:i.position.top-a.top||0,left:i.position.left-a.left||0},l=function(e,i){t(e).each(function(){var e=t(this),r=t(this).data("resizable-alsoresize"),o={},a=i&&i.length?i:e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"] +"object"!=typeof i.alsoResize||i.alsoResize.parentNode?o(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],o(i.alsoResize)):t.each(i.alsoResize,function(t){o(t)})},resize:function(e,n){var r=t(this).data("resizable"),i=r.options,o=r.originalSize,a=r.originalPosition,s={ +height:r.size.height-o.height||0,width:r.size.width-o.width||0,top:r.position.top-a.top||0,left:r.position.left-a.left||0},l=function(e,r){t(e).each(function(){var e=t(this),i=t(this).data("resizable-alsoresize"),o={},a=r&&r.length?r:e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"] -t.each(a,function(t,e){var n=(r[e]||0)+(s[e]||0) +t.each(a,function(t,e){var n=(i[e]||0)+(s[e]||0) n&&n>=0&&(o[e]=n||null)}),e.css(o)})} -"object"!=typeof r.alsoResize||r.alsoResize.nodeType?l(r.alsoResize):t.each(r.alsoResize,function(t,e){l(t,e)})},stop:function(e,n){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{ -stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i._proportionallyResizeElements,a=o.length&&/textarea/i.test(o[0].nodeName),s=a&&t.ui.hasScroll(o[0],"left")?0:i.sizeDiff.height,l=a?0:i.sizeDiff.width,u={ -width:i.size.width-l,height:i.size.height-s},c=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,d=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null +"object"!=typeof i.alsoResize||i.alsoResize.nodeType?l(i.alsoResize):t.each(i.alsoResize,function(t,e){l(t,e)})},stop:function(e,n){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{ +stop:function(e,n){var r=t(this).data("resizable"),i=r.options,o=r._proportionallyResizeElements,a=o.length&&/textarea/i.test(o[0].nodeName),s=a&&t.ui.hasScroll(o[0],"left")?0:r.sizeDiff.height,l=a?0:r.sizeDiff.width,u={ +width:r.size.width-l,height:r.size.height-s},c=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,d=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null -i.element.animate(t.extend(u,d&&c?{top:d,left:c}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10), -top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)} -o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,i){var r=t(this).data("resizable"),o=r.options,a=r.element,s=o.containment,l=s instanceof t?s.get(0):/parent/.test(s)?a.parent().get(0):s +r.element.animate(t.extend(u,d&&c?{top:d,left:c}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10), +top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)} +o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,r){var i=t(this).data("resizable"),o=i.options,a=i.element,s=o.containment,l=s instanceof t?s.get(0):/parent/.test(s)?a.parent().get(0):s -if(l)if(r.containerElement=t(l),/document/.test(s)||s==document)r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:t(document),left:0,top:0,width:t(document).width(), +if(l)if(i.containerElement=t(l),/document/.test(s)||s==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:t(document),left:0,top:0,width:t(document).width(), height:t(document).height()||document.body.parentNode.scrollHeight} else{var u=t(l),c=[] -t(["Top","Right","Left","Bottom"]).each(function(t,e){c[t]=n(u.css("padding"+e))}),r.containerOffset=u.offset(),r.containerPosition=u.position(),r.containerSize={height:u.innerHeight()-c[3],width:u.innerWidth()-c[1] +t(["Top","Right","Left","Bottom"]).each(function(t,e){c[t]=n(u.css("padding"+e))}),i.containerOffset=u.offset(),i.containerPosition=u.position(),i.containerSize={height:u.innerHeight()-c[3],width:u.innerWidth()-c[1] } -var d=r.containerOffset,h=r.containerSize.height,p=r.containerSize.width,f=t.ui.hasScroll(l,"left")?l.scrollWidth:p,m=t.ui.hasScroll(l)?l.scrollHeight:h -r.parentData={element:l,left:d.left,top:d.top,width:f,height:m}}},resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.containerSize,a=i.containerOffset,s=i.size,l=i.position,u=i._aspectRatio||e.shiftKey,c={ -top:0,left:0},d=i.containerElement -d[0]!=document&&/static/.test(d.css("position"))&&(c=a),l.left<(i._helper?a.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-a.left:i.position.left-c.left),u&&(i.size.height=i.size.width/i.aspectRatio), -i.position.left=r.helper?a.left:0),l.top<(i._helper?a.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-a.top:i.position.top),u&&(i.size.width=i.size.height*i.aspectRatio),i.position.top=i._helper?a.top:0), -i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top -var h=Math.abs((i._helper?i.offset.left-c.left:i.offset.left-c.left)+i.sizeDiff.width),p=Math.abs((i._helper?i.offset.top-c.top:i.offset.top-a.top)+i.sizeDiff.height),f=i.containerElement.get(0)==i.element.parent().get(0),m=/relative|absolute/.test(i.containerElement.css("position")) +var d=i.containerOffset,f=i.containerSize.height,p=i.containerSize.width,h=t.ui.hasScroll(l,"left")?l.scrollWidth:p,m=t.ui.hasScroll(l)?l.scrollHeight:f +i.parentData={element:l,left:d.left,top:d.top,width:h,height:m}}},resize:function(e,n){var r=t(this).data("resizable"),i=r.options,o=r.containerSize,a=r.containerOffset,s=r.size,l=r.position,u=r._aspectRatio||e.shiftKey,c={ +top:0,left:0},d=r.containerElement +d[0]!=document&&/static/.test(d.css("position"))&&(c=a),l.left<(r._helper?a.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-a.left:r.position.left-c.left),u&&(r.size.height=r.size.width/r.aspectRatio), +r.position.left=i.helper?a.left:0),l.top<(r._helper?a.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-a.top:r.position.top),u&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?a.top:0), +r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top +var f=Math.abs((r._helper?r.offset.left-c.left:r.offset.left-c.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-c.top:r.offset.top-a.top)+r.sizeDiff.height),h=r.containerElement.get(0)==r.element.parent().get(0),m=/relative|absolute/.test(r.containerElement.css("position")) -f&&m&&(h-=i.parentData.left),h+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-h,u&&(i.size.height=i.size.width/i.aspectRatio)),p+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-p, -u&&(i.size.width=i.size.height*i.aspectRatio))},stop:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.position,a=i.containerOffset,s=i.containerPosition,l=i.containerElement,u=t(i.helper),c=u.offset(),d=u.outerWidth()-i.sizeDiff.width,h=u.outerHeight()-i.sizeDiff.height +h&&m&&(f-=r.parentData.left),f+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-f,u&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p, +u&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(e,n){var r=t(this).data("resizable"),i=r.options,o=r.position,a=r.containerOffset,s=r.containerPosition,l=r.containerElement,u=t(r.helper),c=u.offset(),d=u.outerWidth()-r.sizeDiff.width,f=u.outerHeight()-r.sizeDiff.height -i._helper&&!r.animate&&/relative/.test(l.css("position"))&&t(this).css({left:c.left-s.left-a.left,width:d,height:h}),i._helper&&!r.animate&&/static/.test(l.css("position"))&&t(this).css({left:c.left-s.left-a.left, -width:d,height:h})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size -i.ghost=i.originalElement.clone(),i.ghost.css({opacity:.25,display:"block",position:"relative",height:o.height,width:o.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof r.ghost?r.ghost:""), -i.ghost.appendTo(i.helper)},resize:function(e,n){var i=t(this).data("resizable"),r=i.options -i.ghost&&i.ghost.css({position:"relative",height:i.size.height,width:i.size.width})},stop:function(e,n){var i=t(this).data("resizable"),r=i.options -i.ghost&&i.helper&&i.helper.get(0).removeChild(i.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,n){var i=t(this).data("resizable"),r=i.options,o=i.size,a=i.originalSize,s=i.originalPosition,l=i.axis,u=r._aspectRatio||e.shiftKey +r._helper&&!i.animate&&/relative/.test(l.css("position"))&&t(this).css({left:c.left-s.left-a.left,width:d,height:f}),r._helper&&!i.animate&&/static/.test(l.css("position"))&&t(this).css({left:c.left-s.left-a.left, +width:d,height:f})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,n){var r=t(this).data("resizable"),i=r.options,o=r.size +r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:o.height,width:o.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""), +r.ghost.appendTo(r.helper)},resize:function(e,n){var r=t(this).data("resizable"),i=r.options +r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(e,n){var r=t(this).data("resizable"),i=r.options +r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,n){var r=t(this).data("resizable"),i=r.options,o=r.size,a=r.originalSize,s=r.originalPosition,l=r.axis,u=i._aspectRatio||e.shiftKey -r.grid="number"==typeof r.grid?[r.grid,r.grid]:r.grid -var c=Math.round((o.width-a.width)/(r.grid[0]||1))*(r.grid[0]||1),d=Math.round((o.height-a.height)/(r.grid[1]||1))*(r.grid[1]||1);/^(se|s|e)$/.test(l)?(i.size.width=a.width+c,i.size.height=a.height+d):/^(ne)$/.test(l)?(i.size.width=a.width+c, -i.size.height=a.height+d,i.position.top=s.top-d):/^(sw)$/.test(l)?(i.size.width=a.width+c,i.size.height=a.height+d,i.position.left=s.left-c):(i.size.width=a.width+c,i.size.height=a.height+d,i.position.top=s.top-d, -i.position.left=s.left-c)}}) -var n=function(t){return parseInt(t,10)||0},i=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t,e){t.widget("ui.selectable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"selectable",options:{ +i.grid="number"==typeof i.grid?[i.grid,i.grid]:i.grid +var c=Math.round((o.width-a.width)/(i.grid[0]||1))*(i.grid[0]||1),d=Math.round((o.height-a.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(l)?(r.size.width=a.width+c,r.size.height=a.height+d):/^(ne)$/.test(l)?(r.size.width=a.width+c, +r.size.height=a.height+d,r.position.top=s.top-d):/^(sw)$/.test(l)?(r.size.width=a.width+c,r.size.height=a.height+d,r.position.left=s.left-c):(r.size.width=a.width+c,r.size.height=a.height+d,r.position.top=s.top-d, +r.position.left=s.left-c)}}) +var n=function(t){return parseInt(t,10)||0},r=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t,e){t.widget("ui.selectable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"selectable",options:{ appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e=this this.element.addClass("ui-selectable"),this.dragged=!1 var n @@ -1422,113 +1423,113 @@ this.refresh=function(){n=t(e.options.filter,e.element[0]),n.addClass("ui-select t.data(this,"selectable-item",{element:this,$element:e,left:n.left,top:n.top,right:n.left+e.outerWidth(),bottom:n.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"), unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=t("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var n=this -if(this.opos=[e.pageX,e.pageY],!this.options.disabled){var i=this.options -this.selectees=t(i.filter,this.element[0]),this._trigger("start",e),t(i.appendTo).append(this.helper),this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0}),i.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){ -var i=t.data(this,"selectable-item") -i.startselected=!0,e.metaKey||e.ctrlKey||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element})) +if(this.opos=[e.pageX,e.pageY],!this.options.disabled){var r=this.options +this.selectees=t(r.filter,this.element[0]),this._trigger("start",e),t(r.appendTo).append(this.helper),this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){ +var r=t.data(this,"selectable-item") +r.startselected=!0,e.metaKey||e.ctrlKey||(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",e,{unselecting:r.element})) -}),t(e.target).parents().andSelf().each(function(){var i=t.data(this,"selectable-item") -if(i){var r=!e.metaKey&&!e.ctrlKey||!i.$element.hasClass("ui-selected") -return i.$element.removeClass(r?"ui-unselecting":"ui-selected").addClass(r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",e,{selecting:i.element}):n._trigger("unselecting",e,{ -unselecting:i.element}),!1}})}},_mouseDrag:function(e){var n=this -if(this.dragged=!0,!this.options.disabled){var i=this.options,r=this.opos[0],o=this.opos[1],a=e.pageX,s=e.pageY -if(r>a){var l=a -a=r,r=l}if(o>s){var l=s -s=o,o=l}return this.helper.css({left:r,top:o,width:a-r,height:s-o}),this.selectees.each(function(){var l=t.data(this,"selectable-item") +}),t(e.target).parents().andSelf().each(function(){var r=t.data(this,"selectable-item") +if(r){var i=!e.metaKey&&!e.ctrlKey||!r.$element.hasClass("ui-selected") +return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",e,{selecting:r.element}):n._trigger("unselecting",e,{ +unselecting:r.element}),!1}})}},_mouseDrag:function(e){var n=this +if(this.dragged=!0,!this.options.disabled){var r=this.options,i=this.opos[0],o=this.opos[1],a=e.pageX,s=e.pageY +if(i>a){var l=a +a=i,i=l}if(o>s){var l=s +s=o,o=l}return this.helper.css({left:i,top:o,width:a-i,height:s-o}),this.selectees.each(function(){var l=t.data(this,"selectable-item") if(l&&l.element!=n.element[0]){var u=!1 -"touch"==i.tolerance?u=!(l.left>a||l.rights||l.bottomr&&l.righto&&l.bottoma||l.rights||l.bottomi&&l.righto&&l.bottom
").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===r.range||"max"===r.range?" ui-slider-range-"+r.range:""))), -i=r.values&&r.values.length||1,e=o.length;e
").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===i.range||"max"===i.range?" ui-slider-range-"+i.range:""))), +r=i.values&&i.values.length||1,e=o.length;en&&(r=n,o=t(this),a=e)}),d.range===!0&&this.values(1)===d.min&&(a+=1,o=t(this.handles[a])),s=this._start(e,a),s!==!1&&(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(), +var n,r,i,o,a,s,l,u,c=this,d=this.options +return!d.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:e.pageX,y:e.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1, +this.handles.each(function(e){var n=Math.abs(r-c.values(e)) +i>n&&(i=n,o=t(this),a=e)}),d.range===!0&&this.values(1)===d.min&&(a+=1,o=t(this.handles[a])),s=this._start(e,a),s!==!1&&(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(), l=o.offset(),u=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0) -},this.handles.hasClass("ui-state-hover")||this._slide(e,a,i),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(e) +},this.handles.hasClass("ui-state-hover")||this._slide(e,a,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(e) return this._slide(t,this._handleIndex,n),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex), this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){ -var e,n,i,r,o +var e,n,r,i,o return"horizontal"===this.orientation?(e=this.elementSize.width,n=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,n=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)), -i=n/e,i>1&&(i=1),i<0&&(i=0),"vertical"===this.orientation&&(i=1-i),r=this._valueMax()-this._valueMin(),o=this._valueMin()+i*r,this._trimAlignValue(o)},_start:function(t,e){var n={handle:this.handles[e], +r=n/e,r>1&&(r=1),r<0&&(r=0),"vertical"===this.orientation&&(r=1-r),i=this._valueMax()-this._valueMin(),o=this._valueMin()+r*i,this._trimAlignValue(o)},_start:function(t,e){var n={handle:this.handles[e], value:this.value()} -return this.options.values&&this.options.values.length&&(n.value=this.values(e),n.values=this.values()),this._trigger("start",t,n)},_slide:function(t,e,n){var i,r,o -this.options.values&&this.options.values.length?(i=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&n>i||1===e&&nr||1===e&&n1)return this.options.values[e]=this._trimAlignValue(n),this._refreshValue(),void this._change(null,e) if(!arguments.length)return this._values() if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value() -for(i=this.options.values,r=arguments[0],o=0;o=this._valueMax())return this._valueMax() -var e=this.options.step>0?this.options.step:1,n=(t-this._valueMin())%e,i=t-n -return 2*Math.abs(n)>=e&&(i+=n>0?e:-e),parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,n,i,r,o,a=this.options.range,s=this.options,l=this,u=!this._animateOff&&s.animate,c={} +var e=this.options.step>0?this.options.step:1,n=(t-this._valueMin())%e,r=t-n +return 2*Math.abs(n)>=e&&(r+=n>0?e:-e),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,n,r,i,o,a=this.options.range,s=this.options,l=this,u=!this._animateOff&&s.animate,c={} -this.options.values&&this.options.values.length?this.handles.each(function(i){n=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100,c["horizontal"===l.orientation?"left":"bottom"]=n+"%",t(this).stop(1,1)[u?"animate":"css"](c,s.animate), -l.options.range===!0&&("horizontal"===l.orientation?(0===i&&l.range.stop(1,1)[u?"animate":"css"]({left:n+"%"},s.animate),1===i&&l.range[u?"animate":"css"]({width:n-e+"%"},{queue:!1,duration:s.animate})):(0===i&&l.range.stop(1,1)[u?"animate":"css"]({ -bottom:n+"%"},s.animate),1===i&&l.range[u?"animate":"css"]({height:n-e+"%"},{queue:!1,duration:s.animate}))),e=n}):(i=this.value(),r=this._valueMin(),o=this._valueMax(),n=o!==r?(i-r)/(o-r)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=n+"%", +this.options.values&&this.options.values.length?this.handles.each(function(r){n=(l.values(r)-l._valueMin())/(l._valueMax()-l._valueMin())*100,c["horizontal"===l.orientation?"left":"bottom"]=n+"%",t(this).stop(1,1)[u?"animate":"css"](c,s.animate), +l.options.range===!0&&("horizontal"===l.orientation?(0===r&&l.range.stop(1,1)[u?"animate":"css"]({left:n+"%"},s.animate),1===r&&l.range[u?"animate":"css"]({width:n-e+"%"},{queue:!1,duration:s.animate})):(0===r&&l.range.stop(1,1)[u?"animate":"css"]({ +bottom:n+"%"},s.animate),1===r&&l.range[u?"animate":"css"]({height:n-e+"%"},{queue:!1,duration:s.animate}))),e=n}):(r=this.value(),i=this._valueMin(),o=this._valueMax(),n=o!==i?(r-i)/(o-i)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=n+"%", this.handle.stop(1,1)[u?"animate":"css"](c,s.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:n+"%"},s.animate),"max"===a&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({ width:100-n+"%"},{queue:!1,duration:s.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:n+"%"},s.animate),"max"===a&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({ height:100-n+"%"},{queue:!1,duration:s.animate}))}})}(jQuery),function(t,e){t.widget("ui.sortable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1, @@ -1538,41 +1539,41 @@ this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this. this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy() for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item") return this},_setOption:function(e,n){"disabled"===e?(this.options[e]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,n){ -var i=this +var r=this if(this.reverting)return!1 if(this.options.disabled||"static"==this.options.type)return!1 this._refreshItems(e) -var r=null,o=t(e.target).parents().each(function(){if(t.data(this,i.widgetName+"-item")==i)return r=t(this),!1}) -if(t.data(e.target,i.widgetName+"-item")==i&&(r=t(e.target)),!r)return!1 +var i=null,o=t(e.target).parents().each(function(){if(t.data(this,r.widgetName+"-item")==r)return i=t(this),!1}) +if(t.data(e.target,r.widgetName+"-item")==r&&(i=t(e.target)),!i)return!1 if(this.options.handle&&!n){var a=!1 -if(t(this.options.handle,r).find("*").andSelf().each(function(){this==e.target&&(a=!0)}),!a)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,n,i){var r=this.options +if(t(this.options.handle,i).find("*").andSelf().each(function(){this==e.target&&(a=!0)}),!a)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,n,r){var i=this.options if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(), this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(), relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY, -r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(), -this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",r.cursor)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")), -this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()), -this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this)) +i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(), +this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")), +this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()), +this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this)) -return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e), +return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e), !0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){ -var n=this.options,i=!1 -this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;r--){var o=this.items[r],a=o.item[0],s=this._intersectsWithPointer(o) +for(var i=this.items.length-1;i>=0;i--){var o=this.items[i],a=o.item[0],s=this._intersectsWithPointer(o) if(s&&o.instance===this.currentContainer&&!(a==this.currentItem[0]||this.placeholder[1==s?"next":"prev"]()[0]==a||t.contains(this.placeholder[0],a)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],a))){ if(this.direction=1==s?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(o))break this._rearrange(e,o),this._trigger("change",e,this._uiHash()) break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e), -this.options.revert){var i=this,r=this.placeholder.offset() -this.reverting=!0,t(this.helper).animate({left:r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop) -},parseInt(this.options.revert,10)||500,function(){i._clear(e)})}else this._clear(e,n) +this.options.revert){var r=this,i=this.placeholder.offset() +this.reverting=!0,t(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop) +},parseInt(this.options.revert,10)||500,function(){r._clear(e)})}else this._clear(e,n) return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show() @@ -1580,64 +1581,64 @@ for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactiv this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(), t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this -},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[] +},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[] return e=e||{},t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/) -n&&i.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[] -return e=e||{},n.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,i=this.positionAbs.top,r=i+this.helperProportions.height,o=t.left,a=o+t.width,s=t.top,l=s+t.height,u=this.offset.click.top,c=this.offset.click.left,d=i+u>s&&i+uo&&e+cs&&r+uo&&e+ct[this.floating?"width":"height"]?d:ot[this.floating?"width":"height"]?d:o0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options -return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n=[],i=[],r=this._connectWith() -if(r&&e)for(var o=r.length-1;o>=0;o--)for(var a=t(r[o]),s=a.length-1;s>=0;s--){var l=t.data(a[s],this.widgetName) -l&&l!=this&&!l.options.disabled&&i.push([t.isFunction(l.options.items)?l.options.items.call(l.element):t(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}i.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{ +return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n=[],r=[],i=this._connectWith() +if(i&&e)for(var o=i.length-1;o>=0;o--)for(var a=t(i[o]),s=a.length-1;s>=0;s--){var l=t.data(a[s],this.widgetName) +l&&l!=this&&!l.options.disabled&&r.push([t.isFunction(l.options.items)?l.options.items.call(l.element):t(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{ options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]) -for(var o=i.length-1;o>=0;o--)i[o][0].each(function(){n.push(this)}) +for(var o=r.length-1;o>=0;o--)r[o][0].each(function(){n.push(this)}) return t(n)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)") this.items=t.grep(this.items,function(t){for(var n=0;n=0;o--)for(var a=t(r[o]),s=a.length-1;s>=0;s--){var l=t.data(a[s],this.widgetName) -l&&l!=this&&!l.options.disabled&&(i.push([t.isFunction(l.options.items)?l.options.items.call(l.element[0],e,{item:this.currentItem}):t(l.options.items,l.element),l]),this.containers.push(l))}for(var o=i.length-1;o>=0;o--)for(var u=i[o][1],c=i[o][0],s=0,d=c.length;s=0;n--){var i=this.items[n] -if(i.instance==this.currentContainer||!this.currentContainer||i.item[0]==this.currentItem[0]){var r=this.options.toleranceElement?t(this.options.toleranceElement,i.item):i.item -e||(i.width=r.outerWidth(),i.height=r.outerHeight()) -var o=r.offset() -i.left=o.left,i.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this) +var n=this.items,r=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],i=this._connectWith() +if(i&&this.ready)for(var o=i.length-1;o>=0;o--)for(var a=t(i[o]),s=a.length-1;s>=0;s--){var l=t.data(a[s],this.widgetName) +l&&l!=this&&!l.options.disabled&&(r.push([t.isFunction(l.options.items)?l.options.items.call(l.element[0],e,{item:this.currentItem}):t(l.options.items,l.element),l]),this.containers.push(l))}for(var o=r.length-1;o>=0;o--)for(var u=r[o][1],c=r[o][0],s=0,d=c.length;s=0;n--){var r=this.items[n] +if(r.instance==this.currentContainer||!this.currentContainer||r.item[0]==this.currentItem[0]){var i=this.options.toleranceElement?t(this.options.toleranceElement,r.item):r.item +e||(r.width=i.outerWidth(),r.height=i.outerHeight()) +var o=i.offset() +r.left=o.left,r.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this) else for(var n=this.containers.length-1;n>=0;n--){var o=this.containers[n].element.offset() this.containers[n].containerCache.left=o.left,this.containers[n].containerCache.top=o.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight() }return this},_createPlaceholder:function(e){e=e||this var n=e.options -if(!n.placeholder||n.placeholder.constructor==String){var i=n.placeholder -n.placeholder={element:function(){var n=t(document.createElement(e.currentItem[0].nodeName)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0] -return i||(n.style.visibility="hidden"),n},update:function(t,r){i&&!n.forcePlaceholderSize||(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)), -r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}}e.placeholder=t(n.placeholder.element.call(e.element,e.currentItem)), -e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_contactContainers:function(e){for(var n=null,i=null,r=this.containers.length-1;r>=0;r--)if(!t.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){ -if(n&&t.contains(this.containers[r].element[0],n.element[0]))continue -n=this.containers[r],i=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",e,this._uiHash(this)),this.containers[r].containerCache.over=0) -if(n)if(1===this.containers.length)this.containers[i]._trigger("over",e,this._uiHash(this)),this.containers[i].containerCache.over=1 -else{for(var o=1e4,a=null,s=this.containers[i].floating?"left":"top",l=this.containers[i].floating?"width":"height",u=this.positionAbs[s]+this.offset.click[s],c=this.items.length-1;c>=0;c--)if(t.contains(this.containers[i].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){ -var d=this.items[c].item.offset()[s],h=!1 -Math.abs(d-u)>Math.abs(d+this.items[c][l]-u)&&(h=!0,d+=this.items[c][l]),Math.abs(d-u)=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){ +if(n&&t.contains(this.containers[i].element[0],n.element[0]))continue +n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0) +if(n)if(1===this.containers.length)this.containers[r]._trigger("over",e,this._uiHash(this)),this.containers[r].containerCache.over=1 +else{for(var o=1e4,a=null,s=this.containers[r].floating?"left":"top",l=this.containers[r].floating?"width":"height",u=this.positionAbs[s]+this.offset.click[s],c=this.items.length-1;c>=0;c--)if(t.contains(this.containers[r].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){ +var d=this.items[c].item.offset()[s],f=!1 +Math.abs(d-u)>Math.abs(d+this.items[c][l]-u)&&(f=!0,d+=this.items[c][l]),Math.abs(d-u)this.containment[2]&&(o=this.containment[2]+this. var s=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1] a=this.containment&&(s-this.offset.click.topthis.containment[3])?s-this.offset.click.topthis.containment[2])?l-this.offset.click.leftthis.containment[2])?l-this.offset.click.left=0;r--)n||i.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(function(t){ -return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over=0) +}}.call(this,this.currentContainer)),r.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))) +for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(t){ +return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0) if(this._storedCursor&&t("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex), this.dragging=!1,this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",e,this._uiHash()) -for(var r=0;r0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){ function n(){var t=this.element[0]===this.document[0].activeElement -t||(this.element.focus(),this.previous=i,this._delay(function(){this.previous=i}))}var i -i=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e) +t||(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r}))}var r +r=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e) },"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return this._start(e)!==!1&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e) @@ -1711,11 +1712,11 @@ i=this.element[0]===this.document[0].activeElement?this.previous:this.element.va this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()), -this.options.disabled&&this.disable()},_keydown:function(e){var n=this.options,i=t.ui.keyCode -switch(e.keyCode){case i.UP:return this._repeat(null,1,e),!0 -case i.DOWN:return this._repeat(null,-1,e),!0 -case i.PAGE_UP:return this._repeat(null,n.page,e),!0 -case i.PAGE_DOWN:return this._repeat(null,-n.page,e),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return"" +this.options.disabled&&this.disable()},_keydown:function(e){var n=this.options,r=t.ui.keyCode +switch(e.keyCode){case r.UP:return this._repeat(null,1,e),!0 +case r.DOWN:return this._repeat(null,-1,e),!0 +case r.PAGE_UP:return this._repeat(null,n.page,e),!0 +case r.PAGE_DOWN:return this._repeat(null,-n.page,e),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return"" },_start:function(t){return!(!this.spinning&&this._trigger("start",t)===!1)&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,n){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){ this._repeat(40,e,n)},t),this._spin(e*this.options.step,n)},_spin:function(t,e){var n=this.value()||0 @@ -1724,8 +1725,8 @@ this.counter||(this.counter=1),n=this._adjustValue(n+t*this._increment(this.coun return n?t.isFunction(n)?n(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step) return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),n=e.indexOf(".") -return n===-1?0:e.length-n-1},_adjustValue:function(t){var e,n,i=this.options -return e=null!==i.min?i.min:0,n=t-e,n=Math.round(n/i.step)*i.step,t=e+n,t=parseFloat(t.toFixed(this._precision())),null!==i.max&&t>i.max?i.max:null!==i.min&&tr.max?r.max:null!==r.min&&t1&&t.href.replace(o,"")===location.href.replace(o,"").replace(/\s/g,"%20")} -var r=0,o=/#.*$/ +},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function n(){return++i}function r(t){return t.hash.length>1&&t.href.replace(o,"")===location.href.replace(o,"").replace(/\s/g,"%20")} +var i=0,o=/#.*$/ t.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){ -var e=this,n=this.options,i=n.active,r=location.hash.substring(1) +var e=this,n=this.options,r=n.active,i=location.hash.substring(1) this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){ t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(), -null===i&&(r&&this.tabs.each(function(e,n){if(t(n).attr("aria-controls")===r)return i=e,!1}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==i&&i!==-1||(i=!!this.tabs.length&&0)), -i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),i===-1&&(i=!n.collapsible&&0)),n.active=i,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),t.isArray(n.disabled)&&(n.disabled=t.unique(n.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){ +null===r&&(i&&this.tabs.each(function(e,n){if(t(n).attr("aria-controls")===i)return r=e,!1}),null===r&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==r&&r!==-1||(r=!!this.tabs.length&&0)), +r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=!n.collapsible&&0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),t.isArray(n.disabled)&&(n.disabled=t.unique(n.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){ return e.tabs.index(t)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=t(),this._refresh(),this.active.length&&this.load(n.active) -},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var n=t(this.document[0].activeElement).closest("li"),i=this.tabs.index(n),r=!0 +},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var n=t(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0 -if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:i++ +if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:r++ break -case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:r=!1,i-- +case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:i=!1,r-- break -case t.ui.keyCode.END:i=this.anchors.length-1 +case t.ui.keyCode.END:r=this.anchors.length-1 break -case t.ui.keyCode.HOME:i=0 +case t.ui.keyCode.HOME:r=0 break -case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(i) -case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i) -default:return}e.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,r),e.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){ -this.option("active",i)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)), -!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,n){function i(){return e>r&&(e=0),e<0&&(e=r),e}for(var r=this.tabs.length-1;t.inArray(i(),this.options.disabled)!==-1;)e=n?e+1:e-1 +case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(r) +case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(r!==this.options.active&&r) +default:return}e.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),e.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){ +this.option("active",r)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)), +!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,n){function r(){return e>i&&(e=0),e<0&&(e=i),e}for(var i=this.tabs.length-1;t.inArray(r(),this.options.disabled)!==-1;)e=n?e+1:e-1 return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,e){return"active"===t?void this._activate(e):"disabled"===t?void this._setupDisabled(e):(this._super(t,e), @@ -1775,74 +1776,74 @@ this._setupEvents(this.options.event),this._setupHeightStyle(this.options.height "aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({ "aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({ -role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(n,r){ -var o,a,s,l=t(r).uniqueId().attr("id"),u=t(r).closest("li"),c=u.attr("aria-controls") -i(r)?(o=r.hash,a=e.element.find(e._sanitizeSelector(o))):(s=e._tabId(u),o="#"+s,a=e.element.find(o),a.length||(a=e._createPanel(s),a.insertAfter(e.panels[n-1]||e.tablist)),a.attr("aria-live","polite")), +role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(n,i){ +var o,a,s,l=t(i).uniqueId().attr("id"),u=t(i).closest("li"),c=u.attr("aria-controls") +r(i)?(o=i.hash,a=e.element.find(e._sanitizeSelector(o))):(s=e._tabId(u),o="#"+s,a=e.element.find(o),a.length||(a=e._createPanel(s),a.insertAfter(e.panels[n-1]||e.tablist)),a.attr("aria-live","polite")), a.length&&(e.panels=e.panels.add(a)),c&&u.data("ui-tabs-aria-controls",c),u.attr({"aria-controls":o.substring(1),"aria-labelledby":l}),a.attr("aria-labelledby",l)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel") },_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("
").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0) },_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1) -for(var n=0,i;i=this.tabs[n];n++)e===!0||t.inArray(n,e)!==-1?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled") +for(var n=0,r;r=this.tabs[n];n++)e===!0||t.inArray(n,e)!==-1?t(r).addClass("ui-state-disabled").attr("aria-disabled","true"):t(r).removeClass("ui-state-disabled").removeAttr("aria-disabled") this.options.disabled=e},_setupEvents:function(e){var n={click:function(t){t.preventDefault()}} e&&t.each(e.split(" "),function(t,e){n[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{ -keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var n,i,r=this.element.parent() -"fill"===e?(t.support.minHeight||(i=r.css("overflow"),r.css("overflow","hidden")),n=r.height(),this.element.siblings(":visible").each(function(){var e=t(this),i=e.css("position") -"absolute"!==i&&"fixed"!==i&&(n-=e.outerHeight(!0))}),i&&r.css("overflow",i),this.element.children().not(this.panels).each(function(){n-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,n-t(this).innerHeight()+t(this).height())) +keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var n,r,i=this.element.parent() +"fill"===e?(t.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var e=t(this),r=e.css("position") +"absolute"!==r&&"fixed"!==r&&(n-=e.outerHeight(!0))}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,n-t(this).innerHeight()+t(this).height())) -}).css("overflow","auto")):"auto"===e&&(n=0,this.panels.each(function(){n=Math.max(n,t(this).height("").height())}).height(n))},_eventHandler:function(e){var n=this.options,i=this.active,r=t(e.currentTarget),o=r.closest("li"),a=o[0]===i[0],s=a&&n.collapsible,l=s?t():this._getPanelForTab(o),u=i.length?this._getPanelForTab(i):t(),c={ -oldTab:i,oldPanel:u,newTab:s?t():o,newPanel:l} +}).css("overflow","auto")):"auto"===e&&(n=0,this.panels.each(function(){n=Math.max(n,t(this).height("").height())}).height(n))},_eventHandler:function(e){var n=this.options,r=this.active,i=t(e.currentTarget),o=i.closest("li"),a=o[0]===r[0],s=a&&n.collapsible,l=s?t():this._getPanelForTab(o),u=r.length?this._getPanelForTab(r):t(),c={ +oldTab:r,oldPanel:u,newTab:s?t():o,newPanel:l} e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!n.collapsible||this._trigger("beforeActivate",e,c)===!1||(n.active=!s&&this.tabs.index(o),this.active=a?t():o, -this.xhr&&this.xhr.abort(),u.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,n){function i(){ -o.running=!1,o._trigger("activate",e,n)}function r(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,i):(a.show(),i())}var o=this,a=n.newPanel,s=n.oldPanel +this.xhr&&this.xhr.abort(),u.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,n){function r(){ +o.running=!1,o._trigger("activate",e,n)}function i(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,r):(a.show(),r())}var o=this,a=n.newPanel,s=n.oldPanel -this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), -s.hide(),r()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),a.length&&s.length?n.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex") +this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), +s.hide(),i()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),a.length&&s.length?n.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex") -}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var n,i=this._findActive(e) -i[0]!==this.active[0]&&(i.length||(i=this.active),n=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e) +}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var n,r=this._findActive(e) +r[0]!==this.active[0]&&(r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e) },_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"), this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(), this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role") }),this.tabs.each(function(){var e=t(this),n=e.data("ui-tabs-aria-controls") -n?e.attr("aria-controls",n):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(n){var i=this.options.disabled -i!==!1&&(n===e?i=!1:(n=this._getIndex(n),i=t.isArray(i)?t.map(i,function(t){return t!==n?t:null}):t.map(this.tabs,function(t,e){return e!==n?e:null})),this._setupDisabled(i))},disable:function(n){var i=this.options.disabled +n?e.attr("aria-controls",n):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled +r!==!1&&(n===e?r=!1:(n=this._getIndex(n),r=t.isArray(r)?t.map(r,function(t){return t!==n?t:null}):t.map(this.tabs,function(t,e){return e!==n?e:null})),this._setupDisabled(r))},disable:function(n){var r=this.options.disabled -if(i!==!0){if(n===e)i=!0 -else{if(n=this._getIndex(n),t.inArray(n,i)!==-1)return -i=t.isArray(i)?t.merge([n],i).sort():[n]}this._setupDisabled(i)}},load:function(e,n){e=this._getIndex(e) -var r=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),s=this._getPanelForTab(o),l={tab:o,panel:s} -i(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,n,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){ -s.html(t),r._trigger("load",n,l)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&r.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),s.removeAttr("aria-busy"),t===r.xhr&&delete r.xhr},1) +if(r!==!0){if(n===e)r=!0 +else{if(n=this._getIndex(n),t.inArray(n,r)!==-1)return +r=t.isArray(r)?t.merge([n],r).sort():[n]}this._setupDisabled(r)}},load:function(e,n){e=this._getIndex(e) +var i=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),s=this._getPanelForTab(o),l={tab:o,panel:s} +r(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,n,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){ +s.html(t),i._trigger("load",n,l)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&i.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),s.removeAttr("aria-busy"),t===i.xhr&&delete i.xhr},1) -})))},_ajaxSettings:function(e,n,i){var r=this -return{url:e.attr("href"),beforeSend:function(e,o){return r._trigger("beforeLoad",n,t.extend({jqXHR:e,ajaxSettings:o},i))}}},_getPanelForTab:function(e){var n=t(e).attr("aria-controls") +})))},_ajaxSettings:function(e,n,r){var i=this +return{url:e.attr("href"),beforeSend:function(e,o){return i._trigger("beforeLoad",n,t.extend({jqXHR:e,ajaxSettings:o},r))}}},_getPanelForTab:function(e){var n=t(e).attr("aria-controls") return this.element.find(this._sanitizeSelector("#"+n))}}),t.uiBackCompat!==!1&&(t.ui.tabs.prototype._ui=function(t,e){return{tab:t,panel:e,index:this.anchors.index(t)}},t.widget("ui.tabs",t.ui.tabs,{url:function(t,e){ this.anchors.eq(t).attr("href",e)}}),t.widget("ui.tabs",t.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super() var e=this -this._on({tabsbeforeload:function(n,i){return t.data(i.tab[0],"cache.tabs")?void n.preventDefault():void i.jqXHR.success(function(){e.options.cache&&t.data(i.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(e,n,i){ -var r=this.options.ajaxOptions -return t.extend({},r,{error:function(t,e){try{r.error(t,e,i.tab.closest("li").index(),i.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(t,e){"cache"===t&&e===!1&&this.anchors.removeData("cache.tabs"), +this._on({tabsbeforeload:function(n,r){return t.data(r.tab[0],"cache.tabs")?void n.preventDefault():void r.jqXHR.success(function(){e.options.cache&&t.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(e,n,r){ +var i=this.options.ajaxOptions +return t.extend({},i,{error:function(t,e){try{i.error(t,e,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(t,e){"cache"===t&&e===!1&&this.anchors.removeData("cache.tabs"), this._super(t,e)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(t){this.anchors.eq(t).removeData("cache.tabs"),this._superApply(arguments)}}),t.widget("ui.tabs",t.ui.tabs,{ abort:function(){this.xhr&&this.xhr.abort()}}),t.widget("ui.tabs",t.ui.tabs,{options:{spinner:"Loading…"},_create:function(){this._super(),this._on({tabsbeforeload:function(t,e){if(t.target===this.element[0]&&this.options.spinner){ -var n=e.tab.find("span"),i=n.html() -n.html(this.options.spinner),e.jqXHR.complete(function(){n.html(i)})}}})}}),t.widget("ui.tabs",t.ui.tabs,{options:{enable:null,disable:null},enable:function(e){var n=this.options,i;(e&&n.disabled===!0||t.isArray(n.disabled)&&t.inArray(e,n.disabled)!==-1)&&(i=!0), -this._superApply(arguments),i&&this._trigger("enable",null,this._ui(this.anchors[e],this.panels[e]))},disable:function(e){var n=this.options,i;(e&&n.disabled===!1||t.isArray(n.disabled)&&t.inArray(e,n.disabled)===-1)&&(i=!0), -this._superApply(arguments),i&&this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}}),t.widget("ui.tabs",t.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
  • #{label}
  • " -},add:function(n,i,r){r===e&&(r=this.anchors.length) -var o,a,s=this.options,l=t(s.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,i)),u=n.indexOf("#")?this._tabId(l):n.replace("#","") -return l.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),l.attr("aria-controls",u),o=r>=this.tabs.length,a=this.element.find("#"+u),a.length||(a=this._createPanel(u),o?r>0?a.insertAfter(this.panels.eq(-1)):a.appendTo(this.element):a.insertBefore(this.panels[r])), -a.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),o?l.appendTo(this.tablist):l.insertBefore(this.tabs[r]),s.disabled=t.map(s.disabled,function(t){return t>=r?++t:t}),this.refresh(), -1===this.tabs.length&&s.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[r],this.panels[r])),this},remove:function(e){e=this._getIndex(e) -var n=this.options,i=this.tabs.eq(e).remove(),r=this._getPanelForTab(i).remove() -return i.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(e+(e+1=e?--t:t}), -this.refresh(),this._trigger("remove",null,this._ui(i.find("a")[0],r[0])),this}}),t.widget("ui.tabs",t.ui.tabs,{length:function(){return this.anchors.length}}),t.widget("ui.tabs",t.ui.tabs,{options:{idPrefix:"ui-tabs-" -},_tabId:function(e){var i=e.is("li")?e.find("a[href]"):e -return i=i[0],t(i).closest("li").attr("aria-controls")||i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+n()}}),t.widget("ui.tabs",t.ui.tabs,{options:{panelTemplate:"
    " +var n=e.tab.find("span"),r=n.html() +n.html(this.options.spinner),e.jqXHR.complete(function(){n.html(r)})}}})}}),t.widget("ui.tabs",t.ui.tabs,{options:{enable:null,disable:null},enable:function(e){var n=this.options,r;(e&&n.disabled===!0||t.isArray(n.disabled)&&t.inArray(e,n.disabled)!==-1)&&(r=!0), +this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[e],this.panels[e]))},disable:function(e){var n=this.options,r;(e&&n.disabled===!1||t.isArray(n.disabled)&&t.inArray(e,n.disabled)===-1)&&(r=!0), +this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}}),t.widget("ui.tabs",t.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
  • #{label}
  • " +},add:function(n,r,i){i===e&&(i=this.anchors.length) +var o,a,s=this.options,l=t(s.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),u=n.indexOf("#")?this._tabId(l):n.replace("#","") +return l.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),l.attr("aria-controls",u),o=i>=this.tabs.length,a=this.element.find("#"+u),a.length||(a=this._createPanel(u),o?i>0?a.insertAfter(this.panels.eq(-1)):a.appendTo(this.element):a.insertBefore(this.panels[i])), +a.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),o?l.appendTo(this.tablist):l.insertBefore(this.tabs[i]),s.disabled=t.map(s.disabled,function(t){return t>=i?++t:t}),this.refresh(), +1===this.tabs.length&&s.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(e){e=this._getIndex(e) +var n=this.options,r=this.tabs.eq(e).remove(),i=this._getPanelForTab(r).remove() +return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(e+(e+1=e?--t:t}), +this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),t.widget("ui.tabs",t.ui.tabs,{length:function(){return this.anchors.length}}),t.widget("ui.tabs",t.ui.tabs,{options:{idPrefix:"ui-tabs-" +},_tabId:function(e){var r=e.is("li")?e.find("a[href]"):e +return r=r[0],t(r).closest("li").attr("aria-controls")||r.title&&r.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+n()}}),t.widget("ui.tabs",t.ui.tabs,{options:{panelTemplate:"
    " },_createPanel:function(e){return t(this.options.panelTemplate).attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),t.widget("ui.tabs",t.ui.tabs,{_create:function(){ var t=this.options null===t.active&&t.selected!==e&&(t.active=t.selected!==-1&&t.selected),this._super(),t.selected=t.active,t.selected===!1&&(t.selected=-1)},_setOption:function(t,e){if("selected"!==t)return this._super(t,e) @@ -1853,224 +1854,224 @@ this._super("active",e!==-1&&e),n.selected=n.active,n.selected===!1&&(n.selected }}),t.widget("ui.tabs",t.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0])) -},_trigger:function(t,e,n){var i,r,o=this._superApply(arguments) -return!!o&&("beforeActivate"===t?(i=n.newTab.length?n.newTab:n.oldTab,r=n.newPanel.length?n.newPanel:n.oldPanel,o=this._super("select",e,{tab:i.find(".ui-tabs-anchor")[0],panel:r[0],index:i.closest("li").index() +},_trigger:function(t,e,n){var r,i,o=this._superApply(arguments) +return!!o&&("beforeActivate"===t?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,o=this._super("select",e,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index() })):"activate"===t&&n.newTab.length&&(o=this._super("show",e,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),o)}}),t.widget("ui.tabs",t.ui.tabs,{select:function(t){ if(t=this._getIndex(t),t===-1){if(!this.options.collapsible||this.options.selected===-1)return t=this.options.selected}this.anchors.eq(t).trigger(this.options.event+this.eventNamespace)}}),function(){var e=0 t.widget("ui.tabs",t.ui.tabs,{options:{cookie:null},_create:function(){var t=this.options,e -null==t.active&&t.cookie&&(e=parseInt(this._cookie(),10),e===-1&&(e=!1),t.active=e),this._super()},_cookie:function(n){var i=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++e)] -return arguments.length&&(i.push(n===!1?-1:n),i.push(this.options.cookie)),t.cookie.apply(null,i)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie) +null==t.active&&t.cookie&&(e=parseInt(this._cookie(),10),e===-1&&(e=!1),t.active=e),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++e)] +return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),t.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie) },_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie) -}})}(),t.widget("ui.tabs",t.ui.tabs,{_trigger:function(e,n,i){var r=t.extend({},i) -return"load"===e&&(r.panel=r.panel[0],r.tab=r.tab.find(".ui-tabs-anchor")[0]),this._super(e,n,r)}}),t.widget("ui.tabs",t.ui.tabs,{options:{fx:null},_getFx:function(){var e,n,i=this.options.fx -return i&&(t.isArray(i)?(e=i[0],n=i[1]):e=n=i),i?{show:n,hide:e}:null},_toggle:function(t,e){function n(){r.running=!1,r._trigger("activate",t,e)}function i(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"), -o.length&&s.show?o.animate(s.show,s.show.duration,function(){n()}):(o.show(),n())}var r=this,o=e.newPanel,a=e.oldPanel,s=this._getFx() -return s?(r.running=!0,void(a.length&&s.hide?a.animate(s.hide,s.hide.duration,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), -a.hide(),i()))):this._super(t,e)}}))}(jQuery),function(t){function e(e,n){var i=(e.attr("aria-describedby")||"").split(/\s+/) -i.push(n),e.data("ui-tooltip-id",n).attr("aria-describedby",t.trim(i.join(" ")))}function n(e){var n=e.data("ui-tooltip-id"),i=(e.attr("aria-describedby")||"").split(/\s+/),r=t.inArray(n,i) -r!==-1&&i.splice(r,1),e.removeData("ui-tooltip-id"),i=t.trim(i.join(" ")),i?e.attr("aria-describedby",i):e.removeAttr("aria-describedby")}var i=0 +}})}(),t.widget("ui.tabs",t.ui.tabs,{_trigger:function(e,n,r){var i=t.extend({},r) +return"load"===e&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(e,n,i)}}),t.widget("ui.tabs",t.ui.tabs,{options:{fx:null},_getFx:function(){var e,n,r=this.options.fx +return r&&(t.isArray(r)?(e=r[0],n=r[1]):e=n=r),r?{show:n,hide:e}:null},_toggle:function(t,e){function n(){i.running=!1,i._trigger("activate",t,e)}function r(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"), +o.length&&s.show?o.animate(s.show,s.show.duration,function(){n()}):(o.show(),n())}var i=this,o=e.newPanel,a=e.oldPanel,s=this._getFx() +return s?(i.running=!0,void(a.length&&s.hide?a.animate(s.hide,s.hide.duration,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), +a.hide(),r()))):this._super(t,e)}}))}(jQuery),function(t){function e(e,n){var r=(e.attr("aria-describedby")||"").split(/\s+/) +r.push(n),e.data("ui-tooltip-id",n).attr("aria-describedby",t.trim(r.join(" ")))}function n(e){var n=e.data("ui-tooltip-id"),r=(e.attr("aria-describedby")||"").split(/\s+/),i=t.inArray(n,r) +i!==-1&&r.splice(i,1),e.removeData("ui-tooltip-id"),r=t.trim(r.join(" ")),r?e.attr("aria-describedby",r):e.removeAttr("aria-describedby")}var r=0 t.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return t(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip" },show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,n){ -var i=this -return"disabled"===e?(this[n?"_disable":"_enable"](),void(this.options[e]=n)):(this._super(e,n),void("content"===e&&t.each(this.tooltips,function(t,e){i._updateContent(e)})))},_disable:function(){var e=this +var r=this +return"disabled"===e?(this[n?"_disable":"_enable"](),void(this.options[e]=n)):(this._super(e,n),void("content"===e&&t.each(this.tooltips,function(t,e){r._updateContent(e)})))},_disable:function(){var e=this -t.each(this.tooltips,function(n,i){var r=t.Event("blur") -r.target=r.currentTarget=i[0],e.close(r,!0)}),this.element.find(this.options.items).andSelf().each(function(){var e=t(this) +t.each(this.tooltips,function(n,r){var i=t.Event("blur") +i.target=i.currentTarget=r[0],e.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var e=t(this) e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var e=t(this) -e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var n=this,i=t(e?e.target:this.element).closest(this.options.items) -i.length&&!i.data("ui-tooltip-id")&&(i.attr("title")&&i.data("ui-tooltip-title",i.attr("title")),i.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&i.parents().each(function(){var e=t(this),i -e.data("ui-tooltip-open")&&(i=t.Event("blur"),i.target=i.currentTarget=this,n.close(i,!0)),e.attr("title")&&(e.uniqueId(),n.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._updateContent(i,e)) +e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var n=this,r=t(e?e.target:this.element).closest(this.options.items) +r.length&&!r.data("ui-tooltip-id")&&(r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&r.parents().each(function(){var e=t(this),r +e.data("ui-tooltip-open")&&(r=t.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),e.attr("title")&&(e.uniqueId(),n.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._updateContent(r,e)) -},_updateContent:function(t,e){var n,i=this.options.content,r=this,o=e?e.type:null -return"string"==typeof i?this._open(e,t,i):(n=i.call(t[0],function(n){t.data("ui-tooltip-open")&&r._delay(function(){e&&(e.type=o),this._open(e,t,n)})}),void(n&&this._open(e,t,n)))},_open:function(n,i,r){ +},_updateContent:function(t,e){var n,r=this.options.content,i=this,o=e?e.type:null +return"string"==typeof r?this._open(e,t,r):(n=r.call(t[0],function(n){t.data("ui-tooltip-open")&&i._delay(function(){e&&(e.type=o),this._open(e,t,n)})}),void(n&&this._open(e,t,n)))},_open:function(n,r,i){ function o(t){u.of=t,a.is(":hidden")||a.position(u)}var a,s,l,u=t.extend({},this.options.position) -if(r){if(a=this._find(i),a.length)return void a.find(".ui-tooltip-content").html(r) -i.is("[title]")&&(n&&"mouseover"===n.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),e(i,a.attr("id")),a.find(".ui-tooltip-content").html(r),this.options.track&&n&&/^mouse/.test(n.type)?(this._on(this.document,{ -mousemove:o}),o(n)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(l=setInterval(function(){a.is(":visible")&&(o(u.of), +if(i){if(a=this._find(r),a.length)return void a.find(".ui-tooltip-content").html(i) +r.is("[title]")&&(n&&"mouseover"===n.type?r.attr("title",""):r.removeAttr("title")),a=this._tooltip(r),e(r,a.attr("id")),a.find(".ui-tooltip-content").html(i),this.options.track&&n&&/^mouse/.test(n.type)?(this._on(this.document,{ +mousemove:o}),o(n)):a.position(t.extend({of:r},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(l=setInterval(function(){a.is(":visible")&&(o(u.of), clearInterval(l))},t.fx.interval)),this._trigger("open",n,{tooltip:a}),s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var n=t.Event(e) -n.currentTarget=i[0],this.close(n,!0)}},remove:function(){this._removeTooltip(a)}},n&&"mouseover"!==n.type||(s.mouseleave="close"),n&&"focusin"!==n.type||(s.focusout="close"),this._on(!0,i,s)}},close:function(e){ -var i=this,r=t(e?e.currentTarget:this.element),o=this._find(r) -this.closing||(r.data("ui-tooltip-title")&&r.attr("title",r.data("ui-tooltip-title")),n(r),o.stop(!0),this._hide(o,this.options.hide,function(){i._removeTooltip(t(this))}),r.removeData("ui-tooltip-open"), -this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,n){t(n.element).attr("title",n.title), -delete i.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var n="ui-tooltip-"+i++,r=t("
    ").attr({id:n,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")) +n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(a)}},n&&"mouseover"!==n.type||(s.mouseleave="close"),n&&"focusin"!==n.type||(s.focusout="close"),this._on(!0,r,s)}},close:function(e){ +var r=this,i=t(e?e.currentTarget:this.element),o=this._find(i) +this.closing||(i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),n(i),o.stop(!0),this._hide(o,this.options.hide,function(){r._removeTooltip(t(this))}),i.removeData("ui-tooltip-open"), +this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,n){t(n.element).attr("title",n.title), +delete r.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var n="ui-tooltip-"+r++,i=t("
    ").attr({id:n,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")) -return t("
    ").addClass("ui-tooltip-content").appendTo(r),r.appendTo(this.document[0].body),t.fn.bgiframe&&r.bgiframe(),this.tooltips[n]=e,r},_find:function(e){var n=e.data("ui-tooltip-id") +return t("
    ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),t.fn.bgiframe&&i.bgiframe(),this.tooltips[n]=e,i},_find:function(e){var n=e.data("ui-tooltip-id") return n?t("#"+n):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this -t.each(this.tooltips,function(n,i){var r=t.Event("blur") -r.target=r.currentTarget=i[0],e.close(r,!0),t("#"+n).remove(),i.data("ui-tooltip-title")&&(i.attr("title",i.data("ui-tooltip-title")),i.removeData("ui-tooltip-title"))})}})}(jQuery)}).call(exports,__webpack_require__(1)) +t.each(this.tooltips,function(n,r){var i=t.Event("blur") +i.target=i.currentTarget=r[0],e.close(i,!0),t("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})}(jQuery)}).call(exports,__webpack_require__(1)) },,,,,,,,,,,,,,,function(t,e){t.exports=ReactDom},,,,,,,,,,,,,,,,function(t,e,n){(function(t){var e !function(){var t={},n=/xyz/.test(function(){var t})?/\b_super\b/:/.*/ -e=function(){},e.addMethod=function(t,e){var i=this._super&&this._super.prototype -i&&n.test(e)?this.prototype[t]=function(){var n=this._super -this._super=i[t] -try{var r=e.apply(this,arguments)}finally{this._super=n}return r}:this.prototype[t]=e},e.addMethods=function(t){for(var e in t)"function"==typeof t[e]?this.addMethod(e,t[e]):this.prototype[e]=t[e]},e.subclassOf=function(t){ +e=function(){},e.addMethod=function(t,e){var r=this._super&&this._super.prototype +r&&n.test(e)?this.prototype[t]=function(){var n=this._super +this._super=r[t] +try{var i=e.apply(this,arguments)}finally{this._super=n}return i}:this.prototype[t]=e},e.addMethods=function(t){for(var e in t)"function"==typeof t[e]?this.addMethod(e,t[e]):this.prototype[e]=t[e]},e.subclassOf=function(t){ for(var e=this;e;){if(e===t)return!0 -e=e._super}},e.extend=function(n){var i=function(){if(arguments[0]!==t){if(!(this instanceof i)){var e=new i(t) +e=e._super}},e.extend=function(n){var r=function(){if(arguments[0]!==t){if(!(this instanceof r)){var e=new r(t) return e.init&&e.init.apply(e,arguments),e}this.init&&this.init.apply(this,arguments)}} -return i.constructor=i,i.extend=e.extend,i.addMethod=e.addMethod,i.addMethods=e.addMethods,i.subclassOf=e.subclassOf,i._super=this,i.prototype=new this(t),i.prototype.constructor=i,i.addMethods(n),i}}(), +return r.constructor=r,r.extend=e.extend,r.addMethod=e.addMethod,r.addMethods=e.addMethods,r.subclassOf=e.subclassOf,r._super=this,r.prototype=new this(t),r.prototype.constructor=r,r.addMethods(n),r}}(), function(t){var n={UNICODE:/\\[0-9a-f]{1,6}(?:\r\n|[ \n\r\t\f])?/,ESCAPE:/(?:UNICODE)|\\[^\n\r\f0-9a-f]/,NONASCII:/[^\x00-\x7F]/,NMSTART:/[_a-z]|(?:NONASCII)|(?:ESCAPE)/,NMCHAR:/[_a-z0-9-]|(?:NONASCII)|(?:ESCAPE)/, IDENT:/-?(?:NMSTART)(?:NMCHAR)*/,NL:/\n|\r\n|\r|\f/,STRING:/(?:STRING1)|(?:STRING2)|(?:STRINGBARE)/,STRING1:/"(?:(?:ESCAPE)|\\(?:NL)|[^\n\r\f\"])*"/,STRING2:/'(?:(?:ESCAPE)|\\(?:NL)|[^\n\r\f\'])*'/,STRINGBARE:/(?:(?:ESCAPE)|\\(?:NL)|[^\n\r\f\]])*/, -FUNCTION:/(?:IDENT)\(\)/,INTEGER:/[0-9]+/,WITHN:/([-+])?(INTEGER)?(n)\s*(?:([-+])\s*(INTEGER))?/,WITHOUTN:/([-+])?(INTEGER)/},i={not:/:not\(/,not_end:/\)/,tag:/((?:IDENT)|\*)/,id:/#(IDENT)/,cls:/\.(IDENT)/, +FUNCTION:/(?:IDENT)\(\)/,INTEGER:/[0-9]+/,WITHN:/([-+])?(INTEGER)?(n)\s*(?:([-+])\s*(INTEGER))?/,WITHOUTN:/([-+])?(INTEGER)/},r={not:/:not\(/,not_end:/\)/,tag:/((?:IDENT)|\*)/,id:/#(IDENT)/,cls:/\.(IDENT)/, attr:/\[\s*(IDENT)\s*(?:([^=]?=)\s*(STRING)\s*)?\]/,pseudo_el:/(?::(first-line|first-letter|before|after))|(?:::((?:FUNCTION)|(?:IDENT)))/,pseudo_cls_nth:/:nth-child\(\s*(?:(?:WITHN)|(?:WITHOUTN)|(odd|even))\s*\)/, -pseudo_cls:/:(IDENT)/,comb:/\s*(\+|~|>)\s*|\s+/,comma:/\s*,\s*/,important:/\s+!important\s*$/},r=/[A-Z][A-Z0-9]+/ -for(var o in i){for(var a,s=i[o].source;a=s.match(r);)s=s.replace(a[0],n[a[0]].source) -i[o]=new RegExp(s,"gi")}var l=e.extend({init:function(t){this.str=t,this.pos=0},match:function(t){var e +pseudo_cls:/:(IDENT)/,comb:/\s*(\+|~|>)\s*|\s+/,comma:/\s*,\s*/,important:/\s+!important\s*$/},i=/[A-Z][A-Z0-9]+/ +for(var o in r){for(var a,s=r[o].source;a=s.match(i);)s=s.replace(a[0],n[a[0]].source) +r[o]=new RegExp(s,"gi")}var l=e.extend({init:function(t){this.str=t,this.pos=0},match:function(t){var e return t.lastIndex=this.pos,(e=t.exec(this.str))&&e.index==this.pos?(this.pos=t.lastIndex?t.lastIndex:this.str.length,e):null},peek:function(t){var e return t.lastIndex=this.pos,(e=t.exec(this.str))&&e.index==this.pos?e:null},showpos:function(){return this.str.slice(0,this.pos)+""+this.str.slice(this.pos)},done:function(){return this.pos==this.str.length -}}),u=e.extend({}),c=u.extend({init:function(){this.tag=null,this.id=null,this.classes=[],this.attrs=[],this.nots=[],this.pseudo_classes=[],this.pseudo_els=[]},parse:function(t){var e;(e=t.match(i.tag))&&(this.tag=e[1]) +}}),u=e.extend({}),c=u.extend({init:function(){this.tag=null,this.id=null,this.classes=[],this.attrs=[],this.nots=[],this.pseudo_classes=[],this.pseudo_els=[]},parse:function(t){var e;(e=t.match(r.tag))&&(this.tag=e[1]) -do if(e=t.match(i.not)){if(this.nots[this.nots.length]=h().parse(t),!(e=t.match(i.not_end)))throw"Invalid :not term in selector"}else if(e=t.match(i.id))this.id=e[1] -else if(e=t.match(i.cls))this.classes[this.classes.length]=e[1] -else if(e=t.match(i.attr))this.attrs[this.attrs.length]=[e[1],e[2],e[3]] -else if(e=t.match(i.pseudo_el))this.pseudo_els[this.pseudo_els.length]=e[1]||e[2] -else if(e=t.match(i.pseudo_cls_nth)){if(e[3])var n=parseInt((e[1]||"")+(e[2]||"1")),r=parseInt((e[4]||"")+(e[5]||"0")) -else var n=e[8]?2:0,r=e[8]?4-e[8].length:parseInt((e[6]||"")+e[7]) -this.pseudo_classes[this.pseudo_classes.length]=["nth-child",[n,r]]}else(e=t.match(i.pseudo_cls))&&(this.pseudo_classes[this.pseudo_classes.length]=[e[1]]) +do if(e=t.match(r.not)){if(this.nots[this.nots.length]=f().parse(t),!(e=t.match(r.not_end)))throw"Invalid :not term in selector"}else if(e=t.match(r.id))this.id=e[1] +else if(e=t.match(r.cls))this.classes[this.classes.length]=e[1] +else if(e=t.match(r.attr))this.attrs[this.attrs.length]=[e[1],e[2],e[3]] +else if(e=t.match(r.pseudo_el))this.pseudo_els[this.pseudo_els.length]=e[1]||e[2] +else if(e=t.match(r.pseudo_cls_nth)){if(e[3])var n=parseInt((e[1]||"")+(e[2]||"1")),i=parseInt((e[4]||"")+(e[5]||"0")) +else var n=e[8]?2:0,i=e[8]?4-e[8].length:parseInt((e[6]||"")+e[7]) +this.pseudo_classes[this.pseudo_classes.length]=["nth-child",[n,i]]}else(e=t.match(r.pseudo_cls))&&(this.pseudo_classes[this.pseudo_classes.length]=[e[1]]) while(e&&!t.done()) -return this}}),d=u.extend({init:function(){this.parts=[]},parse:function(t){for(this.parts[this.parts.length]=c().parse(t);!t.done()&&!t.peek(i.comma)&&(a=t.match(i.comb));)this.parts[this.parts.length]=a[1]||" ", +return this}}),d=u.extend({init:function(){this.parts=[]},parse:function(t){for(this.parts[this.parts.length]=c().parse(t);!t.done()&&!t.peek(r.comma)&&(a=t.match(r.comb));)this.parts[this.parts.length]=a[1]||" ", this.parts[this.parts.length]=c().parse(t) -return 1==this.parts.length?this.parts[0]:this}}),h=u.extend({init:function(){this.parts=[]},parse:function(t){for(this.parts[this.parts.length]=d().parse(t);!t.done()&&(a=t.match(i.comma));)this.parts[this.parts.length]=d().parse(t) +return 1==this.parts.length?this.parts[0]:this}}),f=u.extend({init:function(){this.parts=[]},parse:function(t){for(this.parts[this.parts.length]=d().parse(t);!t.done()&&(a=t.match(r.comma));)this.parts[this.parts.length]=d().parse(t) return 1==this.parts.length?this.parts[0]:this}}) -t.selector=function(t){var e=l(t),n=h().parse(e) +t.selector=function(t){var e=l(t),n=f().parse(e) if(n.selector=t,e.done())return n -throw"Could not parse selector - "+e.showpos()},t.selector.SelectorBase=u,t.selector.SimpleSelector=c,t.selector.Selector=d,t.selector.SelectorsGroup=h}(t),function(t){t.selector.SimpleSelector.addMethod("specifity",function(){ +throw"Could not parse selector - "+e.showpos()},t.selector.SelectorBase=u,t.selector.SimpleSelector=c,t.selector.Selector=d,t.selector.SelectorsGroup=f}(t),function(t){t.selector.SimpleSelector.addMethod("specifity",function(){ if(this.spec)return this.spec var e=[this.id?1:0,this.classes.length+this.attrs.length+this.pseudo_classes.length,(this.tag&&"*"!=this.tag?1:0)+this.pseudo_els.length] -return t.each(this.nots,function(t,n){var i=n.specifity() -e[0]+=i[0],e[1]+=i[1],e[2]+=i[2]}),this.spec=e}),t.selector.Selector.addMethod("specifity",function(){if(this.spec)return this.spec +return t.each(this.nots,function(t,n){var r=n.specifity() +e[0]+=r[0],e[1]+=r[1],e[2]+=r[2]}),this.spec=e}),t.selector.Selector.addMethod("specifity",function(){if(this.spec)return this.spec var e=[0,0,0] -return t.each(this.parts,function(t,n){if(!(t%2)){var i=n.specifity() -e[0]+=i[0],e[1]+=i[1],e[2]+=i[2]}}),this.spec=e}),t.selector.SelectorsGroup.addMethod("specifity",function(){if(this.spec)return this.spec +return t.each(this.parts,function(t,n){if(!(t%2)){var r=n.specifity() +e[0]+=r[0],e[1]+=r[1],e[2]+=r[2]}}),this.spec=e}),t.selector.SelectorsGroup.addMethod("specifity",function(){if(this.spec)return this.spec var e=[0,0,0] -return t.each(this.parts,function(t,n){var i=n.specifity() -e[0]+=i[0],e[1]+=i[1],e[2]+=i[2]}),this.spec=e})}(t),function(t){function n(t){return t.complex?c(["l"+ ++y+":{",t.replace(s,"break l"+y),"}"]):t.replace(s,"")}var i=document.createElement("div") -i.innerHTML='' -var r="test"!==i.firstChild.getAttribute("id"),o=i.firstElementChild&&"FORM"==i.firstElementChild.tagName,a=i.children&&"FORM"==i.children[0].tagName,s=/GOOD/g,l=/BAD/g,u=/^['"]/g,c=function(t){return t.join("\n") +return t.each(this.parts,function(t,n){var r=n.specifity() +e[0]+=r[0],e[1]+=r[1],e[2]+=r[2]}),this.spec=e})}(t),function(t){function n(t){return t.complex?c(["l"+ ++y+":{",t.replace(s,"break l"+y),"}"]):t.replace(s,"")}var r=document.createElement("div") +r.innerHTML='
    ' +var i="test"!==r.firstChild.getAttribute("id"),o=r.firstElementChild&&"FORM"==r.firstElementChild.tagName,a=r.children&&"FORM"==r.children[0].tagName,s=/GOOD/g,l=/BAD/g,u=/^['"]/g,c=function(t){return t.join("\n") },d=function(t){var e=new String(t.join("\n")) -return e.complex=!0,e},h=function(t){return"_"+t.replace(/^[^A-Za-z]|[^A-Za-z0-9]/g,function(t){return"_0x"+t.charCodeAt(0).toString(16)+"_"})},p -if(r){var f={"class":"className","for":"htmlFor"} -p=function(t){var e=f[t]||t -return"var "+h(t)+' = el.getAttribute("'+e+'",2) || (el.getAttributeNode("'+t+'")||{}).nodeValue;'}}else p=function(t){return"var "+h(t)+' = el.getAttribute("'+t+'");'} -var m={"-":"!K","=":'K != "V"',"!=":'K == "V"',"~=":'_WS_K.indexOf(" V ") == -1',"^=":'!K || K.indexOf("V") != 0',"*=":'!K || K.indexOf("V") == -1',"$=":'!K || K.substr(K.length-"V".length) != "V"'},g=t.selector.State=e.extend({ +return e.complex=!0,e},f=function(t){return"_"+t.replace(/^[^A-Za-z]|[^A-Za-z0-9]/g,function(t){return"_0x"+t.charCodeAt(0).toString(16)+"_"})},p +if(i){var h={"class":"className","for":"htmlFor"} +p=function(t){var e=h[t]||t +return"var "+f(t)+' = el.getAttribute("'+e+'",2) || (el.getAttributeNode("'+t+'")||{}).nodeValue;'}}else p=function(t){return"var "+f(t)+' = el.getAttribute("'+t+'");'} +var m={"-":"!K","=":'K != "V"',"!=":'K == "V"',"~=":'_WS_K.indexOf(" V ") == -1',"^=":'!K || K.indexOf("V") != 0',"*=":'!K || K.indexOf("V") == -1',"$=":'!K || K.substr(K.length-"V".length) != "V"'},v=t.selector.State=e.extend({ init:function(){this.reset()},reset:function(){this.attrs={},this.wsattrs={}},prev:function(){return this.reset(),o?"el = el.previousElementSibling":"while((el = el.previousSibling) && el.nodeType != 1) {}" },next:function(){return this.reset(),o?"el = el.nextElementSibling":"while((el = el.nextSibling) && el.nodeType != 1) {}"},prevLoop:function(t){return this.reset(),c(o?["while(el = el.previousElementSibling){",t]:["while(el = el.previousSibling){","if (el.nodeType != 1) continue;",t]) },parent:function(){return this.reset(),"el = el.parentNode;"},parentLoop:function(t){return this.reset(),c(["while((el = el.parentNode) && el.nodeType == 1){",t,"}"])},uses_attr:function(t){if(!this.attrs[t])return this.attrs[t]=!0, -p(t)},uses_wsattr:function(t){if(!this.wsattrs[t])return this.wsattrs[t]=!0,c([this.uses_attr(t),"var _WS_"+h(t)+' = " "+'+h(t)+'+" ";'])},uses_jqueryFilters:function(){if(!this.jqueryFiltersAdded)return this.jqueryFiltersAdded=!0, -"var _$filters = jQuery.find.selectors.filters;"},save:function(t){return"var el"+t+" = el;"},restore:function(t){return this.reset(),"el = el"+t+";"}}),v={"first-child":c(["var cel = el;","while(cel = cel.previousSibling){ if (cel.nodeType === 1) BAD; }"]), +p(t)},uses_wsattr:function(t){if(!this.wsattrs[t])return this.wsattrs[t]=!0,c([this.uses_attr(t),"var _WS_"+f(t)+' = " "+'+f(t)+'+" ";'])},uses_jqueryFilters:function(){if(!this.jqueryFiltersAdded)return this.jqueryFiltersAdded=!0, +"var _$filters = jQuery.find.selectors.filters;"},save:function(t){return"var el"+t+" = el;"},restore:function(t){return this.reset(),"el = el"+t+";"}}),g={"first-child":c(["var cel = el;","while(cel = cel.previousSibling){ if (cel.nodeType === 1) BAD; }"]), "last-child":c(["var cel = el;","while(cel = cel.nextSibling){ if (cel.nodeType === 1) BAD; }"]),"nth-child":function(t,e){var n=c(["var i = 1, cel = el;","while(cel = cel.previousSibling){","if (cel.nodeType === 1) i++;","}"]) return c(0==t?[n,"if (i- "+e+" != 0) BAD;"]:0==e&&t>=0?[n,"if (i%"+t+" != 0 || i/"+t+" < 0) BAD;"]:0==e&&t<0?["BAD;"]:[n,"if ((i- "+e+")%"+t+" != 0 || (i- "+e+")/"+t+" < 0) BAD;"])}} -v["only-child"]=c([v["first-child"],v["last-child"]]),t.selector.SimpleSelector.addMethod("compile",function(e){var n=[] +g["only-child"]=c([g["first-child"],g["last-child"]]),t.selector.SimpleSelector.addMethod("compile",function(e){var n=[] return this.tag&&"*"!=this.tag&&(n[n.length]='if (el.tagName != "'+this.tag.toUpperCase()+'") BAD;'),this.id&&(n[n.length]=e.uses_attr("id"),n[n.length]='if (_id !== "'+this.id+'") BAD;'),this.classes.length&&(n[n.length]=e.uses_wsattr("class"), -t.each(this.classes,function(t,e){n[n.length]='if (_WS__class.indexOf(" '+e+' ") == -1) BAD;'})),t.each(this.attrs,function(t,i){n[n.length]="~="==i[1]?e.uses_wsattr(i[0]):e.uses_attr(i[0]) -var r=m[i[1]||"-"] -r=r.replace(/K/g,h(i[0])).replace(/V/g,i[2]&&i[2].match(u)?i[2].slice(1,-1):i[2]),n[n.length]="if ("+r+") BAD;"}),t.each(this.nots,function(i,r){var o=++y,a=c(["l"+o+":{",r.compile(e).replace(l,"break l"+o).replace(s,"BAD"),"}"]) +t.each(this.classes,function(t,e){n[n.length]='if (_WS__class.indexOf(" '+e+' ") == -1) BAD;'})),t.each(this.attrs,function(t,r){n[n.length]="~="==r[1]?e.uses_wsattr(r[0]):e.uses_attr(r[0]) +var i=m[r[1]||"-"] +i=i.replace(/K/g,f(r[0])).replace(/V/g,r[2]&&r[2].match(u)?r[2].slice(1,-1):r[2]),n[n.length]="if ("+i+") BAD;"}),t.each(this.nots,function(r,i){var o=++y,a=c(["l"+o+":{",i.compile(e).replace(l,"break l"+o).replace(s,"BAD"),"}"]) -r instanceof t.selector.SimpleSelector||(a=c([e.save(o),a,e.restore(o)])),n[n.length]=a}),t.each(this.pseudo_classes,function(i,r){var o=v[r[0]] -o?n[n.length]="function"==typeof o?o.apply(this,r[1]):o:(o=t.find.selectors.filters[r[0]])&&(n[n.length]=e.uses_jqueryFilters(),n[n.length]="if (!_$filters."+r[0]+"(el)) BAD;")}),n[n.length]="GOOD",c(n) +i instanceof t.selector.SimpleSelector||(a=c([e.save(o),a,e.restore(o)])),n[n.length]=a}),t.each(this.pseudo_classes,function(r,i){var o=g[i[0]] +o?n[n.length]="function"==typeof o?o.apply(this,i[1]):o:(o=t.find.selectors.filters[i[0]])&&(n[n.length]=e.uses_jqueryFilters(),n[n.length]="if (!_$filters."+i[0]+"(el)) BAD;")}),n[n.length]="GOOD",c(n) }) var y=0,_={" ":function(t,e,n){return d([n,"while(true){",t.parent(),"if (!el || el.nodeType !== 1) BAD;",e.compile(t).replace(l,"continue"),"}"])},">":function(t,e,n){return c([n,t.parent(),"if (!el || el.nodeType !== 1) BAD;",e.compile(t)]) },"~":function(t,e,n){return d([n,t.prevLoop(),e.compile(t).replace(l,"continue"),"}","BAD;"])},"+":function(t,e,n){return c([n,t.prev(),"if (!el) BAD;",e.compile(t)])}} -t.selector.Selector.addMethod("compile",function(t){for(var e=this.parts.length,i=this.parts[--e].compile(t);e;){var r=this.parts[--e] -i=_[r](t,this.parts[--e],n(i))}return i}),t.selector.SelectorsGroup.addMethod("compile",function(t){for(var e=[],n=++y,i=0;i=0;)e[e.length]=this.parts[n].ABC_compile().replace(i,"CONTEXT") +for(e[e.length]=this.parts[n].ABC_compile();(n-=2)>=0;)e[e.length]=this.parts[n].ABC_compile().replace(r,"CONTEXT") return e.join("\n")}),t.selector.SelectorsGroup.addMethod("ABC_compile",function(){var e=[] return t.each(this.parts,function(t,n){e[e.length]=n.ABC_compile()}),e.join("\n")})}(t),function(t){void 0===t.support.focusinBubbles&&(t.support.focusinBubbles=!!t.browser.msie),t.support.focusinBubbles||t.event.special.focusin||t.each({ focus:"focusin",blur:"focusout"},function(e,n){t.event.special[n]={setup:function(){return!!this.addEventListener&&void this.addEventListener(e,t.event.special[n].handler,!0)},teardown:function(){return!!this.removeEventListener&&void this.removeEventListener(e,t.event.special[n].handler,!0) },handler:function(e){return arguments[0]=t.event.fix(e),arguments[0].type=n,t.event.handle.apply(this,arguments)}}}),function(){var e=null -t(document).bind("focusin",function(n){var i=n.realTarget||n.target -e&&e!==i&&(n.type="focusout",t(e).trigger(n),n.type="focusin",n.target=i),e=i}).bind("focusout",function(t){e=null})}()}(t) -try{console.log}catch(n){window.console=void 0}!function(n){var i=function(){function e(t,n){return new e.fn.init(t,n)}t.extend(!0,e,n),e.superclass=n,e.fn=e.prototype=n(),e.fn.constructor=e,e.fn.init=function r(n,o){ -return o&&o instanceof t&&!(o instanceof e)&&(o=e(o)),t.fn.init.call(this,n,o,i)},e.fn.init.prototype=e.fn -var i=e(document) -return e},r={} -n.entwine=function(){n.fn.entwine.apply(null,arguments)},n.extend(n.entwine,{namespaces:r,clear_all_rules:function(){for(var t in n.fn)n.fn[t].isentwinemethod&&delete n.fn[t] +t(document).bind("focusin",function(n){var r=n.realTarget||n.target +e&&e!==r&&(n.type="focusout",t(e).trigger(n),n.type="focusin",n.target=r),e=r}).bind("focusout",function(t){e=null})}()}(t) +try{console.log}catch(n){window.console=void 0}!function(n){var r=function(){function e(t,n){return new e.fn.init(t,n)}t.extend(!0,e,n),e.superclass=n,e.fn=e.prototype=n(),e.fn.constructor=e,e.fn.init=function i(n,o){ +return o&&o instanceof t&&!(o instanceof e)&&(o=e(o)),t.fn.init.call(this,n,o,r)},e.fn.init.prototype=e.fn +var r=e(document) +return e},i={} +n.entwine=function(){n.fn.entwine.apply(null,arguments)},n.extend(n.entwine,{namespaces:i,clear_all_rules:function(){for(var t in n.fn)n.fn[t].isentwinemethod&&delete n.fn[t] n(document).unbind(".entwine"),n(window).unbind(".entwine") -for(var t in r)delete r[t] +for(var t in i)delete i[t] for(var t in n.entwine.capture_bindings)delete n.entwine.capture_bindings[t]},WARN_LEVEL_NONE:0,WARN_LEVEL_IMPORTANT:1,WARN_LEVEL_BESTPRACTISE:2,warningLevel:0,warn:function(t,e){e<=n.entwine.warningLevel&&console&&console.warn&&(console.warn(t), -console.trace&&console.trace())},warn_exception:function(t,e,i){n.entwine.WARN_LEVEL_IMPORTANT<=n.entwine.warningLevel&&console&&console.warn&&(2==arguments.length&&(i=e,e=null),e?console.warn("Uncaught exception",i,"in",t,"on",e):console.warn("Uncaught exception",i,"in",t), -i.stack&&console.warn("Stack Trace:\n"+i.stack))}}) +console.trace&&console.trace())},warn_exception:function(t,e,r){n.entwine.WARN_LEVEL_IMPORTANT<=n.entwine.warningLevel&&console&&console.warn&&(2==arguments.length&&(r=e,e=null),e?console.warn("Uncaught exception",r,"in",t,"on",e):console.warn("Uncaught exception",r,"in",t), +r.stack&&console.warn("Stack Trace:\n"+r.stack))}}) var o=0,a=e.extend({init:function(t,e){this.selector=t,this.specifity=t.specifity(),this.important=0,this.name=e,this.rulecount=o++}}) -a.compare=function(t,e){var n=t.specifity,i=e.specifity -return t.important-e.important||n[0]-i[0]||n[1]-i[1]||n[2]-i[2]||t.rulecount-e.rulecount},n.entwine.RuleList=function(){var t=[] -return t.addRule=function(e,n){var i=a(e,n) -return t[t.length]=i,t.sort(a.compare),i},t} +a.compare=function(t,e){var n=t.specifity,r=e.specifity +return t.important-e.important||n[0]-r[0]||n[1]-r[1]||n[2]-r[2]||t.rulecount-e.rulecount},n.entwine.RuleList=function(){var t=[] +return t.addRule=function(e,n){var r=a(e,n) +return t[t.length]=r,t.sort(a.compare),r},t} var s=[] n.entwine.Namespace=e.extend({init:function(t){if(t&&!t.match(/^[A-Za-z0-9.]+$/)&&n.entwine.warn("Entwine namespace "+t+" is not formatted as period seperated identifiers",n.entwine.WARN_LEVEL_BESTPRACTISE), -t=t||"__base",this.name=t,this.store={},r[t]=this,"__base"==t)this.injectee=n.fn,this.$=n -else{this.$=n.sub?n.sub():i(),this.$.cache=n.cache,this.injectee=this.$.prototype -var e=this.injectee.entwine=function(e){var i=arguments -return e&&"string"==typeof e?"."!=e.charAt(0)&&(i[0]=t+"."+e):(i=n.makeArray(i),i.unshift(t)),n.fn.entwine.apply(this,i)} +t=t||"__base",this.name=t,this.store={},i[t]=this,"__base"==t)this.injectee=n.fn,this.$=n +else{this.$=n.sub?n.sub():r(),this.$.cache=n.cache,this.injectee=this.$.prototype +var e=this.injectee.entwine=function(e){var r=arguments +return e&&"string"==typeof e?"."!=e.charAt(0)&&(r[0]=t+"."+e):(r=n.makeArray(r),r.unshift(t)),n.fn.entwine.apply(this,r)} this.$.entwine=function(){e.apply(null,arguments)} for(var o=0;o1||o[1]>=10?1:2,s=t.prototype.domManip -t.prototype.domManip=function(){return arguments[a].patched||(arguments[a]=r(arguments[a])),s.apply(this,arguments)} +return i.patched=!0,i},o=t.prototype.jquery.split("."),a=o[0]>1||o[1]>=10?1:2,s=t.prototype.domManip +t.prototype.domManip=function(){return arguments[a].patched||(arguments[a]=i(arguments[a])),s.apply(this,arguments)} var l=t.prototype.html t.prototype.html=function(n){if(void 0===n)return l.apply(this,arguments) -i=!0 -var r=l.apply(this,arguments) -i=!1 +r=!0 +var i=l.apply(this,arguments) +r=!1 for(var o=[],a=0,s=this.length;a-1&&(i=t.map(e.options,function(t){return t.selected}).join("-"))):t.nodeName(e,"select")&&(i=e.selectedIndex), -i},r=/^(?:textarea|input|select)$/i,o=function(e){var o=e.target,a,s -if(r.test(o.nodeName)&&!o.readOnly&&(a=t.data(o,"_entwine_change_data"),s=i(o),"focusout"===e.type&&"radio"===o.type||t.data(o,"_entwine_change_data",s),void 0!==a&&s!==a&&(null!=a||s)))for(e.type="change";o&&1==o.nodeType&&!e.isPropagationStopped();){ +return n},build_change_proxy:function(e){var n=this.one(e,"func"),r=function(e){var n=e.type,r=e.value +return"radio"===n||"checkbox"===n?r=e.checked:"select-multiple"===n?(r="",e.selectedIndex>-1&&(r=t.map(e.options,function(t){return t.selected}).join("-"))):t.nodeName(e,"select")&&(r=e.selectedIndex), +r},i=/^(?:textarea|input|select)$/i,o=function(e){var o=e.target,a,s +if(i.test(o.nodeName)&&!o.readOnly&&(a=t.data(o,"_entwine_change_data"),s=r(o),"focusout"===e.type&&"radio"===o.type||t.data(o,"_entwine_change_data",s),void 0!==a&&s!==a&&(null!=a||s)))for(e.type="change";o&&1==o.nodeType&&!e.isPropagationStopped();){ var l=n(o,arguments) -void 0!==l&&(e.result=l),l===!1&&(e.preventDefault(),e.stopPropagation()),o=o.parentNode}},a=function(e){var n=e.type,r=e.target,a=t.nodeName(r,"input")?r.type:"" +void 0!==l&&(e.result=l),l===!1&&(e.preventDefault(),e.stopPropagation()),o=o.parentNode}},a=function(e){var n=e.type,i=e.target,a=t.nodeName(i,"input")?i.type:"" switch(n){case"focusout":case"beforedeactivate":o.apply(this,arguments) break -case"click":("radio"===a||"checkbox"===a||t.nodeName(r,"select"))&&o.apply(this,arguments) +case"click":("radio"===a||"checkbox"===a||t.nodeName(i,"select"))&&o.apply(this,arguments) break -case"keydown":(13===e.keyCode&&!t.nodeName(r,"textarea")||32===e.keyCode&&("checkbox"===a||"radio"===a)||"select-multiple"===a)&&o.apply(this,arguments) +case"keydown":(13===e.keyCode&&!t.nodeName(i,"textarea")||32===e.keyCode&&("checkbox"===a||"radio"===a)||"select-multiple"===a)&&o.apply(this,arguments) break -case"focusin":case"beforeactivate":t.data(r,"_entwine_change_data",i(r))}} -return a},bind_event:function(t,n,i,r){var o=this.store[n]||(this.store[n]=e.entwine.RuleList()),a=o.proxies||(o.proxies={}),s=o.addRule(t,n) -if(s.func=i,!a[n]){switch(n){case"onmouseenter":a[n]=this.build_mouseenterleave_proxy(n),r="mouseover" +case"focusin":case"beforeactivate":t.data(i,"_entwine_change_data",r(i))}} +return a},bind_event:function(t,n,r,i){var o=this.store[n]||(this.store[n]=e.entwine.RuleList()),a=o.proxies||(o.proxies={}),s=o.addRule(t,n) +if(s.func=r,!a[n]){switch(n){case"onmouseenter":a[n]=this.build_mouseenterleave_proxy(n),i="mouseover" break -case"onmouseleave":a[n]=this.build_mouseenterleave_proxy(n),r="mouseout" +case"onmouseleave":a[n]=this.build_mouseenterleave_proxy(n),i="mouseout" break -case"onchange":e.support.changeBubbles||(a[n]=this.build_change_proxy(n),r="click keydown focusin focusout beforeactivate beforedeactivate") +case"onchange":e.support.changeBubbles||(a[n]=this.build_change_proxy(n),i="click keydown focusin focusout beforeactivate beforedeactivate") break -case"onsubmit":r="delegatedSubmit" +case"onsubmit":i="delegatedSubmit" break -case"onfocus":case"onblur":e.entwine.warn("Event "+r+" not supported - using focusin / focusout instead",e.entwine.WARN_LEVEL_IMPORTANT)}a[n]||(a[n]=this.build_event_proxy(n)),e(document).bind(r.replace(/(\s+|$)/g,".entwine$1"),a[n]) +case"onfocus":case"onblur":e.entwine.warn("Event "+i+" not supported - using focusin / focusout instead",e.entwine.WARN_LEVEL_IMPORTANT)}a[n]||(a[n]=this.build_event_proxy(n)),e(document).bind(i.replace(/(\s+|$)/g,".entwine$1"),a[n]) -}}}),e.entwine.Namespace.addHandler({order:40,bind:function(t,n,i){var r,o -if(e.isFunction(i)&&(r=n.match(/^on(.*)/)))return o=r[1],this.bind_event(t,n,i,o),!0}}) -var o=function(t,n){var i=e.Event("delegatedSubmit") -return i.delegatedEvent=t,e(document).trigger(i,n)} +}}}),e.entwine.Namespace.addHandler({order:40,bind:function(t,n,r){var i,o +if(e.isFunction(r)&&(i=n.match(/^on(.*)/)))return o=i[1],this.bind_event(t,n,r,o),!0}}) +var o=function(t,n){var r=e.Event("delegatedSubmit") +return r.delegatedEvent=t,e(document).trigger(r,n)} e(document).bind("EntwineElementsAdded",function(t){var n=e(t.targets).filter("form") -n.length&&n.bind("submit.entwine_delegate_submit",o)})}(t),function(t){t.entwine.Namespace.addMethods({bind_capture:function(e,n,i,r){var o=this.captures||(this.captures={}),a=o[n]||(o[n]={}),s=a[i]||(a[i]=t.entwine.RuleList()),l=s.addRule(e,n) +n.length&&n.bind("submit.entwine_delegate_submit",o)})}(t),function(t){t.entwine.Namespace.addMethods({bind_capture:function(e,n,r,i){var o=this.captures||(this.captures={}),a=o[n]||(o[n]={}),s=a[r]||(a[r]=t.entwine.RuleList()),l=s.addRule(e,n) -l.handler=i,this.bind_proxy(e,i,r)}}) -var e=t.entwine.capture_bindings={},n=function(e){return function(n){var i,r,o,a,s,l,u -for(var c in t.entwine.namespaces)if(i=t.entwine.namespaces[c],r=i.captures,r&&(o=r[e]))for(var c in o)for(var a=o[c],d=i.$([]),h=a.length;h--;){s=a[h],l=s.handler,u=s.selector.selector -var p=i.$(u).not(d) -p[l].apply(p,arguments),d=d.add(p)}}},i=function(e,n,i){var r=t.selector(e) -return function(t){if(r.matches(t.target))return n.apply(this,arguments)}},r=function(t,e,n){return function(t){if(t.target===document)return e.apply(this,arguments)}},o=function(t,e,n){return function(t){ -if(t.target===window)return e.apply(this,arguments)}},a=function(e,n,i){var r -return function(i){var r=this["get"+e]() -if("string"==typeof r){var o=o&&r==o.selector?o:t.selector(r) -if(o.matches(i.target))return n.apply(this,arguments)}else if(t.inArray(i.target,r)!==-1)return n.apply(this,arguments)}} +l.handler=r,this.bind_proxy(e,r,i)}}) +var e=t.entwine.capture_bindings={},n=function(e){return function(n){var r,i,o,a,s,l,u +for(var c in t.entwine.namespaces)if(r=t.entwine.namespaces[c],i=r.captures,i&&(o=i[e]))for(var c in o)for(var a=o[c],d=r.$([]),f=a.length;f--;){s=a[f],l=s.handler,u=s.selector.selector +var p=r.$(u).not(d) +p[l].apply(p,arguments),d=d.add(p)}}},r=function(e,n,r){var i=t.selector(e) +return function(t){if(i.matches(t.target))return n.apply(this,arguments)}},i=function(t,e,n){return function(t){if(t.target===document)return e.apply(this,arguments)}},o=function(t,e,n){return function(t){ +if(t.target===window)return e.apply(this,arguments)}},a=function(e,n,r){var i +return function(r){var i=this["get"+e]() +if("string"==typeof i){var o=o&&i==o.selector?o:t.selector(i) +if(o.matches(r.target))return n.apply(this,arguments)}else if(t.inArray(r.target,i)!==-1)return n.apply(this,arguments)}} t.entwine.Namespace.addHandler({order:10,bind:function(s,l,u){var c -if(t.isPlainObject(u)&&(c=l.match(/^from\s*(.*)/))){var d=c[1],h -h=d.match(/[^\w]/)?i:"Window"==d||"window"==d?o:"Document"==d||"document"==d?r:a -for(var p in u){var f=u[p] +if(t.isPlainObject(u)&&(c=l.match(/^from\s*(.*)/))){var d=c[1],f +f=d.match(/[^\w]/)?r:"Window"==d||"window"==d?o:"Document"==d||"document"==d?i:a +for(var p in u){var h=u[p] c=p.match(/^on(.*)/) var m=c[1] -if(this.bind_capture(s,m,l+"_"+m,h(d,f)),!e[m]){var g=m.replace(/(\s+|$)/g,".entwine$1") -e[m]=n(m),t(h==o?window:document).bind(g,e[m])}}return!0}}})}(t),function(t){t.entwine.Namespace.addMethods({bind_condesc:function(e,n,i){for(var r=this.store.ctors||(this.store.ctors=t.entwine.RuleList()),o,a=0;ae;)(n=o[i].cache)&&(a=a.add(n))}},c,d,h,p,f,m,g,v,y=o.length;y--;){if(p=o[y],f=p.selector.selector,m=p.onmatch,g=p.onunmatch,h=null,v=!1,r.matchersDirty||n.global)v=!0 -else{for(var i in n.attrs){v=!0 +for(var n,r=o.length;--r>e;)(n=o[r].cache)&&(a=a.add(n))}},c,d,f,p,h,m,v,g,y=o.length;y--;){if(p=o[y],h=p.selector.selector,m=p.onmatch,v=p.onunmatch,f=null,g=!1,i.matchersDirty||n.global)g=!0 +else{for(var r in n.attrs){g=!0 break}var _=p.selector.affectedBy(n) -if(_.classes.context)v=!0 -else for(var i in _.classes.direct){u(y) -var b=n.classes[i].not(a) -null===h&&(h=p.cache?p.cache.not(s).add(l.filter(f)):t([])),h=h.not(b).add(b.filter(f))}}v?(u(y),h=t(f).not(a)):h||(c=l.length&&l.filter(f),c&&c.length?h=p.cache?p.cache.not(s).add(c):c:(d=s.length&&p.cache&&p.cache.filter(s), -d&&d.length&&(h=p.cache.not(d)))),null===h?a&&p.cache&&(a=a.add(p.cache)):(p.cache?(c=h.not(p.cache),d=p.cache.not(h)):(c=h,d=null),(c&&c.length||d&&d.length)&&(d&&d.length&&(l=l.add(d),g&&!p.onunmatchRunning&&(p.onunmatchRunning=!0, -o.onunmatchproxy(d,y,g),p.onunmatchRunning=!1)),c&&c.length&&(s=s.add(c),l=l.not(c),m&&!p.onmatchRunning&&(p.onmatchRunning=!0,o.onmatchproxy(c,y,m),p.onmatchRunning=!1))),a&&(a=a.add(h)),p.cache=h)}r.matchersDirty=!1 +if(_.classes.context)g=!0 +else for(var r in _.classes.direct){u(y) +var b=n.classes[r].not(a) +null===f&&(f=p.cache?p.cache.not(s).add(l.filter(h)):t([])),f=f.not(b).add(b.filter(h))}}g?(u(y),f=t(h).not(a)):f||(c=l.length&&l.filter(h),c&&c.length?f=p.cache?p.cache.not(s).add(c):c:(d=s.length&&p.cache&&p.cache.filter(s), +d&&d.length&&(f=p.cache.not(d)))),null===f?a&&p.cache&&(a=a.add(p.cache)):(p.cache?(c=f.not(p.cache),d=p.cache.not(f)):(c=f,d=null),(c&&c.length||d&&d.length)&&(d&&d.length&&(l=l.add(d),v&&!p.onunmatchRunning&&(p.onunmatchRunning=!0, +o.onunmatchproxy(d,y,v),p.onunmatchRunning=!1)),c&&c.length&&(s=s.add(c),l=l.not(c),m&&!p.onmatchRunning&&(p.onmatchRunning=!0,o.onmatchproxy(c,y,m),p.onmatchRunning=!1))),a&&(a=a.add(f)),p.cache=f)}i.matchersDirty=!1 }}})}(t),function(t){t.entwine.Namespace.addMethods({build_addrem_proxy:function(t){var e=this.one(t,"func") return function(){if(0!==this.length){if(this.length){for(var t,n=this.length;n--;)t=e(this[n],arguments) -return t}return e(this,arguments)}}},bind_addrem_proxy:function(e,n,i){var r=this.store[n]||(this.store[n]=t.entwine.RuleList()),o=r.addRule(e,n) -o.func=i,this.injectee.hasOwnProperty(n)||(this.injectee[n]=this.build_addrem_proxy(n),this.injectee[n].isentwinemethod=!0)}}),t.entwine.Namespace.addHandler({order:30,bind:function(e,n,i){if(t.isFunction(i)&&("onadd"==n||"onremove"==n))return this.bind_addrem_proxy(e,n,i), -!0}}),t(document).bind("EntwineElementsAdded",function(e){for(var n in t.entwine.namespaces){var i=t.entwine.namespaces[n] -i.injectee.onadd&&i.injectee.onadd.call(e.targets)}}),t(document).bind("EntwineElementsRemoved",function(e){for(var n in t.entwine.namespaces){var i=t.entwine.namespaces[n] -i.injectee.onremove&&i.injectee.onremove.call(e.targets)}})}(t),function(e){var n="__entwine!",i=function(t,e,i){return t.data(n+e+"!"+i)},r=function(t,e,i,r){return t.data(n+e+"!"+i,r)},o=function(e,i){ -var r={},o=t.data(e[0]),a=n+i+"!",s=a.length,l=t.cache[o] -for(var u in l)u.substr(0,s)==a&&(r[u.substr(s)]=l[u]) -return r},a=function(t,e,n){for(var i in n)r(e,i,n[i])},s=function(t,e,n){switch(n.length){case 0:return o(t,e) -case 1:return"string"==typeof n[0]?i(t,e,n[0]):a(t,e,n[0]) -default:return r(t,e,n[0],n[1])}} -e.extend(e.fn,{entwineData:function(){return s(this,"__base",arguments)}}),e.entwine.Namespace.addHandler({order:60,bind:function(t,n,i){n.charAt(0)!=n.charAt(0).toUpperCase()&&e.entwine.warn("Entwine property "+n+" does not start with a capital letter",e.entwine.WARN_LEVEL_BESTPRACTISE) +return t}return e(this,arguments)}}},bind_addrem_proxy:function(e,n,r){var i=this.store[n]||(this.store[n]=t.entwine.RuleList()),o=i.addRule(e,n) +o.func=r,this.injectee.hasOwnProperty(n)||(this.injectee[n]=this.build_addrem_proxy(n),this.injectee[n].isentwinemethod=!0)}}),t.entwine.Namespace.addHandler({order:30,bind:function(e,n,r){if(t.isFunction(r)&&("onadd"==n||"onremove"==n))return this.bind_addrem_proxy(e,n,r), +!0}}),t(document).bind("EntwineElementsAdded",function(e){for(var n in t.entwine.namespaces){var r=t.entwine.namespaces[n] +r.injectee.onadd&&r.injectee.onadd.call(e.targets)}}),t(document).bind("EntwineElementsRemoved",function(e){for(var n in t.entwine.namespaces){var r=t.entwine.namespaces[n] +r.injectee.onremove&&r.injectee.onremove.call(e.targets)}})}(t),function(e){var n="__entwine!",r=function(t,e,r){return t.data(n+e+"!"+r)},i=function(t,e,r,i){return t.data(n+e+"!"+r,i)},o=function(e,r){ +var i={},o=t.data(e[0]),a=n+r+"!",s=a.length,l=t.cache[o] +for(var u in l)u.substr(0,s)==a&&(i[u.substr(s)]=l[u]) +return i},a=function(t,e,n){for(var r in n)i(e,r,n[r])},s=function(t,e,n){switch(n.length){case 0:return o(t,e) +case 1:return"string"==typeof n[0]?r(t,e,n[0]):a(t,e,n[0]) +default:return i(t,e,n[0],n[1])}} +e.extend(e.fn,{entwineData:function(){return s(this,"__base",arguments)}}),e.entwine.Namespace.addHandler({order:60,bind:function(t,n,r){n.charAt(0)!=n.charAt(0).toUpperCase()&&e.entwine.warn("Entwine property "+n+" does not start with a capital letter",e.entwine.WARN_LEVEL_BESTPRACTISE) -var r="get"+n,o="set"+n -this.bind_proxy(t,r,function(){var t=this.entwineData(n) -return void 0===t?i:t}),this.bind_proxy(t,o,function(t){return this.entwineData(n,t)}) -var a=this.injectee[r],s=this.injectee[o] +var i="get"+n,o="set"+n +this.bind_proxy(t,i,function(){var t=this.entwineData(n) +return void 0===t?r:t}),this.bind_proxy(t,o,function(t){return this.entwineData(n,t)}) +var a=this.injectee[i],s=this.injectee[o] return this.bind_proxy(t,n,function(t){return(1==arguments.length?s:a).call(this,t)}),!0},namespaceMethodOverrides:function(t){return{entwineData:function(){return s(this,t.name,arguments)}}}})}(t),function(t){ t.concrete=t.entwine,t.fn.concrete=t.fn.entwine,t.fn.concreteData=t.fn.entwineData,t.entwine.Namespace.addHandler({order:100,bind:function(t,e,n){return!1},namespaceMethodOverrides:function(t){return t.$.concrete=t.$.entwine, t.injectee.concrete=t.injectee.entwine,t.injectee.concreteData=t.injectee.entwineData,{}}})}(t)}).call(e,n(1))},function(t,e,n){(function(t){"use strict" -!function(){if(!t||!t.jstree){var e=!1,n=!1,i=!1 +!function(){if(!t||!t.jstree){var e=!1,n=!1,r=!1 !function(t){t.vakata={},t.vakata.css={get_css:function(t,e,n){t=t.toLowerCase() -var i=n.cssRules||n.rules,r=0 -do{if(i.length&&r>i.length+5)return!1 -if(i[r].selectorText&&i[r].selectorText.toLowerCase()==t)return e===!0?(n.removeRule&&n.removeRule(r),n.deleteRule&&n.deleteRule(r),!0):i[r]}while(i[++r]) +var r=n.cssRules||n.rules,i=0 +do{if(r.length&&i>r.length+5)return!1 +if(r[i].selectorText&&r[i].selectorText.toLowerCase()==t)return e===!0?(n.removeRule&&n.removeRule(i),n.deleteRule&&n.deleteRule(i),!0):r[i]}while(r[++i]) return!1},add_css:function(e,n){return!t.jstree.css.get_css(e,!1,n)&&(n.insertRule?n.insertRule(e+" { }",0):n.addRule(e,null,0),t.vakata.css.get_css(e))},remove_css:function(e,n){return t.vakata.css.get_css(e,!0,n) },add_sheet:function(t){}} -var r=[],o=-1,a={},s={} -t.fn.jstree=function(e){var n="string"==typeof e,i=Array.prototype.slice.call(arguments,1),o=this +var i=[],o=-1,a={},s={} +t.fn.jstree=function(e){var n="string"==typeof e,r=Array.prototype.slice.call(arguments,1),o=this if(n){if("_"==e.substring(0,1))return o -this.each(function(){var n=r[t.data(this,"jstree_instance_id")],a=n&&t.isFunction(n[e])?n[e].apply(n,i):n +this.each(function(){var n=i[t.data(this,"jstree_instance_id")],a=n&&t.isFunction(n[e])?n[e].apply(n,r):n if("undefined"!=typeof a&&(0===e.indexOf("is_")||a!==!0&&a!==!1))return o=a,!1})}else this.each(function(){var n=t.data(this,"jstree_instance_id"),o=[],s=e?t.extend({},!0,e):{},l=t(this),u=!1,c=[] -o=o.concat(i),l.data("jstree")&&o.push(l.data("jstree")),s=o.length?t.extend.apply(null,[!0,s].concat(o)):s,"undefined"!=typeof n&&r[n]&&r[n].destroy(),n=parseInt(r.push({}),10)-1,t.data(this,"jstree_instance_id",n), +o=o.concat(r),l.data("jstree")&&o.push(l.data("jstree")),s=o.length?t.extend.apply(null,[!0,s].concat(o)):s,"undefined"!=typeof n&&i[n]&&i[n].destroy(),n=parseInt(i.push({}),10)-1,t.data(this,"jstree_instance_id",n), s.plugins=t.isArray(s.plugins)?s.plugins:t.jstree.defaults.plugins.slice(),s.plugins.unshift("core"),s.plugins=s.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","), -u=t.extend(!0,{},t.jstree.defaults,s),u.plugins=s.plugins,t.each(a,function(e,n){t.inArray(e,u.plugins)===-1?(u[e]=null,delete u[e]):c.push(e)}),u.plugins=c,r[n]=new t.jstree._instance(n,t(this).addClass("jstree jstree-"+n),u), -t.each(r[n]._get_settings().plugins,function(t,e){r[n].data[e]={}}),t.each(r[n]._get_settings().plugins,function(t,e){a[e]&&a[e].__init.apply(r[n])}),setTimeout(function(){r[n]&&r[n].init()},0)}) -return o},t.jstree={defaults:{plugins:[]},_focused:function(){return r[o]||null},_reference:function(e){if(r[e])return r[e] +u=t.extend(!0,{},t.jstree.defaults,s),u.plugins=s.plugins,t.each(a,function(e,n){t.inArray(e,u.plugins)===-1?(u[e]=null,delete u[e]):c.push(e)}),u.plugins=c,i[n]=new t.jstree._instance(n,t(this).addClass("jstree jstree-"+n),u), +t.each(i[n]._get_settings().plugins,function(t,e){i[n].data[e]={}}),t.each(i[n]._get_settings().plugins,function(t,e){a[e]&&a[e].__init.apply(i[n])}),setTimeout(function(){i[n]&&i[n].init()},0)}) +return o},t.jstree={defaults:{plugins:[]},_focused:function(){return i[o]||null},_reference:function(e){if(i[e])return i[e] var n=t(e) -return n.length||"string"!=typeof e||(n=t("#"+e)),n.length?r[n.closest(".jstree").data("jstree_instance_id")]||null:null},_instance:function(e,n,i){this.data={core:{}},this.get_settings=function(){return t.extend(!0,{},i) +return n.length||"string"!=typeof e||(n=t("#"+e)),n.length?i[n.closest(".jstree").data("jstree_instance_id")]||null:null},_instance:function(e,n,r){this.data={core:{}},this.get_settings=function(){return t.extend(!0,{},r) -},this._get_settings=function(){return i},this.get_index=function(){return e},this.get_container=function(){return n},this.get_container_ul=function(){return n.children("ul:eq(0)")},this._set_settings=function(e){ -i=t.extend(!0,{},i,e)}},_fn:{},plugin:function(e,n){n=t.extend({},{__init:t.noop,__destroy:t.noop,_fn:{},defaults:!1},n),a[e]=n,t.jstree.defaults[e]=n.defaults,t.each(n._fn,function(n,i){i.plugin=e,i.old=t.jstree._fn[n], -t.jstree._fn[n]=function(){var e,r=i,o=Array.prototype.slice.call(arguments),a=new t.Event("before.jstree"),s=!1 -if(this.data.core.locked!==!0||"unlock"===n||"is_locked"===n){do{if(r&&r.plugin&&t.inArray(r.plugin,this._get_settings().plugins)!==-1)break -r=r.old}while(r) -if(r){if(0===n.indexOf("_"))e=r.apply(this,o) -else{if(e=this.get_container().triggerHandler(a,{func:n,inst:this,args:o,plugin:r.plugin}),e===!1)return -"undefined"!=typeof e&&(o=e),e=r.apply(t.extend({},this,{__callback:function(t){this.get_container().triggerHandler(n+".jstree",{inst:this,args:o,rslt:t,rlbk:s})},__rollback:function(){return s=this.get_rollback() +},this._get_settings=function(){return r},this.get_index=function(){return e},this.get_container=function(){return n},this.get_container_ul=function(){return n.children("ul:eq(0)")},this._set_settings=function(e){ +r=t.extend(!0,{},r,e)}},_fn:{},plugin:function(e,n){n=t.extend({},{__init:t.noop,__destroy:t.noop,_fn:{},defaults:!1},n),a[e]=n,t.jstree.defaults[e]=n.defaults,t.each(n._fn,function(n,r){r.plugin=e,r.old=t.jstree._fn[n], +t.jstree._fn[n]=function(){var e,i=r,o=Array.prototype.slice.call(arguments),a=new t.Event("before.jstree"),s=!1 +if(this.data.core.locked!==!0||"unlock"===n||"is_locked"===n){do{if(i&&i.plugin&&t.inArray(i.plugin,this._get_settings().plugins)!==-1)break +i=i.old}while(i) +if(i){if(0===n.indexOf("_"))e=i.apply(this,o) +else{if(e=this.get_container().triggerHandler(a,{func:n,inst:this,args:o,plugin:i.plugin}),e===!1)return +"undefined"!=typeof e&&(o=e),e=i.apply(t.extend({},this,{__callback:function(t){this.get_container().triggerHandler(n+".jstree",{inst:this,args:o,rslt:t,rlbk:s})},__rollback:function(){return s=this.get_rollback() -},__call_old:function(t){return r.old.apply(this,t?Array.prototype.slice.call(arguments,1):o)}}),o)}return e}}},t.jstree._fn[n].old=i.old,t.jstree._fn[n].plugin=e})},rollback:function(e){e&&(t.isArray(e)||(e=[e]), -t.each(e,function(t,e){r[e.i].set_rollback(e.h,e.d)}))}},t.jstree._fn=t.jstree._instance.prototype={},t(function(){var r=navigator.userAgent.toLowerCase(),o=(r.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],a=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } " +},__call_old:function(t){return i.old.apply(this,t?Array.prototype.slice.call(arguments,1):o)}}),o)}return e}}},t.jstree._fn[n].old=r.old,t.jstree._fn[n].plugin=e})},rollback:function(e){e&&(t.isArray(e)||(e=[e]), +t.each(e,function(t,e){i[e.i].set_rollback(e.h,e.d)}))}},t.jstree._fn=t.jstree._instance.prototype={},t(function(){var i=navigator.userAgent.toLowerCase(),o=(i.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],a=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } " -if(/msie/.test(r)&&6==parseInt(o,10)){e=!0 +if(/msie/.test(i)&&6==parseInt(o,10)){e=!0 try{document.execCommand("BackgroundImageCache",!1,!0)}catch(s){}a+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } " -}/msie/.test(r)&&7==parseInt(o,10)&&(n=!0,a+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "),!/compatible/.test(r)&&/mozilla/.test(r)&&parseFloat(o,10)<1.9&&(i=!0,a+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "), +}/msie/.test(i)&&7==parseInt(o,10)&&(n=!0,a+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "),!/compatible/.test(i)&&/mozilla/.test(i)&&parseFloat(o,10)<1.9&&(r=!0,a+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "), t.vakata.css.add_sheet({str:a,title:"jstree"})}),t.jstree.plugin("core",{__init:function(){this.data.core.locked=!1,this.data.core.to_open=this.get_settings().core.initially_open,this.data.core.to_load=this.get_settings().core.initially_load },defaults:{html_titles:!1,animation:500,initially_open:[],initially_load:[],open_parents:!0,notify_plugins:!0,rtl:!1,load_open:!1,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection" @@ -2243,33 +2244,33 @@ this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstr this.toggle_node(n)},this)).bind("mousedown.jstree",t.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(t){var e if(document.selection&&document.selection.empty)document.selection.empty() else if(window.getSelection){e=window.getSelection() -try{e.removeAllRanges(),e.collapse()}catch(n){}}}),this._get_settings().core.notify_plugins&&this.get_container().bind("load_node.jstree",t.proxy(function(e,n){var i=this._get_node(n.rslt.obj),r=this -i===-1&&(i=this.get_container_ul()),i.length&&i.find("li").each(function(){var e=t(this) -e.data("jstree")&&t.each(e.data("jstree"),function(n,i){r.data[n]&&t.isFunction(r["_"+n+"_notify"])&&r["_"+n+"_notify"].call(r,e,i)})})},this)),this._get_settings().core.load_open&&this.get_container().bind("load_node.jstree",t.proxy(function(e,n){ -var i=this._get_node(n.rslt.obj),r=this -i===-1&&(i=this.get_container_ul()),i.length&&i.find("li.jstree-open:not(:has(ul))").each(function(){r.load_node(this,t.noop,t.noop)})},this)),this.__callback(),this.load_node(-1,function(){this.loaded(), -this.reload_nodes()})},destroy:function(){var e,n=this.get_index(),i=this._get_settings(),s=this -if(t.each(i.plugins,function(t,e){try{a[e].__destroy.apply(s)}catch(n){}}),this.__callback(),this.is_focused())for(e in r)if(r.hasOwnProperty(e)&&e!=n){r[e].set_focus() +try{e.removeAllRanges(),e.collapse()}catch(n){}}}),this._get_settings().core.notify_plugins&&this.get_container().bind("load_node.jstree",t.proxy(function(e,n){var r=this._get_node(n.rslt.obj),i=this +r===-1&&(r=this.get_container_ul()),r.length&&r.find("li").each(function(){var e=t(this) +e.data("jstree")&&t.each(e.data("jstree"),function(n,r){i.data[n]&&t.isFunction(i["_"+n+"_notify"])&&i["_"+n+"_notify"].call(i,e,r)})})},this)),this._get_settings().core.load_open&&this.get_container().bind("load_node.jstree",t.proxy(function(e,n){ +var r=this._get_node(n.rslt.obj),i=this +r===-1&&(r=this.get_container_ul()),r.length&&r.find("li.jstree-open:not(:has(ul))").each(function(){i.load_node(this,t.noop,t.noop)})},this)),this.__callback(),this.load_node(-1,function(){this.loaded(), +this.reload_nodes()})},destroy:function(){var e,n=this.get_index(),r=this._get_settings(),s=this +if(t.each(r.plugins,function(t,e){try{a[e].__destroy.apply(s)}catch(n){}}),this.__callback(),this.is_focused())for(e in i)if(i.hasOwnProperty(e)&&e!=n){i[e].set_focus() break}n===o&&(o=-1),this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"") -}),t(document).unbind(".jstree-"+n).undelegate(".jstree-"+n),r[n]=null,delete r[n]},_core_notify:function(t,e){e.opened&&this.open_node(t,!1,!0)},lock:function(){this.data.core.locked=!0,this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7"), +}),t(document).unbind(".jstree-"+n).undelegate(".jstree-"+n),i[n]=null,delete i[n]},_core_notify:function(t,e){e.opened&&this.open_node(t,!1,!0)},lock:function(){this.data.core.locked=!0,this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7"), this.__callback({})},unlock:function(){this.data.core.locked=!1,this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1"),this.__callback({})},is_locked:function(){return this.data.core.locked },save_opened:function(){var t=this this.data.core.to_open=[],this.get_container_ul().find("li.jstree-open").each(function(){this.id&&t.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")) -}),this.__callback(t.data.core.to_open)},save_loaded:function(){},reload_nodes:function(e){var n=this,i=!0,r=[],o=[] +}),this.__callback(t.data.core.to_open)},save_loaded:function(){},reload_nodes:function(e){var n=this,r=!0,i=[],o=[] e||(this.data.core.reopen=!1,this.data.core.refreshing=!0,this.data.core.to_open=t.map(t.makeArray(this.data.core.to_open),function(t){return"#"+t.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:") }),this.data.core.to_load=t.map(t.makeArray(this.data.core.to_load),function(t){return"#"+t.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:") -}),this.data.core.to_open.length&&(this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open))),this.data.core.to_load.length&&(t.each(this.data.core.to_load,function(e,n){return"#"==n||void(t(n).length?r.push(n):o.push(n)) +}),this.data.core.to_open.length&&(this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open))),this.data.core.to_load.length&&(t.each(this.data.core.to_load,function(e,n){return"#"==n||void(t(n).length?i.push(n):o.push(n)) -}),r.length&&(this.data.core.to_load=o,t.each(r,function(t,e){n._is_loaded(e)||(n.load_node(e,function(){n.reload_nodes(!0)},function(){n.reload_nodes(!0)}),i=!1)}))),this.data.core.to_open.length&&t.each(this.data.core.to_open,function(t,e){ -n.open_node(e,!1,!0)}),i&&(this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){n.__callback({},n)},50),this.data.core.refreshing=!1,this.reopen())},reopen:function(){ +}),i.length&&(this.data.core.to_load=o,t.each(i,function(t,e){n._is_loaded(e)||(n.load_node(e,function(){n.reload_nodes(!0)},function(){n.reload_nodes(!0)}),r=!1)}))),this.data.core.to_open.length&&t.each(this.data.core.to_open,function(t,e){ +n.open_node(e,!1,!0)}),r&&(this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){n.__callback({},n)},50),this.data.core.refreshing=!1,this.reopen())},reopen:function(){ var e=this -this.data.core.to_open.length&&t.each(this.data.core.to_open,function(t,n){e.open_node(n,!1,!0)}),this.__callback({})},refresh:function(t,e,n){var i=this -this.save_opened(),t||(t=-1),t=this._get_node(t),t||(t=-1),t!==-1?t.children("UL").remove():this.get_container_ul().empty(),this.load_node(t,function(){i.__callback({obj:t}),i.reload_nodes(),e&&e.call(this) +this.data.core.to_open.length&&t.each(this.data.core.to_open,function(t,n){e.open_node(n,!1,!0)}),this.__callback({})},refresh:function(t,e,n){var r=this +this.save_opened(),t||(t=-1),t=this._get_node(t),t||(t=-1),t!==-1?t.children("UL").remove():this.get_container_ul().empty(),this.load_node(t,function(){r.__callback({obj:t}),r.reload_nodes(),e&&e.call(this) },n)},loaded:function(){this.__callback()},set_focus:function(){if(!this.is_focused()){var e=t.jstree._focused() e&&e.unset_focus(),this.get_container().addClass("jstree-focused"),o=this.get_index(),this.__callback()}},is_focused:function(){return o==this.get_index()},unset_focus:function(){this.is_focused()&&(this.get_container().removeClass("jstree-focused"), @@ -2284,38 +2285,38 @@ return t}var n=t.parentsUntil(".jstree","li:eq(0)") return!!n.length&&n},_get_parent:function(t){if(t=this._get_node(t),t==-1||!t.length)return!1 var e=t.parentsUntil(".jstree","li:eq(0)") return e.length?e:-1},_get_children:function(t){return t=this._get_node(t),t===-1?this.get_container().children("ul:eq(0)").children("li"):!!t.length&&t.children("ul:eq(0)").children("li")},get_path:function(t,e){ -var n=[],i=this -return t=this._get_node(t),!(t===-1||!t||!t.length)&&(t.parentsUntil(".jstree","li").each(function(){n.push(e?this.id:i.get_text(this))}),n.reverse(),n.push(e?t.attr("id"):this.get_text(t)),n)},_get_string:function(t){ +var n=[],r=this +return t=this._get_node(t),!(t===-1||!t||!t.length)&&(t.parentsUntil(".jstree","li").each(function(){n.push(e?this.id:r.get_text(this))}),n.reverse(),n.push(e?t.attr("id"):this.get_text(t)),n)},_get_string:function(t){ return this._get_settings().core.strings[t]||t},is_open:function(t){return t=this._get_node(t),t&&t!==-1&&t.hasClass("jstree-open")},is_closed:function(t){return t=this._get_node(t),t&&t!==-1&&t.hasClass("jstree-closed") },is_leaf:function(t){return t=this._get_node(t),t&&t!==-1&&t.hasClass("jstree-leaf")},correct_state:function(t){return t=this._get_node(t),!(!t||t===-1)&&(t.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove(), -void this.__callback({obj:t}))},open_node:function(t,n,i){if(t=this._get_node(t),!t.length)return!1 +void this.__callback({obj:t}))},open_node:function(t,n,r){if(t=this._get_node(t),!t.length)return!1 if(!t.hasClass("jstree-closed"))return n&&n.call(),!1 -var r=i||e?0:this._get_settings().core.animation,o=this -this._is_loaded(t)?(this._get_settings().core.open_parents&&t.parentsUntil(".jstree",".jstree-closed").each(function(){o.open_node(this,!1,!0)}),r&&t.children("ul").css("display","none"),t.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"), -r?t.children("ul").stop(!0,!0).slideDown(r,function(){this.style.display="",o.after_open(t)}):o.after_open(t),this.__callback({obj:t}),n&&n.call()):(t.children("a").addClass("jstree-loading"),this.load_node(t,function(){ -o.open_node(t,n,i)},n))},after_open:function(t){this.__callback({obj:t})},close_node:function(t,n){t=this._get_node(t) -var i=n||e?0:this._get_settings().core.animation,r=this -return!(!t.length||!t.hasClass("jstree-open"))&&(i&&t.children("ul").attr("style","display:block !important"),t.removeClass("jstree-open").addClass("jstree-closed"),i?t.children("ul").stop(!0,!0).slideUp(i,function(){ -this.style.display="",r.after_close(t)}):r.after_close(t),void this.__callback({obj:t}))},after_close:function(t){this.__callback({obj:t})},toggle_node:function(t){return t=this._get_node(t),t.hasClass("jstree-closed")?this.open_node(t):t.hasClass("jstree-open")?this.close_node(t):void 0 +var i=r||e?0:this._get_settings().core.animation,o=this +this._is_loaded(t)?(this._get_settings().core.open_parents&&t.parentsUntil(".jstree",".jstree-closed").each(function(){o.open_node(this,!1,!0)}),i&&t.children("ul").css("display","none"),t.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"), +i?t.children("ul").stop(!0,!0).slideDown(i,function(){this.style.display="",o.after_open(t)}):o.after_open(t),this.__callback({obj:t}),n&&n.call()):(t.children("a").addClass("jstree-loading"),this.load_node(t,function(){ +o.open_node(t,n,r)},n))},after_open:function(t){this.__callback({obj:t})},close_node:function(t,n){t=this._get_node(t) +var r=n||e?0:this._get_settings().core.animation,i=this +return!(!t.length||!t.hasClass("jstree-open"))&&(r&&t.children("ul").attr("style","display:block !important"),t.removeClass("jstree-open").addClass("jstree-closed"),r?t.children("ul").stop(!0,!0).slideUp(r,function(){ +this.style.display="",i.after_close(t)}):i.after_close(t),void this.__callback({obj:t}))},after_close:function(t){this.__callback({obj:t})},toggle_node:function(t){return t=this._get_node(t),t.hasClass("jstree-closed")?this.open_node(t):t.hasClass("jstree-open")?this.close_node(t):void 0 },open_all:function(t,e,n){t=t?this._get_node(t):-1,t&&t!==-1||(t=this.get_container_ul()),n?t=t.find("li.jstree-closed"):(n=t,t=t.is(".jstree-closed")?t.find("li.jstree-closed").andSelf():t.find("li.jstree-closed")) -var i=this +var r=this t.each(function(){var t=this -i._is_loaded(this)?i.open_node(this,!1,!e):i.open_node(this,function(){i.open_all(t,e,n)},!e)}),0===n.find("li.jstree-closed").length&&this.__callback({obj:n})},close_all:function(t,e){var n=this +r._is_loaded(this)?r.open_node(this,!1,!e):r.open_node(this,function(){r.open_all(t,e,n)},!e)}),0===n.find("li.jstree-closed").length&&this.__callback({obj:n})},close_all:function(t,e){var n=this t=t?this._get_node(t):this.get_container(),t&&t!==-1||(t=this.get_container_ul()),t.find("li.jstree-open").andSelf().each(function(){n.close_node(this,!e)}),this.__callback({obj:t})},clean_node:function(e){ e=e&&e!=-1?t(e):this.get_container_ul(),e=e.is("li")?e.find("li").andSelf():e.find("li"),e.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"), e.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(),this.__callback({obj:e})},get_rollback:function(){return this.__callback(),{i:this.get_index(),h:this.get_container().children("ul").clone(!0), -d:this.data}},set_rollback:function(t,e){this.get_container().empty().append(t),this.data=e,this.__callback()},load_node:function(t,e,n){this.__callback({obj:t})},_is_loaded:function(t){return!0},create_node:function(e,n,i,r,o){ +d:this.data}},set_rollback:function(t,e){this.get_container().empty().append(t),this.data=e,this.__callback()},load_node:function(t,e,n){this.__callback({obj:t})},_is_loaded:function(t){return!0},create_node:function(e,n,r,i,o){ e=this._get_node(e),n="undefined"==typeof n?"last":n var a=t("
  • "),s=this._get_settings().core,l if(e!==-1&&!e.length)return!1 -if(!o&&!this._is_loaded(e))return this.load_node(e,function(){this.create_node(e,n,i,r,!0)}),!1 -switch(this.__rollback(),"string"==typeof i&&(i={data:i}),i||(i={}),i.attr&&a.attr(i.attr),i.metadata&&a.data(i.metadata),i.state&&a.addClass("jstree-"+i.state),i.data||(i.data=this._get_string("new_node")), -t.isArray(i.data)||(l=i.data,i.data=[],i.data.push(l)),t.each(i.data,function(e,n){l=t(""),t.isFunction(n)&&(n=n.call(this,i)),"string"==typeof n?l.attr("href","#")[s.html_titles?"html":"text"](n):(n.attr||(n.attr={}), -n.attr.href||(n.attr.href="#"),l.attr(n.attr)[s.html_titles?"html":"text"](n.title),n.language&&l.addClass(n.language)),l.prepend(" "),!n.icon&&i.icon&&(n.icon=i.icon), +if(!o&&!this._is_loaded(e))return this.load_node(e,function(){this.create_node(e,n,r,i,!0)}),!1 +switch(this.__rollback(),"string"==typeof r&&(r={data:r}),r||(r={}),r.attr&&a.attr(r.attr),r.metadata&&a.data(r.metadata),r.state&&a.addClass("jstree-"+r.state),r.data||(r.data=this._get_string("new_node")), +t.isArray(r.data)||(l=r.data,r.data=[],r.data.push(l)),t.each(r.data,function(e,n){l=t(""),t.isFunction(n)&&(n=n.call(this,r)),"string"==typeof n?l.attr("href","#")[s.html_titles?"html":"text"](n):(n.attr||(n.attr={}), +n.attr.href||(n.attr.href="#"),l.attr(n.attr)[s.html_titles?"html":"text"](n.title),n.language&&l.addClass(n.language)),l.prepend(" "),!n.icon&&r.icon&&(n.icon=r.icon), n.icon&&(n.icon.indexOf("/")===-1?l.children("ins").addClass(n.icon):l.children("ins").css("background","url('"+n.icon+"') center center no-repeat")),a.append(l)}),a.prepend(" "), e===-1&&(e=this.get_container(),"before"===n&&(n="first"),"after"===n&&(n="last")),n){case"before":e.before(a),l=this._get_parent(e) break @@ -2326,7 +2327,7 @@ break case"last":e.children("ul").length||e.append("